repo_name stringlengths 4 116 | path stringlengths 4 379 | size stringlengths 1 7 | content stringlengths 3 1.05M | license stringclasses 15
values |
|---|---|---|---|---|
lfreneda/cepdb | api/v1/41630372.jsonp.js | 134 | jsonp({"cep":"41630372","logradouro":"Alameda das Palmeiras","bairro":"Itapu\u00e3","cidade":"Salvador","uf":"BA","estado":"Bahia"});
| cc0-1.0 |
ivayloivanof/AdvancedCSharp | AdvancedCSharp/02.MuldimentionalArraysSetsDictionaries/OtherHomeworks/3-Multidimensional-Arrays-Sets-Dictionaries/10-Plus-Remove/PlusRemove.cs | 2148 | using System;
using System.Collections.Generic;
using System.Linq;
class PlusRemove
{
static void Main()
{
List<string> lines = new List<string>();
while (true)
{
string input = Console.ReadLine();
if (input == "END")
{
break;
}
lines.Add(input);
}
char[][] symbols = new char[lines.Count][];
char[][] copySymbols = new char[lines.Count][];
for (int i = 0; i < lines.Count; i++)
{
symbols[i] = lines[i].ToArray();
copySymbols[i] = lines[i].ToArray();
}
for (int row = 1; row < symbols.Length - 1; row++)
{
for (int col = 1; col < symbols[row].Length - 1; col++)
{
if (!(col >= symbols[row - 1].Length || col >= symbols[row + 1].Length))
{
int caseLetters = 0;
if (symbols[row][col] >= 'a' && symbols[row][col] <= 'z')
{
caseLetters = symbols[row][col] - 32;
}
else if (symbols[row][col] >= 'A' && symbols[row][col] <= 'Z')
{
caseLetters = symbols[row][col] + 32;
}
if (new[] { symbols[row][col], symbols[row + 1][col], symbols[row - 1][col], symbols[row][col - 1], symbols[row][col + 1] }.All(x => x == symbols[row][col] || x == caseLetters))
{
copySymbols[row][col] = copySymbols[row + 1][col] = copySymbols[row - 1][col] = copySymbols[row][col - 1] = copySymbols[row][col + 1] = ' ';
}
}
}
}
Console.WriteLine();
for (int row = 0; row < copySymbols.Length; row++)
{
for (int col = 0; col < copySymbols[row].Length; col++)
{
if (copySymbols[row][col] != ' ')
{
Console.Write(copySymbols[row][col]);
}
}
Console.WriteLine();
}
}
}
| cc0-1.0 |
lfreneda/cepdb | api/v1/04863460.jsonp.js | 146 | jsonp({"cep":"04863460","logradouro":"Rua Tangerina Natal","bairro":"Vila Natal","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
filosobella/brilhodagua | form.php | 609 | <?php
$nome = $_GET["cd-name"];
$email = $_GET["cd-email"];
$tel = $_GET["cd-phone"];
$unidade = $_GET["radio-button"];
if($unidade == "tijuca"){
$estabelecimento = 'Tijuca';
$unidadeemail = 'contato@tijuca';
}else{
$estabelecimento = 'Ipanema';
$unidadeemail = 'contato@ipanema';
}
$msg = $_GET["cd-textarea"];
mail($unidadeemail,'Contato - Site', 'Olá, esse é um e-mail automático do Site Brilho Dagua, por favor não responda.
Nome - '.$nome.'
Email - '.$email .'
Telefone - '.$tel.'
Estabelecimento - '.$estabelecimento.'
Mensagem: '.$msg);
header('Location: resposta');
?>
| cc0-1.0 |
lfreneda/cepdb | api/v1/15706422.jsonp.js | 133 | jsonp({"cep":"15706422","logradouro":"Rua Roma","bairro":"Jardim Novo Mundo","cidade":"Jales","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/94015000.jsonp.js | 137 | jsonp({"cep":"94015000","logradouro":"Rua Boa Vista","bairro":"Natal","cidade":"Gravata\u00ed","uf":"RS","estado":"Rio Grande do Sul"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/17527590.jsonp.js | 197 | jsonp({"cep":"17527590","logradouro":"Rua Maria Rosa Nunes de Oliveira","bairro":"Conjunto Habitacional Vila dos Comerci\u00e1rios I","cidade":"Mar\u00edlia","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/13972512.jsonp.js | 139 | jsonp({"cep":"13972512","logradouro":"Rua B\u00e9lgica","bairro":"Jardim Raquel","cidade":"Itapira","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/72015925.jsonp.js | 157 | jsonp({"cep":"72015925","logradouro":"Quadra CSA 3","bairro":"Taguatinga Sul (Taguatinga)","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/19915250.jsonp.js | 145 | jsonp({"cep":"19915250","logradouro":"Rua Ant\u00f4nio Segala","bairro":"Vila Brasil","cidade":"Ourinhos","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/35182300.jsonp.js | 137 | jsonp({"cep":"35182300","logradouro":"Rua Rom\u00eania","bairro":"Ana Rita","cidade":"Tim\u00f3teo","uf":"MG","estado":"Minas Gerais"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/34515400.jsonp.js | 143 | jsonp({"cep":"34515400","logradouro":"Rua S\u00e3o Jo\u00e3o","bairro":"Esplanada","cidade":"Sabar\u00e1","uf":"MG","estado":"Minas Gerais"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/02562050.jsonp.js | 155 | jsonp({"cep":"02562050","logradouro":"Rua Miguel Bartholomeu","bairro":"Vila Santa Maria","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/91120422.jsonp.js | 138 | jsonp({"cep":"91120422","logradouro":"Acesso Dois C","bairro":"Sarandi","cidade":"Porto Alegre","uf":"RS","estado":"Rio Grande do Sul"});
| cc0-1.0 |
rgonzaleztec/icsscREDES | Verano2016-17/SistemaSeguridad/SEGURITEC-Android/core/src/main/java/ibmmobileappbuilder/behaviors/LogoutBehavior.java | 1242 | package ibmmobileappbuilder.behaviors;
import android.app.Activity;
import android.content.Context;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import ibmmobileappbuilder.actions.LogoutAction;
import ibmmobileappbuilder.core.R;
import ibmmobileappbuilder.util.SecurePreferences;
/**
* Add 3 dots menu to logout
*/
public class LogoutBehavior extends NoOpBehavior {
private SecurePreferences mSharedPreferences;
private Class loginActivity;
private Activity activity;
public LogoutBehavior(SecurePreferences mSharedPreferences, Class loginActivity, Activity activity) {
this.mSharedPreferences = mSharedPreferences;
this.loginActivity = loginActivity;
this.activity = activity;
}
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {
MenuItem item = menu.add(R.string.log_out);
item.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
new LogoutAction(mSharedPreferences, loginActivity, activity).execute(activity);
return true;
}
});
}
}
| cc0-1.0 |
lfreneda/cepdb | api/v1/57608535.jsonp.js | 171 | jsonp({"cep":"57608535","logradouro":"2\u00aa Travessa Santo Ant\u00f4nio","bairro":"Palmeira de Fora","cidade":"Palmeira dos \u00cdndios","uf":"AL","estado":"Alagoas"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/13046415.jsonp.js | 138 | jsonp({"cep":"13046415","logradouro":"Rua Treze","bairro":"Jardim Esmeraldina","cidade":"Campinas","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
Xblivior/MusicnMaths | Assets/Scripts/CompetitiveController.cs | 1981 | using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class CompetitiveController : MonoBehaviour
{
public Canvas pauseMenu;
public Canvas normUI;
public Text overallTimerT;
//public Text livesT;
public float livesTimer = 10f;
public int lives = 3;
public Image[] life;
public Slider timerSlider;
float overallTimer;
// Use this for initialization
void Start ()
{
pauseMenu.enabled = false;
}
// Update is called once per frame
void Update ()
{
//start overall timer
overallTimer += Time.deltaTime;
//round to nearest sec
int secondsO = Mathf.RoundToInt (overallTimer);
//show timer text
overallTimerT.text = "Survived Time: " + secondsO + "sec";
LivesTimer ();
if (lives <= 0)
{
GameOver ();
}
}
public void Pause()
{
//pause time
Time.timeScale = 0.0f;
//enable pause menu
pauseMenu.enabled = true;
//disable normal ui
normUI.enabled = false;
}
public void Continue()
{
//reset time
Time.timeScale = 1.0f;
//reset lives timer
livesTimer = 10f;
//get a new question
GetComponent<QuestionController> ().RandomType ();
//enable pause menu
pauseMenu.enabled = false;
//disable normal ui
normUI.enabled = true;
}
public void Quit()
{
//reset time
Time.timeScale = 1.0f;
//go to menu
SceneManager.LoadScene ("Menu");
}
public void LivesTimer()
{
//timer
livesTimer -= Time.deltaTime;
//show on slider
timerSlider.value = livesTimer;
//if lives <=0
if (livesTimer <= 0f)
{
//TakeLife()
TakeLife ();
//Reset timer
livesTimer = 10f;
}
}
public void TakeLife()
{
//disable a life image
life [lives - 1].color = new Color(0f,0f,0f,0f);
//take life
lives -= 1;
//reset timer
livesTimer = 10f;
}
public void GameOver()
{
PlayerPrefs.SetInt ("RecentScore", GetComponent<QuestionController> ().currentScore);
SceneManager.LoadScene ("LoseScreen");
}
}
| cc0-1.0 |
lfreneda/cepdb | api/v1/15704150.jsonp.js | 144 | jsonp({"cep":"15704150","logradouro":"Rua Fl\u00e1vio Ferraz","bairro":"Jardim Morumbi","cidade":"Jales","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
holtat/localflix-rails | app/serializers/tv_show_serializer.rb | 92 | class TvShowSerializer < ActiveModel::Serializer
attributes :id,
:name,
:year
end
| cc0-1.0 |
lfreneda/cepdb | api/v1/21371570.jsonp.js | 162 | jsonp({"cep":"21371570","logradouro":"Pra\u00e7a Nelson C\u00e9sar de Matos","bairro":"Vaz Lobo","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/21020250.jsonp.js | 132 | jsonp({"cep":"21020250","logradouro":"Rua Grucai","bairro":"Penha","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/89025150.jsonp.js | 141 | jsonp({"cep":"89025150","logradouro":"Rua Guilherme Ropke","bairro":"Gl\u00f3ria","cidade":"Blumenau","uf":"SC","estado":"Santa Catarina"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/73803205.jsonp.js | 134 | jsonp({"cep":"73803205","logradouro":"Avenida Rifaina","bairro":"Vila Carolina","cidade":"Formosa","uf":"GO","estado":"Goi\u00e1s"});
| cc0-1.0 |
iCONEXT/SMI_Travel | src/java/com/smi/travel/datalayer/view/entity/ReceiptDetailView.java | 5025 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.smi.travel.datalayer.view.entity;
import java.math.BigDecimal;
import java.util.Date;
/**
*
* @author Jittima
*/
public class ReceiptDetailView {
private String id;
private String receiptNo;
private Date receiptDate;
private String invoiceNo;
private Date receiveDate;
private String mbillTypeStatus;
private String description;
private String displayDescription;
private BigDecimal cost;
private String curCost;
private Integer isVat;
private BigDecimal vat;
private BigDecimal amount;
private String curAmount;
private String airlineCode;
private String remark;
private String payment;
private BigDecimal billAmount;
private BigDecimal recAmount;
private String currency;
private String billDescription;
private String receiptName;
private String receiptType;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getReceiptNo() {
return receiptNo;
}
public void setReceiptNo(String receiptNo) {
this.receiptNo = receiptNo;
}
public Date getReceiptDate() {
return receiptDate;
}
public void setReceiptDate(Date receiptDate) {
this.receiptDate = receiptDate;
}
public String getInvoiceNo() {
return invoiceNo;
}
public void setInvoiceNo(String invoiceNo) {
this.invoiceNo = invoiceNo;
}
public Date getReceiveDate() {
return receiveDate;
}
public void setReceiveDate(Date receiveDate) {
this.receiveDate = receiveDate;
}
public String getMbillTypeStatus() {
return mbillTypeStatus;
}
public void setMbillTypeStatus(String mbillTypeStatus) {
this.mbillTypeStatus = mbillTypeStatus;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getDisplayDescription() {
return displayDescription;
}
public void setDisplayDescription(String displayDescription) {
this.displayDescription = displayDescription;
}
public BigDecimal getCost() {
return cost;
}
public void setCost(BigDecimal cost) {
this.cost = cost;
}
public String getCurCost() {
return curCost;
}
public void setCurCost(String curCost) {
this.curCost = curCost;
}
public Integer getIsVat() {
return isVat;
}
public void setIsVat(Integer isVat) {
this.isVat = isVat;
}
public BigDecimal getVat() {
return vat;
}
public void setVat(BigDecimal vat) {
this.vat = vat;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getCurAmount() {
return curAmount;
}
public void setCurAmount(String curAmount) {
this.curAmount = curAmount;
}
public String getAirlineCode() {
return airlineCode;
}
public void setAirlineCode(String airlineCode) {
this.airlineCode = airlineCode;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getPayment() {
return payment;
}
public void setPayment(String payment) {
this.payment = payment;
}
public BigDecimal getBillAmount() {
return billAmount;
}
public void setBillAmount(BigDecimal billAmount) {
this.billAmount = billAmount;
}
public BigDecimal getRecAmount() {
return recAmount;
}
public void setRecAmount(BigDecimal recAmount) {
this.recAmount = recAmount;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency;
}
public String getBillDescription() {
return billDescription;
}
public void setBillDescription(String billDescription) {
this.billDescription = billDescription;
}
public String getReceiptName() {
return receiptName;
}
public void setReceiptName(String receiptName) {
this.receiptName = receiptName;
}
public String getReceiptType() {
return receiptType;
}
public void setReceiptType(String receiptType) {
this.receiptType = receiptType;
}
}
| cc0-1.0 |
lfreneda/cepdb | api/v1/29161530.jsonp.js | 145 | jsonp({"cep":"29161530","logradouro":"Rua Esmeralda","bairro":"Central de Carapina","cidade":"Serra","uf":"ES","estado":"Esp\u00edrito Santo"});
| cc0-1.0 |
kenbod/5828_F15_Code | lecture_29/file_total_fixed1.js | 897 | var fs = require('fs');
var all_done = function(size) {
console.log("Total size:", size);
}
var handleFile = function(stats, i, filenames, total) {
if (i === filenames.length - 1) {
all_done(total + stats.size);
} else {
processFile(i+1, filenames, total+stats.size);
}
}
var handleDir = function(i, filenames, total) {
if (i === filenames.length - 1) {
all_done(total);
} else {
processFile(i+1, filenames, total);
}
}
var processFile = function(i, filenames, total) {
var name = filenames[i];
fs.stat(name, function(err, stats) {
if (err) throw err;
if (stats.isFile()) {
handleFile(stats, i, filenames, total);
} else {
handleDir(i, filenames, total);
}
});
}
fs.readdir('.', function(err, filenames) {
if (err) throw err;
console.log("Number of Directory Entries:", filenames.length)
processFile(0, filenames, 0);
});
| cc0-1.0 |
johnny9052/EjemploIntroduccionJQUERYMobile | Vista/Paneles.php | 3585 | <!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="../Recursos/jquerymobile/jquery.mobile-1.4.5.min.css" />
<script src="../Recursos/jquerymobile/jquery-1.11.3.min.js"></script>
<script src="../Recursos/jquerymobile/jquery.mobile-1.4.5.min.js"></script>
<!-- CARGAR ARCHIVOS ONLINE -->
<!-- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" />
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>-->
</head>
<body>
<div data-role="page" id="pageonePanel">
<!--PANEL #1 data-display= efecto data-dismissible= solo cerrar deslizando data-position= ubicacion -->
<div data-role="panel" id="overlayPanel"
data-display="overlay" data-dismissible="false" data-position="right">
<h2>Overlay Panel</h2>
<p>You can close the panel by clicking outside the panel, pressing the Esc key, by swiping, or by clicking the button below:</p>
<a href="#pageonePanel" data-rel="close" class="ui-btn ui-btn-inline ui-shadow ui-corner-all ui-btn-a ui-icon-delete ui-btn-icon-left">Close panel</a>
</div>
<!--PANEL #2 -->
<div data-role="panel" id="revealPanel"
data-display="reveal" data-dismissible="false" data-position="left"
data-position-fixed="true">
<h2>Reveal Panel</h2>
<p>You can close the panel by clicking outside the panel, pressing the Esc key, by swiping, or by clicking the button below:</p>
<a href="#pageonePanel" data-rel="close" class="ui-btn ui-btn-inline ui-shadow ui-corner-all ui-btn-a ui-icon-delete ui-btn-icon-left">Close panel</a>
</div>
<!--PANEL #3 -->
<div data-role="panel" id="pushPanel" data-display="push" data-dismissible="false" data-position="left">
<h2>Push Panel</h2>
<p>You can close the panel by clicking outside the panel, pressing the Esc key, by swiping, or by clicking the button below:</p>
<a href="#pageonePanel" data-rel="close" class="ui-btn ui-btn-inline ui-shadow ui-corner-all ui-btn-a ui-icon-delete ui-btn-icon-left">Close panel</a>
</div>
<!-- ESTRUCTURA PAGINA -->
<div data-role="header">
<h1>Page Header</h1>
</div>
<div data-role="main" class="ui-content">
<p>Click on one of the the buttons to open the Panel with different display modes.</p>
<a href="#overlayPanel"
class="ui-btn ui-btn-inline ui-corner-all ui-shadow">Overlay Panel</a>
<a href="#revealPanel" class="ui-btn ui-btn-inline ui-corner-all ui-shadow">Reveal Panel</a>
<a href="#pushPanel" class="ui-btn ui-btn-inline ui-corner-all ui-shadow">Push Panel</a>
</div>
<div data-role="footer">
<h1>Page Footer</h1>
</div>
</div>
</body>
</html>
| cc0-1.0 |
lfreneda/cepdb | api/v1/22610141.jsonp.js | 152 | jsonp({"cep":"22610141","logradouro":"Estrada do Jo\u00e1","bairro":"S\u00e3o Conrado","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/35701451.jsonp.js | 125 | jsonp({"cep":"35701451","logradouro":"Rua A","bairro":"Iporanga","cidade":"Sete Lagoas","uf":"MG","estado":"Minas Gerais"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/12213440.jsonp.js | 154 | jsonp({"cep":"12213440","logradouro":"Rua Almenara","bairro":"Vila Paiva","cidade":"S\u00e3o Jos\u00e9 dos Campos","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/35430303.jsonp.js | 152 | jsonp({"cep":"35430303","logradouro":"Rua Padre Jos\u00e9 Alvarenga","bairro":"Para\u00edso","cidade":"Ponte Nova","uf":"MG","estado":"Minas Gerais"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/12229813.jsonp.js | 185 | jsonp({"cep":"12229813","logradouro":"Rua Aurora de Paula Ribeiro","bairro":"Jardim Torr\u00e3o de Ouro","cidade":"S\u00e3o Jos\u00e9 dos Campos","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/89285726.jsonp.js | 157 | jsonp({"cep":"89285726","logradouro":"Rua Bar\u00e3o de Mau\u00e1","bairro":"Oxford","cidade":"S\u00e3o Bento do Sul","uf":"SC","estado":"Santa Catarina"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/13186708.jsonp.js | 152 | jsonp({"cep":"13186708","logradouro":"Rua 12","bairro":"Jardim Green Park Residence","cidade":"Hortol\u00e2ndia","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/05894460.jsonp.js | 152 | jsonp({"cep":"05894460","logradouro":"Rua Teo Cabral","bairro":"Jardim Maced\u00f4nia","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/08660042.jsonp.js | 139 | jsonp({"cep":"08660042","logradouro":"Rua Felipe Sanchez","bairro":"Caxang\u00e1","cidade":"Suzano","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/32230310.jsonp.js | 145 | jsonp({"cep":"32230310","logradouro":"Rua Jos\u00e9 Brand\u00e3o","bairro":"Industrial","cidade":"Contagem","uf":"MG","estado":"Minas Gerais"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/48070230.jsonp.js | 124 | jsonp({"cep":"48070230","logradouro":"Rua Rio Real","bairro":"Barreiro","cidade":"Alagoinhas","uf":"BA","estado":"Bahia"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/29198163.jsonp.js | 136 | jsonp({"cep":"29198163","logradouro":"Rua Rubi","bairro":"Barra do Sahy","cidade":"Aracruz","uf":"ES","estado":"Esp\u00edrito Santo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/12711400.jsonp.js | 155 | jsonp({"cep":"12711400","logradouro":"Rua Germano Marcondes do Amaral","bairro":"Lagoa Dourada","cidade":"Cruzeiro","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/36047290.jsonp.js | 145 | jsonp({"cep":"36047290","logradouro":"Rua Miguel Gustavo","bairro":"Parque Guarani","cidade":"Juiz de Fora","uf":"MG","estado":"Minas Gerais"});
| cc0-1.0 |
adityasubawa/mechanic-visitor-counter | src/js/media/controllers/gallery-edit.js | 6215 | var Library = wp.media.controller.Library,
l10n = wp.media.view.l10n,
GalleryEdit;
/**
* wp.media.controller.GalleryEdit
*
* A state for editing a gallery's images and settings.
*
* @since 3.5.0
*
* @class
* @augments wp.media.controller.Library
* @augments wp.media.controller.State
* @augments Backbone.Model
*
* @memberOf wp.media.controller
*
* @param {Object} [attributes] The attributes hash passed to the state.
* @param {string} [attributes.id=gallery-edit] Unique identifier.
* @param {string} [attributes.title=Edit Gallery] Title for the state. Displays in the frame's title region.
* @param {wp.media.model.Attachments} [attributes.library] The collection of attachments in the gallery.
* If one is not supplied, an empty media.model.Selection collection is created.
* @param {boolean} [attributes.multiple=false] Whether multi-select is enabled.
* @param {boolean} [attributes.searchable=false] Whether the library is searchable.
* @param {boolean} [attributes.sortable=true] Whether the Attachments should be sortable. Depends on the orderby property being set to menuOrder on the attachments collection.
* @param {boolean} [attributes.date=true] Whether to show the date filter in the browser's toolbar.
* @param {string|false} [attributes.content=browse] Initial mode for the content region.
* @param {string|false} [attributes.toolbar=image-details] Initial mode for the toolbar region.
* @param {boolean} [attributes.describe=true] Whether to offer UI to describe attachments - e.g. captioning images in a gallery.
* @param {boolean} [attributes.displaySettings=true] Whether to show the attachment display settings interface.
* @param {boolean} [attributes.dragInfo=true] Whether to show instructional text about the attachments being sortable.
* @param {number} [attributes.idealColumnWidth=170] The ideal column width in pixels for attachments.
* @param {boolean} [attributes.editing=false] Whether the gallery is being created, or editing an existing instance.
* @param {number} [attributes.priority=60] The priority for the state link in the media menu.
* @param {boolean} [attributes.syncSelection=false] Whether the Attachments selection should be persisted from the last state.
* Defaults to false for this state, because the library passed in *is* the selection.
* @param {view} [attributes.AttachmentView] The single `Attachment` view to be used in the `Attachments`.
* If none supplied, defaults to wp.media.view.Attachment.EditLibrary.
*/
GalleryEdit = Library.extend(/** @lends wp.media.controller.GalleryEdit.prototype */{
defaults: {
id: 'gallery-edit',
title: l10n.editGalleryTitle,
multiple: false,
searchable: false,
sortable: true,
date: false,
display: false,
content: 'browse',
toolbar: 'gallery-edit',
describe: true,
displaySettings: true,
dragInfo: true,
idealColumnWidth: 170,
editing: false,
priority: 60,
syncSelection: false
},
/**
* Initializes the library.
*
* Creates a selection if a library isn't supplied and creates an attachment
* view if no attachment view is supplied.
*
* @since 3.5.0
*
* @return {void}
*/
initialize: function() {
// If we haven't been provided a `library`, create a `Selection`.
if ( ! this.get('library') ) {
this.set( 'library', new wp.media.model.Selection() );
}
// The single `Attachment` view to be used in the `Attachments` view.
if ( ! this.get('AttachmentView') ) {
this.set( 'AttachmentView', wp.media.view.Attachment.EditLibrary );
}
Library.prototype.initialize.apply( this, arguments );
},
/**
* Activates the library.
*
* Limits the library to images, watches for uploaded attachments. Watches for
* the browse event on the frame and binds it to gallerySettings.
*
* @since 3.5.0
*
* @return {void}
*/
activate: function() {
var library = this.get('library');
// Limit the library to images only.
library.props.set( 'type', 'image' );
// Watch for uploaded attachments.
this.get('library').observe( wp.Uploader.queue );
this.frame.on( 'content:render:browse', this.gallerySettings, this );
Library.prototype.activate.apply( this, arguments );
},
/**
* Deactivates the library.
*
* Stops watching for uploaded attachments and browse events.
*
* @since 3.5.0
*
* @return {void}
*/
deactivate: function() {
// Stop watching for uploaded attachments.
this.get('library').unobserve( wp.Uploader.queue );
this.frame.off( 'content:render:browse', this.gallerySettings, this );
Library.prototype.deactivate.apply( this, arguments );
},
/**
* Adds the gallery settings to the sidebar and adds a reverse button to the
* toolbar.
*
* @since 3.5.0
*
* @param {wp.media.view.Frame} browser The file browser.
*
* @return {void}
*/
gallerySettings: function( browser ) {
if ( ! this.get('displaySettings') ) {
return;
}
var library = this.get('library');
if ( ! library || ! browser ) {
return;
}
library.gallery = library.gallery || new Backbone.Model();
browser.sidebar.set({
gallery: new wp.media.view.Settings.Gallery({
controller: this,
model: library.gallery,
priority: 40
})
});
browser.toolbar.set( 'reverse', {
text: l10n.reverseOrder,
priority: 80,
click: function() {
library.reset( library.toArray().reverse() );
}
});
}
});
module.exports = GalleryEdit;
| cc0-1.0 |
lfreneda/cepdb | api/v1/60180030.jsonp.js | 149 | jsonp({"cep":"60180030","logradouro":"Travessa Get\u00falio Vargas","bairro":"Cais do Porto","cidade":"Fortaleza","uf":"CE","estado":"Cear\u00e1"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/13486712.jsonp.js | 147 | jsonp({"cep":"13486712","logradouro":"Rua Bernardo Martins","bairro":"Jardim Cana\u00e3","cidade":"Limeira","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/38082000.jsonp.js | 163 | jsonp({"cep":"38082000","logradouro":"Avenida Niza Marquez Guarit\u00e1","bairro":"Conjunto Manoel Mendes","cidade":"Uberaba","uf":"MG","estado":"Minas Gerais"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/88511440.jsonp.js | 141 | jsonp({"cep":"88511440","logradouro":"Rua do Guaviju","bairro":"Habita\u00e7\u00e3o","cidade":"Lages","uf":"SC","estado":"Santa Catarina"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/24743280.jsonp.js | 158 | jsonp({"cep":"24743280","logradouro":"Rua Isolina Sales","bairro":"J\u00f3quei Clube","cidade":"S\u00e3o Gon\u00e7alo","uf":"RJ","estado":"Rio de Janeiro"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/04303001.jsonp.js | 165 | jsonp({"cep":"04303001","logradouro":"Rua Professor Apr\u00edgio Gonzaga","bairro":"S\u00e3o Judas","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/21862190.jsonp.js | 135 | jsonp({"cep":"21862190","logradouro":"Rua Carangola","bairro":"Bangu","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/29040680.jsonp.js | 151 | jsonp({"cep":"29040680","logradouro":"Rua Padre V\u00edtor","bairro":"Jucutuquara","cidade":"Vit\u00f3ria","uf":"ES","estado":"Esp\u00edrito Santo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/88355385.jsonp.js | 128 | jsonp({"cep":"88355385","logradouro":"Rua BA - 026","bairro":"Bateas","cidade":"Brusque","uf":"SC","estado":"Santa Catarina"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/68020110.jsonp.js | 153 | jsonp({"cep":"68020110","logradouro":"Rua Jos\u00e9 do Patroc\u00ednio","bairro":"Diamantino","cidade":"Santar\u00e9m","uf":"PA","estado":"Par\u00e1"});
| cc0-1.0 |
stuchalk/OSDB | app/webroot/js/jsmol/j2s/J/rendersurface/MolecularOrbitalRenderer.js | 1128 | Clazz.declarePackage ("J.rendersurface");
Clazz.load (["J.rendersurface.IsosurfaceRenderer"], "J.rendersurface.MolecularOrbitalRenderer", null, function () {
c$ = Clazz.declareType (J.rendersurface, "MolecularOrbitalRenderer", J.rendersurface.IsosurfaceRenderer);
Clazz.overrideMethod (c$, "render",
function () {
this.imageFontScaling = this.vwr.imageFontScaling;
this.renderIso ();
return this.needTranslucent;
});
Clazz.overrideMethod (c$, "renderInfo",
function () {
if (this.isExport || this.vwr.am.cmi < 0 || this.mesh.title == null || !this.g3d.setC (this.vwr.cm.colixBackgroundContrast) || this.vwr.gdata.getTextPosition () != 0) return;
var ht = this.vwr.getInt (553648147);
this.vwr.gdata.setFontFid (this.vwr.gdata.getFontFidFS ("Serif", ht * this.imageFontScaling));
var lineheight = Math.round ((ht + 1) * this.imageFontScaling);
var x = Math.round (5 * this.imageFontScaling);
var y = lineheight;
for (var i = 0; i < this.mesh.title.length; i++) if (this.mesh.title[i].length > 0) {
this.g3d.drawStringNoSlab (this.mesh.title[i], null, x, y, 0, 0);
y += lineheight;
}
this.vwr.gdata.setTextPosition (y);
});
});
| cc0-1.0 |
lathspell/java_test | java_test_spring_jdbc/src/test/java/test8/AtTransactionalTest.java | 1954 | package test8;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.BadSqlGrammarException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import test8.config.Config;
import test8.service.KvService;
import javax.sql.DataSource;
import java.sql.Connection;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = Config.class)
public class AtTransactionalTest {
@Autowired
private KvService kvService;
@Test
public void testGood() {
assertEquals(2, kvService.countGood());
}
@Test
public void testFancy() {
assertEquals(2, kvService.countFancy());
}
@Test(expected = BadSqlGrammarException.class)
public void testBad() {
kvService.countBad();
}
@Test
public void testRollback() {
assertEquals(2, kvService.countGood());
try {
kvService.badTransaction();
} catch (Exception e) {
// Bad SQL Grammer will be thrown
}
assertEquals(2, kvService.countGood());
}
/** The readOnly attribute in @Transactional is only a optimizer hint, it does not make the JDBC Connection readonly! */
@Test
public void testReadOnly() throws Exception {
JdbcTemplate tmpl = kvService.getReadonlyJdbcTemplate();
DataSource ds = tmpl.getDataSource();
Connection c = ds.getConnection();
assertFalse(c.isReadOnly()); // the JDBC Connection itself is *not* read-only!
kvService.writesDuringReadOnly();
assertEquals(0, kvService.countGood()); // write worked despite read-only!
}
} | cc0-1.0 |
lfreneda/cepdb | api/v1/22713750.jsonp.js | 138 | jsonp({"cep":"22713750","logradouro":"Rua Tesourinha","bairro":"Taquara","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/08140313.jsonp.js | 150 | jsonp({"cep":"08140313","logradouro":"Rua A\u00e7ai\u00e1","bairro":"Itaim Paulista","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/25555381.jsonp.js | 163 | jsonp({"cep":"25555381","logradouro":"Rua Doutor Gil Mota","bairro":"Jardim Meriti","cidade":"S\u00e3o Jo\u00e3o de Meriti","uf":"RJ","estado":"Rio de Janeiro"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/79044340.jsonp.js | 186 | jsonp({"cep":"79044340","logradouro":"Rua Gumercindo Pereira","bairro":"Parque Residencial Maria Aparecida Pedrossian","cidade":"Campo Grande","uf":"MS","estado":"Mato Grosso do Sul"});
| cc0-1.0 |
ajmacd/desktop-capturer-demo | main.js | 1926 | const electron = require('electron')
// Module to control application life.
const app = electron.app
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow
const path = require('path')
const url = require('url')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({width: 1280, height: 720})
// and load the index.html of the app.
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}))
// Open the DevTools.
// mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
mainWindow = null
})
}
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs.
app.on('ready', createWindow)
// Quit when all windows are closed.
app.on('window-all-closed', function () {
// On OS X it is common for applications and their menu bar
// to stay active until the user quits explicitly with Cmd + Q
if (process.platform !== 'darwin') {
app.quit()
}
})
app.on('activate', function () {
// On OS X it's common to re-create a window in the app when the
// dock icon is clicked and there are no other windows open.
if (mainWindow === null) {
createWindow()
}
})
// In this file you can include the rest of your app's specific main process
// code. You can also put them in separate files and require them here.
| cc0-1.0 |
lfreneda/cepdb | api/v1/66026690.jsonp.js | 126 | jsonp({"cep":"66026690","logradouro":"Vila Novaes","bairro":"Jurunas","cidade":"Bel\u00e9m","uf":"PA","estado":"Par\u00e1"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/45027295.jsonp.js | 137 | jsonp({"cep":"45027295","logradouro":"Avenida E","bairro":"Boa Vista","cidade":"Vit\u00f3ria da Conquista","uf":"BA","estado":"Bahia"});
| cc0-1.0 |
RedStoneCr33per/AtoZGamesV2 | New folder/phone.Designer.cs | 2038 | namespace Sciencetific_Calc
{
partial class phone
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.callBtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// callBtn
//
this.callBtn.Location = new System.Drawing.Point(78, 113);
this.callBtn.Name = "callBtn";
this.callBtn.Size = new System.Drawing.Size(75, 23);
this.callBtn.TabIndex = 0;
this.callBtn.Text = "Call";
this.callBtn.UseVisualStyleBackColor = true;
this.callBtn.Click += new System.EventHandler(this.callBtn_Click);
//
// phone
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(284, 261);
this.Controls.Add(this.callBtn);
this.Name = "phone";
this.Text = "phone";
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button callBtn;
}
} | cc0-1.0 |
lfreneda/cepdb | api/v1/86078675.jsonp.js | 156 | jsonp({"cep":"86078675","logradouro":"Rua Wagner Bauer","bairro":"Parque Residencial Michael Licha","cidade":"Londrina","uf":"PR","estado":"Paran\u00e1"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/29155591.jsonp.js | 154 | jsonp({"cep":"29155591","logradouro":"Rodovia BR-101 Norte Contorno","bairro":"Flexal I","cidade":"Cariacica","uf":"ES","estado":"Esp\u00edrito Santo"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/70740761.jsonp.js | 151 | jsonp({"cep":"70740761","logradouro":"Quadra SHCGN 708 Bloco A","bairro":"Asa Norte","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
| cc0-1.0 |
iCONEXT/SMI_Travel | src/java/com/smi/travel/datalayer/service/SaleVatReportService.java | 1146 | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.smi.travel.datalayer.service;
import com.smi.travel.datalayer.view.dao.SaleVatReportDao;
import com.smi.travel.datalayer.view.entity.OutputTaxView;
import java.util.List;
/**
*
* @author Jittima
*/
public class SaleVatReportService {
private SaleVatReportDao saleVatReportDao;
public List<OutputTaxView> SearchOutputTaxViewFromFilter(String from,String to,String department,String status){
return saleVatReportDao.SearchOutputTaxViewFromFilter(from, to, department,status);
}
public String UpdateOutputTaxStatusCancel(List<OutputTaxView> outputTaxViewList){
return saleVatReportDao.UpdateOutputTaxStatusCancel(outputTaxViewList);
}
public SaleVatReportDao getSaleVatReportDao() {
return saleVatReportDao;
}
public void setSaleVatReportDao(SaleVatReportDao saleVatReportDao) {
this.saleVatReportDao = saleVatReportDao;
}
}
| cc0-1.0 |
lfreneda/cepdb | api/v1/69901164.jsonp.js | 143 | jsonp({"cep":"69901164","logradouro":"Rua M\u00e1rio Maia","bairro":"Adalberto Arag\u00e3o","cidade":"Rio Branco","uf":"AC","estado":"Acre"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/45603280.jsonp.js | 140 | jsonp({"cep":"45603280","logradouro":"Travessa Cassimiro de Abreu","bairro":"Alto Mirante","cidade":"Itabuna","uf":"BA","estado":"Bahia"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/73026563.jsonp.js | 165 | jsonp({"cep":"73026563","logradouro":"Quadra Quadra 6 \u00c1rea Especial 07","bairro":"Sobradinho","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
| cc0-1.0 |
lfreneda/cepdb | api/v1/65066852.jsonp.js | 162 | jsonp({"cep":"65066852","logradouro":"Rua Rio Grande do Norte","bairro":"Ch\u00e1cara Brasil","cidade":"S\u00e3o Lu\u00eds","uf":"MA","estado":"Maranh\u00e3o"});
| cc0-1.0 |
MiguelMMota/CV_template | js/helper.js | 8934 | /*
This file contains all of the code running in the background that makes resumeBuilder.js possible. We call these helper functions because they support your code in this course.
Don't worry, you'll learn what's going on in this file throughout the course. You won't need to make any changes to it until you start experimenting with inserting a Google Map in Problem Set 3.
Cameron Pittman
*/
/*
These are HTML strings. As part of the course, you'll be using JavaScript functions
replace the %data% placeholder text you see in them.
*/
var HTMLheaderName = '<h1 id="name">%data%</h1>';
var HTMLheaderRole = '<span class="white-text">%data%</span><hr/>';
var HTMLcontactGeneric = '<li class="flex-item"><span class="orange-text">%contact%</span><span class="white-text">%data%</span></li>';
var HTMLmobile = '<li class="flex-item"><span class="orange-text">mobile</span><span class="white-text">%data%</span></li>';
var HTMLemail = '<li class="flex-item"><span class="orange-text">email</span><span class="white-text">%data%</span></li>';
var HTMLtwitter = '<li class="flex-item"><span class="orange-text">twitter</span><span class="white-text">%data%</span></li>';
var HTMLgithub = '<li class="flex-item"><span class="orange-text">github</span><span class="white-text">%data%</span></li>';
var HTMLblog = '<li class="flex-item"><span class="orange-text">blog</span><span class="white-text">%data%</span></li>';
var HTMLlocation = '<li class="flex-item"><span class="orange-text">location</span><span class="white-text">%data%</span></li>';
var HTMLbioPic = '<img src="%data%" class="biopic">';
var HTMLWelcomeMsg = '<span class="welcome-message">%data%</span>';
var HTMLskillsStart = '<h3 id="skillsH3">Skills at a Glance:</h3><ul id="skills" class="flex-box"></ul>';
var HTMLskills = '<li class="flex-item"><span class="white-text">%data%</span></li>';
var HTMLworkStart = '<div class="work-entry"></div>';
var HTMLworkEmployer = '<a href="#">%data%';
var HTMLworkTitle = ' - %data%</a>';
var HTMLworkDates = '<div class="date-text">%data%</div>';
var HTMLworkLocation = '<div class="location-text">%data%</div>';
var HTMLworkDescription = '<p><br>%data%</p>';
var HTMLprojectStart = '<div class="project-entry"></div>';
var HTMLprojectTitle = '<a href="#">%data%</a>';
var HTMLprojectDates = '<div class="date-text">%data%</div>';
var HTMLprojectDescription = '<p><br>%data%</p>';
var HTMLprojectImage = '<img src="%data%">';
var HTMLschoolStart = '<div class="education-entry"></div>';
var HTMLschoolName = '<a href="#">%data%';
var HTMLschoolDegree = ' -- %data%</a>';
var HTMLschoolDates = '<div class="date-text">%data%</div>';
var HTMLschoolLocation = '<div class="location-text">%data%</div>';
var HTMLschoolMajor = '<em><br>Major: %data%</em>';
var HTMLonlineClasses = '<h3>Online Classes</h3>';
var HTMLonlineTitle = '<a href="#">%data%';
var HTMLonlineSchool = ' - %data%</a>';
var HTMLonlineDates = '<div class="date-text">%data%</div>';
var HTMLonlineURL = '<br><a href="#">%data%</a>';
var internationalizeButton = '<button>Internationalize</button>';
var googleMap = '<div id="map"></div>';
/*
The International Name challenge in Lesson 2 where you'll create a function that will need this helper code to run. Don't delete! It hooks up your code to the button you'll be appending.
*/
$(document).ready(function() {
$('button').click(function() {
var oldName = $('#name').html() || '';
var iName = inName(oldName) || function(){};
$('#name').html(iName);
});
});
/*
The next few lines about clicks are for the Collecting Click Locations quiz in Lesson 2.
*/
clickLocations = [];
function logClicks(x,y) {
clickLocations.push(
{
x: x,
y: y
}
);
console.log('x location: ' + x + '; y location: ' + y);
}
$(document).click(function(loc) {
// your code goes here!
logClicks(loc.pageX,loc.pageY);
});
/*
This is the fun part. Here's where we generate the custom Google Map for the website.
See the documentation below for more details.
https://developers.google.com/maps/documentation/javascript/reference
*/
var map; // declares a global map variable
/*
Start here! initializeMap() is called when page is loaded.
*/
function initializeMap() {
var locations;
var mapOptions = {
disableDefaultUI: false
};
// This next line makes `map` a new Google Map JavaScript Object and attaches it to
// <div id="map">, which is appended as part of an exercise late in the course.
map = new google.maps.Map(document.querySelector('#map'), mapOptions);
/*
locationFinder() returns an array of every location string from the JSONs
written for bio, education, and work.
*/
function locationFinder() {
// initializes an empty array
var locations = [];
// adds the single location property from bio to the locations array
for (var contact in bio.contacts) {
locations.push(bio.contacts[contact].location);
}
// iterates through school locations and appends each location to
// the locations array
for (var school in education.schools) {
locations.push(education.schools[school].location);
}
// iterates through work locations and appends each location to
// the locations array
for (var job in work.jobs) {
locations.push(work.jobs[job].location);
}
locations.push ("Paris, France");
locations.push ("Angers, France");
locations.push ("Brussels, Belgium");
return locations;
}
/*
createMapMarker(placeData) reads Google Places search results to create map pins.
placeData is the object returned from search results containing information
about a single location.
*/
function createMapMarker(placeData) {
// The next lines save location data from the search result object to local variables
var lat = placeData.geometry.location.lat(); // latitude from the place service
var lon = placeData.geometry.location.lng(); // longitude from the place service
var name = placeData.formatted_address; // name of the place from the place service
var bounds = window.mapBounds; // current boundaries of the map window
// marker is an object with additional data about the pin for a single location
var marker = new google.maps.Marker({
map: map,
position: placeData.geometry.location,
title: name
});
// infoWindows are the little helper windows that open when you click
// or hover over a pin on a map. They usually contain more information
// about a location.
var infoWindow = new google.maps.InfoWindow({
content: name
});
// hmmmm, I wonder what this is about...
google.maps.event.addListener(marker, 'click', function() {
// your code goes here!
infoWindow.open(map,marker);
});
// this is where the pin actually gets added to the map.
// bounds.extend() takes in a map location object
bounds.extend(new google.maps.LatLng(lat, lon));
// fit the map to the new marker
map.fitBounds(bounds);
// center the map
map.setCenter(bounds.getCenter());
}
/*
callback(results, status) makes sure the search returned results for a location.
If so, it creates a new map marker for that location.
*/
function callback(results, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
createMapMarker(results[0]);
}
}
/*
pinPoster(locations) takes in the array of locations created by locationFinder()
and fires off Google place searches for each location
*/
function pinPoster(locations) {
// creates a Google place search service object. PlacesService does the work of
// actually searching for location data.
var service = new google.maps.places.PlacesService(map);
// Iterates through the array of locations, creates a search object for each location
for (var place in locations) {
// the search request object
var request = { query: locations[place] };
// Actually searches the Google Maps API for location data and runs the callback
// function with the search results after each search.
service.textSearch(request, callback);
}
}
// Sets the boundaries of the map based on pin locations
window.mapBounds = new google.maps.LatLngBounds();
// locations is an array of location strings returned from locationFinder()
locations = locationFinder();
// pinPoster(locations) creates pins on the map for each location in
// the locations array
pinPoster(locations);
}
/*
Uncomment the code below when you're ready to implement a Google Map!
*/
// Calls the initializeMap() function when the page loads
window.addEventListener('load', initializeMap);
// Vanilla JS way to listen for resizing of the window
// and adjust map bounds
window.addEventListener('resize', function(e) {
// Make sure the map bounds get updated on page resize
map.fitBounds(mapBounds);
});
| cc0-1.0 |
lfreneda/cepdb | api/v1/72509225.jsonp.js | 150 | jsonp({"cep":"72509225","logradouro":"Quadra CL 209 Bloco E","bairro":"Santa Maria","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
| cc0-1.0 |
miklossy/xtext-core | org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/lexer/serializer/BacktrackingLexerTestLanguageSemanticSequencer.java | 4983 | /*
* generated by Xtext
*/
package org.eclipse.xtext.lexer.serializer;
import com.google.inject.Inject;
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.xtext.Action;
import org.eclipse.xtext.Parameter;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Ab;
import org.eclipse.xtext.lexer.backtrackingTestLanguage.BacktrackingTestLanguagePackage;
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Model;
import org.eclipse.xtext.lexer.backtrackingTestLanguage.Xb;
import org.eclipse.xtext.lexer.services.BacktrackingLexerTestLanguageGrammarAccess;
import org.eclipse.xtext.serializer.ISerializationContext;
import org.eclipse.xtext.serializer.acceptor.SequenceFeeder;
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
import org.eclipse.xtext.serializer.sequencer.ITransientValueService.ValueTransient;
@SuppressWarnings("all")
public class BacktrackingLexerTestLanguageSemanticSequencer extends AbstractDelegatingSemanticSequencer {
@Inject
private BacktrackingLexerTestLanguageGrammarAccess grammarAccess;
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == BacktrackingTestLanguagePackage.eINSTANCE)
switch (semanticObject.eClass().getClassifierID()) {
case BacktrackingTestLanguagePackage.AB:
sequence_Ab(context, (Ab) semanticObject);
return;
case BacktrackingTestLanguagePackage.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
case BacktrackingTestLanguagePackage.XB:
sequence_Xb(context, (Xb) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
/**
* Contexts:
* Ab returns Ab
*
* Constraint:
* (x=CharA y=Charb)
*/
protected void sequence_Ab(ISerializationContext context, Ab semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, BacktrackingTestLanguagePackage.Literals.AB__X) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BacktrackingTestLanguagePackage.Literals.AB__X));
if (transientValues.isValueTransient(semanticObject, BacktrackingTestLanguagePackage.Literals.AB__Y) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BacktrackingTestLanguagePackage.Literals.AB__Y));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getAbAccess().getXCharATerminalRuleCall_0_0(), semanticObject.getX());
feeder.accept(grammarAccess.getAbAccess().getYCharbTerminalRuleCall_1_0(), semanticObject.getY());
feeder.finish();
}
/**
* Contexts:
* Model returns Model
*
* Constraint:
* (
* (enums+=EnumName* ((xbs+=Xb+ as+=CharA+) | as+=CharA+)) |
* (enums+=EnumName* ycs+=Yc+ ((xbs+=Xb+ as+=CharA+) | as+=CharA+)) |
* (((enums+=EnumName* abs+=Ab+) | (enums+=EnumName* ycs+=Yc+ abs+=Ab+) | abs+=Ab+) ((xbs+=Xb+ as+=CharA+) | as+=CharA+)) |
* (
* ((enums+=EnumName* ((abs+=Ab+ xbs+=Xb+) | xbs+=Xb+)) | (enums+=EnumName* ycs+=Yc+ ((abs+=Ab+ xbs+=Xb+) | xbs+=Xb+)) | (abs+=Ab+ xbs+=Xb+) | xbs+=Xb+)?
* ys+=CharY+
* as+=CharA+
* ) |
* (xbs+=Xb+ as+=CharA+) |
* as+=CharA+
* )?
*/
protected void sequence_Model(ISerializationContext context, Model semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Xb returns Xb
*
* Constraint:
* (x=CharX y=Charb)
*/
protected void sequence_Xb(ISerializationContext context, Xb semanticObject) {
if (errorAcceptor != null) {
if (transientValues.isValueTransient(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__X) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__X));
if (transientValues.isValueTransient(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__Y) == ValueTransient.YES)
errorAcceptor.accept(diagnosticProvider.createFeatureValueMissing(semanticObject, BacktrackingTestLanguagePackage.Literals.XB__Y));
}
SequenceFeeder feeder = createSequencerFeeder(context, semanticObject);
feeder.accept(grammarAccess.getXbAccess().getXCharXTerminalRuleCall_0_0(), semanticObject.getX());
feeder.accept(grammarAccess.getXbAccess().getYCharbTerminalRuleCall_1_0(), semanticObject.getY());
feeder.finish();
}
}
| epl-1.0 |
miklossy/xtext-core | org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/linking/lazy/serializer/LazyLinkingTestLanguageSemanticSequencer.java | 3416 | /*
* generated by Xtext
*/
package org.eclipse.xtext.linking.lazy.serializer;
import com.google.inject.Inject;
import java.util.Set;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.xtext.Action;
import org.eclipse.xtext.Parameter;
import org.eclipse.xtext.ParserRule;
import org.eclipse.xtext.linking.lazy.lazyLinking.LazyLinkingPackage;
import org.eclipse.xtext.linking.lazy.lazyLinking.Model;
import org.eclipse.xtext.linking.lazy.lazyLinking.Property;
import org.eclipse.xtext.linking.lazy.lazyLinking.Type;
import org.eclipse.xtext.linking.lazy.lazyLinking.UnresolvedProxyProperty;
import org.eclipse.xtext.linking.lazy.services.LazyLinkingTestLanguageGrammarAccess;
import org.eclipse.xtext.serializer.ISerializationContext;
import org.eclipse.xtext.serializer.sequencer.AbstractDelegatingSemanticSequencer;
@SuppressWarnings("all")
public class LazyLinkingTestLanguageSemanticSequencer extends AbstractDelegatingSemanticSequencer {
@Inject
private LazyLinkingTestLanguageGrammarAccess grammarAccess;
@Override
public void sequence(ISerializationContext context, EObject semanticObject) {
EPackage epackage = semanticObject.eClass().getEPackage();
ParserRule rule = context.getParserRule();
Action action = context.getAssignedAction();
Set<Parameter> parameters = context.getEnabledBooleanParameters();
if (epackage == LazyLinkingPackage.eINSTANCE)
switch (semanticObject.eClass().getClassifierID()) {
case LazyLinkingPackage.MODEL:
sequence_Model(context, (Model) semanticObject);
return;
case LazyLinkingPackage.PROPERTY:
sequence_Property(context, (Property) semanticObject);
return;
case LazyLinkingPackage.TYPE:
sequence_Type(context, (Type) semanticObject);
return;
case LazyLinkingPackage.UNRESOLVED_PROXY_PROPERTY:
sequence_UnresolvedProxyProperty(context, (UnresolvedProxyProperty) semanticObject);
return;
}
if (errorAcceptor != null)
errorAcceptor.accept(diagnosticProvider.createInvalidContextOrTypeDiagnostic(semanticObject, context));
}
/**
* Contexts:
* Model returns Model
*
* Constraint:
* types+=Type+
*/
protected void sequence_Model(ISerializationContext context, Model semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Property returns Property
*
* Constraint:
* (type+=[Type|ID]+ name=ID)
*/
protected void sequence_Property(ISerializationContext context, Property semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* Type returns Type
*
* Constraint:
* (
* name=ID
* (extends=[Type|ID] parentId=[Property|ID])?
* (parentId=[Property|ID] extends=[Type|ID])?
* properties+=Property*
* unresolvedProxyProperty+=UnresolvedProxyProperty*
* )
*/
protected void sequence_Type(ISerializationContext context, Type semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
/**
* Contexts:
* UnresolvedProxyProperty returns UnresolvedProxyProperty
*
* Constraint:
* (type+=[Type|ID]+ name=ID)
*/
protected void sequence_UnresolvedProxyProperty(ISerializationContext context, UnresolvedProxyProperty semanticObject) {
genericSequencer.createSequence(context, semanticObject);
}
}
| epl-1.0 |
brokenhands/elite-mfd | resources/public/js/views/stations/stations.js | 2071 | 'use strict';
/* jshint indent:false */
/* global angular */
angular.module('emfd.views.stations', ['ngRoute'])
.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/stations/:system/:station/:ref', {
templateUrl: 'js/views/stations/stations.html'
, controller: 'StationController'
});
}])
.controller('StationController', [
'$scope', '$routeParams', 'dataStore', 'websocket', 'commander',
function($scope, $routeParams, dataStore, websocket, commander) {
$scope.system = $routeParams.system;
$scope.station = $routeParams.station;
$scope.ref = $routeParams.ref;
$scope.destination = commander.destination($routeParams.system);
websocket.registerLocal($scope, {
calculate_result: function(result) {
if (result && result.result)
$scope.returnTrades = result.result;
}
});
switch ($scope.ref) {
case 'trading':
console.log($scope.destination);
$scope.trade = JSON.parse($routeParams.trade);
$scope.subtitle = "Selected Trade";
$scope.distance = $scope.trade.distance;
$scope.distanceFromJumpIn = $scope.trade.destDistanceFromJumpIn;
var form = JSON.parse($routeParams.form);
form['station-name-end'] = form['station-name'];
form['station-name'] = $scope.station + ' (' + $scope.system + ')';
form['min-profit'] /= 10;
console.log(form);
websocket.send(form);
break;
case 'search':
$scope.search = JSON.parse($routeParams.result);
$scope.subtitle = null; // station name is sufficient
$scope.distance = $scope.search.Distance;
$scope.distanceFromJumpIn = $scope.search.Station.DistanceFromJumpIn;
$scope.commodity = $routeParams.commodity;
$scope.searchType = $routeParams.mode;
console.log($routeParams);
break;
}
// if (dataStore[$routeParams.ref]) {
// $scope[$routeParams.ref] = dataStore[$routeParams.ref][$routeParams.index];
// }
}]);
| epl-1.0 |
FTSRG/mondo-collab-framework | archive/workspaceTracker/VA/ikerlanEMF/src/eu/mondo/collaboration/operationtracemodel/example/WTSpec/impl/CtrlUnit129Impl.java | 22500 | /**
*/
package eu.mondo.collaboration.operationtracemodel.example.WTSpec.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import eu.mondo.collaboration.operationtracemodel.example.WTSpec.CtrlUnit129;
import eu.mondo.collaboration.operationtracemodel.example.WTSpec.WTCFault;
import eu.mondo.collaboration.operationtracemodel.example.WTSpec.WTCInput;
import eu.mondo.collaboration.operationtracemodel.example.WTSpec.WTCParam;
import eu.mondo.collaboration.operationtracemodel.example.WTSpec.WTCTimer;
import eu.mondo.collaboration.operationtracemodel.example.WTSpec.WTSpecPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Ctrl Unit129</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link eu.mondo.collaboration.operationtracemodel.example.WTSpec.impl.CtrlUnit129Impl#getInput__iYawStatus <em>Input iYaw Status</em>}</li>
* <li>{@link eu.mondo.collaboration.operationtracemodel.example.WTSpec.impl.CtrlUnit129Impl#getInput__iYawCurrent1 <em>Input iYaw Current1</em>}</li>
* <li>{@link eu.mondo.collaboration.operationtracemodel.example.WTSpec.impl.CtrlUnit129Impl#getInput__iYawCurrent2 <em>Input iYaw Current2</em>}</li>
* <li>{@link eu.mondo.collaboration.operationtracemodel.example.WTSpec.impl.CtrlUnit129Impl#getInput__iYawCurrent3 <em>Input iYaw Current3</em>}</li>
* <li>{@link eu.mondo.collaboration.operationtracemodel.example.WTSpec.impl.CtrlUnit129Impl#getInput__iYawCurrent4 <em>Input iYaw Current4</em>}</li>
* <li>{@link eu.mondo.collaboration.operationtracemodel.example.WTSpec.impl.CtrlUnit129Impl#getParameter__pMinimumTorque <em>Parameter pMinimum Torque</em>}</li>
* <li>{@link eu.mondo.collaboration.operationtracemodel.example.WTSpec.impl.CtrlUnit129Impl#getParameter__pTorqueDifferenceLimit <em>Parameter pTorque Difference Limit</em>}</li>
* <li>{@link eu.mondo.collaboration.operationtracemodel.example.WTSpec.impl.CtrlUnit129Impl#getFault__fYawMotor <em>Fault fYaw Motor</em>}</li>
* <li>{@link eu.mondo.collaboration.operationtracemodel.example.WTSpec.impl.CtrlUnit129Impl#getTimer__tTimer <em>Timer tTimer</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class CtrlUnit129Impl extends wtcImpl implements CtrlUnit129 {
/**
* The cached value of the '{@link #getInput__iYawStatus() <em>Input iYaw Status</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInput__iYawStatus()
* @generated
* @ordered
*/
protected WTCInput input__iYawStatus;
/**
* The cached value of the '{@link #getInput__iYawCurrent1() <em>Input iYaw Current1</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInput__iYawCurrent1()
* @generated
* @ordered
*/
protected WTCInput input__iYawCurrent1;
/**
* The cached value of the '{@link #getInput__iYawCurrent2() <em>Input iYaw Current2</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInput__iYawCurrent2()
* @generated
* @ordered
*/
protected WTCInput input__iYawCurrent2;
/**
* The cached value of the '{@link #getInput__iYawCurrent3() <em>Input iYaw Current3</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInput__iYawCurrent3()
* @generated
* @ordered
*/
protected WTCInput input__iYawCurrent3;
/**
* The cached value of the '{@link #getInput__iYawCurrent4() <em>Input iYaw Current4</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getInput__iYawCurrent4()
* @generated
* @ordered
*/
protected WTCInput input__iYawCurrent4;
/**
* The cached value of the '{@link #getParameter__pMinimumTorque() <em>Parameter pMinimum Torque</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParameter__pMinimumTorque()
* @generated
* @ordered
*/
protected WTCParam parameter__pMinimumTorque;
/**
* The cached value of the '{@link #getParameter__pTorqueDifferenceLimit() <em>Parameter pTorque Difference Limit</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getParameter__pTorqueDifferenceLimit()
* @generated
* @ordered
*/
protected WTCParam parameter__pTorqueDifferenceLimit;
/**
* The cached value of the '{@link #getFault__fYawMotor() <em>Fault fYaw Motor</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getFault__fYawMotor()
* @generated
* @ordered
*/
protected WTCFault fault__fYawMotor;
/**
* The cached value of the '{@link #getTimer__tTimer() <em>Timer tTimer</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getTimer__tTimer()
* @generated
* @ordered
*/
protected WTCTimer timer__tTimer;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CtrlUnit129Impl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return WTSpecPackage.eINSTANCE.getCtrlUnit129();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCInput getInput__iYawStatus() {
if (input__iYawStatus != null && input__iYawStatus.eIsProxy()) {
InternalEObject oldInput__iYawStatus = (InternalEObject)input__iYawStatus;
input__iYawStatus = (WTCInput)eResolveProxy(oldInput__iYawStatus);
if (input__iYawStatus != oldInput__iYawStatus) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_STATUS, oldInput__iYawStatus, input__iYawStatus));
}
}
return input__iYawStatus;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCInput basicGetInput__iYawStatus() {
return input__iYawStatus;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInput__iYawStatus(WTCInput newInput__iYawStatus) {
WTCInput oldInput__iYawStatus = input__iYawStatus;
input__iYawStatus = newInput__iYawStatus;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_STATUS, oldInput__iYawStatus, input__iYawStatus));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCInput getInput__iYawCurrent1() {
if (input__iYawCurrent1 != null && input__iYawCurrent1.eIsProxy()) {
InternalEObject oldInput__iYawCurrent1 = (InternalEObject)input__iYawCurrent1;
input__iYawCurrent1 = (WTCInput)eResolveProxy(oldInput__iYawCurrent1);
if (input__iYawCurrent1 != oldInput__iYawCurrent1) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT1, oldInput__iYawCurrent1, input__iYawCurrent1));
}
}
return input__iYawCurrent1;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCInput basicGetInput__iYawCurrent1() {
return input__iYawCurrent1;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInput__iYawCurrent1(WTCInput newInput__iYawCurrent1) {
WTCInput oldInput__iYawCurrent1 = input__iYawCurrent1;
input__iYawCurrent1 = newInput__iYawCurrent1;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT1, oldInput__iYawCurrent1, input__iYawCurrent1));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCInput getInput__iYawCurrent2() {
if (input__iYawCurrent2 != null && input__iYawCurrent2.eIsProxy()) {
InternalEObject oldInput__iYawCurrent2 = (InternalEObject)input__iYawCurrent2;
input__iYawCurrent2 = (WTCInput)eResolveProxy(oldInput__iYawCurrent2);
if (input__iYawCurrent2 != oldInput__iYawCurrent2) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT2, oldInput__iYawCurrent2, input__iYawCurrent2));
}
}
return input__iYawCurrent2;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCInput basicGetInput__iYawCurrent2() {
return input__iYawCurrent2;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInput__iYawCurrent2(WTCInput newInput__iYawCurrent2) {
WTCInput oldInput__iYawCurrent2 = input__iYawCurrent2;
input__iYawCurrent2 = newInput__iYawCurrent2;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT2, oldInput__iYawCurrent2, input__iYawCurrent2));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCInput getInput__iYawCurrent3() {
if (input__iYawCurrent3 != null && input__iYawCurrent3.eIsProxy()) {
InternalEObject oldInput__iYawCurrent3 = (InternalEObject)input__iYawCurrent3;
input__iYawCurrent3 = (WTCInput)eResolveProxy(oldInput__iYawCurrent3);
if (input__iYawCurrent3 != oldInput__iYawCurrent3) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT3, oldInput__iYawCurrent3, input__iYawCurrent3));
}
}
return input__iYawCurrent3;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCInput basicGetInput__iYawCurrent3() {
return input__iYawCurrent3;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInput__iYawCurrent3(WTCInput newInput__iYawCurrent3) {
WTCInput oldInput__iYawCurrent3 = input__iYawCurrent3;
input__iYawCurrent3 = newInput__iYawCurrent3;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT3, oldInput__iYawCurrent3, input__iYawCurrent3));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCInput getInput__iYawCurrent4() {
if (input__iYawCurrent4 != null && input__iYawCurrent4.eIsProxy()) {
InternalEObject oldInput__iYawCurrent4 = (InternalEObject)input__iYawCurrent4;
input__iYawCurrent4 = (WTCInput)eResolveProxy(oldInput__iYawCurrent4);
if (input__iYawCurrent4 != oldInput__iYawCurrent4) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT4, oldInput__iYawCurrent4, input__iYawCurrent4));
}
}
return input__iYawCurrent4;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCInput basicGetInput__iYawCurrent4() {
return input__iYawCurrent4;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setInput__iYawCurrent4(WTCInput newInput__iYawCurrent4) {
WTCInput oldInput__iYawCurrent4 = input__iYawCurrent4;
input__iYawCurrent4 = newInput__iYawCurrent4;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT4, oldInput__iYawCurrent4, input__iYawCurrent4));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCParam getParameter__pMinimumTorque() {
if (parameter__pMinimumTorque != null && parameter__pMinimumTorque.eIsProxy()) {
InternalEObject oldParameter__pMinimumTorque = (InternalEObject)parameter__pMinimumTorque;
parameter__pMinimumTorque = (WTCParam)eResolveProxy(oldParameter__pMinimumTorque);
if (parameter__pMinimumTorque != oldParameter__pMinimumTorque) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WTSpecPackage.CTRL_UNIT129__PARAMETER_PMINIMUM_TORQUE, oldParameter__pMinimumTorque, parameter__pMinimumTorque));
}
}
return parameter__pMinimumTorque;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCParam basicGetParameter__pMinimumTorque() {
return parameter__pMinimumTorque;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParameter__pMinimumTorque(WTCParam newParameter__pMinimumTorque) {
WTCParam oldParameter__pMinimumTorque = parameter__pMinimumTorque;
parameter__pMinimumTorque = newParameter__pMinimumTorque;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WTSpecPackage.CTRL_UNIT129__PARAMETER_PMINIMUM_TORQUE, oldParameter__pMinimumTorque, parameter__pMinimumTorque));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCParam getParameter__pTorqueDifferenceLimit() {
if (parameter__pTorqueDifferenceLimit != null && parameter__pTorqueDifferenceLimit.eIsProxy()) {
InternalEObject oldParameter__pTorqueDifferenceLimit = (InternalEObject)parameter__pTorqueDifferenceLimit;
parameter__pTorqueDifferenceLimit = (WTCParam)eResolveProxy(oldParameter__pTorqueDifferenceLimit);
if (parameter__pTorqueDifferenceLimit != oldParameter__pTorqueDifferenceLimit) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WTSpecPackage.CTRL_UNIT129__PARAMETER_PTORQUE_DIFFERENCE_LIMIT, oldParameter__pTorqueDifferenceLimit, parameter__pTorqueDifferenceLimit));
}
}
return parameter__pTorqueDifferenceLimit;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCParam basicGetParameter__pTorqueDifferenceLimit() {
return parameter__pTorqueDifferenceLimit;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setParameter__pTorqueDifferenceLimit(WTCParam newParameter__pTorqueDifferenceLimit) {
WTCParam oldParameter__pTorqueDifferenceLimit = parameter__pTorqueDifferenceLimit;
parameter__pTorqueDifferenceLimit = newParameter__pTorqueDifferenceLimit;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WTSpecPackage.CTRL_UNIT129__PARAMETER_PTORQUE_DIFFERENCE_LIMIT, oldParameter__pTorqueDifferenceLimit, parameter__pTorqueDifferenceLimit));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCFault getFault__fYawMotor() {
if (fault__fYawMotor != null && fault__fYawMotor.eIsProxy()) {
InternalEObject oldFault__fYawMotor = (InternalEObject)fault__fYawMotor;
fault__fYawMotor = (WTCFault)eResolveProxy(oldFault__fYawMotor);
if (fault__fYawMotor != oldFault__fYawMotor) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WTSpecPackage.CTRL_UNIT129__FAULT_FYAW_MOTOR, oldFault__fYawMotor, fault__fYawMotor));
}
}
return fault__fYawMotor;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCFault basicGetFault__fYawMotor() {
return fault__fYawMotor;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setFault__fYawMotor(WTCFault newFault__fYawMotor) {
WTCFault oldFault__fYawMotor = fault__fYawMotor;
fault__fYawMotor = newFault__fYawMotor;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WTSpecPackage.CTRL_UNIT129__FAULT_FYAW_MOTOR, oldFault__fYawMotor, fault__fYawMotor));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCTimer getTimer__tTimer() {
if (timer__tTimer != null && timer__tTimer.eIsProxy()) {
InternalEObject oldTimer__tTimer = (InternalEObject)timer__tTimer;
timer__tTimer = (WTCTimer)eResolveProxy(oldTimer__tTimer);
if (timer__tTimer != oldTimer__tTimer) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, WTSpecPackage.CTRL_UNIT129__TIMER_TTIMER, oldTimer__tTimer, timer__tTimer));
}
}
return timer__tTimer;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public WTCTimer basicGetTimer__tTimer() {
return timer__tTimer;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setTimer__tTimer(WTCTimer newTimer__tTimer) {
WTCTimer oldTimer__tTimer = timer__tTimer;
timer__tTimer = newTimer__tTimer;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, WTSpecPackage.CTRL_UNIT129__TIMER_TTIMER, oldTimer__tTimer, timer__tTimer));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_STATUS:
if (resolve) return getInput__iYawStatus();
return basicGetInput__iYawStatus();
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT1:
if (resolve) return getInput__iYawCurrent1();
return basicGetInput__iYawCurrent1();
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT2:
if (resolve) return getInput__iYawCurrent2();
return basicGetInput__iYawCurrent2();
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT3:
if (resolve) return getInput__iYawCurrent3();
return basicGetInput__iYawCurrent3();
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT4:
if (resolve) return getInput__iYawCurrent4();
return basicGetInput__iYawCurrent4();
case WTSpecPackage.CTRL_UNIT129__PARAMETER_PMINIMUM_TORQUE:
if (resolve) return getParameter__pMinimumTorque();
return basicGetParameter__pMinimumTorque();
case WTSpecPackage.CTRL_UNIT129__PARAMETER_PTORQUE_DIFFERENCE_LIMIT:
if (resolve) return getParameter__pTorqueDifferenceLimit();
return basicGetParameter__pTorqueDifferenceLimit();
case WTSpecPackage.CTRL_UNIT129__FAULT_FYAW_MOTOR:
if (resolve) return getFault__fYawMotor();
return basicGetFault__fYawMotor();
case WTSpecPackage.CTRL_UNIT129__TIMER_TTIMER:
if (resolve) return getTimer__tTimer();
return basicGetTimer__tTimer();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_STATUS:
setInput__iYawStatus((WTCInput)newValue);
return;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT1:
setInput__iYawCurrent1((WTCInput)newValue);
return;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT2:
setInput__iYawCurrent2((WTCInput)newValue);
return;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT3:
setInput__iYawCurrent3((WTCInput)newValue);
return;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT4:
setInput__iYawCurrent4((WTCInput)newValue);
return;
case WTSpecPackage.CTRL_UNIT129__PARAMETER_PMINIMUM_TORQUE:
setParameter__pMinimumTorque((WTCParam)newValue);
return;
case WTSpecPackage.CTRL_UNIT129__PARAMETER_PTORQUE_DIFFERENCE_LIMIT:
setParameter__pTorqueDifferenceLimit((WTCParam)newValue);
return;
case WTSpecPackage.CTRL_UNIT129__FAULT_FYAW_MOTOR:
setFault__fYawMotor((WTCFault)newValue);
return;
case WTSpecPackage.CTRL_UNIT129__TIMER_TTIMER:
setTimer__tTimer((WTCTimer)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_STATUS:
setInput__iYawStatus((WTCInput)null);
return;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT1:
setInput__iYawCurrent1((WTCInput)null);
return;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT2:
setInput__iYawCurrent2((WTCInput)null);
return;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT3:
setInput__iYawCurrent3((WTCInput)null);
return;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT4:
setInput__iYawCurrent4((WTCInput)null);
return;
case WTSpecPackage.CTRL_UNIT129__PARAMETER_PMINIMUM_TORQUE:
setParameter__pMinimumTorque((WTCParam)null);
return;
case WTSpecPackage.CTRL_UNIT129__PARAMETER_PTORQUE_DIFFERENCE_LIMIT:
setParameter__pTorqueDifferenceLimit((WTCParam)null);
return;
case WTSpecPackage.CTRL_UNIT129__FAULT_FYAW_MOTOR:
setFault__fYawMotor((WTCFault)null);
return;
case WTSpecPackage.CTRL_UNIT129__TIMER_TTIMER:
setTimer__tTimer((WTCTimer)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_STATUS:
return input__iYawStatus != null;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT1:
return input__iYawCurrent1 != null;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT2:
return input__iYawCurrent2 != null;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT3:
return input__iYawCurrent3 != null;
case WTSpecPackage.CTRL_UNIT129__INPUT_IYAW_CURRENT4:
return input__iYawCurrent4 != null;
case WTSpecPackage.CTRL_UNIT129__PARAMETER_PMINIMUM_TORQUE:
return parameter__pMinimumTorque != null;
case WTSpecPackage.CTRL_UNIT129__PARAMETER_PTORQUE_DIFFERENCE_LIMIT:
return parameter__pTorqueDifferenceLimit != null;
case WTSpecPackage.CTRL_UNIT129__FAULT_FYAW_MOTOR:
return fault__fYawMotor != null;
case WTSpecPackage.CTRL_UNIT129__TIMER_TTIMER:
return timer__tTimer != null;
}
return super.eIsSet(featureID);
}
} //CtrlUnit129Impl
| epl-1.0 |
smeup/asup | org.smeup.sys.db.syntax/src/org/smeup/sys/db/syntax/ddl/impl/CommitStatementImpl.java | 4036 | /**
* Copyright (c) 2012, 2016 Sme.UP and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.smeup.sys.db.syntax.ddl.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.smeup.sys.db.syntax.ddl.QCommitStatement;
import org.smeup.sys.db.syntax.ddl.QDatabaseSyntaxDDLPackage;
import org.smeup.sys.db.syntax.impl.DefinitionStatementImpl;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Commit Statement</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* </p>
* <ul>
* <li>{@link org.smeup.sys.db.syntax.ddl.impl.CommitStatementImpl#isHold <em>Hold</em>}</li>
* </ul>
*
* @generated
*/
public class CommitStatementImpl extends DefinitionStatementImpl implements QCommitStatement {
/**
* The default value of the '{@link #isHold() <em>Hold</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isHold()
* @generated
* @ordered
*/
protected static final boolean HOLD_EDEFAULT = false;
/**
* The cached value of the '{@link #isHold() <em>Hold</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #isHold()
* @generated
* @ordered
*/
protected boolean hold = HOLD_EDEFAULT;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected CommitStatementImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return QDatabaseSyntaxDDLPackage.Literals.COMMIT_STATEMENT;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean isHold() {
return hold;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setHold(boolean newHold) {
boolean oldHold = hold;
hold = newHold;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, QDatabaseSyntaxDDLPackage.COMMIT_STATEMENT__HOLD, oldHold, hold));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case QDatabaseSyntaxDDLPackage.COMMIT_STATEMENT__HOLD:
return isHold();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case QDatabaseSyntaxDDLPackage.COMMIT_STATEMENT__HOLD:
setHold((Boolean)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case QDatabaseSyntaxDDLPackage.COMMIT_STATEMENT__HOLD:
setHold(HOLD_EDEFAULT);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case QDatabaseSyntaxDDLPackage.COMMIT_STATEMENT__HOLD:
return hold != HOLD_EDEFAULT;
}
return super.eIsSet(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String toString() {
if (eIsProxy()) return super.toString();
StringBuffer result = new StringBuffer(super.toString());
result.append(" (hold: ");
result.append(hold);
result.append(')');
return result.toString();
}
} //CommitStatementImpl
| epl-1.0 |
theanuradha/debrief | org.mwc.cmap.legacy/src/MWC/GUI/JFreeChart/StepperChartPanel.java | 5378 | /*
* Debrief - the Open Source Maritime Analysis Application
* http://debrief.info
*
* (C) 2000-2014, PlanetMayo Ltd
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html)
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*/
package MWC.GUI.JFreeChart;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
import MWC.GUI.CanvasType;
import MWC.GUI.StepperListener;
import MWC.GenericData.HiResDate;
/**
* *******************************************************************
* embedded class which extends free chart to give current DTG indication
* *******************************************************************
*/
public final class StepperChartPanel extends ChartPanel implements StepperListener
{
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* the step control we monitor
*/
private final StepperListener.StepperController _myStepper;
//////////////////////////////////////////////////
// constructor
//////////////////////////////////////////////////
/**
* Constructs a panel containing a chart.
*
* @param chart the chart.
* @param useBuffer a flag controlling whether or not an off-screen buffer is used.
*/
public StepperChartPanel(final JFreeChart chart, final boolean useBuffer,
final StepperListener.StepperController stepper)
{
super(chart, useBuffer);
this._myStepper = stepper;
// increase the maximum draw height, so it doesn't get scaled
this.setMaximumDrawHeight(1600);
this.setMaximumDrawWidth(1600);
if (_myStepper != null)
{
_myStepper.addStepperListener(this);
}
}
//////////////////////////////////////////////////
// support for time stepper
//////////////////////////////////////////////////
/**
* the current time has changed
*/
public final void newTime(final HiResDate oldDTG, final HiResDate newDTG, final CanvasType canvas)
{
// trigger refresh
this.setRefreshBuffer(true);
// and invalidate
this.invalidate();
// and the redraw
this.repaint();
}
/**
* the mode for stepping has changed
*/
public final void steppingModeChanged(final boolean on)
{
}
/** Working storage for available panel area after deducting insets. */
private final Rectangle2D available = new Rectangle2D.Double();
/** Working storage for the chart area. */
private final Rectangle2D chartArea = new Rectangle2D.Double();
/**
* Paints the component by drawing the chart to fill the entire component,
* but allowing for the insets (which will be non-zero if a border has been
* set for this component). To increase performance (at the expense of
* memory), an off-screen buffer image can be used.
*
* @param g the graphics device for drawing on.
*/
public void paintWMFComponent(final Graphics g) {
final Graphics2D g2 = (Graphics2D) g;
// first determine the size of the chart rendering area...
final Dimension size = getSize();
final Insets insets = getInsets();
available.setRect(insets.left, insets.top,
size.getWidth() - insets.left - insets.right,
size.getHeight() - insets.top - insets.bottom);
// work out if scaling is required...
boolean scale = false;
double drawWidth = available.getWidth();
double drawHeight = available.getHeight();
double scaleX = 1.0;
double scaleY = 1.0;
if (drawWidth < this.getMinimumDrawWidth()) {
scaleX = drawWidth / getMinimumDrawWidth();
drawWidth = getMinimumDrawWidth();
scale = true;
}
else if (drawWidth > this.getMaximumDrawWidth()) {
scaleX = drawWidth / getMaximumDrawWidth();
drawWidth = getMaximumDrawWidth();
scale = true;
}
if (drawHeight < this.getMinimumDrawHeight()) {
scaleY = drawHeight / getMinimumDrawHeight();
drawHeight = getMinimumDrawHeight();
scale = true;
}
else if (drawHeight > this.getMaximumDrawHeight()) {
scaleY = drawHeight / getMaximumDrawHeight();
drawHeight = getMaximumDrawHeight();
scale = true;
}
chartArea.setRect(0.0, 0.0, drawWidth, drawHeight);
final AffineTransform saved = g2.getTransform();
g2.translate(insets.left, insets.right);
if (scale) {
final AffineTransform st = AffineTransform.getScaleInstance(scaleX, scaleY);
g2.transform(st);
}
getChart().draw(g2, chartArea, this.getChartRenderingInfo());
g2.setTransform(saved);
}
@Override
public void reset()
{
// don't worry about it, ignore
}
}
| epl-1.0 |
slemeur/che | ide/che-core-ide-app/src/main/java/org/eclipse/che/ide/part/editor/recent/RecentFileStore.java | 7857 | /*******************************************************************************
* Copyright (c) 2012-2016 Codenvy, S.A.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Codenvy, S.A. - initial API and implementation
*******************************************************************************/
package org.eclipse.che.ide.part.editor.recent;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import com.google.web.bindery.event.shared.EventBus;
import org.eclipse.che.ide.CoreLocalizationConstant;
import org.eclipse.che.ide.api.action.AbstractPerspectiveAction;
import org.eclipse.che.ide.api.action.ActionEvent;
import org.eclipse.che.ide.api.action.ActionManager;
import org.eclipse.che.ide.api.action.DefaultActionGroup;
import org.eclipse.che.ide.api.action.IdeActions;
import org.eclipse.che.ide.api.constraints.Constraints;
import org.eclipse.che.ide.api.event.FileEvent;
import org.eclipse.che.ide.api.event.FileEvent.FileEventHandler;
import org.eclipse.che.ide.api.resources.File;
import org.eclipse.che.ide.api.resources.VirtualFile;
import org.eclipse.che.ide.util.Pair;
import javax.validation.constraints.NotNull;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import static com.google.common.collect.Lists.newLinkedList;
import static java.util.Collections.singletonList;
import static org.eclipse.che.ide.api.constraints.Anchor.BEFORE;
import static org.eclipse.che.ide.api.constraints.Constraints.FIRST;
import static org.eclipse.che.ide.api.constraints.Constraints.LAST;
import static org.eclipse.che.ide.api.event.FileEvent.FileOperation.OPEN;
import static org.eclipse.che.ide.workspace.perspectives.project.ProjectPerspective.PROJECT_PERSPECTIVE_ID;
/**
* Default implementation of Recent File List.
*
* @author Vlad Zhukovskiy
*/
@Singleton
public class RecentFileStore implements RecentFileList, FileEventHandler {
public static final int MAX_FILES_IN_STACK = 25;
public static final int MAX_PATH_LENGTH_TO_DISPLAY = 50;
public static final String RECENT_GROUP_ID = "Recent";
private final OpenRecentFilesPresenter openRecentFilesPresenter;
private final ActionManager actionManager;
private final RecentFileActionFactory recentFileActionFactory;
private final CoreLocalizationConstant locale;
private final DefaultActionGroup recentGroup;
private LinkedList<File> recentStorage = newLinkedList();
private LinkedList<Pair<File, RecentFileAction>> fileToAction = newLinkedList();
@Inject
public RecentFileStore(EventBus eventBus,
OpenRecentFilesPresenter openRecentFilesPresenter,
ActionManager actionManager,
RecentFileActionFactory recentFileActionFactory,
CoreLocalizationConstant locale) {
this.openRecentFilesPresenter = openRecentFilesPresenter;
this.actionManager = actionManager;
this.recentFileActionFactory = recentFileActionFactory;
this.locale = locale;
ClearRecentListAction action = new ClearRecentListAction();
recentGroup = new DefaultActionGroup(RECENT_GROUP_ID, true, actionManager);
actionManager.registerAction(IdeActions.GROUP_RECENT_FILES, recentGroup);
actionManager.registerAction("clearRecentList", action);
recentGroup.addSeparator();
recentGroup.add(action, LAST);
DefaultActionGroup editGroup = (DefaultActionGroup)actionManager.getAction(IdeActions.GROUP_EDIT);
editGroup.add(recentGroup, new Constraints(BEFORE, "openRecentFiles"));
eventBus.addHandler(FileEvent.TYPE, this);
}
/** {@inheritDoc} */
@Override
public void onFileOperation(FileEvent event) {
if (event.getOperationType() == OPEN) {
VirtualFile file = event.getFile();
if (file instanceof File) {
add((File)file);
}
}
}
/** {@inheritDoc} */
@Override
public boolean isEmpty() {
return recentStorage.isEmpty();
}
/** {@inheritDoc} */
@Override
public boolean add(final File item) {
if (item == null) {
return false;
}
//initial precondition
if (recentStorage.size() == MAX_FILES_IN_STACK) {
remove(recentStorage.getLast());
}
remove(item);
recentStorage.addFirst(item);
openRecentFilesPresenter.setRecentFiles(getAll());
//register recent item action
RecentFileAction action = recentFileActionFactory.newRecentFileAction(item);
fileToAction.add(Pair.of(item, action));
actionManager.registerAction(action.getId(), action);
recentGroup.add(action, FIRST);
return true;
}
/** {@inheritDoc} */
@Override
public boolean remove(File item) {
recentStorage.remove(item);
openRecentFilesPresenter.setRecentFiles(getAll());
//with one cycle de-register action and remove it from recent group
Iterator<Pair<File, RecentFileAction>> iterator = fileToAction.iterator();
while (iterator.hasNext()) {
Pair<File, RecentFileAction> pair = iterator.next();
if (pair.getFirst().equals(item)) {
recentGroup.remove(pair.getSecond());
actionManager.unregisterAction(pair.getSecond().getId());
iterator.remove();
return true;
}
}
return false;
}
/** {@inheritDoc} */
@Override
public boolean contains(File item) {
return recentStorage.contains(item);
}
/** {@inheritDoc} */
@Override
public List<File> getAll() {
return recentStorage;
}
/** {@inheritDoc} */
@Override
public void clear() {
openRecentFilesPresenter.clearRecentFiles();
recentStorage.clear();
//de-register all previously registered actions
for (Pair<File, RecentFileAction> pair : fileToAction) {
actionManager.unregisterAction(pair.getSecond().getId());
recentGroup.remove(pair.getSecond());
}
fileToAction.clear();
}
/** {@inheritDoc} */
@Override
public OpenRecentFilesPresenter getRecentViewDialog() {
return openRecentFilesPresenter;
}
/**
* Split path if it more then 50 characters. Otherwise, if path is less then 50 characters then it returns as is.
*
* @param path
* path to check
* @return path to display
*/
static String getShortPath(String path) {
if (path.length() < MAX_PATH_LENGTH_TO_DISPLAY) {
return path;
}
int bIndex = path.length() - MAX_PATH_LENGTH_TO_DISPLAY;
String raw = path.substring(bIndex);
if (raw.indexOf('/') == -1) {
return raw;
}
raw = raw.substring(raw.indexOf('/'));
raw = "..." + raw;
return raw;
}
private class ClearRecentListAction extends AbstractPerspectiveAction {
public ClearRecentListAction() {
super(singletonList(PROJECT_PERSPECTIVE_ID), locale.openRecentFileClearTitle(), locale.openRecentFileClearDescription(), null,
null);
}
@Override
public void updateInPerspective(@NotNull ActionEvent event) {
event.getPresentation().setEnabledAndVisible(!isEmpty());
}
@Override
public void actionPerformed(ActionEvent e) {
clear();
}
}
}
| epl-1.0 |
lunifera/lunifera-doc | org.lunifera.doc.dsl.semantic/src/org/lunifera/doc/dsl/doccompiler/impl/MovieEndImpl.java | 5269 | /**
*/
package org.lunifera.doc.dsl.doccompiler.impl;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.lunifera.doc.dsl.doccompiler.DocCompilerPackage;
import org.lunifera.doc.dsl.doccompiler.MovieEnd;
import org.lunifera.doc.dsl.doccompiler.MovieStart;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Movie End</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link org.lunifera.doc.dsl.doccompiler.impl.MovieEndImpl#getStart <em>Start</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class MovieEndImpl extends LinePartImpl implements MovieEnd {
/**
* The cached value of the '{@link #getStart() <em>Start</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getStart()
* @generated
* @ordered
*/
protected MovieStart start;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected MovieEndImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return DocCompilerPackage.Literals.MOVIE_END;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MovieStart getStart() {
if (start != null && start.eIsProxy()) {
InternalEObject oldStart = (InternalEObject)start;
start = (MovieStart)eResolveProxy(oldStart);
if (start != oldStart) {
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.RESOLVE, DocCompilerPackage.MOVIE_END__START, oldStart, start));
}
}
return start;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public MovieStart basicGetStart() {
return start;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetStart(MovieStart newStart, NotificationChain msgs) {
MovieStart oldStart = start;
start = newStart;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, DocCompilerPackage.MOVIE_END__START, oldStart, newStart);
if (msgs == null) msgs = notification; else msgs.add(notification);
}
return msgs;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setStart(MovieStart newStart) {
if (newStart != start) {
NotificationChain msgs = null;
if (start != null)
msgs = ((InternalEObject)start).eInverseRemove(this, DocCompilerPackage.MOVIE_START__END, MovieStart.class, msgs);
if (newStart != null)
msgs = ((InternalEObject)newStart).eInverseAdd(this, DocCompilerPackage.MOVIE_START__END, MovieStart.class, msgs);
msgs = basicSetStart(newStart, msgs);
if (msgs != null) msgs.dispatch();
}
else if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DocCompilerPackage.MOVIE_END__START, newStart, newStart));
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DocCompilerPackage.MOVIE_END__START:
if (start != null)
msgs = ((InternalEObject)start).eInverseRemove(this, DocCompilerPackage.MOVIE_START__END, MovieStart.class, msgs);
return basicSetStart((MovieStart)otherEnd, msgs);
}
return super.eInverseAdd(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
switch (featureID) {
case DocCompilerPackage.MOVIE_END__START:
return basicSetStart(null, msgs);
}
return super.eInverseRemove(otherEnd, featureID, msgs);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case DocCompilerPackage.MOVIE_END__START:
if (resolve) return getStart();
return basicGetStart();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case DocCompilerPackage.MOVIE_END__START:
setStart((MovieStart)newValue);
return;
}
super.eSet(featureID, newValue);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void eUnset(int featureID) {
switch (featureID) {
case DocCompilerPackage.MOVIE_END__START:
setStart((MovieStart)null);
return;
}
super.eUnset(featureID);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case DocCompilerPackage.MOVIE_END__START:
return start != null;
}
return super.eIsSet(featureID);
}
} //MovieEndImpl
| epl-1.0 |
eclipse-ease-addons/jruby | plugins/org.eclipse.ease.lang.ruby/src/org/eclipse/ease/lang/ruby/PluginConstants.java | 672 | /*******************************************************************************
* Copyright (c) 2015 Christian Pontesegger and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Christian Pontesegger - initial API and implementation
*******************************************************************************/
package org.eclipse.ease.lang.ruby;
public interface PluginConstants {
String PLUGIN_ID = "org.eclipse.ease.lang.ruby";
}
| epl-1.0 |
bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs | foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/models/ownership/ObjectD.java | 4221 | /*******************************************************************************
* Copyright (c) 1998, 2013 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Eclipse Distribution License is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* Contributors:
* Oracle - initial API and implementation from Oracle TopLink
******************************************************************************/
package org.eclipse.persistence.testing.models.ownership;
import java.io.*;
import java.util.*;
import org.eclipse.persistence.indirection.*;
import org.eclipse.persistence.tools.schemaframework.*;
public class ObjectD implements Serializable {
public Number id;
public String name;
public ValueHolderInterface oneToMany;
public ObjectD() {
oneToMany = new ValueHolder();
}
public static ObjectD example1() {
ObjectD example = new ObjectD();
Vector objects = new Vector();
objects.addElement(ObjectE.example1(example));
objects.addElement(ObjectE.example2(example));
objects.addElement(ObjectE.example3(example));
example.getOneToMany().setValue(objects);
example.setName("D1");
return example;
}
public static ObjectD example2() {
ObjectD example = new ObjectD();
Vector objects = new Vector();
objects.addElement(ObjectE.example4(example));
objects.addElement(ObjectE.example5(example));
objects.addElement(ObjectE.example6(example));
example.getOneToMany().setValue(objects);
example.setName("D2");
return example;
}
public static ObjectD example3() {
ObjectD example = new ObjectD();
Vector objects = new Vector();
objects.addElement(ObjectE.example7(example));
objects.addElement(ObjectE.example8(example));
objects.addElement(ObjectE.example9(example));
example.getOneToMany().setValue(objects);
example.setName("D3");
return example;
}
public static ObjectD example4() {
ObjectD example = new ObjectD();
Vector objects = new Vector();
objects.addElement(ObjectE.example10(example));
objects.addElement(ObjectE.example11(example));
objects.addElement(ObjectE.example12(example));
example.getOneToMany().setValue(objects);
example.setName("D4");
return example;
}
public static ObjectD example5() {
ObjectD example = new ObjectD();
Vector objects = new Vector();
objects.addElement(ObjectE.example13(example));
objects.addElement(ObjectE.example14(example));
objects.addElement(ObjectE.example15(example));
example.getOneToMany().setValue(objects);
example.setName("D5");
return example;
}
public static ObjectD example6() {
ObjectD example = new ObjectD();
Vector objects = new Vector();
objects.addElement(ObjectE.example16(example));
objects.addElement(ObjectE.example17(example));
objects.addElement(ObjectE.example18(example));
example.getOneToMany().setValue(objects);
example.setName("D6");
return example;
}
public ValueHolderInterface getOneToMany() {
return oneToMany;
}
public void setName(String aName) {
name = aName;
}
/**
* Return a platform independant definition of the database table.
*/
public static TableDefinition tableDefinition() {
TableDefinition definition = new TableDefinition();
definition.setName("OWNER_D");
definition.addIdentityField("ID", java.math.BigDecimal.class, 15);
definition.addField("NAME", String.class, 10);
return definition;
}
}
| epl-1.0 |
ttimbul/eclipse.wst | bundles/org.eclipse.wst.sse.ui/src-extensions/org/eclipse/wst/sse/ui/internal/provisional/extensions/ISelfValidateEditAction.java | 1089 | /*******************************************************************************
* Copyright (c) 2001, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* Jens Lukowski/Innoopract - initial renaming/restructuring
*
*******************************************************************************/
package org.eclipse.wst.sse.ui.internal.provisional.extensions;
/**
* This is a marker interface to control ValidateEdit call Usually framework
* calls IExtendedSimpleEditor#validateEdit() before calling
* IExtendedEditorAction's run() method. However, if the action implements
* this interface, framework won't call validateEdit() method.
*
* The action should call validateEdit() at their own appropriate timing.
*/
public interface ISelfValidateEditAction {
}
| epl-1.0 |
sleshchenko/che | plugins/plugin-git/che-plugin-git-ext-git/src/main/java/org/eclipse/che/ide/ext/git/client/branch/BranchView.java | 3294 | /*
* Copyright (c) 2012-2018 Red Hat, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
*/
package org.eclipse.che.ide.ext.git.client.branch;
import java.util.List;
import javax.validation.constraints.NotNull;
import org.eclipse.che.api.git.shared.Branch;
import org.eclipse.che.ide.api.mvp.View;
/**
* The view of {@link BranchPresenter}.
*
* @author Andrey Plotnikov
*/
public interface BranchView extends View<BranchView.ActionDelegate> {
/** Needs for delegate some function into Branch view. */
interface ActionDelegate {
/** Performs any actions appropriate in response to the user having pressed the Close action. */
void onClose();
/**
* Performs any actions appropriate in response to the user having pressed the Rename button.
*/
void onRenameClicked();
/**
* Performs any actions appropriate in response to the user having pressed the Delete button.
*/
void onDeleteClicked();
/**
* Performs any actions appropriate in response to the user having pressed the Checkout button.
*/
void onCheckoutClicked();
/**
* Performs any actions appropriate in response to the user having pressed the Create button.
*/
void onCreateClicked();
/**
* Performs any action in response to the user having selected branch.
*
* @param branch selected revision
*/
void onBranchSelected(@NotNull Branch branch);
/** Performs any action in response to the user do not have any selected branch. */
void onBranchUnselected();
/**
* Performs any action in response to the user having selected branch filter (local/remote/all).
*/
void onLocalRemoteFilterChanged();
/** Is called when search filter is updated */
void onSearchFilterChanged(String filter);
}
/**
* Set available branches.
*
* @param branches git branches
*/
void setBranches(@NotNull List<Branch> branches);
/**
* Change the enable state of the delete button.
*
* @param enabled <code>true</code> to enable the button, <code>false</code> to disable it
*/
void setEnableDeleteButton(boolean enabled);
/**
* Change the enable state of the checkout button.
*
* @param enabled <code>true</code> to enable the button, <code>false</code> to disable it
*/
void setEnableCheckoutButton(boolean enabled);
/**
* Change the enable state of the rename button.
*
* @param enabled <code>true</code> to enable the button, <code>false</code> to disable it
*/
void setEnableRenameButton(boolean enabled);
/** Returns selected branch filter. */
String getFilterValue();
/** Close dialog if it is showing. */
void closeDialogIfShowing();
/** Show dialog. */
void showDialogIfClosed();
/**
* Set new content to search filter label.
*
* @param text text to set
*/
void setTextToSearchFilterLabel(String text);
/** Clear search filter. */
void clearSearchFilter();
/** Set focus to current window. */
void setFocus();
}
| epl-1.0 |
Snickermicker/openhab2 | bundles/org.openhab.binding.mqtt.homeassistant/src/main/java/org/openhab/binding/mqtt/homeassistant/internal/ComponentSensor.java | 2098 | /**
* Copyright (c) 2010-2019 Contributors to the openHAB project
*
* See the NOTICE file(s) distributed with this work for additional
* information.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.mqtt.homeassistant.internal;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.mqtt.generic.values.TextValue;
/**
* A MQTT sensor, following the https://www.home-assistant.io/components/sensor.mqtt/ specification.
*
* @author David Graeff - Initial contribution
*/
@NonNullByDefault
public class ComponentSensor extends AbstractComponent<ComponentSensor.ChannelConfiguration> {
public static final String sensorChannelID = "sensor"; // Randomly chosen channel "ID"
/**
* Configuration class for MQTT component
*/
static class ChannelConfiguration extends BaseChannelConfiguration {
ChannelConfiguration() {
super("MQTT Sensor");
}
protected String unit_of_measurement = "";
protected @Nullable String device_class;
protected boolean force_update = false;
protected int expire_after = 0;
protected String state_topic = "";
}
public ComponentSensor(CFactory.ComponentConfiguration componentConfiguration) {
super(componentConfiguration, ChannelConfiguration.class);
if (channelConfiguration.force_update) {
throw new UnsupportedOperationException("Component:Sensor does not support forced updates");
}
buildChannel(sensorChannelID, new TextValue(), channelConfiguration.name,
componentConfiguration.getUpdateListener())//
.stateTopic(channelConfiguration.state_topic, channelConfiguration.value_template)//
.unit(channelConfiguration.unit_of_measurement)//
.build();
}
}
| epl-1.0 |
4G-ADS/Projeto_PI | controladora/ControladoraInstituicao.java | 2580 | package com.fafica.projeto_pi.controladora;
import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import com.fafica.projeto_pi.excecoes.AdministradorJaCadastradoException;
import com.fafica.projeto_pi.excecoes.CPFInvalidoException;
import com.fafica.projeto_pi.excecoes.CampoObritarorioInvalidoException;
import com.fafica.projeto_pi.excecoes.InstituicacaoNaoEncontrada;
import com.fafica.projeto_pi.modelos.Instituicao;
import com.fafica.projeto_pi.repositorioBDR.RepositorioIntituicaoBDR;
import com.fafica.projeto_pi.repositorioBDR.irepositorioBDR.IRepositorioInstituicao;
public class ControladoraInstituicao {
IRepositorioInstituicao repositorioInstituicao;
public ControladoraInstituicao() throws Exception {
this.repositorioInstituicao = new RepositorioIntituicaoBDR();
}
public void cadastrarInstituicao(Instituicao instituicao)
throws SQLException, IOException,
CampoObritarorioInvalidoException, CPFInvalidoException,
AdministradorJaCadastradoException {
System.out
.println("Panssando pelo cadastrarInstituicao em controladoraInstituicao");
this.repositorioInstituicao.cadastrarInstituicao(instituicao);
}
public ArrayList<Instituicao> listarInstituicao() throws SQLException,
IOException {
System.out
.println("Panssando pelo listarInstituicao em controladoraInstituicao");
ArrayList<Instituicao> lista = null;
lista = this.repositorioInstituicao.listarInstituicao();
return lista;
}
public ArrayList<Instituicao> listarInstituicao(int idReserva)
throws SQLException {
System.out
.println("Panssando pelo listarInstituicao em controladoraInstituicao");
return this.repositorioInstituicao.listarInstituicao(idReserva);
}
public Instituicao procurarInstituicao(int idInstituicao)
throws SQLException, InstituicacaoNaoEncontrada {
System.out
.println("Panssando pelo procurarInstituicao em controladoraInstituicao");
return this.repositorioInstituicao.procurarInstituicao(idInstituicao);
}
public void editarInstituicao(Instituicao instituicao) throws SQLException,
IOException, InstituicacaoNaoEncontrada {
System.out
.println("Panssando pelo editarInstituicao em controladoraInstituicao");
this.repositorioInstituicao.editarInstituicao(instituicao);
}
public void removerInstituicao(int idIntituicao) throws SQLException,
IOException, InstituicacaoNaoEncontrada {
System.out
.println("Panssando pelo removerInstituicao em controladoraInstituicao");
this.repositorioInstituicao.removerInstituicao(idIntituicao);
}
}
| epl-1.0 |
windup/windup-sample-apps | test-files/src_example/org/apache/wicket/util/cookies/CookieUtils.java | 5481 | package org.apache.wicket.util.cookies;
import javax.servlet.http.*;
import org.apache.wicket.markup.html.form.*;
import org.apache.wicket.util.string.*;
import org.apache.wicket.protocol.http.servlet.*;
import org.apache.wicket.request.cycle.*;
import org.apache.wicket.request.http.*;
import org.apache.wicket.util.time.*;
import org.slf4j.*;
public class CookieUtils{
private static final Logger log;
private final CookieDefaults settings;
public CookieUtils(){
super();
this.settings=new CookieDefaults();
}
public CookieUtils(final CookieDefaults settings){
super();
this.settings=settings;
}
public final CookieDefaults getSettings(){
return this.settings;
}
public final void remove(final String key){
final Cookie cookie=this.getCookie(key);
if(cookie!=null){
this.remove(cookie);
}
}
public final void remove(final FormComponent<?> formComponent){
this.remove(this.getKey(formComponent));
}
protected String getKey(final FormComponent<?> component){
return component.getPageRelativePath();
}
public final String load(final String key){
final Cookie cookie=this.getCookie(key);
if(cookie!=null){
return cookie.getValue();
}
return null;
}
public final String load(final FormComponent<?> formComponent){
final String value=this.load(this.getKey(formComponent));
if(value!=null){
formComponent.setModelValue(this.splitValue(value));
}
return value;
}
protected String[] splitValue(final String value){
return value.split(";");
}
protected String joinValues(final String... values){
return Strings.join(";",values);
}
public final void save(String key,final String... values){
key=this.getSaveKey(key);
final String value=this.joinValues(values);
Cookie cookie=this.getCookie(key);
if(cookie==null){
cookie=new Cookie(key,value);
}
else{
cookie.setValue(value);
}
cookie.setSecure(false);
cookie.setMaxAge(this.settings.getMaxAge());
this.save(cookie);
}
public final void save(final FormComponent<?> formComponent){
this.save(this.getKey(formComponent),formComponent.getValue());
}
protected String getSaveKey(String key){
if(Strings.isEmpty((CharSequence)key)){
throw new IllegalArgumentException("A Cookie name can not be null or empty");
}
key=key.replace((CharSequence)".",(CharSequence)"..");
key=key.replace((CharSequence)":",(CharSequence)".");
return key;
}
private void remove(final Cookie cookie){
if(cookie!=null){
cookie.setMaxAge(0);
cookie.setValue(null);
this.save(cookie);
if(CookieUtils.log.isDebugEnabled()){
CookieUtils.log.debug("Removed Cookie: "+cookie.getName());
}
}
}
private Cookie getCookie(final String name){
final String key=this.getSaveKey(name);
try{
final Cookie cookie=this.getWebRequest().getCookie(key);
if(CookieUtils.log.isDebugEnabled()){
if(cookie!=null){
CookieUtils.log.debug("Found Cookie with name="+key+" and request URI="+this.getWebRequest().getUrl().toString());
}
else{
CookieUtils.log.debug("Unable to find Cookie with name="+key+" and request URI="+this.getWebRequest().getUrl().toString());
}
}
return cookie;
}
catch(NullPointerException ex){
return null;
}
}
private Cookie save(final Cookie cookie){
if(cookie==null){
return null;
}
this.initializeCookie(cookie);
this.getWebResponse().addCookie(cookie);
if(CookieUtils.log.isDebugEnabled()){
CookieUtils.log.debug("Cookie saved: "+this.cookieToDebugString(cookie)+"; request URI="+this.getWebRequest().getUrl().toString());
}
return cookie;
}
protected void initializeCookie(final Cookie cookie){
final String comment=this.settings.getComment();
if(comment!=null){
cookie.setComment(comment);
}
final String domain=this.settings.getDomain();
if(domain!=null){
cookie.setDomain(domain);
}
final ServletWebRequest request=(ServletWebRequest)this.getWebRequest();
final String path=request.getContainerRequest().getContextPath()+"/"+request.getFilterPrefix();
cookie.setPath(path);
cookie.setVersion(this.settings.getVersion());
cookie.setSecure(this.settings.getSecure());
}
private WebRequest getWebRequest(){
return (WebRequest)RequestCycle.get().getRequest();
}
private WebResponse getWebResponse(){
return (WebResponse)RequestCycle.get().getResponse();
}
private String cookieToDebugString(final Cookie cookie){
return "[Cookie name = "+cookie.getName()+", value = "+cookie.getValue()+", domain = "+cookie.getDomain()+", path = "+cookie.getPath()+", maxAge = "+Time.millis((long)cookie.getMaxAge()).toDateString()+"("+cookie.getMaxAge()+")"+"]";
}
static{
log=LoggerFactory.getLogger(CookieUtils.class);
}
}
| epl-1.0 |
uci-sdcl/lighthouse | main/LighthouseSDK/src/edu/uci/lighthouse/sdk/Activator.java | 1739 | /*******************************************************************************
* Copyright (c) {2009,2011} {Software Design and Collaboration Laboratory (SDCL)
* , University of California, Irvine}.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* {Software Design and Collaboration Laboratory (SDCL)
* , University of California, Irvine}
* - initial API and implementation and/or initial documentation
*******************************************************************************/
package edu.uci.lighthouse.sdk;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "edu.uci.lighthouse.sdk";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}
| epl-1.0 |
ControlSystemStudio/cs-studio | thirdparty/plugins/org.csstudio.platform.libs.hibernate/project/annotations/src/test/java/org/hibernate/test/annotations/quote/QuoteTest.java | 933 | //$Id: QuoteTest.java 18653 2010-01-27 17:22:13Z epbernard $
package org.hibernate.test.annotations.quote;
import org.hibernate.test.annotations.TestCase;
import org.hibernate.Session;
import org.hibernate.Transaction;
/**
* @author Emmanuel Bernard
*/
public class QuoteTest extends TestCase {
public void testQuoteManytoMany() {
Session s = openSession();
Transaction tx = s.beginTransaction();
User u = new User();
s.persist( u );
Role r = new Role();
s.persist( r );
u.getRoles().add( r );
s.flush();
s.clear();
u = (User) s.get( User.class, u.getId() );
assertEquals( 1, u.getRoles().size() );
tx.rollback();
String role = User.class.getName() + ".roles";
assertEquals( "User_Role", getCfg().getCollectionMapping( role ).getCollectionTable().getName() );
s.close();
}
protected Class[] getAnnotatedClasses() {
return new Class[] {
User.class,
Role.class,
Phone.class
};
}
}
| epl-1.0 |
gomezabajo/Wodel | wodel.models/src/mutatorenvironment/miniOCL/validation/PathNameCSValidator.java | 648 | /**
*
* $Id$
*/
package mutatorenvironment.miniOCL.validation;
import mutatorenvironment.miniOCL.PathCS;
import org.eclipse.emf.common.util.EList;
/**
* A sample validator interface for {@link mutatorenvironment.miniOCL.PathNameCS}.
* This doesn't really do anything, and it's not a real EMF artifact.
* It was generated by the org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's code generator can be extended.
* This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false.
*/
public interface PathNameCSValidator {
boolean validate();
boolean validatePath(EList<PathCS> value);
}
| epl-1.0 |
neelance/jface4ruby | jface4ruby/src/org/eclipse/jface/text/ListLineTracker.java | 9593 | /*******************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jface.text;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.text.AbstractLineTracker.DelimiterInfo;
/**
* Abstract, read-only implementation of <code>ILineTracker</code>. It lets the definition of
* line delimiters to subclasses. Assuming that '\n' is the only line delimiter, this abstract
* implementation defines the following line scheme:
* <ul>
* <li> "" -> [0,0]
* <li> "a" -> [0,1]
* <li> "\n" -> [0,1], [1,0]
* <li> "a\n" -> [0,2], [2,0]
* <li> "a\nb" -> [0,2], [2,1]
* <li> "a\nbc\n" -> [0,2], [2,3], [5,0]
* </ul>
* This class must be subclassed.
*
* @since 3.2
*/
abstract class ListLineTracker implements ILineTracker {
/** The line information */
private final List fLines= new ArrayList();
/** The length of the tracked text */
private int fTextLength;
/**
* Creates a new line tracker.
*/
protected ListLineTracker() {
}
/**
* Binary search for the line at a given offset.
*
* @param offset the offset whose line should be found
* @return the line of the offset
*/
private int findLine(int offset) {
if (fLines.size() == 0)
return -1;
int left= 0;
int right= fLines.size() - 1;
int mid= 0;
Line line= null;
while (left < right) {
mid= (left + right) / 2;
line= (Line) fLines.get(mid);
if (offset < line.offset) {
if (left == mid)
right= left;
else
right= mid - 1;
} else if (offset > line.offset) {
if (right == mid)
left= right;
else
left= mid + 1;
} else if (offset == line.offset) {
left= right= mid;
}
}
line= (Line) fLines.get(left);
if (line.offset > offset)
--left;
return left;
}
/**
* Returns the number of lines covered by the specified text range.
*
* @param startLine the line where the text range starts
* @param offset the start offset of the text range
* @param length the length of the text range
* @return the number of lines covered by this text range
* @exception BadLocationException if range is undefined in this tracker
*/
private int getNumberOfLines(int startLine, int offset, int length) throws BadLocationException {
if (length == 0)
return 1;
int target= offset + length;
Line l= (Line) fLines.get(startLine);
if (l.delimiter == null)
return 1;
if (l.offset + l.length > target)
return 1;
if (l.offset + l.length == target)
return 2;
return getLineNumberOfOffset(target) - startLine + 1;
}
/*
* @see org.eclipse.jface.text.ILineTracker#getLineLength(int)
*/
public final int getLineLength(int line) throws BadLocationException {
int lines= fLines.size();
if (line < 0 || line > lines)
throw new BadLocationException();
if (lines == 0 || lines == line)
return 0;
Line l= (Line) fLines.get(line);
return l.length;
}
/*
* @see org.eclipse.jface.text.ILineTracker#getLineNumberOfOffset(int)
*/
public final int getLineNumberOfOffset(int position) throws BadLocationException {
if (position < 0 || position > fTextLength)
throw new BadLocationException();
if (position == fTextLength) {
int lastLine= fLines.size() - 1;
if (lastLine < 0)
return 0;
Line l= (Line) fLines.get(lastLine);
return (l.delimiter != null ? lastLine + 1 : lastLine);
}
return findLine(position);
}
/*
* @see org.eclipse.jface.text.ILineTracker#getLineInformationOfOffset(int)
*/
public final IRegion getLineInformationOfOffset(int position) throws BadLocationException {
if (position > fTextLength)
throw new BadLocationException();
if (position == fTextLength) {
int size= fLines.size();
if (size == 0)
return new Region(0, 0);
Line l= (Line) fLines.get(size - 1);
return (l.delimiter != null ? new Line(fTextLength, 0) : new Line(fTextLength - l.length, l.length));
}
return getLineInformation(findLine(position));
}
/*
* @see org.eclipse.jface.text.ILineTracker#getLineInformation(int)
*/
public final IRegion getLineInformation(int line) throws BadLocationException {
int lines= fLines.size();
if (line < 0 || line > lines)
throw new BadLocationException();
if (lines == 0)
return new Line(0, 0);
if (line == lines) {
Line l= (Line) fLines.get(line - 1);
return new Line(l.offset + l.length, 0);
}
Line l= (Line) fLines.get(line);
return (l.delimiter != null ? new Line(l.offset, l.length - l.delimiter.length()) : l);
}
/*
* @see org.eclipse.jface.text.ILineTracker#getLineOffset(int)
*/
public final int getLineOffset(int line) throws BadLocationException {
int lines= fLines.size();
if (line < 0 || line > lines)
throw new BadLocationException();
if (lines == 0)
return 0;
if (line == lines) {
Line l= (Line) fLines.get(line - 1);
if (l.delimiter != null)
return l.offset + l.length;
throw new BadLocationException();
}
Line l= (Line) fLines.get(line);
return l.offset;
}
/*
* @see org.eclipse.jface.text.ILineTracker#getNumberOfLines()
*/
public final int getNumberOfLines() {
int lines= fLines.size();
if (lines == 0)
return 1;
Line l= (Line) fLines.get(lines - 1);
return (l.delimiter != null ? lines + 1 : lines);
}
/*
* @see org.eclipse.jface.text.ILineTracker#getNumberOfLines(int, int)
*/
public final int getNumberOfLines(int position, int length) throws BadLocationException {
if (position < 0 || position + length > fTextLength)
throw new BadLocationException();
if (length == 0) // optimization
return 1;
return getNumberOfLines(getLineNumberOfOffset(position), position, length);
}
/*
* @see org.eclipse.jface.text.ILineTracker#computeNumberOfLines(java.lang.String)
*/
public final int computeNumberOfLines(String text) {
int count= 0;
int start= 0;
DelimiterInfo delimiterInfo= nextDelimiterInfo(text, start);
while (delimiterInfo != null && delimiterInfo.delimiterIndex > -1) {
++count;
start= delimiterInfo.delimiterIndex + delimiterInfo.delimiterLength;
delimiterInfo= nextDelimiterInfo(text, start);
}
return count;
}
/*
* @see org.eclipse.jface.text.ILineTracker#getLineDelimiter(int)
*/
public final String getLineDelimiter(int line) throws BadLocationException {
int lines= fLines.size();
if (line < 0 || line > lines)
throw new BadLocationException();
if (lines == 0)
return null;
if (line == lines)
return null;
Line l= (Line) fLines.get(line);
return l.delimiter;
}
/**
* Returns the information about the first delimiter found in the given text starting at the
* given offset.
*
* @param text the text to be searched
* @param offset the offset in the given text
* @return the information of the first found delimiter or <code>null</code>
*/
protected abstract DelimiterInfo nextDelimiterInfo(String text, int offset);
/**
* Creates the line structure for the given text. Newly created lines are inserted into the line
* structure starting at the given position. Returns the number of newly created lines.
*
* @param text the text for which to create a line structure
* @param insertPosition the position at which the newly created lines are inserted into the
* tracker's line structure
* @param offset the offset of all newly created lines
* @return the number of newly created lines
*/
private int createLines(String text, int insertPosition, int offset) {
int count= 0;
int start= 0;
DelimiterInfo delimiterInfo= nextDelimiterInfo(text, 0);
while (delimiterInfo != null && delimiterInfo.delimiterIndex > -1) {
int index= delimiterInfo.delimiterIndex + (delimiterInfo.delimiterLength - 1);
if (insertPosition + count >= fLines.size())
fLines.add(new Line(offset + start, offset + index, delimiterInfo.delimiter));
else
fLines.add(insertPosition + count, new Line(offset + start, offset + index, delimiterInfo.delimiter));
++count;
start= index + 1;
delimiterInfo= nextDelimiterInfo(text, start);
}
if (start < text.length()) {
if (insertPosition + count < fLines.size()) {
// there is a line below the current
Line l= (Line) fLines.get(insertPosition + count);
int delta= text.length() - start;
l.offset-= delta;
l.length+= delta;
} else {
fLines.add(new Line(offset + start, offset + text.length() - 1, null));
++count;
}
}
return count;
}
/*
* @see org.eclipse.jface.text.ILineTracker#replace(int, int, java.lang.String)
*/
public final void replace(int position, int length, String text) throws BadLocationException {
throw new UnsupportedOperationException();
}
/*
* @see org.eclipse.jface.text.ILineTracker#set(java.lang.String)
*/
public final void set(String text) {
fLines.clear();
if (text != null) {
fTextLength= text.length();
createLines(text, 0, 0);
}
}
/**
* Returns the internal data structure, a {@link List} of {@link Line}s. Used only by
* {@link TreeLineTracker#TreeLineTracker(ListLineTracker)}.
*
* @return the internal list of lines.
*/
final List getLines() {
return fLines;
}
}
| epl-1.0 |
eclipse/buildr4eclipse | buildr/spec/core/build_spec.rb | 13068 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with this
# work for additional information regarding copyright ownership. The ASF
# licenses this file to you 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.
require File.join(File.dirname(__FILE__), '../spec_helpers')
describe 'local task', :shared=>true do
it "should execute task for project in current directory" do
define 'foobar'
lambda { @task.invoke }.should run_task("foobar:#{@task.name}")
end
it "should not execute task for projects in other directory" do
define 'foobar', :base_dir=>'elsewhere'
lambda { task('build').invoke }.should_not run_task('foobar:build')
end
end
describe 'build task' do
it_should_behave_like 'local task'
before(:each) { @task = task('build') }
end
describe 'clean task' do
it_should_behave_like 'local task'
before(:each) { @task = task('clean') }
end
describe 'package task' do
it_should_behave_like 'local task'
before(:each) { @task = task('package') }
it 'should execute build task as prerequisite' do
lambda { @task.invoke }.should run_task('build')
end
end
describe 'install task' do
it_should_behave_like 'local task'
before(:each) { @task = task('install') }
it 'should execute package task as prerequisite' do
lambda { @task.invoke }.should run_task('package')
end
end
describe 'uninstall task' do
it_should_behave_like 'local task'
before(:each) { @task = task('uninstall') }
end
describe 'upload task' do
it_should_behave_like 'local task'
before(:each) { @task = task('upload') }
it 'should execute package task as prerequisite' do
lambda { @task.invoke }.should run_task('package')
end
end
describe Project, '#build' do
it 'should return the project\'s build task' do
define('foo').build.should eql(task('foo:build'))
end
it 'should enhance the project\'s build task' do
task 'prereq'
task 'action'
define 'foo' do
build 'prereq' do
task('action').invoke
end
end
lambda { project('foo').build.invoke }.should run_tasks('prereq', 'action')
end
it 'should execute build task for sub-project' do
define 'foo' do
define 'bar'
end
lambda { task('foo:build').invoke }.should run_task('foo:bar:build')
end
it 'should not execute build task of other projects' do
define 'foo'
define 'bar'
lambda { task('foo:build').invoke }.should_not run_task('bar:build')
end
end
describe Project, '#clean' do
it 'should return the project\'s clean task' do
define('foo').clean.should eql(task('foo:clean'))
end
it 'should enhance the project\'s clean task' do
task 'prereq'
task 'action'
define 'foo' do
clean 'prereq' do
task('action').invoke
end
end
lambda { project('foo').clean.invoke }.should run_tasks('prereq', 'action')
end
it 'should remove target directory' do
define 'foo' do
self.layout[:target] = 'targeted'
end
mkpath 'targeted'
lambda { project('foo').clean.invoke }.should change { File.exist?('targeted') }.from(true).to(false)
end
it 'should remove reports directory' do
define 'foo' do
self.layout[:reports] = 'reported'
end
mkpath 'reported'
lambda { project('foo').clean.invoke }.should change { File.exist?('reported') }.from(true).to(false)
end
it 'should execute clean task for sub-project' do
define 'foo' do
define 'bar'
end
lambda { task('foo:clean').invoke }.should run_task('foo:bar:clean')
end
it 'should not execute clean task of other projects' do
define 'foo'
define 'bar'
lambda { task('foo:clean').invoke }.should_not run_task('bar:clean')
end
end
describe Project, '#target' do
before :each do
@project = define('foo', :layout=>Layout.new)
end
it 'should default to target' do
@project.target.should eql('target')
end
it 'should set layout :target' do
@project.target = 'bar'
@project.layout.expand(:target).should point_to_path('bar')
end
it 'should come from layout :target' do
@project.layout[:target] = 'baz'
@project.target.should eql('baz')
end
it 'should be removed in version 1.5 since it was deprecated in version 1.3' do
Buildr::VERSION.should < '1.5'
end
end
describe Project, '#reports' do
before :each do
@project = define('foo', :layout=>Layout.new)
end
it 'should default to reports' do
@project.reports.should eql('reports')
end
it 'should set layout :reports' do
@project.reports = 'bar'
@project.layout.expand(:reports).should point_to_path('bar')
end
it 'should come from layout :reports' do
@project.layout[:reports] = 'baz'
@project.reports.should eql('baz')
end
it 'should be removed in version 1.5 since it was deprecated in version 1.3' do
Buildr::VERSION.should < '1.5'
end
end
describe Buildr::Release do
describe '#make' do
before do
write 'buildfile', "VERSION_NUMBER = '1.0.0-SNAPSHOT'"
# Prevent a real call to a spawned buildr process.
Release.stub!(:buildr)
Svn.stub!(:repo_url).and_return('http://my.repo.org/foo/trunk')
Svn.stub!(:uncommitted_files).and_return('')
Svn.stub!(:remove)
Svn.stub!(:copy)
Svn.stub!(:commit)
end
it 'should tag a release with the release version' do
Svn.should_receive(:copy).with(Dir.pwd, 'http://my.repo.org/foo/tags/1.0.0', 'Release 1.0.0').and_return {
file('buildfile').should contain('VERSION_NUMBER = "1.0.0"')
}
Release.make
end
it 'should update the buildfile with the next version number' do
Release.make
file('buildfile').should contain('VERSION_NUMBER = "1.0.1-SNAPSHOT"')
end
it 'should commit the updated buildfile' do
Svn.should_receive(:commit).with(File.expand_path('buildfile'), 'Changed version number to 1.0.1-SNAPSHOT').and_return {
file('buildfile').should contain('VERSION_NUMBER = "1.0.1-SNAPSHOT"')
}
Release.make
end
end
describe '#check' do
before do
Svn.stub!(:uncommitted_files).and_return('')
end
it 'should accept to release from the trunk' do
Svn.stub!(:repo_url).and_return('http://my.repo.org/foo/trunk')
lambda { Release.check }.should_not raise_error
end
it 'should accept to release from a branch' do
Svn.stub!(:repo_url).and_return('http://my.repo.org/foo/branches/1.0')
lambda { Release.check }.should_not raise_error
end
it 'should reject releasing from a tag' do
Svn.stub!(:repo_url).and_return('http://my.repo.org/foo/tags/1.0.0')
lambda { Release.check }.should raise_error(RuntimeError, "SVN URL must contain 'trunk' or 'branches/...'")
end
it 'should reject a non standard repository layout' do
Svn.stub!(:repo_url).and_return('http://my.repo.org/foo/bar')
lambda { Release.check }.should raise_error(RuntimeError, "SVN URL must contain 'trunk' or 'branches/...'")
end
it 'should reject an uncommitted file' do
Svn.stub!(:repo_url).and_return('http://my.repo.org/foo/trunk')
Svn.stub!(:uncommitted_files).and_return('M foo.rb')
lambda { Release.check }.should raise_error(RuntimeError,
"Uncommitted SVN files violate the First Principle Of Release!\n" +
"M foo.rb")
end
end
describe '#extract_version' do
it 'should extract VERSION_NUMBER with single quotes' do
write 'buildfile', "VERSION_NUMBER = '1.0.0-SNAPSHOT'"
Release.extract_version.should == '1.0.0-SNAPSHOT'
end
it 'should extract VERSION_NUMBER with double quotes' do
write 'buildfile', %{VERSION_NUMBER = "1.0.1-SNAPSHOT"}
Release.extract_version.should == '1.0.1-SNAPSHOT'
end
it 'should extract VERSION_NUMBER without any spaces' do
write 'buildfile', "VERSION_NUMBER='1.0.2-SNAPSHOT'"
Release.extract_version.should == '1.0.2-SNAPSHOT'
end
it 'should extract THIS_VERSION as an alternative to VERSION_NUMBER' do
write 'buildfile', "THIS_VERSION = '1.0.3-SNAPSHOT'"
Release.extract_version.should == '1.0.3-SNAPSHOT'
end
it 'should complain if no current version number' do
write 'buildfile', 'define foo'
lambda { Release.extract_version }.should raise_error('Looking for THIS_VERSION = "..." in your Buildfile, none found')
end
end
# Reference: http://svnbook.red-bean.com/en/1.4/svn.reposadmin.planning.html#svn.reposadmin.projects.chooselayout
describe '#tag url' do
it 'should accept to tag foo/trunk' do
Release.tag_url('http://my.repo.org/foo/trunk', '1.0.0').should == 'http://my.repo.org/foo/tags/1.0.0'
end
it 'should accept to tag foo/branches/1.0' do
Release.tag_url('http://my.repo.org/foo/branches/1.0', '1.0.1').should == 'http://my.repo.org/foo/tags/1.0.1'
end
it 'should accept to tag trunk/foo' do
Release.tag_url('http://my.repo.org/trunk/foo', '1.0.0').should == 'http://my.repo.org/tags/foo/1.0.0'
end
it 'should accept to tag branches/foo/1.0' do
Release.tag_url('http://my.repo.org/branches/foo/1.0', '1.0.0').should == 'http://my.repo.org/tags/foo/1.0.0'
end
it 'should use tag specified by tag_name' do
Release.tag_name = 'first'
Release.tag_url('http://my.repo.org/foo/trunk', '1.0.0').should == 'http://my.repo.org/foo/tags/first'
end
it 'should use tag returned by tag_name if tag_name is a proc' do
Release.tag_name = lambda { |version| "buildr-#{version}" }
Release.tag_url('http://my.repo.org/foo/trunk', '1.0.0').should == 'http://my.repo.org/foo/tags/buildr-1.0.0'
end
after { Release.tag_name = nil }
end
describe '#with_release_candidate_version' do
before do
Buildr.application.stub!(:buildfile).and_return(file('buildfile'))
write 'buildfile', "THIS_VERSION = '1.1.0-SNAPSHOT'"
end
it 'should yield the name of the release candidate buildfile' do
Release.send :with_release_candidate_version do |new_filename|
File.read(new_filename).should == %{THIS_VERSION = "1.1.0"}
end
end
it 'should yield a name different from the original buildfile' do
Release.send :with_release_candidate_version do |new_filename|
new_filename.should_not point_to_path('buildfile')
end
end
end
describe '#tag_release' do
before do
write 'buildfile', "THIS_VERSION = '1.0.1'"
Svn.stub!(:repo_url).and_return('http://my.repo.org/foo/trunk')
Svn.stub!(:copy)
Svn.stub!(:remove)
end
it 'should tag the working copy' do
Svn.should_receive(:copy).with(Dir.pwd, 'http://my.repo.org/foo/tags/1.0.1', 'Release 1.0.1')
Release.send :tag_release
end
it 'should remove the tag if it already exists' do
Svn.should_receive(:remove).with('http://my.repo.org/foo/tags/1.0.1', 'Removing old copy')
Release.send :tag_release
end
it 'should accept that the tag does not exist' do
Svn.stub!(:remove).and_raise(RuntimeError)
Release.send :tag_release
end
it 'should inform the user' do
lambda { Release.send :tag_release }.should show_info('Tagging release 1.0.1')
end
end
describe '#commit_new_snapshot' do
before do
write 'buildfile', 'THIS_VERSION = "1.0.0"'
Svn.stub!(:commit)
end
it 'should update the buildfile with a new version number' do
Release.send :commit_new_snapshot
file('buildfile').should contain('THIS_VERSION = "1.0.1-SNAPSHOT"')
end
it 'should commit the new buildfile on the trunk' do
Svn.should_receive(:commit).with(File.expand_path('buildfile'), 'Changed version number to 1.0.1-SNAPSHOT')
Release.send :commit_new_snapshot
end
it 'should inform the user of the new version' do
lambda { Release.send :commit_new_snapshot }.should show_info('Current version is now 1.0.1-SNAPSHOT')
end
end
end
describe Buildr::Svn, '#repo_url' do
it 'should extract the SVN URL from svn info' do
Svn.stub!(:svn, 'info').and_return(<<EOF)
Path: .
URL: http://my.repo.org/foo/trunk
Repository Root: http://my.repo.org
Repository UUID: 12345678-9abc-def0-1234-56789abcdef0
Revision: 112
Node Kind: directory
Schedule: normal
Last Changed Author: Lacton
Last Changed Rev: 110
Last Changed Date: 2008-08-19 12:00:00 +0200 (Tue, 19 Aug 2008)
EOF
Svn.repo_url.should == 'http://my.repo.org/foo/trunk'
end
end | epl-1.0 |
Alisontalha/DP-57926 | Factory/src/Red.java | 118 |
public class Red implements IColor {
public void fill()
{
System.out.println("My color is Red !");
}
}
| epl-1.0 |
harbourfy/newjiaxiaotong | app/src/main/java/com/app/jiaxiaotong/data/ServiceConst.java | 3245 | package com.app.jiaxiaotong.data;
import java.util.HashMap;
import java.util.Map;
public class ServiceConst {
public static final String SERVICE_URL = "http://121.40.78.2:7890";
public static final String SERVICE_LOGIN = "001";//登录
public static final String SERVICE_GET_USERINFO = "002";//获取用户信息
public static final String SERVICE_GET_AUTHCODE = "003";//获取修改手机号码验证码
public static final String SERVICE_VERIFY_AUTHCODE = "004";//验证验证码
public static final String SERVICE_GET_CHILD_LIST_INFO = "005";//获取孩子列表
public static final String SERVICE_CHANGE_PASSWORD = "006";//修改密码
public static final String SERVICE_UPDATA_AVATAR = "007";//修改用户头像
public static final String SERVICE_CHANGE_IDENTITY = "008";//修改身份
public static final String SERVICE_FORGET_PASSWORD = "009";//忘记密码
public static final String SERVICE_CHANGE_TEL = "010";//修改手机号
public static final String SERVICE_GET_NICK_AND_AVATAR = "011";//获取用户昵称和头像
public static final String SERVICE_GET_FAMILY_CONTACT_LIST = "100";//获取家长的通讯录列表
public static final String SERVICE_GET_TEACHER_CLASS_LIST = "101";//获取教师班级列表
public static final String SERVICE_GET_TEACHER_CONTACT_LIST = "102";//获取教师班级联想列表
public static final String SERVICE_GET_PUSH_MSG = "997";//获取推送的新消息
public static final String SERVICE_REPORT_MESSAGE = "998";//反馈意见
public static final String SERVICE_GET_SERVICE_TEL = "999";//获取服务热线
public static final Map<String,String> codeModelMap = new HashMap<String,String>();
static{
//备注:ListModel<T extends BaseModel>泛型T下面有每个位置需要的描述
//用户接口
codeModelMap.put(SERVICE_LOGIN,"com.app.jiaxiaotong.model.LoginModel");
codeModelMap.put(SERVICE_GET_USERINFO,"com.app.jiaxiaotong.model.UserModel");
codeModelMap.put(SERVICE_GET_AUTHCODE,"com.app.jiaxiaotong.model.BaseModel");
codeModelMap.put(SERVICE_VERIFY_AUTHCODE,"com.app.jiaxiaotong.model.ChangeTelModel");
codeModelMap.put(SERVICE_GET_CHILD_LIST_INFO,"com.app.jiaxiaotong.model.ChildModel");
codeModelMap.put(SERVICE_CHANGE_PASSWORD,"com.app.jiaxiaotong.model.BaseModel");
codeModelMap.put(SERVICE_UPDATA_AVATAR,"com.app.jiaxiaotong.model.StringModel");
codeModelMap.put(SERVICE_CHANGE_IDENTITY,"com.app.jiaxiaotong.model.BaseModel");
codeModelMap.put(SERVICE_FORGET_PASSWORD,"com.app.jiaxiaotong.model.BaseModel");
codeModelMap.put(SERVICE_GET_FAMILY_CONTACT_LIST,"com.app.jiaxiaotong.model.ContactModel");
codeModelMap.put(SERVICE_GET_TEACHER_CLASS_LIST,"com.app.jiaxiaotong.model.ContactModel");
codeModelMap.put(SERVICE_GET_TEACHER_CONTACT_LIST,"com.app.jiaxiaotong.model.ContactModel");
codeModelMap.put(SERVICE_CHANGE_TEL,"com.app.jiaxiaotong.model.StringModel");
codeModelMap.put(SERVICE_GET_NICK_AND_AVATAR,"com.app.jiaxiaotong.model.UserModel");
codeModelMap.put(SERVICE_GET_PUSH_MSG,"com.app.jiaxiaotong.model.PushMsgModel");
codeModelMap.put(SERVICE_REPORT_MESSAGE,"com.app.jiaxiaotong.model.BaseModel");
codeModelMap.put(SERVICE_GET_SERVICE_TEL,"com.app.jiaxiaotong.model.StringModel");
}
}
| epl-1.0 |
Tasktop/code2cloud.server | com.tasktop.c2c.server/com.tasktop.c2c.server.profile.web.ui/src/main/java/com/tasktop/c2c/server/profile/web/ui/client/place/ResetPasswordPlace.java | 3816 | /*******************************************************************************
* Copyright (c) 2010, 2012 Tasktop Technologies
* Copyright (c) 2010, 2011 SpringSource, a division of VMware
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Tasktop Technologies - initial API and implementation
******************************************************************************/
package com.tasktop.c2c.server.profile.web.ui.client.place;
import java.util.LinkedHashMap;
import net.customware.gwt.dispatch.shared.Action;
import net.customware.gwt.dispatch.shared.DispatchException;
import com.tasktop.c2c.server.common.profile.web.client.navigation.AbstractPlaceTokenizer;
import com.tasktop.c2c.server.common.profile.web.client.navigation.PageMapping;
import com.tasktop.c2c.server.common.profile.web.client.place.AnonymousPlace;
import com.tasktop.c2c.server.common.profile.web.client.place.HeadingPlace;
import com.tasktop.c2c.server.common.profile.web.client.place.SignInPlace;
import com.tasktop.c2c.server.common.profile.web.shared.actions.GetPasswordResetTokenAction;
import com.tasktop.c2c.server.common.profile.web.shared.actions.GetPasswordResetTokenResult;
import com.tasktop.c2c.server.common.web.client.navigation.Args;
import com.tasktop.c2c.server.common.web.client.util.ExceptionsUtil;
import com.tasktop.c2c.server.profile.web.ui.client.gin.AppGinjector;
import com.tasktop.c2c.server.profile.web.ui.client.resources.ProfileMessages;
public class ResetPasswordPlace extends AnonymousPlace implements HeadingPlace {
public static PageMapping ResetPassword = new PageMapping(new ResetPasswordPlace.Tokenizer(), "resetPassword/{"
+ SignUpPlace.TOKEN + "}");
private static class Tokenizer extends AbstractPlaceTokenizer<ResetPasswordPlace> {
@Override
public ResetPasswordPlace getPlace(String token) {
// Tokenize our URL now.
Args pathArgs = getPathArgsForUrl(token);
return createPlace(pathArgs.getString(SignUpPlace.TOKEN));
}
}
public static ResetPasswordPlace createPlace(String resetToken) {
return new ResetPasswordPlace(resetToken);
}
private String resetToken;
private String username;
private ProfileMessages profileMessages = AppGinjector.get.instance().getProfileMessages();
private ResetPasswordPlace(String resetToken) {
this.resetToken = resetToken;
}
public String getResetToken() {
return resetToken;
}
public String getUsername() {
return username;
}
@Override
public String getHeading() {
return profileMessages.passwordReset();
}
@Override
public String getPrefix() {
LinkedHashMap<String, String> tokenMap = new LinkedHashMap<String, String>();
tokenMap.put(SignUpPlace.TOKEN, resetToken);
return ResetPassword.getUrlForNamedArgs(tokenMap);
}
@Override
protected void addActions() {
super.addActions();
addAction(new GetPasswordResetTokenAction(resetToken));
}
protected boolean handleExceptionInResults(Action<?> action, DispatchException dispatchException) {
if (ExceptionsUtil.isEntityNotFound(dispatchException)) {
SignInPlace.createPlace().go();
return false;
}
return super.handleExceptionInResults(action, dispatchException);
}
@Override
protected void handleBatchResults() {
super.handleBatchResults();
GetPasswordResetTokenResult result = getResult(GetPasswordResetTokenResult.class);
if (result.get() != null && result.get().getProfile() != null
&& result.get().getProfile().getUsername() != null) {
username = result.get().getProfile().getUsername();
onPlaceDataFetched();
} else {
SignInPlace.createPlace().go();
}
}
}
| epl-1.0 |
chongzi1990/continuouskNNjoin | continuousKNN/src/test/InnerNode.java | 242 | package test;
import java.util.ArrayList;
public class InnerNode extends Node{
public ArrayList<Node> child;
public InnerNode(int dimen,int num,double ra)
{
super(dimen,num,ra);
isleaf=false;
child=new ArrayList<Node>();
}
}
| epl-1.0 |
wo-amlangwang/ice | org.eclipse.ice.reactor/src/org/eclipse/ice/reactor/pwr/ControlBank.java | 7318 | /*******************************************************************************
* Copyright (c) 2012, 2014 UT-Battelle, LLC.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Initial API and implementation and/or initial documentation - Jay Jay Billings,
* Jordan H. Deyton, Dasha Gorin, Alexander J. McCaskey, Taylor Patterson,
* Claire Saunders, Matthew Wang, Anna Wojtowicz
*******************************************************************************/
package org.eclipse.ice.reactor.pwr;
import ncsa.hdf.object.h5.H5File;
import ncsa.hdf.object.h5.H5Group;
import org.eclipse.ice.io.hdf.HdfReaderFactory;
import org.eclipse.ice.io.hdf.HdfWriterFactory;
import org.eclipse.ice.reactor.HDF5LWRTagType;
import org.eclipse.ice.reactor.ILWRComponentVisitor;
import org.eclipse.ice.reactor.LWRComponent;
/**
* <p>
* The ControlBank class contains properties associated with axially movable
* RodClusterAssembly objects known as Rod Cluster Control Assemblies. A Bank is
* a group of RCCA's that are positioned simultaneously by the plant operations.
* A Bank may have 8 individual RCCAs, for instance, located symmetrically
* around the core. For a core with 50+ RCCAs, usually only 8 or so banks are
* controlled independently.
* </p>
*
* @author Scott Forest Hull II
*/
public class ControlBank extends LWRComponent {
/**
* <p>
* The distance between an axial step.
* </p>
*
*/
private double stepSize;
/**
* <p>
* The maximum number of axial steps.
* </p>
*
*/
private int maxNumberOfSteps;
/**
* <p>
* The nullary Constructor.
* </p>
*
*/
public ControlBank() {
this.setMaxNumberOfSteps(1);
this.setStepSize(0.0);
this.setName("ControlBank 1");
this.setDescription("Default Control Bank");
this.setId(1);
this.HDF5LWRTag = HDF5LWRTagType.CONTROL_BANK;
}
/**
* <p>
* A parameterized Constructor.
* </p>
*
* @param name
* The name of the component.
* @param stepSize
* <p>
* The distance between an axial step.
* </p>
* @param maxNumberOfSteps
* <p>
* The maximum number of axial steps.
* </p>
*/
public ControlBank(String name, double stepSize, int maxNumberOfSteps) {
this();
this.setStepSize(stepSize);
this.setMaxNumberOfSteps(maxNumberOfSteps);
this.setName(name);
}
/**
* <p>
* Sets the axial step size.
* </p>
*
* @param stepSize
* <p>
* The axial step size.
* </p>
*/
public void setStepSize(double stepSize) {
if (stepSize > 0.0) {
this.stepSize = stepSize;
} else {
this.stepSize = 0.0;
}
}
/**
* <p>
* Sets the maximum number of axial steps.
* </p>
*
* @param maxNumberOfSteps
* <p>
* The maximum number of axial steps.
* </p>
*/
public void setMaxNumberOfSteps(int maxNumberOfSteps) {
if (maxNumberOfSteps > 0) {
this.maxNumberOfSteps = maxNumberOfSteps;
} else {
this.maxNumberOfSteps = 1;
}
}
/**
* <p>
* Returns the maximum number of axial steps.
* </p>
*
* @return <p>
* The maximum number of axial steps.
* </p>
*/
public int getMaxNumberOfSteps() {
return this.maxNumberOfSteps;
}
/**
* <p>
* Returns the axial step size.
* </p>
*
* @return <p>
* The axial step size.
* </p>
*/
public double getStepSize() {
return this.stepSize;
}
/**
* <p>
* Calculates and returns the stroke length, which is the axial step size
* multiplied by the maximum number of axial steps.
* </p>
*
* @return <p>
* The axial step size multiplied by the maximum number of axial
* steps.
* </p>
*/
public double getStrokeLength() {
return (this.maxNumberOfSteps) * this.stepSize;
}
/*
* (non-Javadoc)
* @see org.eclipse.ice.reactor.LWRComponent#writeAttributes(ncsa.hdf.object.h5.H5File, ncsa.hdf.object.h5.H5Group)
*/
@Override
public boolean writeAttributes(H5File h5File, H5Group h5Group) {
boolean flag = true;
flag &= super.writeAttributes(h5File, h5Group);
flag &= HdfWriterFactory.writeDoubleAttribute(h5File, h5Group,
"stepSize", stepSize);
flag &= HdfWriterFactory.writeIntegerAttribute(h5File, h5Group,
"maxNumberOfSteps", maxNumberOfSteps);
return flag;
}
/*
* (non-Javadoc)
* @see org.eclipse.ice.reactor.LWRComponent#equals(java.lang.Object)
*/
@Override
public boolean equals(Object otherObject) {
// Local Declarations
boolean retVal = false;
ControlBank bank;
// If they are the same on the heap, return true
if (otherObject == this) {
return true;
}
// Make sure the otherObject is not null and an instance of this object
if (otherObject != null && otherObject instanceof ControlBank) {
// Cast it
bank = (ControlBank) otherObject;
// Compare values
retVal = (super.equals(otherObject)
&& this.maxNumberOfSteps == bank.maxNumberOfSteps && this.stepSize == bank.stepSize);
}
// Return retVal
return retVal;
}
/*
* (non-Javadoc)
* @see org.eclipse.ice.reactor.LWRComponent#hashCode()
*/
@Override
public int hashCode() {
// Local Declarations
int hash = super.hashCode();
hash += 31 * this.maxNumberOfSteps;
hash += 31 * this.stepSize;
return hash;
}
/**
* <p>
* Deep copies the contents of the object.
* </p>
*
* @param otherObject
* <p>
* The object to be copied.
* </p>
*/
public void copy(ControlBank otherObject) {
// If otherObject is null, return
if (otherObject == null) {
return;
}
// Copy contents - super
super.copy(otherObject);
// Copy local contents
this.maxNumberOfSteps = otherObject.maxNumberOfSteps;
this.stepSize = otherObject.stepSize;
}
/*
* (non-Javadoc)
* @see org.eclipse.ice.reactor.LWRComponent#clone()
*/
@Override
public Object clone() {
// Local Declarations
ControlBank bank = new ControlBank();
// Copy contents
bank.copy(this);
// Return newly instantiated object
return bank;
}
/*
* (non-Javadoc)
* @see org.eclipse.ice.reactor.LWRComponent#readAttributes(ncsa.hdf.object.h5.H5Group)
*/
@Override
public boolean readAttributes(H5Group h5Group) {
// Local Declarations
boolean flag = true;
// Get values
Double stepSize = HdfReaderFactory.readDoubleAttribute(h5Group,
"stepSize");
Integer maxNumberOfSteps = HdfReaderFactory.readIntegerAttribute(
h5Group, "maxNumberOfSteps");
// Call super
flag &= super.readAttributes(h5Group);
// check values
if (stepSize == null || maxNumberOfSteps == null || !flag
|| h5Group == null) {
return false;
}
// If everything is valid, then set data
this.stepSize = stepSize.doubleValue();
this.maxNumberOfSteps = maxNumberOfSteps.intValue();
return true;
}
/*
* (non-Javadoc)
* @see org.eclipse.ice.reactor.LWRComponent#accept(org.eclipse.ice.reactor.ILWRComponentVisitor)
*/
@Override
public void accept(ILWRComponentVisitor visitor) {
visitor.visit(this);
}
} | epl-1.0 |
mballance-sf/psstools | psstools/plugins/net.sf.psstools.lang/src/net/sf/psstools/lang/psi/IConstraintFactory.java | 895 | package net.sf.psstools.lang.psi;
import java.util.List;
public interface IConstraintFactory {
IConstraintSet mk_constraint_set(
List<IConstraintStmt> constraints);
IConstraintSet mk_constraint_set(IConstraintStmt ... constraints);
IConstraintBlock mk_constraint_block(
String name,
IConstraintSet constraints,
boolean is_anonymous,
boolean is_dynamic);
IConstraintBlock mk_constraint_block(
String name,
IConstraintSet constraints);
IConstraintExprStmt mk_expr_constraint(IExpr expr);
IConstraintForeachStmt mk_foreach_constraint(
IExpr expr,
IConstraintSet constraints);
IConstraintForeachStmt mk_foreach_constraint(
IExpr expr,
List<IConstraintStmt> constraints);
IConstraintForeachStmt mk_foreach_constraint(
IExpr expr,
IConstraintStmt ... constraints);
}
| epl-1.0 |
debrief/debrief | org.mwc.cmap.legacy/src/MWC/GUI/JFreeChart/formattingOperation.java | 829 | /*******************************************************************************
* Debrief - the Open Source Maritime Analysis Application
* http://debrief.info
*
* (C) 2000-2020, Deep Blue C Technology Ltd
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Eclipse Public License v1.0
* (http://www.eclipse.org/legal/epl-v10.html)
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
*******************************************************************************/
package MWC.GUI.JFreeChart;
import org.jfree.chart.plot.XYPlot;
public interface formattingOperation {
public void format(XYPlot thePlot);
} | epl-1.0 |