answer
stringlengths
15
1.25M
package visualk.gallery.db; import java.awt.Color; import java.sql.*; import java.util.logging.Level; import java.util.logging.Logger; import visualk.db.MysqlLayer; import visualk.gallery.objects.Artist; import visualk.gallery.objects.Work; public class DbGallery extends MysqlLayer{ public DbGallery(String user, String pass, String db) { super(user, pass, db); } public void addObra(Work obra, Artist author) { if (this != null) { try { } catch (Exception e) { } finally { disconnect(); } } } public ResultSet listHrzns() { ResultSet myResult = null; try { myResult = queryDB("SELECT * FROM hrzns WHERE namehrz<>'wellcome' order by dt desc;"); } catch (SQLException ex) { Logger.getLogger(DbGallery.class.getName()).log(Level.SEVERE, null, ex); } catch (<API key> ex) { Logger.getLogger(DbGallery.class.getName()).log(Level.SEVERE, null, ex); } return (myResult); } /* public Horizon getHrznBD(String name) { Horizon temp = new Horizon(name); ResultSet myResult; myResult = mySQL.queryDB("SELECT * FROM hrzns where nameHrz='" + name + "'"); temp.makeRandom(100, 300); if (myResult != null) { try { while (myResult.next()) { String nameHrz = ""; String topHrz = ""; String topHrzColor = ""; String bottomHrzColor = ""; String canvasWidth = ""; String canvasHeigth = ""; String authorHrz = ""; String xPal = ""; String yPal = ""; String hPalx = ""; String hPaly = ""; String alcada = ""; String horizontal = ""; String aureaProp = ""; String colPal = ""; String superX = ""; String superY = ""; String textura = ""; String version = ""; try { nameHrz = myResult.getString("nameHrz"); topHrz = myResult.getString("topHrz"); topHrzColor = myResult.getString("topHrzColor"); bottomHrzColor = myResult.getString("bottomHrzColor"); canvasWidth = myResult.getString("canvasWidth"); canvasHeigth = myResult.getString("canvasHeigth"); authorHrz = myResult.getString("authorHrz"); xPal = myResult.getString("xPal"); yPal = myResult.getString("yPal"); hPalx = myResult.getString("hPalx"); hPaly = myResult.getString("hPaly"); alcada = myResult.getString("alcada"); colPal = myResult.getString("colPal"); horizontal = myResult.getString("horizontal"); aureaProp = myResult.getString("aureaProp"); superX = myResult.getString("superX"); superY = myResult.getString("superY"); textura = myResult.getString("textura"); version = myResult.getString("version"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } temp.setNameHrz(nameHrz); temp.setTopHrz(Integer.parseInt(topHrz)); temp.setTopHrzColor(new Color(Integer.parseInt(topHrzColor))); temp.setBottomHrzColor(new Color(Integer.parseInt(bottomHrzColor))); temp.setCanvasWidth(Integer.parseInt(canvasWidth)); temp.setCanvasHeigth(Integer.parseInt(canvasHeigth)); temp.setAuthorHrz(authorHrz); temp.setxPal(Integer.parseInt(xPal)); temp.setyPal(Integer.parseInt(yPal)); temp.sethPalx(Integer.parseInt(hPalx)); temp.sethPaly(Integer.parseInt(hPaly)); temp.setAlcada(Integer.parseInt(alcada)); temp.setColPal(new Color(Integer.parseInt(colPal))); temp.setHorizontal(horizontal.equals("true")); temp.setAureaProp(aureaProp.equals("true")); temp.setSuperX(Integer.parseInt(superX)); temp.setSuperY(Integer.parseInt(superY)); temp.setTextura(textura.equals("true")); temp.setVersion(version); } myResult.close(); } catch (<API key> e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return (temp); } */ }
package soc.message; /** * This reply from server means this client currently isn't allowed to connect. * * @author Robert S Thomas */ public class SOCRejectConnection extends SOCMessage { private static final long serialVersionUID = 100L; // last structural change v1.0.0 or earlier /** * Text message */ private String text; /** * Create a RejectConnection message. * * @param message the text message */ public SOCRejectConnection(String message) { messageType = REJECTCONNECTION; text = message; } /** * @return the text message */ public String getText() { return text; } /** * REJECTCONNECTION sep text * * @return the command String */ public String toCmd() { return toCmd(text); } /** * REJECTCONNECTION sep text * * @param tm the text message * @return the command string */ public static String toCmd(String tm) { return REJECTCONNECTION + sep + tm; } /** * Parse the command String into a RejectConnection message * * @param s the String to parse; will be directly used as {@link #getText()} without any parsing * @return a RejectConnection message */ public static SOCRejectConnection parseDataStr(String s) { return new SOCRejectConnection(s); } /** * @return a human readable form of the message */ public String toString() { return "SOCRejectConnection:" + text; } }
(function (angular) { 'use strict'; var config = { githubApiUrl: 'https://api.github.com/', }; angular.module('myGithubApp').constant('config', config); })(angular);
<html> <style> body { font-family: Helvetica, Arial; color: #2B332E; } .errorlist li { margin: 0; color: red; } a { text-decoration: none; color: #2B332E; } p.button { font-size: 0.875em; font-weight: bold; float: left; border: 1px solid #C0CCC4; background-color: #ebf2ee; padding: 0.25em 8px; -<API key>: 5px; -webkit-box-shadow: 0 1px #FFF; } </style> <body> <h1>Opt-In/Opt-Out</h1> <form method="POST" action=""> <p> <label>Email Address</label> {{ form.email }} {% if form.email.errors %}{{ form.email.errors }}{% endif %} </p> <p> <label>Subscribe</label> {{ form.subscribed }} </p> <p class="button"><a href="javascript:document.forms[0].submit()">Submit</a></p> </form> </body> </html>
#include "fonts.h" Fonts::Fonts() { <API key> = Font(Typeface::<API key>( BinaryData::RobotoRegular_ttf, BinaryData::<API key>)); proportional_light_ = Font(Typeface::<API key>( BinaryData::RobotoLight_ttf, BinaryData::RobotoLight_ttfSize)); monospace_ = Font(Typeface::<API key>( BinaryData::DroidSansMono_ttf, BinaryData::<API key>)); }
package org.codefx.jwos.file; import org.codefx.jwos.analysis.AnalysisPersistence; import org.codefx.jwos.artifact.AnalyzedArtifact; import org.codefx.jwos.artifact.CompletedArtifact; import org.codefx.jwos.artifact.DownloadedArtifact; import org.codefx.jwos.artifact.FailedArtifact; import org.codefx.jwos.artifact.FailedProject; import org.codefx.jwos.artifact.IdentifiesArtifact; import org.codefx.jwos.artifact.IdentifiesProject; import org.codefx.jwos.artifact.ProjectCoordinates; import org.codefx.jwos.artifact.ResolvedArtifact; import org.codefx.jwos.artifact.ResolvedProject; import org.codefx.jwos.file.persistence.PersistentAnalysis; import org.codefx.jwos.file.persistence.<API key>; import org.codefx.jwos.file.persistence.<API key>; import org.codefx.jwos.file.persistence.<API key>; import org.codefx.jwos.file.persistence.<API key>; import org.codefx.jwos.file.persistence.<API key>; import org.codefx.jwos.file.persistence.<API key>; import org.codefx.jwos.file.persistence.<API key>; import org.codefx.jwos.file.persistence.<API key>; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.InputStream; import java.util.Collection; import java.util.SortedSet; import java.util.concurrent.<API key>; import java.util.function.Function; import static java.util.Collections.unmodifiableSet; import static org.codefx.jwos.Util.transformToList; /** * An {@link AnalysisPersistence} that uses YAML to store results. * <p> * This implementation is not thread-safe. */ public class <API key> implements AnalysisPersistence { private static final Logger LOGGER = LoggerFactory.getLogger("Persistence"); private static final YamlPersister PERSISTER = new YamlPersister(); private final SortedSet<ProjectCoordinates> projects = new <API key><>(IdentifiesProject.alphabeticalOrder()); private final SortedSet<ResolvedProject> resolvedProjects = new <API key><>(IdentifiesProject.alphabeticalOrder()); private final SortedSet<FailedProject> <API key> = new <API key><>(IdentifiesProject.alphabeticalOrder()); private final SortedSet<DownloadedArtifact> downloadedArtifacts = new <API key><>(IdentifiesArtifact.alphabeticalOrder()); private final SortedSet<FailedArtifact> <API key> = new <API key><>(IdentifiesArtifact.alphabeticalOrder()); private final SortedSet<AnalyzedArtifact> analyzedArtifacts = new <API key><>(IdentifiesArtifact.alphabeticalOrder()); private final SortedSet<FailedArtifact> <API key> = new <API key><>(IdentifiesArtifact.alphabeticalOrder()); private final SortedSet<ResolvedArtifact> resolvedArtifacts = new <API key><>(IdentifiesArtifact.alphabeticalOrder()); private final SortedSet<FailedArtifact> <API key> = new <API key><>(IdentifiesArtifact.alphabeticalOrder()); private final SortedSet<CompletedArtifact> completedArtifacts = new <API key><>(IdentifiesArtifact.alphabeticalOrder()); // CREATION & PERSISTENCE private <API key>() { // private constructor to enforce use of static factory methods } public static <API key> empty() { return new <API key>(); } public static <API key> fromString(String yamlString) { if (yamlString.isEmpty()) return empty(); PersistentAnalysis persistent = PERSISTER.read(yamlString, PersistentAnalysis.class); return from(persistent); } public static <API key> fromStream(InputStream yamlStream) { LOGGER.debug("Parsing result file..."); PersistentAnalysis persistent = PERSISTER.read(yamlStream, PersistentAnalysis.class); if (persistent == null) return new <API key>(); else return from(persistent); } private static <API key> from(PersistentAnalysis persistent) { <API key> yaml = new <API key>(); addTo(persistent.step_1_projects, <API key>::toProject, yaml.projects); addTo(persistent.<API key>, <API key>::toProject, yaml.resolvedProjects); addTo(persistent.<API key>, <API key>::toProject, yaml.<API key>); addTo(persistent.<API key>, <API key>::toArtifact, yaml.downloadedArtifacts); addTo(persistent.<API key>, <API key>::toArtifact, yaml.<API key>); addTo(persistent.<API key>, <API key>::toArtifact, yaml.analyzedArtifacts); addTo(persistent.<API key>, <API key>::toArtifact, yaml.<API key>); addTo(persistent.<API key>, <API key>::toArtifact, yaml.resolvedArtifacts); addTo(persistent.<API key>, <API key>::toArtifact, yaml.<API key>); <API key> .toArtifacts(persistent.<API key>.stream()) .forEach(yaml.completedArtifacts::add); return yaml; } private static <P, T> void addTo(Collection<P> source, Function<P, T> transform, Collection<T> target) { source.stream() .map(transform) .forEach(target::add); } public String toYaml() { PersistentAnalysis persistent = <API key>(); return PERSISTER.write(persistent); } private PersistentAnalysis <API key>() { PersistentAnalysis persistent = new PersistentAnalysis(); persistent.step_1_projects = transformToList(projects, <API key>::from); persistent.<API key> = transformToList(resolvedProjects, <API key>::from); persistent.<API key> = transformToList(<API key>, <API key>::from); persistent.<API key> = transformToList(downloadedArtifacts, <API key>::from); persistent.<API key> = transformToList(<API key>, <API key>::from); persistent.<API key> = transformToList(analyzedArtifacts, <API key>::from); persistent.<API key> = transformToList(<API key>, <API key>::from); persistent.<API key> = transformToList(resolvedArtifacts, <API key>::from); persistent.<API key> = transformToList(<API key>, <API key>::from); persistent.<API key> = transformToList(completedArtifacts, <API key>::from); return persistent; } // IMPLEMENTATION OF 'AnalysisPersistence' @Override public Collection<ProjectCoordinates> <API key>() { return unmodifiableSet(projects); } @Override public Collection<ResolvedProject> <API key>() { return unmodifiableSet(resolvedProjects); } @Override public Collection<FailedProject> <API key>() { return unmodifiableSet(<API key>); } @Override public Collection<DownloadedArtifact> <API key>() { return unmodifiableSet(downloadedArtifacts); } @Override public Collection<FailedArtifact> <API key>() { return unmodifiableSet(<API key>); } @Override public Collection<AnalyzedArtifact> <API key>() { return unmodifiableSet(analyzedArtifacts); } @Override public Collection<FailedArtifact> <API key>() { return unmodifiableSet(<API key>); } @Override public Collection<ResolvedArtifact> <API key>() { return unmodifiableSet(resolvedArtifacts); } @Override public Collection<FailedArtifact> <API key>() { return unmodifiableSet(<API key>); } @Override public void addProject(ProjectCoordinates project) { projects.add(project); } @Override public void addResolvedProject(ResolvedProject project) { resolvedProjects.add(project); } @Override public void <API key>(FailedProject project) { <API key>.add(project); } @Override public void <API key>(DownloadedArtifact artifact) { downloadedArtifacts.add(artifact); } @Override public void addDownloadError(FailedArtifact artifact) { <API key>.add(artifact); } @Override public void addAnalyzedArtifact(AnalyzedArtifact artifact) { analyzedArtifacts.add(artifact); } @Override public void addAnalysisError(FailedArtifact artifact) { <API key>.add(artifact); } @Override public void addResolvedArtifact(ResolvedArtifact artifact) { resolvedArtifacts.add(artifact); } @Override public void <API key>(FailedArtifact artifact) { <API key>.add(artifact); } @Override public void addResult(CompletedArtifact artifact) { completedArtifacts.add(artifact); } }
package Calibradores; import java.io.File; import Metricas.MultiescalaConBorde; import Modelo.UrbanizandoFrenos; public class TanteadorTopilejo extends Tanteador { UrbanizandoFrenos CA; public TanteadorTopilejo() { // int[] <API key> = {1, 1, 1, 333, 333, 333, 1, 1, 444, 400, 400, 555}; // puntoDeTanteo = new PuntoDeBusqueda(<API key>); // puntoDelRecuerdo = new PuntoDeBusqueda(<API key>); CA = new UrbanizandoFrenos(72, 56, 11, 4); CA.setInitialGrid(new File ("Topilejo/topi1995.txt")); CA.setBosque(new File ("Topilejo/bosqueb.txt")); CA.setDistVias(new File ("Topilejo/distancia1.txt")); CA.setPendiente(new File ("Topilejo/pendiente.txt")); CA.setGoalGrid(new File ("Topilejo/topi1999.txt")); infoADN = CA.infoADN; MultiescalaConBorde metrica = new MultiescalaConBorde(CA.gridMeta, CA.numeroDeCeldasX, CA.numeroDeCeldasY ); metrica.normalizateConEste(new File ("Topilejo/topi1995.txt")); CA.setMetric(metrica); CA.setIteraciones(4); puntoDeTanteo = new PuntoDeBusqueda(infoADN.size); puntoDelRecuerdo = new PuntoDeBusqueda(infoADN.size); vuelo = new PuntoDeBusqueda(infoADN.size); bajando = new Ventana("Guardar Acercamiento", "Caminante Siego Estocastico"); bajando.setVisible(true); bajando.graf.setLocation(850, 715); bajando.setQueTantoLocation(865, 650); //solo para correr los 3 calibradores al mismo tiempo // ventana = new Ventana("Guardar Todo", "Todos"); // ventana.setVisible(true); pintaGrid1 = new PintaGrid(new File("Topilejo/topi1999.txt"), "Grrid Meta", 4); pintaGrid2 = new PintaGrid(new File("Topilejo/topi1995.txt"), "Mejor Aproximacion", 5); pintaGrid3 = new PintaGrid(new File("Topilejo/topi1995.txt"), "Grid de Salida", 4); pintaGrid2.setLocation(865, 370); } public double mide(int[] parametros) { return CA.mide(parametros, 100); } public static void main(String[] args) { TanteadorTopilejo topo = new TanteadorTopilejo(); topo.busca(); } @Override public int[][] unOutputPara(int[] parametros) { // TODO Auto-generated method stub return CA.unOutputPara(parametros); } }
#!/bin/bash #Coded by:FadyHazem/V2.0 Support:<API key>. #You can recodeing this script but yo must typing the own of this script(FadyHazem). echo "Welcome i will help you to update your system." sleep 4 echo "This script support:<API key>" sleep 2 read -p "What's your distro name?:" DISTRO echo "Now updateing $DISTRO" sleep 3 echo "Now loading..." sleep 4 sudo apt-get update && sudo apt-get upgrade
package me.mast3rplan.phantombot.event.ytplayer; import me.mast3rplan.phantombot.twitchwsirc.Channel; import me.mast3rplan.phantombot.ytplayer.YTPlayerState; public class YTPlayerStateEvent extends YTPlayerEvent { private final YTPlayerState state; public YTPlayerStateEvent(YTPlayerState state) { this.state = state; } public YTPlayerStateEvent(YTPlayerState state, Channel channel) { super(channel); this.state = state; } public YTPlayerState getState() { return state; } public int getStateId() { return state.i; } }
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_102) on Tue Feb 21 18:04:04 GMT 2017 --> <title>gate.chineseSeg (${plugin.name} JavaDoc)</title> <meta name="date" content="2017-02-21"> <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../script.js"></script> </head> <body> <h1 class="bar"><a href="../../gate/chineseSeg/package-summary.html" target="classFrame">gate.chineseSeg</a></h1> <div class="indexContainer"> <h2 title="Classes">Classes</h2> <ul title="Classes"> <li><a href="ChineseSegMain.html" title="class in gate.chineseSeg" target="classFrame">ChineseSegMain</a></li> <li><a href="ConstantParameters.html" title="class in gate.chineseSeg" target="classFrame">ConstantParameters</a></li> <li><a href="TestChineseSegMain.html" title="class in gate.chineseSeg" target="classFrame">TestChineseSegMain</a></li> </ul> <h2 title="Enums">Enums</h2> <ul title="Enums"> <li><a href="RunMode.html" title="enum in gate.chineseSeg" target="classFrame">RunMode</a></li> </ul> </div> </body> </html>
using System; namespace org.btg.Star.Rhapsody { public struct SkeletalPoint { public int x { get; set; } public int y { get; set; } public int z { get; set; } public SkeletalPointType type { get; set; } } }
package org.thoughtcrime.securesms.jobs; import androidx.annotation.NonNull; import org.thoughtcrime.securesms.dependencies.<API key>; import org.thoughtcrime.securesms.jobmanager.Data; import org.thoughtcrime.securesms.jobmanager.Job; import org.thoughtcrime.securesms.jobmanager.impl.NetworkConstraint; import org.thoughtcrime.securesms.logging.Log; import org.thoughtcrime.securesms.crypto.<API key>; import org.thoughtcrime.securesms.database.IdentityDatabase.VerifiedStatus; import org.thoughtcrime.securesms.recipients.RecipientId; import org.thoughtcrime.securesms.recipients.RecipientUtil; import org.thoughtcrime.securesms.util.Base64; import org.thoughtcrime.securesms.recipients.Recipient; import org.thoughtcrime.securesms.util.<API key>; import org.whispersystems.libsignal.IdentityKey; import org.whispersystems.libsignal.InvalidKeyException; import org.whispersystems.signalservice.api.<API key>; import org.whispersystems.signalservice.api.crypto.<API key>; import org.whispersystems.signalservice.api.messages.multidevice.<API key>; import org.whispersystems.signalservice.api.messages.multidevice.VerifiedMessage; import org.whispersystems.signalservice.api.push.<API key>; import org.whispersystems.signalservice.api.push.exceptions.<API key>; import java.io.IOException; import java.util.concurrent.TimeUnit; public class <API key> extends BaseJob { public static final String KEY = "<API key>"; private static final String TAG = <API key>.class.getSimpleName(); private static final String KEY_DESTINATION = "destination"; private static final String KEY_IDENTITY_KEY = "identity_key"; private static final String KEY_VERIFIED_STATUS = "verified_status"; private static final String KEY_TIMESTAMP = "timestamp"; private RecipientId destination; private byte[] identityKey; private VerifiedStatus verifiedStatus; private long timestamp; public <API key>(@NonNull RecipientId destination, IdentityKey identityKey, VerifiedStatus verifiedStatus) { this(new Job.Parameters.Builder() .addConstraint(NetworkConstraint.KEY) .setQueue("<API key>") .setLifespan(TimeUnit.DAYS.toMillis(1)) .setMaxAttempts(Parameters.UNLIMITED) .build(), destination, identityKey.serialize(), verifiedStatus, System.currentTimeMillis()); } private <API key>(@NonNull Job.Parameters parameters, @NonNull RecipientId destination, @NonNull byte[] identityKey, @NonNull VerifiedStatus verifiedStatus, long timestamp) { super(parameters); this.destination = destination; this.identityKey = identityKey; this.verifiedStatus = verifiedStatus; this.timestamp = timestamp; } @Override public @NonNull Data serialize() { return new Data.Builder().putString(KEY_DESTINATION, destination.serialize()) .putString(KEY_IDENTITY_KEY, Base64.encodeBytes(identityKey)) .putInt(KEY_VERIFIED_STATUS, verifiedStatus.toInt()) .putLong(KEY_TIMESTAMP, timestamp) .build(); } @Override public @NonNull String getFactoryKey() { return KEY; } @Override public void onRun() throws IOException, <API key> { try { if (!<API key>.isMultiDevice(context)) { Log.i(TAG, "Not multi device..."); return; } if (destination == null) { Log.w(TAG, "No destination..."); return; } <API key> messageSender = <API key>.<API key>(); Recipient recipient = Recipient.resolved(destination); VerifiedMessage.VerifiedState verifiedState = getVerifiedState(verifiedStatus); <API key> verifiedAddress = RecipientUtil.<API key>(context, recipient); VerifiedMessage verifiedMessage = new VerifiedMessage(verifiedAddress, new IdentityKey(identityKey, 0), verifiedState, timestamp); messageSender.sendMessage(<API key>.forVerified(verifiedMessage), <API key>.getAccessFor(context, recipient)); } catch (InvalidKeyException e) { throw new IOException(e); } } private VerifiedMessage.VerifiedState getVerifiedState(VerifiedStatus status) { VerifiedMessage.VerifiedState verifiedState; switch (status) { case DEFAULT: verifiedState = VerifiedMessage.VerifiedState.DEFAULT; break; case VERIFIED: verifiedState = VerifiedMessage.VerifiedState.VERIFIED; break; case UNVERIFIED: verifiedState = VerifiedMessage.VerifiedState.UNVERIFIED; break; default: throw new AssertionError("Unknown status: " + verifiedStatus); } return verifiedState; } @Override public boolean onShouldRetry(@NonNull Exception exception) { return exception instanceof <API key>; } @Override public void onFailure() { } public static final class Factory implements Job.Factory<<API key>> { @Override public @NonNull <API key> create(@NonNull Parameters parameters, @NonNull Data data) { try { RecipientId destination = RecipientId.from(data.getString(KEY_DESTINATION)); VerifiedStatus verifiedStatus = VerifiedStatus.forState(data.getInt(KEY_VERIFIED_STATUS)); long timestamp = data.getLong(KEY_TIMESTAMP); byte[] identityKey = Base64.decode(data.getString(KEY_IDENTITY_KEY)); return new <API key>(parameters, destination, identityKey, verifiedStatus, timestamp); } catch (IOException e) { throw new AssertionError(e); } } } }
require_relative '../../spec_helper' describe TypedRb::TypeSignature::Parser do it 'parses a unit type' do result = described_class.parse('unit') expect(result).to eq(:unit) end it 'parses an atomic type' do result = described_class.parse('Bool') expect(result).to eq('Bool') end it 'parses a generic type' do result = described_class.parse('Array[Bool]') expect(result).to eq({:type => 'Array', :parameters => [{:type => 'Bool', :kind => :type_var}], :kind => :generic_type}) end it 'parses a nested generic type' do result = described_class.parse('Array[Array[Integer]]') expect(result).to eq({:type=>'Array', :parameters => [ {:type=>'Array', :parameters => [{ :type => 'Integer', :kind => :type_var }], :kind => :generic_type } ], :kind => :generic_type}) end it 'parses a nested generic type with multiple type arguments' do result = described_class.parse('Array[Hash[Symbol][String]]') expect(result).to eq({:type=>'Array', :parameters => [ {:type=>'Hash', :parameters => [{ :type => 'Symbol', :kind => :type_var }, { :type => 'String', :kind => :type_var }], :kind => :generic_type } ], :kind => :generic_type}) end it 'parses an atomic rest type' do result = described_class.parse('Bool...') expect(result).to eq({:type => 'Array', :parameters => ['Bool'], :kind => :rest}) end it 'parses a type var rest type' do result = described_class.parse('[T]...') expect(result).to eq({:type => 'Array', :parameters => [{:type=>"T", :kind => :type_var}], :kind => :rest}) end it 'parses a function type' do result = described_class.parse('Bool -> Int') expect(result).to eq(['Bool', 'Int']) end it 'parses applied type parameters in signatures' do result = described_class.parse('Bool... -> Array[Bool]') expect(result[0]).to eq({:type => 'Array', :parameters => ['Bool'], :kind => :rest}) expect(result[1]).to eq({:type => 'Array', :parameters => [{:type=>"Bool", :kind=>:type_var}], :kind => :generic_type}) end it 'parses applied type parameters in signatures' do result = described_class.parse('Bool... -> Array[T < Bool]') expect(result[0]).to eq({:type => 'Array', :parameters => ['Bool'], :kind => :rest}) expect(result[1]).to eq({:type => 'Array', :parameters => [{:type =>"T", :kind =>:type_var, :bound => 'Bool', :binding => '<'}], :kind => :generic_type}) end it 'parses applied type parameters in signatures' do result = described_class.parse('Bool... -> Array[T > Bool]') expect(result[0]).to eq({:type => 'Array', :parameters => ['Bool'], :kind => :rest}) expect(result[1]).to eq({:type => 'Array', :parameters => [{:type =>"T", :kind =>:type_var, :bound => 'Bool', :binding => '>'}], :kind => :generic_type}) end it 'parses a complex type' do result = described_class.parse('Bool -> Int -> Bool') expect(result).to eq(['Bool', 'Int', 'Bool']) end it 'parses a complex type using unit' do result = described_class.parse('Bool -> Int -> unit') expect(result).to eq(['Bool', 'Int', :unit]) end it 'parses a types with parentheses' do result = described_class.parse('(Bool -> Int) -> Bool') expect(result).to eq([['Bool', 'Int'], 'Bool']) end it 'parses a types with parentheses in the return type' do result = described_class.parse('Bool -> (Int -> Bool)') expect(result).to eq(['Bool', ['Int', 'Bool']]) end it 'parses a types with parentheses in the complex return type' do result = described_class.parse('Bool -> (Int -> (Bool -> Int))') expect(result).to eq(['Bool', ['Int', ['Bool', 'Int']]]) end it 'parses a types with complex parentheses' do result = described_class.parse('(Bool -> Bool) -> (Bool -> Int)') expect(result).to eq([['Bool', 'Bool'], ['Bool', 'Int']]) end it 'parses a types with complex parentheses' do result = described_class.parse('(Bool -> Bool) -> (Bool -> Int) -> (Int -> Int)') expect(result).to eq([['Bool', 'Bool'], ['Bool', 'Int'], ['Int', 'Int']]) end it 'parses a types with complex compound parentheses' do result = described_class.parse('((Bool -> Bool) -> (Bool -> Int)) -> (Bool -> Int)') expect(result).to eq([[['Bool','Bool'], ['Bool', 'Int']], ['Bool', 'Int']]) end it 'parses unbalanced type expressions' do result = described_class.parse('Bool -> Int -> (Bool -> Int) -> Int') expect(result).to eq(['Bool','Int', ['Bool','Int'], 'Int']) end it 'parses unbalanced type expressions with just return types' do result = described_class.parse('Bool -> Int -> (-> Int) -> Int') expect(result).to eq(['Bool','Int', ['Int'], 'Int']) end it 'parses expressions with only return type' do result = described_class.parse(' -> Int') expect(result).to eq(['Int']) end it 'parses type variables' do result = described_class.parse('[X]') expect(result).to eq({:type => 'X', :kind => :type_var }) end it 'parses type variables with lower binding' do result = described_class.parse('[X < Numeric]') expect(result).to eq({:type => 'X', :kind => :type_var, :bound => 'Numeric', :binding => '<' }) end it 'parses type variables with lower binding' do result = described_class.parse('[X > Numeric]') expect(result).to eq({:type => 'X', :kind => :type_var, :bound => 'Numeric', :binding => '>' }) end it 'parses return type variables' do result = described_class.parse(' -> [X]') expect(result).to eq([{:type => 'X', :kind => :type_var }]) end it 'parses type variables in both sides' do result = described_class.parse('[X<String] -> [Y]') expect(result).to eq([{:type => 'X', :bound => 'String', :kind => :type_var, :binding => '<' }, {:type => 'Y', :kind => :type_var }]) end it 'parses type variables in complex expressions' do result = described_class.parse('[X] -> ([Y] -> Integer)') expect(result).to eq([{:type => 'X', :kind => :type_var }, [{:type => 'Y', :kind => :type_var }, 'Integer']]) end it 'parses a block' do result = described_class.parse('Int -> unit -> &(String -> Integer)') expect(result).to eq(['Int', :unit, {:block => ['String', 'Integer'], :kind => :block_arg}]) end it 'parses parametric types' do result = described_class.parse('Array[X] -> [X]') expect(result).to eq([{:type => "Array", :parameters => [{:type => "X", :kind => :type_var}], :kind => :generic_type}, {:type => "X", :kind => :type_var}]) end it 'parses parametric types with multiple var types' do result = described_class.parse('Int -> (Bool -> Array[X][Y][Z])') expect(result).to eq(["Int", ["Bool", {:type => "Array", :parameters => [{:type => "X", :kind => :type_var}, {:type => "Y", :kind => :type_var}, {:type => "Z", :kind => :type_var}], :kind => :generic_type}]]) end it 'parses parametric types with bounds' do result = described_class.parse('Array[X<Int] -> Hash[T<String][U<Object]') expect(result).to eq([{:type => "Array", :parameters => [{:type => "X", :bound => "Int", :binding => '<', :kind => :type_var}], :kind => :generic_type}, {:type => "Hash", :parameters => [{:type => "T", :bound => "String", :binding => '<', :kind => :type_var}, {:type => "U", :bound => "Object", :binding => '<', :kind => :type_var}], :kind => :generic_type}]) end it 'parses parametric rest arguments' do result = described_class.parse('Array[X]... -> String') expect(result).to eq([{:kind=>:rest, :type=>"Array", :parameters=>[{:type=>"Array", :parameters=>[{:type=>"X", :kind=>:type_var}], :kind=>:generic_type}]}, "String"]) end it 'parses multiple type variables in sequence' do result = described_class.parse('[X][Y][Z]') expect(result).to eq([{:type=>"X", :kind=>:type_var}, {:type=>"Y", :kind=>:type_var}, {:type=>"Z", :kind=>:type_var}]) end end
<form class="form-horizontal" method="POST" action="{{ request.url }}"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title" id="myModalLabel">{{ _('Edit Participant') }}</h4> </div> <div class="modal-body" style="padding-bottom:5px; padding-top:20px;"> {{ form.hidden_tag() }} {%- for field in form -%} {%- if field.type != 'CSRFTokenField' -%} <div class="form-group {% if field.errors %}has-error{% endif %}"> {{ field.label(class_='col-sm-3 control-label') }} <div class="col-sm-7"> {% if field.name == 'supervisor' %} {{ field(class_='form-control select2-container span3 select2 <API key>', **{'data-name': participant.supervisor.name, 'data-participant_id': participant.supervisor.participant_id}) }} {% elif field.name == 'location' %} {{ field(class_='form-control select2-container span3 select2 select2-locations', **{'data-name': participant.location.name, 'data-location_type': participant.location.location_type}) }} {% else %} {{ field(class_='form-control span3') }} {% endif %} {% if field.errors %} {% for e in field.errors %} <p class="help-block">{{ e }}</p> {% endfor %} {% endif %} </div> <div class="col-sm-2"></div> </div> {%- endif -%} {%- endfor -%} </div> <div class="modal-footer"> <div class="row"> <div class="col-sm-1"></div> <div class="col-sm-10" style="padding-right:1.8em;"> <button type="submit" style="width:122px;"class="btn btn-primary">{{ _('Save') }}</button> <button type="button" style="width:122px;"class="btn btn-default" data-dismiss="modal">{{ _('Close') }}</button> </div> </div> </div> </form>
#include "house2.h" int House2::objCount = 0; GImage *House2::image = nullptr; House2::House2(int x, int y) { posx = x; posy = y; width = 336; height = 366; if(!objCount) image = new GImage("./assets/house-a.gif",width,height,GImage::IS_TRANSPARENT,0); objCount++; if(Debug::debug_enable()) std::cout << "House2 " << objCount-1 << " created" << std::endl; } House2::~House2() { objCount if(!objCount) delete image; if(Debug::debug_enable()) std::cout << "House2 " << objCount << " destroyed" << std::endl; } bool House2::show(int x) { if(posx-x+width >= 0 && posx-x <= 800) { image->show(posx-x,posy); return 1; } return 0; }
package com.silvermatch.advancedMod.block; import com.silvermatch.advancedMod.init.ModBlocks; import com.silvermatch.advancedMod.reference.Reference; import com.silvermatch.advancedMod.utility.Names; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.world.World; public class BlockFrenchFlag extends BlockAdvancedMod{ public BlockFrenchFlag() { setBlockName(Names.Blocks.FRENCH_FLAG); setBlockTextureName(Reference.MOD_ID_LOWER + ":" + Names.Blocks.FRENCH_FLAG); } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float hitX, float hitY, float hitZ) { if (world.isAirBlock(x, y+1, z)){ world.setBlock(x, y+1, z, ModBlocks.frenchFlag); } return true; } }
using System; using System.Linq; using LeagueSharp; using LeagueSharp.Common; using EloBuddy; using LeagueSharp.Common; namespace ezEvade.SpecialSpells { class Darius : ChampionPlugin { static Darius() { // todo: fix for multiple darius' on same team (one for all) } public void LoadSpecialSpell(SpellData spellData) { if (spellData.spellName == "DariusCleave") { Game.OnUpdate += Game_OnUpdate; SpellDetector.<API key> += <API key>; } } private void Game_OnUpdate(EventArgs args) { var darius = HeroManager.Enemies.FirstOrDefault(x => x.ChampionName == "Darius"); if (darius != null) { foreach (var spell in SpellDetector.detectedSpells.Where(x => x.Value.heroID == darius.NetworkId)) { spell.Value.startPos = darius.ServerPosition.To2D(); spell.Value.endPos = darius.ServerPosition.To2D() + spell.Value.direction * spell.Value.info.range; } } } private void <API key>(Obj_AI_Base hero, <API key> args, SpellData spellData, <API key> specialSpellArgs) { if (spellData.spellName == "DariusCleave") { //SpellDetector.CreateSpellData(hero, start.To3D(), end.To3D(), spellData); } } } }
package pg.autyzm.friendly_plans.manager_app.view.task_create; import android.app.FragmentTransaction; import android.content.Intent; import android.databinding.DataBindingUtil; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.Button; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.TextView; import database.repository.<API key>; import javax.inject.Inject; import database.entities.Asset; import database.entities.TaskTemplate; import database.repository.<API key>; import pg.autyzm.friendly_plans.ActivityProperties; import pg.autyzm.friendly_plans.App; import pg.autyzm.friendly_plans.AppComponent; import pg.autyzm.friendly_plans.R; import pg.autyzm.friendly_plans.asset.AssetType; import pg.autyzm.friendly_plans.databinding.<API key>; import pg.autyzm.friendly_plans.manager_app.validation.TaskValidation; import pg.autyzm.friendly_plans.manager_app.validation.Utils; import pg.autyzm.friendly_plans.manager_app.validation.ValidationResult; import pg.autyzm.friendly_plans.manager_app.view.components.SoundComponent; import pg.autyzm.friendly_plans.manager_app.view.main_screen.MainActivity; import pg.autyzm.friendly_plans.manager_app.view.step_list.StepListFragment; import pg.autyzm.friendly_plans.manager_app.view.task_type_enum.TaskType; import pg.autyzm.friendly_plans.manager_app.view.view_fragment.CreateFragment; public class TaskCreateFragment extends CreateFragment implements <API key> { private static final String REGEX_TRIM_NAME = "_([\\d]*)(?=\\.)"; @Inject TaskValidation taskValidation; @Inject <API key> <API key>; @Inject <API key> <API key>; private TextView labelTaskName; private EditText taskName; private EditText taskDurationTime; private Long taskId; private Integer typeId; private Button steps; private RadioGroup types; private TaskType taskType = TaskType.TASK; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { <API key> binding = DataBindingUtil.inflate( inflater, R.layout.<API key>, container, false); binding.setEvents(this); View view = binding.getRoot(); ImageButton playSoundIcon = (ImageButton) view.findViewById(R.id.id_btn_play_sound); AppComponent appComponent = ((App) getActivity().getApplication()).getAppComponent(); soundComponent = SoundComponent.getSoundComponent( soundId, playSoundIcon, getActivity().<API key>(), appComponent); appComponent.inject(this); binding.setSoundComponent(soundComponent); return view; } @Override public void onViewCreated(View view, Bundle savedInstanceState) { registerViews(view); view.post(new Runnable() { // Set assets only when the layout is completely built @Override public void run() { Bundle arguments = getArguments(); if (arguments != null) { Long taskId = (Long) arguments.get(ActivityProperties.TASK_ID); if (taskId != null) { initTaskForm(taskId); } } } }); } private void registerViews(View view) { labelTaskName = (TextView) view.findViewById(R.id.<API key>); Utils.markFieldMandatory(labelTaskName); taskName = (EditText) view.findViewById(R.id.id_et_task_name); pictureFileName = (EditText) view.findViewById(R.id.id_et_task_picture); soundFileName = (EditText) view.findViewById(R.id.id_et_task_sound); taskDurationTime = (EditText) view.findViewById(R.id.<API key>); picturePreview = (ImageView) view.findViewById(R.id.iv_picture_preview); clearSound = (ImageButton) view.findViewById(R.id.<API key>); clearPicture = (ImageButton) view.findViewById(R.id.id_ib_clear_img_btn); steps = (Button) view.findViewById(R.id.id_btn_steps); types = (RadioGroup) view.findViewById(R.id.id_rg_types); RadioButton typeTask = (RadioButton) view.findViewById(R.id.id_rb_type_task); typeTask.setChecked(true); taskType = TaskType.TASK; } private Long saveOrUpdate() { soundComponent.stopActions(); try { if (taskId != null) { if (validateName(taskId, taskName) && validateDuration(taskDurationTime)) { typeId = taskType.getId(); Integer duration = getDuration(); clearSteps(typeId, taskId); <API key>.update(taskId, taskName.getText().toString(), duration, pictureId, soundId, typeId); showToastMessage(R.string.task_saved_message); return taskId; } } else { if (validateName(taskName) && validateDuration(taskDurationTime)) { Integer duration = getDuration(); typeId = taskType.getId(); long taskId = <API key>.create(taskName.getText().toString(), duration, pictureId, soundId, typeId); showToastMessage(R.string.task_saved_message); return taskId; } } } catch (RuntimeException exception) { Log.e("Task Create View", "Error saving task", exception); showToastMessage(R.string.<API key>); } return null; } private void clearSteps(Integer typeId, Long taskId) { if (typeId != 1) { <API key>.<API key>(taskId); } } private boolean validateName(Long taskId, EditText taskName) { ValidationResult validationResult = taskValidation .isUpdateNameValid(taskId, taskName.getText().toString()); return handleInvalidResult(taskName, validationResult); } private boolean validateName(EditText taskName) { ValidationResult validationResult = taskValidation .isNewNameValid(taskName.getText().toString()); return handleInvalidResult(taskName, validationResult); } private boolean validateDuration(EditText duration) { ValidationResult validationResult = taskValidation .isDurationValid(duration.getText().toString()); return handleInvalidResult(duration, validationResult); } private void initTaskForm(long taskId) { this.taskId = taskId; TaskTemplate task = <API key>.get(taskId); taskName.setText(task.getName()); if (task.getDurationTime() != null) { taskDurationTime.setText(String.valueOf(task.getDurationTime())); } Asset picture = task.getPicture(); Asset sound = task.getSound(); if (picture != null) { setAssetValue(AssetType.PICTURE, picture.getFilename(), picture.getId()); } if (sound != null) { setAssetValue(AssetType.SOUND, sound.getFilename(), sound.getId()); } typeId = task.getTypeId(); ((RadioButton) types.getChildAt(typeId - 1)).setChecked(true); <API key>(Integer.valueOf(task.getTypeId().toString())); } private void <API key>(int typeIdValue) { if (typeIdValue == 1) { steps.setVisibility(View.VISIBLE); } else { steps.setVisibility(View.INVISIBLE); } } private void showStepsList(final long taskId) { StepListFragment fragment = new StepListFragment(); Bundle args = new Bundle(); args.putLong(ActivityProperties.TASK_ID, taskId); fragment.setArguments(args); FragmentTransaction transaction = getFragmentManager() .beginTransaction(); transaction.replace(R.id.task_container, fragment); transaction.addToBackStack(null); transaction.commit(); } private void showMainMenu() { Intent intent = new Intent(getActivity(), MainActivity.class); startActivity(intent); } @Override protected void setAssetValue(AssetType assetType, String assetName, Long assetId) { String assetNameTrimmed = assetName.replaceAll(REGEX_TRIM_NAME, ""); if (assetType.equals(AssetType.PICTURE)) { pictureFileName.setText(assetNameTrimmed); clearPicture.setVisibility(View.VISIBLE); pictureId = assetId; showPreview(pictureId, picturePreview); } else { soundFileName.setText(assetNameTrimmed); clearSound.setVisibility(View.VISIBLE); soundId = assetId; soundComponent.setSoundId(soundId); } } private Integer getDuration() { if (!taskDurationTime.getText().toString().isEmpty() && !taskDurationTime.getText().toString().equals("0")) { return Integer.valueOf(taskDurationTime.getText().toString()); } return null; } @Override public void eventListStep(View view) { taskId = saveOrUpdate(); if (taskId != null) { showStepsList(taskId); } } @Override public void eventSelectPicture(View view) { filePickerProxy.openFilePicker(TaskCreateFragment.this, AssetType.PICTURE); } @Override public void eventSelectSound(View view) { filePickerProxy.openFilePicker(TaskCreateFragment.this, AssetType.SOUND); } @Override public void eventClearPicture(View view) { clearPicture(); } @Override public void eventClearSound(View view) { clearSound(); } @Override public void <API key>(View view) { showPicture(pictureId); } @Override public void <API key>(View view, int id) { if (id == R.id.id_rb_type_task) { steps.setVisibility(View.VISIBLE); taskType = TaskType.TASK; } else { steps.setVisibility(View.INVISIBLE); if (id == R.id.<API key>) { taskType = TaskType.INTERACTION; } else { taskType = TaskType.PRIZE; } } } @Override public void eventSaveAndFinish(View view) { Long taskId = saveOrUpdate(); if (taskId != null) { showMainMenu(); } } }
package de.ovgu.cide.export.virtual.internal; import java.util.Set; import org.eclipse.jdt.core.dom.CompilationUnit; import de.ovgu.cide.export.<API key>; import de.ovgu.cide.export.useroptions.IUserOptionProvider; import de.ovgu.cide.features.IFeature; import de.ovgu.cide.features.source.ColoredSourceFile; /** * how to print annotations? note: we assume ifdef semantics, i.e. annotations * may be nested, but always close in the reverse order * * * @author ckaestne * */ public interface IPPExportOptions extends IUserOptionProvider { /** * should the start and end instructions be printed in a new line? (i.e. * should a line break be enforced before?) * * the instruction is responsible for the linebreak at the end itself * * @return */ boolean inNewLine(); /** * get the code statement(s) to begin an annotation block * * @param f * set of features annotated for the current element * @return */ String getStartInstruction(Set<IFeature> f); /** * get the code statement(s) to end an annotation block * * @param f * set of features annotated for the current element * @return */ String getEndInstruction(Set<IFeature> f); <API key> getPrettyPrinter(ColoredSourceFile sourceFile); /** * allows the developer to change the AST before printing it. can be used * for some refactorings. returns the modified AST * * @param root * @param sourceFile * @return */ CompilationUnit refactorAST(CompilationUnit root, ColoredSourceFile sourceFile); }
#ifdef WITH_LIBREGEX # include REGEX_HEADER #endif /*=export_func optionUnstackArg * private: * * what: Remove option args from a stack * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Invoked for options that are equivalenced to stacked options. =*/ void optionUnstackArg(tOptions * pOpts, tOptDesc * pOptDesc) { tArgList * pAL; (void)pOpts; if ((pOptDesc->fOptState & OPTST_RESET) != 0) return; pAL = (tArgList*)pOptDesc->optCookie; /* * IF we don't have any stacked options, * THEN indicate that we don't have any of these options */ if (pAL == NULL) { pOptDesc->fOptState &= <API key>; if ((pOptDesc->fOptState & OPTST_INITENABLED) == 0) pOptDesc->fOptState |= OPTST_DISABLED; return; } #ifdef WITH_LIBREGEX { regex_t re; int i, ct, dIdx; if (regcomp(&re, pOptDesc->optArg.argString, REG_NOSUB) != 0) return; /* * search the list for the entry(s) to remove. Entries that * are removed are *not* copied into the result. The source * index is incremented every time. The destination only when * we are keeping a define. */ for (i = 0, dIdx = 0, ct = pAL->useCt; --ct >= 0; i++) { char const * pzSrc = pAL->apzArgs[ i ]; char * pzEq = strchr(pzSrc, '='); int res; if (pzEq != NULL) *pzEq = NUL; res = regexec(&re, pzSrc, (size_t)0, NULL, 0); switch (res) { case 0: /* * Remove this entry by reducing the in-use count * and *not* putting the string pointer back into * the list. */ AGFREE(pzSrc); pAL->useCt break; default: case REG_NOMATCH: if (pzEq != NULL) *pzEq = '='; /* * IF we have dropped an entry * THEN we have to move the current one. */ if (dIdx != i) pAL->apzArgs[ dIdx ] = pzSrc; dIdx++; } } regfree(&re); } #else /* not WITH_LIBREGEX */ { int i, ct, dIdx; /* * search the list for the entry(s) to remove. Entries that * are removed are *not* copied into the result. The source * index is incremented every time. The destination only when * we are keeping a define. */ for (i = 0, dIdx = 0, ct = pAL->useCt; --ct >= 0; i++) { tCC* pzSrc = pAL->apzArgs[ i ]; char* pzEq = strchr(pzSrc, '='); if (pzEq != NULL) *pzEq = NUL; if (strcmp(pzSrc, pOptDesc->optArg.argString) == 0) { /* * Remove this entry by reducing the in-use count * and *not* putting the string pointer back into * the list. */ AGFREE(pzSrc); pAL->useCt } else { if (pzEq != NULL) *pzEq = '='; /* * IF we have dropped an entry * THEN we have to move the current one. */ if (dIdx != i) pAL->apzArgs[ dIdx ] = pzSrc; dIdx++; } } } #endif /* WITH_LIBREGEX */ /* * IF we have unstacked everything, * THEN indicate that we don't have any of these options */ if (pAL->useCt == 0) { pOptDesc->fOptState &= <API key>; if ((pOptDesc->fOptState & OPTST_INITENABLED) == 0) pOptDesc->fOptState |= OPTST_DISABLED; AGFREE((void*)pAL); pOptDesc->optCookie = NULL; } } /* * Put an entry into an argument list. The first argument points to * a pointer to the argument list structure. It gets passed around * as an opaque address. */ LOCAL void addArgListEntry(void** ppAL, void* entry) { tArgList* pAL = *(void**)ppAL; /* * IF we have never allocated one of these, * THEN allocate one now */ if (pAL == NULL) { pAL = (tArgList*)AGALOC(sizeof(*pAL), "new option arg stack"); if (pAL == NULL) return; pAL->useCt = 0; pAL->allocCt = MIN_ARG_ALLOC_CT; *ppAL = (void*)pAL; } /* * ELSE if we are out of room * THEN make it bigger */ else if (pAL->useCt >= pAL->allocCt) { size_t sz = sizeof(*pAL); pAL->allocCt += INCR_ARG_ALLOC_CT; /* * The base structure contains space for MIN_ARG_ALLOC_CT * pointers. We subtract it off to find our augment size. */ sz += sizeof(char*) * (pAL->allocCt - MIN_ARG_ALLOC_CT); pAL = (tArgList*)AGREALOC((void*)pAL, sz, "expanded opt arg stack"); if (pAL == NULL) return; *ppAL = (void*)pAL; } /* * Insert the new argument into the list */ pAL->apzArgs[ (pAL->useCt)++ ] = entry; } /*=export_func optionStackArg * private: * * what: put option args on a stack * arg: + tOptions* + pOpts + program options descriptor + * arg: + tOptDesc* + pOptDesc + the descriptor for this arg + * * doc: * Keep an entry-ordered list of option arguments. =*/ void optionStackArg(tOptions * pOpts, tOptDesc * pOD) { char * pz; (void)pOpts; if ((pOD->fOptState & OPTST_RESET) != 0) { tArgList* pAL = (void*)pOD->optCookie; int ix; if (pAL == NULL) return; ix = pAL->useCt; while (--ix >= 0) AGFREE(pAL->apzArgs[ix]); AGFREE(pAL); } else { if (pOD->optArg.argString == NULL) return; AGDUPSTR(pz, pOD->optArg.argString, "stack arg"); addArgListEntry(&(pOD->optCookie), (void*)pz); } } /* * Local Variables: * mode: C * c-file-style: "stroustrup" * indent-tabs-mode: nil * End: * end of autoopts/stack.c */
<ion-header-bar align-title="left" class="bar-positive"> <div class="buttons"> <button class="button button-clear icon ion-chevron-left" ng-click="back('menu');"></button> </div> <h1 class="title">Guimo</h1> </ion-header-bar> <ion-pane> <ion-content> <div class="row"> <div class="col"> <a class="button button-energized button-full" ng-click="changeValue('food')">Resetar Comida</a> <a class="button button-assertive button-full"ng-click="changeValue('health')">Resetar Saúde</a> <a class="button button-calm button-full" ng-click="changeValue('fome')">Fome</a> <a class="button button-balanced button-full" ng-click="changeValue('sick')">Doente</a> <a class="button button-positive button-full" ng-show="connected" ng-click="changeValue('screen')">Tela Padrão</a> </div> </div> </ion-content> </ion-pane>
class HomeController < <API key> def index @movies = Movie.all.sort_by{|movie| movie.rank}.reverse.first(7) @books = Book.all.sort_by{|book| book.rank}.reverse.first(7) @albums = Album.all.sort_by{|album| album.rank}.reverse.first(7) end end
{% load <API key> %} <div id="<API key>"> <h1>report: <a href="/report/#report/{{ report.pk }}/details/">{{ report.name }}</a></h1> </div> {% <API key> object report.pk %} <div class="<API key> clearfix"> <div class="text-bullet"> <span class="name">link:</span> <span class="value"> <a href="/report/external/{{ report.bound_link }}" target="_blank"> {% if request.is_secure %}https:{% else %}http:{% endif %}//{{ request.get_host }}/report/external/{{ report.bound_link }} </a> </span> </div> <div class="text-bullet"> <span class="name">public:</span> <span class="value">{{ report.public|yesno }}</span> </div> </div> <div class="<API key> clearfix"> {{ report.content }} </div>
// <auto-generated> // This code was generated by a tool. // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> public partial class <API key> { <summary> pnlUIContext control. </summary> <remarks> Auto-generated field. To modify move field declaration from designer file to code-behind file. </remarks> protected global::CMS.ExtendedControls.UIContextPanel pnlUIContext; <summary> form control. </summary> <remarks> Auto-generated field. To modify move field declaration from designer file to code-behind file. </remarks> protected global::CMS.FormControls.CustomTableForm form; }
#!/usr/bin/env bash set -e if [ ${TARGET} = "win64" ]; then EXTENSION=zip else if [ ${TRAVIS_OS_NAME} = "linux" ]; then EXTENSION=tar.gz else EXTENSION=dmg fi fi curl -T OpenPSTD-${<API key>}.${<API key>}.${TRAVIS_BUILD_NUMBER}-${TARGET}.${EXTENSION} ${WEBDAV}
// <auto-generated> // This code was generated from a template. // Manual changes to this file may cause unexpected behavior in your application. // Manual changes to this file will be overwritten if the code is regenerated. // </auto-generated> namespace FoodInventory.Data.Models { using System; using System.Data.Entity; using System.Data.Entity.Infrastructure; public partial class <API key> : DbContext { public <API key>() : base("name=<API key>") { } protected override void OnModelCreating(DbModelBuilder modelBuilder) { throw new <API key>(); } public virtual DbSet<Product> Products { get; set; } } }
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2014.05.14 at 05:14:09 PM CDT @javax.xml.bind.annotation.XmlSchema(namespace = "http: package hortonworks.hdp.refapp.trucking.simulator.impl.domain.transport.route.jaxb;
#ifndef THREAD_H_INCLUDED #define THREAD_H_INCLUDED #include <bitset> #include <condition_variable> #include <mutex> #include <thread> #include <vector> #include "material.h" #include "movepick.h" #include "pawns.h" #include "position.h" #include "search.h" const int MAX_THREADS = 128; const int <API key> = 8; struct Thread; struct SplitPoint { // Const data after split point has been setup const Position* pos; const Search::Stack* ss; Thread* masterThread; Depth depth; Value beta; int nodeType; bool cutNode; // Const pointers to shared data MovePicker* movePicker; SplitPoint* parentSplitPoint; // Shared data std::mutex mutex; std::bitset<MAX_THREADS> slavesMask; volatile bool allSlavesSearching; volatile uint64_t nodes; volatile Value alpha; volatile Value bestValue; volatile Move bestMove; volatile int moveCount; volatile bool cutoff; }; ThreadBase struct is the base of the hierarchy from where we derive all the specialized thread classes. struct ThreadBase { ThreadBase() : exit(false) {} virtual ~ThreadBase() {} virtual void idle_loop() = 0; void notify_one(); void wait_for(volatile const bool& b); std::thread nativeThread; std::mutex mutex; std::condition_variable sleepCondition; volatile bool exit; }; Thread struct keeps together all the thread related stuff like locks, state and especially split points. We also use per-thread pawn and material hash tables so that once we get a pointer to an entry its life time is unlimited and we don't have to care about someone changing the entry under our feet. struct Thread : public ThreadBase { Thread(); virtual void idle_loop(); bool cutoff_occurred() const; bool available_to(const Thread* master) const; template <bool Fake> void split(Position& pos, const Search::Stack* ss, Value alpha, Value beta, Value* bestValue, Move* bestMove, Depth depth, int moveCount, MovePicker* movePicker, int nodeType, bool cutNode); SplitPoint splitPoints[<API key>]; Material::Table materialTable; Endgames endgames; Pawns::Table pawnsTable; Position* activePosition; size_t idx; int maxPly; SplitPoint* volatile activeSplitPoint; volatile int splitPointsSize; volatile bool searching; }; MainThread and TimerThread are derived classes used to characterize the two special threads: the main one and the recurring timer. struct MainThread : public Thread { MainThread() : thinking(true) {} // Avoid a race with start_thinking() virtual void idle_loop(); volatile bool thinking; }; struct TimerThread : public ThreadBase { TimerThread() : run(false) {} virtual void idle_loop(); bool run; static const int Resolution = 5; // msec between two check_time() calls }; ThreadPool struct handles all the threads related stuff like init, starting, parking and, most importantly, launching a slave thread at a split point. All the access to shared thread data is done through this class. struct ThreadPool : public std::vector<Thread*> { void init(); // No c'tor and d'tor, threads rely on globals that should void exit(); // be initialized and are valid during the whole thread lifetime. MainThread* main() { return static_cast<MainThread*>((*this)[0]); } void read_uci_options(); Thread* available_slave(const Thread* master) const; void <API key>(); void start_thinking(const Position&, const Search::LimitsType&, Search::StateStackPtr&); Depth minimumSplitDepth; std::mutex mutex; std::condition_variable sleepCondition; TimerThread* timer; }; extern ThreadPool Threads; #endif // #ifndef THREAD_H_INCLUDED
<?php define('INTERNAL', 1); define('JSON', 1); if (isset($_POST['view'])) { define('PUBLIC', 1); } require(dirname(dirname(dirname(__FILE__))) . '/init.php'); safe_require('artefact', 'resume'); $limit = param_integer('limit', null); $offset = param_integer('offset', 0); $type = param_alpha('type'); $view = param_integer('view', 0); $data = array(); $count = 0; $othertable = 'artefact_resume_' . $type; $owner = $USER->get('id'); $sql = 'SELECT ar.*, a.owner FROM {artefact} a JOIN {' . $othertable . '} ar ON ar.artefact = a.id WHERE a.owner = ? AND a.artefacttype = ? ORDER BY ar.displayorder'; if (!empty($view)) { if (!can_view_view($view)) { throw new <API key>(); } require_once('view.php'); $v = new View($view); $owner = $v->get('owner'); } if (!$data = <API key>($sql, array($owner, $type))) { $data = array(); } $count = count_records('artefact', 'owner', $owner, 'artefacttype', $type); echo json_encode(array( 'data' => $data, 'limit' => $limit, 'offset' => $offset, 'count' => $count, 'type' => $type)); ?>
<?php $client = ClientData::getById($_GET["id"]); $client->del(); $_SESSION['message'] = L::<API key>; $_SESSION['alert_type'] = 'success'; Core::redir("./index.php?view=clients"); ?>
/** * @addtogroup OutputTranslator * @{ * @file OutputTranslator/Scala.hh * @author Massimiliano Pagani * @version 1.0 * @date 2016-10-18 * */ #if !defined( <API key> ) #define <API key> #include "OutputTranslator/Base.hh" #include "Tydal/Grammar/BaseType.hh" #include "Tydal/Grammar/VariantType.hh" namespace OutputTranslator { class Scala : public Base { private: virtual void translateRecord( std::string const& name, std::shared_ptr<Tydal::Grammar::RecordType const> recordType, std::ostream& out ) override; virtual void translateEnum( std::string const& name, std::shared_ptr<Tydal::Grammar::EnumType const> enumType, std::ostream& out ) override; virtual void translateString( std::string const& name, std::shared_ptr<Tydal::Grammar::StringType const> stringType, std::ostream& out ) override; virtual void translateSimpleType( std::string const& name, std::shared_ptr<Tydal::Grammar::SimpleType const> simpleType, std::ostream& out ) override; virtual void translateArray( std::string const& name, std::shared_ptr<Tydal::Grammar::ArrayType const> arrayType, std::ostream& out ) override; void <API key>( std::string const& name, std::shared_ptr<Tydal::Grammar::VariantType const> variant, std::shared_ptr<Tydal::Grammar::VariantCaseEntry const> branch, std::ostream& out ); void <API key>( std::string const& name, std::shared_ptr<Tydal::Grammar::RecordType const> recordType, std::ostream& out ); void translateFields( std::string const& name, std::shared_ptr<Tydal::Grammar::RecordType const> recordType, std::ostream& out ); void <API key>( std::string const& name, std::shared_ptr<Tydal::Grammar::RecordType const> recordType, std::ostream& out ); void <API key>( std::string const& name, std::shared_ptr<Tydal::Grammar::RecordType const> recordType, std::ostream& out ); void translateSubRecords( std::string const& name, std::shared_ptr<Tydal::Grammar::RecordType const> recordType, std::ostream& out ); void printField( std::ostream& out, Tydal::Grammar::RecordType::ConstIterator::value_type const& field ); void tydalTypeToScala( std::shared_ptr<Tydal::Grammar::BaseType const> type, std::string const& fieldName, std::ostream& out ); void <API key>( std::string const& recordName ); void <API key>(); std::vector<std::string> const& <API key>() const; std::string getRecordNames() const; std::vector<std::string> <API key>; }; } // end of namespace OutputTranslator #endif @}
{% load wagtailcore_tags wagtailimages_tags jetstream_tags %} <div class="row-wrapper {{ self.style }} {% if self.background.background_color or self.background.background_image %} bg {% endif %} {% if self.background.background_color and not self.background.background_image %} bg-color-{{ self.background.background_color }}{% endif %} " {% if self.background.background_image %} {% image self.background.background_image original as img_data %} style="background-image: url('{{ img_data.url }}');" {% endif %} > <div class="row gutter-{{ self.gutter_width }}px"> {% <API key> self.column_one_width self.column_two_width self.column_three_width as fill_width %} <div class="four-col-item grid-item col-md-{{ self.column_one_width }} col-sm-{{ self.column_one_width }}"> {% for block in self.column_one %} {% if block.block_type == 'heading' %} <h1>{{ block.value }}</h1> {% else %} <section class="block-{{ block.block_type }}"> {% if parent_width %} {% <API key> parent_width self.column_one_width self.gutter_width as my_width %} {% include_block block with parent_width=my_width parent_height=self.fixed_height parent_gutter_width=self.gutter_width %} {% else %} {% <API key> 1000 self.column_one_width self.gutter_width as my_width %} {% include_block block with parent_width=my_width parent_height=self.fixed_height parent_gutter_width=self.gutter_width %} {% endif %} </section> {% endif %} {% endfor %} </div> <div class="four-col-item grid-item col-md-{{ self.column_two_width }} col-sm-{{ self.column_two_width }}"> {% for block in self.column_two %} {% if block.block_type == 'heading' %} <h1>{{ block.value }}</h1> {% else %} <section class="block-{{ block.block_type }}"> {% if parent_width %} {% <API key> parent_width self.column_two_width self.gutter_width as my_width %} {% include_block block with parent_width=my_width parent_height=self.fixed_height parent_gutter_width=self.gutter_width %} {% else %} {% <API key> 1000 self.column_two_width self.gutter_width as my_width %} {% include_block block with parent_width=my_width parent_height=self.fixed_height parent_gutter_width=self.gutter_width %} {% endif %} </section> {% endif %} {% endfor %} </div> <div class="four-col-item grid-item col-md-{{ self.column_three_width }} col-sm-{{ self.column_three_width }}"> {% for block in self.column_three %} {% if block.block_type == 'heading' %} <h1>{{ block.value }}</h1> {% else %} <section class="block-{{ block.block_type }}"> {% if parent_width %} {% <API key> parent_width self.column_three_width self.gutter_width as my_width %} {% include_block block with parent_width=my_width parent_height=self.fixed_height parent_gutter_width=self.gutter_width %} {% else %} {% <API key> 1000 self.column_three_width self.gutter_width as my_width %} {% include_block block with parent_width=my_width parent_height=self.fixed_height parent_gutter_width=self.gutter_width %} {% endif %} </section> {% endif %} {% endfor %} </div> <div class="four-col-item grid-item col-md-{{ fill_width }} col-sm-{{ fill_width }}"> {% for block in self.column_four %} {% if block.block_type == 'heading' %} <h1>{{ block.value }}</h1> {% else %} <section class="block-{{ block.block_type }}"> {% if parent_width %} {% <API key> parent_width fill_width self.gutter_width as my_width %} {% include_block block with parent_width=my_width parent_height=self.fixed_height parent_gutter_width=self.gutter_width %} {% else %} {% <API key> 1000 fill_width self.gutter_width as my_width %} {% include_block block with parent_width=my_width parent_height=self.fixed_height parent_gutter_width=self.gutter_width %} {% endif %} </section> {% endif %} {% endfor %} </div> </div> </div>
/* ptinit.c - ptinit */ #include <xinu.h> struct ptnode *ptfree; /* list of free message nodes */ struct ptentry porttab[NPORTS]; /* port table */ int32 ptnextid; /* next table entry to try */ syscall ptinit( int32 maxmsgs /* total messages in all ports */ ) { int32 i; /* runs through port table */ struct ptnode *next, *prev; /* used to build free list */ ptfree = (struct ptnode *)getmem(maxmsgs*sizeof(struct ptnode)); if (ptfree == (struct ptnode *)SYSERR) { panic("pinit - insufficient memory"); } /* Initialize all port table entries to free */ for (i=0 ; i<NPORTS ; i++) { porttab[i].ptstate = PT_FREE; porttab[i].ptseq = 0; } ptnextid = 0; /* Create free list of message pointer nodes */ for ( prev=next=ptfree ; --maxmsgs > 0 ; prev=next ) prev->ptnext = ++next; prev->ptnext = NULL; return(OK); }
'use strict'; angular.module('aurea') .directive('d3Bars', function ($window, $timeout, d3Service) { return { restrict: 'EA', scope: { data: '=', onClick: '&' }, link: function (scope, ele, attrs) { d3Service.d3().then(function (d3) { var margin = parseInt(attrs.margin) || 20, barHeight = parseInt(attrs.barHeight) || 20, barPadding = parseInt(attrs.barPadding) || 5; var svg = d3.select(ele[0]) .append('svg') .style('width', '100%'); // Browser onresize event window.onresize = function () { scope.$apply(); }; // Watch for resize event scope.$watch(function () { return angular.element($window)[0].innerWidth; }, function () { scope.render(scope.data); }); scope.$watch('data', function (newData) { scope.render(newData); }, true); scope.render = function (data) { // remove all previous items before render svg.selectAll('*').remove(); // If we don't pass any data, return out of the element if (!data) return; // setup variables var width = d3.select(ele[0]).node().offsetWidth - margin, // calculate the height height = scope.data.length * (barHeight + barPadding), // Use the category20() scale function for multicolor support color = d3.scale.category20(), // our xScale xScale = d3.scale.linear() .domain([0, 31]) .range([0, width]); // set the height based on the calculations above svg.attr('height', height); //create the rectangles for the bar chart svg.selectAll('rect') .data(data).enter() .append('rect') .attr('height', barHeight) .attr('width', 140) .attr('x', 110) .attr('y', function (d, i) { return i * (barHeight + barPadding); }) .attr('fill', function (d) { return color(d.value); }) .attr('width', function (d) { return xScale(d.value); }); var baseSelection = svg.selectAll('text'); baseSelection .data(data) .enter() .append('text') .attr('font-family', 'monospace') .attr('fill', '#000') .attr('y', function (d, i) { return i * (barHeight + barPadding) + 15; }) .attr('x', 15) .text(function (d) { return d.name; }); baseSelection .data(data) .enter() .append('text') .attr('font-family', 'monospace') .attr('fill', '#fff') .attr('y', function (d, i) { return i * (barHeight + barPadding) + 15; }) .attr('x', 114) .text(function (d) { return d.value > 0 ? d.value : ''; }); }; }); } }; });
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_17) on Thu Oct 24 15:10:37 CEST 2013 --> <title>UdpListener</title> <meta name="date" content="2013-10-24"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><! if (location.href.indexOf('is-external=true') == -1) { parent.document.title="UdpListener"; } </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <div class="topNav"><a name="navbar_top"> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/UdpListener.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/veraxsystems/vxipmi/transport/Messenger.html" title="interface in com.veraxsystems.vxipmi.transport"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../com/veraxsystems/vxipmi/transport/UdpMessage.html" title="class in com.veraxsystems.vxipmi.transport"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/veraxsystems/vxipmi/transport/UdpListener.html" target="_top">Frames</a></li> <li><a href="UdpListener.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_top"> </a></div> <div class="header"> <div class="subTitle">com.veraxsystems.vxipmi.transport</div> <h2 title="Interface UdpListener" class="title">Interface UdpListener</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Known Implementing Classes:</dt> <dd><a href="../../../../com/veraxsystems/vxipmi/sm/StateMachine.html" title="class in com.veraxsystems.vxipmi.sm">StateMachine</a></dd> </dl> <hr> <br> <pre>public interface <span class="strong">UdpListener</span></pre> <div class="block">An interface for <a href="../../../../com/veraxsystems/vxipmi/transport/UdpMessenger.html" title="class in com.veraxsystems.vxipmi.transport"><code>UdpMessenger</code></a> listener.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="method_summary"> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><strong><a href="../../../../com/veraxsystems/vxipmi/transport/UdpListener.html#notifyMessage(com.veraxsystems.vxipmi.transport.UdpMessage)">notifyMessage</a></strong>(<a href="../../../../com/veraxsystems/vxipmi/transport/UdpMessage.html" title="class in com.veraxsystems.vxipmi.transport">UdpMessage</a>&nbsp;message)</code> <div class="block">Notifies listener of the UDP message that was received.</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="method_detail"> </a> <h3>Method Detail</h3> <a name="notifyMessage(com.veraxsystems.vxipmi.transport.UdpMessage)"> </a> <ul class="blockListLast"> <li class="blockList"> <h4>notifyMessage</h4> <pre>void&nbsp;notifyMessage(<a href="../../../../com/veraxsystems/vxipmi/transport/UdpMessage.html" title="class in com.veraxsystems.vxipmi.transport">UdpMessage</a>&nbsp;message)</pre> <div class="block">Notifies listener of the UDP message that was received.</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>message</code> - - message received</dd></dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div class="bottomNav"><a name="navbar_bottom"> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="<API key>"> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/UdpListener.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-files/index-1.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../com/veraxsystems/vxipmi/transport/Messenger.html" title="interface in com.veraxsystems.vxipmi.transport"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../com/veraxsystems/vxipmi/transport/UdpMessage.html" title="class in com.veraxsystems.vxipmi.transport"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?com/veraxsystems/vxipmi/transport/UdpListener.html" target="_top">Frames</a></li> <li><a href="UdpListener.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="<API key>"> <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><! allClassesLink = document.getElementById("<API key>"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method_detail">Method</a></li> </ul> </div> <a name="skip-navbar_bottom"> </a></div> </body> </html>
package com.softech.ls360.lms.api.proxy.service; import com.softech.vu360.lms.webservice.message.lmsapi.serviceoperations.user.AddUserResponse; import com.softech.vu360.lms.webservice.message.lmsapi.serviceoperations.user.UpdateUserResponse; import com.softech.vu360.lms.webservice.message.lmsapi.types.user.UpdateableUser; import com.softech.vu360.lms.webservice.message.lmsapi.types.user.User; public interface LmsApiUserService { AddUserResponse createUser(User user, Long customerId, String customerCode, String apiKey) throws Exception; UpdateUserResponse updateUser(UpdateableUser updateableUser, Long customerId, String customerCode, String apiKey) throws Exception; }
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is machine-generated by lib/unicore/mktables from the Unicode # database, Version 5.2.0. Any changes made here will be lost! # !!!!!!! INTERNAL PERL USE ONLY !!!!!!! # This file is for internal use by the Perl program only. The format and even # the name or existence of this file are subject to change without notice. # Don't use it directly. # This file returns the single code point in Unicode Version 5.2.0 that # matches any of the following regular expression constructs: # \p{<API key>=21} # \p{Ccc=21} # \p{<API key>=21} # \p{Is_Ccc=21} # perluniprops.pod should be consulted for the syntax rules for any of these, # including if adding or subtracting white space, underscore, and hyphen # characters matters or doesn't matter, and other permissible syntactic # variants. Upper/lower case distinctions never matter. # A colon can be substituted for the equals sign, and anything to the left of # the equals (or colon) can be combined with anything to the right. Thus, # for example, # \p{Is_Ccc: 21} # is also valid. # The format of the lines of this file is: START\tSTOP\twhere START is the # starting code point of the range, in hex; STOP is the ending point, or if # omitted, the range has just one code point. Numbers in comments in # [brackets] indicate how many code points are in the range. return <<'END'; 05BC END
define(['Scripts/App/CommentsScraper'], function(CommentsScraper) { describe('myFilter', function() { var failTest = function(error) { expect(error).toBeUndefined(); }; beforeEach(function(){ jasmine.addMatchers({ toBeEqualComment: function() { return { compare: function (actual, expected) { return { pass: actual.author === expected.author && actual.commentType === expected.commentType && actual.link === expected.link && actual.x === expected.x && actual.y === expected.y }; } }; } }); jasmine.getFixtures().fixturesPath = 'base/Tests/Fixtures/'; loadFixtures('sampleComments.html'); }); it('should give correct comment object when given correct comment html', function () { var expected = { author: 'Vaniver', commentType: 'Parent', link: 'http://lesswrong.com/lw/n93/<API key>/d2us', x: 1454336014000, y: 2 }; //var employee = CommentsScraper.getCommentObj($('.comment')[0].outerHTML); //expect(employee.author).toBeEqualComment('ScottL'); }); // Our first test!!!! it('about greeting says "This is the about message2!"', function () { //console.log(CommentsScraper); //CommentsScraper.getCommentData($('.comment')[0].outerHTML).then(function(data) { // console.log(data); }); }); });
<!-- <div class="jumbotron"> <h1>Welcome!</h1> <?php echo $content->getHtml(); ?> </div> <div class="row" style="padding: 15px;"> <?php $bgcolors = array('blue','green','orange','grey'); $i=0; foreach($content->children as $child){ $mod = $i % count($bgcolors); $color = $bgcolors[$mod]; echo '<div class="col-md-4 tile '.$color.'">'; echo '<a href="'.$child->getUrl().'">'.$child->title.'</a>'; echo '<p>'.$child->shortText.'</p>'; echo '</div>'; $i++; } ?> </div>
package cz.cuni.lf1.lge.ThunderSTORM.estimators; import cz.cuni.lf1.lge.ThunderSTORM.detectors.<API key>; import cz.cuni.lf1.lge.ThunderSTORM.estimators.PSF.EllipticGaussianPSF; import cz.cuni.lf1.lge.ThunderSTORM.estimators.PSF.<API key>; import cz.cuni.lf1.lge.ThunderSTORM.estimators.PSF.Molecule; import cz.cuni.lf1.lge.ThunderSTORM.estimators.PSF.<API key>; import cz.cuni.lf1.lge.ThunderSTORM.filters.<API key>; import cz.cuni.lf1.lge.ThunderSTORM.FormulaParser.<API key>; import cz.cuni.lf1.lge.ThunderSTORM.estimators.PSF.<API key>; import cz.cuni.lf1.lge.ThunderSTORM.estimators.PSF.PSFModel.Params; import cz.cuni.lf1.lge.ThunderSTORM.util.CSV; import static cz.cuni.lf1.lge.ThunderSTORM.util.MathProxy.sqr; import cz.cuni.lf1.lge.ThunderSTORM.util.Point; import ij.IJ; import ij.process.FloatProcessor; import java.util.List; import java.util.Vector; import org.junit.Test; import static org.junit.Assert.*; public class EstimatorsTest { @Test public void testRadialSymmetry() { testEstimator(new <API key>(5, new <API key>())); } @Test public void testLSQSym() { testEstimator(new <API key>(5, new LSQFitter(new <API key>(1), false, Params.BACKGROUND))); testEstimator(new <API key>(5, new LSQFitter(new <API key>(1), true, Params.BACKGROUND))); } @Test public void testLSQIntSym() { testEstimator(new <API key>(5, new LSQFitter(new <API key>(1), false, Params.BACKGROUND))); testEstimator(new <API key>(5, new LSQFitter(new <API key>(1), true, Params.BACKGROUND))); } @Test public void testMLEIntSym() { testEstimator(new <API key>(5, new MLEFitter(new <API key>(1), Params.BACKGROUND))); } @Test public void testMLESym() { testEstimator(new <API key>(5, new MLEFitter(new <API key>(1), Params.BACKGROUND))); } @Test public void <API key>() { testEstimator(new <API key>(5, new LSQFitter(new <API key>(1, 0), false, Params.BACKGROUND))); testEstimator(new <API key>(5, new LSQFitter(new <API key>(1, 0), true, Params.BACKGROUND))); } @Test public void <API key>() { testEstimator(new <API key>(5, new MLEFitter(new <API key>(1, 0), Params.BACKGROUND))); } @Test public void testLSQElliptic() { testEstimator(new <API key>(5, new LSQFitter(new EllipticGaussianPSF(1, 45), false, Params.BACKGROUND))); testEstimator(new <API key>(5, new LSQFitter(new EllipticGaussianPSF(1, 45), true, Params.BACKGROUND))); } @Test public void testMLEElliptic() { testEstimator(new <API key>(5, new MLEFitter(new EllipticGaussianPSF(1, 45), Params.BACKGROUND))); } private void testEstimator(IEstimator estimator) throws <API key> { String basePath = this.getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); FloatProcessor image = (FloatProcessor) IJ.openImage(basePath + "tubulins1_00020.tif").getProcessor().convertToFloat(); FloatProcessor filtered = (new <API key>()).filterImage(image); Vector<Point> detections = (new <API key>("16", true)).<API key>(filtered); List<Molecule> fits = estimator.estimateParameters(image, detections); for(Molecule fit : fits) { <API key>(fit, 150.0); } Vector<Molecule> ground_truth = null; try { ground_truth = CSV.csv2psf(basePath + "tubulins1_00020.csv", 1, 2); } catch(Exception ex) { fail(ex.getMessage()); } Vector<Pair> pairs = <API key>(detections, fits, ground_truth); for(Pair pair : pairs) { assertFalse("Result from the estimator should be better than guess from the detector.", dist2(pair.fit, pair.ground_truth) > dist2(pair.detection, pair.ground_truth)); } // Note: better test would be to compare these results to the results from Matlab...but I don't have them at the moment } static void <API key>(Molecule fit, double px2nm) { fit.setX(fit.getX() * px2nm); fit.setY(fit.getY() * px2nm); } static class Pair { Point detection; Molecule fit; Molecule ground_truth; public Pair(Point detection, Molecule fit, Molecule ground_truth) { this.detection = detection; this.fit = fit; this.ground_truth = ground_truth; } } static Vector<Pair> <API key>(Vector<Point> detections, List<Molecule> fits, Vector<Molecule> ground_truth) { assertNotNull(fits); assertNotNull(detections); assertNotNull(ground_truth); assertFalse(fits.isEmpty()); assertFalse(detections.isEmpty()); assertFalse(ground_truth.isEmpty()); assertEquals("Number of detections should be the same as number of fits!", detections.size(), fits.size()); Vector<Pair> pairs = new Vector<Pair>(); int best_fit; double best_dist2, dist2; for(int i = 0, im = fits.size(); i < im; i++) { best_fit = 0; best_dist2 = dist2(fits.get(i), ground_truth.elementAt(best_fit)); for(int j = 1, jm = ground_truth.size(); j < jm; j++) { dist2 = dist2(fits.get(i), ground_truth.elementAt(j)); if(dist2 < best_dist2) { best_dist2 = dist2; best_fit = j; } } pairs.add(new Pair(detections.elementAt(i), fits.get(i), ground_truth.elementAt(best_fit))); } return pairs; } static double dist2(Point detection, Molecule ground_truth) { return sqr(detection.x.doubleValue() - ground_truth.getX()) + sqr(detection.y.doubleValue() - ground_truth.getY()); } static double dist2(Molecule fit, Molecule ground_truth) { return sqr(fit.getX() - ground_truth.getY()) + sqr(fit.getX() - ground_truth.getY()); } }
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import requests import xml.dom.minidom import sys import signal import os import getopt from queue import Queue from threading import Thread import time class SetQueue(Queue): def _init(self, maxsize): Queue._init(self, maxsize) self.all_items = set() def _put(self, item): if item not in self.all_items: Queue._put(self, item) self.all_items.add(item) def signal_handler(signal, frame): print('You pressed Ctrl+C!') sys.exit(0) def usage(): """usage de la ligne de commande""" print ("usage : " + sys.argv[0] + "-h --help -s --server someurl.com -u --user login -p --password password") def getAtomFeed(url, login, pwd): # var MAX_TRY = 10 essai = 0 # get atom document while essai < MAX_TRY: try: r = requests.get('http://' + url, auth=(login,pwd), timeout=10) except: essai += 1 continue break else: raise ('Erreur lors de la requête') # parse atom document try: dom = xml.dom.minidom.parseString(r.text) except: raise ('Erreur lors du parsing du document Atom') return dom def getManagerInfo(atomFeed): try: entries = atomFeed.<API key>('entry')[1] except: return None try: managerId = entries.<API key>('snx:userid')[0] return managerId.firstChild.data except: return None def buildUrlSearchList(server, login, pwd, q): # var alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'] #alphabet = ['a'] for i in alphabet: url = server + '/profiles/atom/search.do?search=' + i + '*&ps=250' dom = getAtomFeed(url, login, pwd) totalResult = dom.<API key>('opensearch:totalResults')[0] totalResult = int(totalResult.firstChild.data) if totalResult > 250: nbPage = int(float(totalResult) / 250) + 1 for n in range(1,nbPage,1): item = url + "&page=" + str(n) q.put(item) else: nbPage = 1 q.put(url) def getUserIdsWorker(login, pwd, qin, qout): while True: url = qin.get() if url == None: break qin.task_done() try: dom = getAtomFeed(url, login, pwd) except: continue userIds = dom.<API key>('snx:userid') for index, item, in enumerate(userIds): qout.put(item.firstChild.data) def getRelationsWorker(server, login, pwd, qin, qout, getManager, qmgmt): while True: userid = qin.get() if userid == None: break qin.task_done() url = server + '/profiles/atom/connections.do?userid=' + userid + '&connectionType=colleague&ps=250' try: dom = getAtomFeed(url, login, pwd) except: continue feed = dom.firstChild entries = feed.<API key>('entry') for entry in entries: # get date dateRelation = entry.<API key>('updated')[0] dateRelation = dateRelation.firstChild.data dateRelation = dateRelation[:10] # get author user id author = entry.<API key>('author')[0] try: authorName = author.<API key>('name')[0] authorName = authorName.firstChild.data except: authorName = "" try: authorEMail = author.<API key>('email')[0] authorEMail = authorEMail.firstChild.data except: authorEMail = "" authorUserId = author.<API key>('snx:userid')[0] authorUserId = authorUserId.firstChild.data # get contributor user id contributor = entry.<API key>('contributor')[0] try: contribName = contributor.<API key>('name')[0] contribName = contribName.firstChild.data except: contribName = "" try: contribEMail = contributor.<API key>('email')[0] contribEMail = contribEMail.firstChild.data except: contribEMail = "" contribUserId = contributor.<API key>('snx:userid')[0] contribUserId = contribUserId.firstChild.data # build dict authorInfo = { "userid" : authorUserId, "name" : authorName, "email" : authorEMail } contribInfo = { "userid" : contribUserId, "name" : contribName, "email" : contribEMail } relation = "\"" + authorUserId + "\",\"" + contribUserId + "\",\"<(" + str(dateRelation) + ",Infinity)>\"" qout.put(authorInfo) qout.put(contribInfo) qout.put(relation) # get manager if getManager == True: url = server + "/profiles/atom/reportingChain.do?userid=" + userid rc = getAtomFeed(url, login, pwd) managerId = getManagerInfo(rc) if managerId is not None: reportingChain = str(userid) + "," + str(managerId) qmgmt.put(reportingChain) def printStatusThread(q0, q1, q2, q3): strtime = time.time() while True: sys.stdout.write('\r\x1b[K') sys.stdout.write("urls:" + str(q0.qsize()) + " | ") sys.stdout.write("userids:" + str(q1.qsize()) + " | ") sys.stdout.write("user infos:" + str(q2.qsize()) + " | ") sys.stdout.write("manager infos:" + str(q3.qsize())) sys.stdout.flush() time.sleep(1) def writeFileThread(usersFilename, relationsFilename, qin): # file for user details u = open(usersFilename + ".csv", "w") u.write("Id,Label,eMail\n") # file for relations r = open(relationsFilename + ".csv", "w") r.write("Source,Target,Time Interval\n") doneUsers = [] while True: data = qin.get() if data == None: u.flush() r.flush() u.close() r.close() break # write data if type(data) is dict: string = str(data["userid"]) + ',' + str(data["name"]) + ',' + str(data["email"]) if string not in doneUsers: u.write(string + "\n") doneUsers.append(string) elif type(data) is str: r.write(str(data) + "\n") qin.task_done() def <API key>(managerFilename, qin): m = open(managerFilename + ".csv", "w") m.write("Source,Target\n") while True: data = qin.get() if data == None: break m.write(str(data) + "\n") qin.task_done() def main(argv): # global serverUrl = "" login = "" pwd = "" getManager = False urlQueue = SetQueue(maxsize=5000) userIdsQueue = SetQueue(maxsize=5000) userInfosQueue = Queue(maxsize=5000) userManagerQueue = Queue(maxsize=5000) # signal handler signal.signal(signal.SIGINT, signal_handler) # retrive arguments try: opts, args = getopt.getopt(argv, "hs:u:p:m", ["help", "server=", "user=", "password=", "manager"]) for opt, arg in opts: if opt in ("-h", "--help"): usage() sys.exit() elif opt in ("-s", "--server"): serverUrl = arg elif opt in ("-u", "--user"): login = arg elif opt in ("-p", "--password"): pwd = arg elif opt in ("-m", "--manager"): getManager = True except: usage() sys.exit() # threading get userinfo worker userIdWorker = [] for i in range(10): w1 = Thread(target=getUserIdsWorker, args=(login, pwd, urlQueue, userIdsQueue,)) w1.setDaemon(True) w1.start() userIdWorker.append(w1) # threading get relations worker userInfoWorker = [] for i in range(20): w2 = Thread(target=getRelationsWorker, args=(serverUrl, login, pwd, userIdsQueue, userInfosQueue, getManager, userManagerQueue,)) w2.setDaemon(True) w2.start() userInfoWorker.append(w2) # thread to print size of queue w3 = Thread(target=printStatusThread, args=(urlQueue, userIdsQueue, userInfosQueue, userManagerQueue,)) w3.setDaemon(True) w3.start() # thread to write files w4 = Thread(target=writeFileThread, args=("users", "relations", userInfosQueue,)) w4.setDaemon(True) w4.start() if getManager == True: w5 = Thread(target=<API key>, args=("manager", userManagerQueue,)) w5.setDaemon(True) w5.start() # build Queue url list MAX_TRY = 10 essai = 0 while essai < MAX_TRY: try: buildUrlSearchList(serverUrl, login, pwd, urlQueue) except KeyboardInterrupt: break except: essai += 1 continue break while not (urlQueue.empty() and userIdsQueue.empty() and userInfosQueue.empty()): pass print ("end threads") urlQueue.put(None) userIdsQueue.put(None) userInfosQueue.put(None) # end of workers for i in userIdWorker: i.join() for i in userInfoWorker: i.join() time.sleep(5) sys.exit(0) if __name__ == '__main__': main(sys.argv[1:])
package org.renjin.invoke.codegen; import com.google.common.collect.Lists; import com.sun.codemodel.*; import org.apache.commons.math.complex.Complex; import org.renjin.invoke.annotations.<API key>; import org.renjin.invoke.model.JvmMethod; import org.renjin.invoke.model.PrimitiveModel; import org.renjin.primitives.vector.DeferredComputation; import org.renjin.sexp.*; import java.util.List; import static com.sun.codemodel.JExpr.lit; public class <API key> { public static final int LENGTH_THRESHOLD = 100; private final JExpression contextArgument; private JCodeModel codeModel; private PrimitiveModel primitive; private JvmMethod overload; private int arity; private JDefinedClass vectorClass; private VectorType type; private List<DeferredArgument> arguments = Lists.newArrayList(); private JFieldVar lengthField; public <API key>(JCodeModel codeModel, JExpression contextArgument, PrimitiveModel primitive, JvmMethod overload) { this.codeModel = codeModel; this.primitive = primitive; this.overload = overload; this.arity = overload.<API key>().size(); this.contextArgument = contextArgument; if(overload.getReturnType().equals(double.class)) { type = VectorType.DOUBLE; } else if(overload.getReturnType().equals(boolean.class)) { type = VectorType.LOGICAL; } else if(overload.getReturnType().equals(Logical.class)) { type = VectorType.LOGICAL; } else if(overload.getReturnType().equals(int.class)) { type = VectorType.INTEGER; } else if(overload.getReturnType().equals(Complex.class)) { type = VectorType.COMPLEX; } else if(overload.getReturnType().equals(byte.class)) { type = VectorType.RAW; } else { throw new <API key>(overload.getReturnType().toString()); } } public void buildClass() { try { vectorClass = codeModel._class( WrapperGenerator2.toFullJavaName(primitive.getName()) + "$deferred_" + typeSuffix() ); } catch (<API key> e) { throw new RuntimeException(e); } vectorClass._extends(type.baseClass); vectorClass._implements(DeferredComputation.class); for(int i=0;i!=arity;++i) { arguments.add(new DeferredArgument(overload.<API key>().get(i), i)); } this.lengthField = vectorClass.field(JMod.PRIVATE, codeModel._ref(int.class), "length"); writeConstructor(); implementAccessor(); implementLength(); <API key>(); <API key>(); <API key>(); <API key>(); <API key>(); <API key>(); if(overload.isPassNA() && overload.getReturnType().equals(boolean.class)) { <API key>(); } } private void <API key>() { JMethod method = vectorClass.method(JMod.PUBLIC, boolean.class, "<API key>"); JExpression condition = null; for(DeferredArgument arg : arguments) { JExpression operandIsConstant = arg.valueField.invoke("<API key>"); if(condition == null) { condition = operandIsConstant; } else { condition = condition.cand(operandIsConstant); } } method.body()._return(condition); } private void <API key>() { JMethod method = vectorClass.method(JMod.PUBLIC, int.class, "getComputationDepth"); JVar depth = method.body().decl(codeModel._ref(int.class), "depth", arguments.get(0).valueField.invoke("getComputationDepth")); for(int i=1;i<arguments.size();++i) { method.body().assign(depth, codeModel.ref(Math.class).staticInvoke("max") .arg(depth) .arg(arguments.get(1).valueField.invoke("getComputationDepth"))); } method.body()._return(depth.plus(JExpr.lit(1))); } private void <API key>() { JMethod method = vectorClass.method(JMod.PUBLIC, Vector[].class, "getOperands"); JArray array = JExpr.newArray(codeModel.ref(Vector.class)); for(DeferredArgument arg : arguments) { array.add(arg.valueField); } method.body()._return(array); } private void <API key>() { JMethod method = vectorClass.method(JMod.PUBLIC, String.class, "getComputationName"); method.body()._return(lit(primitive.getName())); } private String typeSuffix() { StringBuilder suffix = new StringBuilder(); for(JvmMethod.Argument formal : overload.<API key>()) { suffix.append(abbrev(formal.getClazz())); } return suffix.toString(); } private String abbrev(Class clazz) { if(clazz.equals(double.class)) { return "d"; } else if(clazz.equals(boolean.class)) { return "b"; } else if(clazz.equals(String.class)) { return "s"; } else if(clazz.equals(int.class)) { return "i"; } else if(clazz.equals(Complex.class)) { return "z"; } else if(clazz.equals(byte.class)) { return "r"; } else { throw new <API key>(clazz.toString()); } } public void maybeReturn(JBlock parent, JExpression cycleCount, List<JExpression> arguments) { JExpression condition = cycleCount.gt(lit(LENGTH_THRESHOLD)); for(JExpression arg : arguments) { condition = condition.cor(arg._instanceof(codeModel.ref(DeferredComputation.class))); } JBlock ifBig = parent._if(condition)._then(); JExpression attributes = copyAttributes(arguments); JInvocation newInvocation = JExpr._new(vectorClass); for(JExpression arg : arguments) { newInvocation.arg(arg); } newInvocation.arg(attributes); ifBig._return(contextArgument.invoke("simplify").arg(newInvocation)); } private JExpression copyAttributes(List<JExpression> arguments) { if(overload.<API key>() == <API key>.NONE) { return codeModel.ref(AttributeMap.class).staticRef("EMPTY"); } else { if(arity == 1) { return copyAttributes(arguments.get(0)); } else if(arity == 2) { return copyAttributes(arguments.get(0), arguments.get(1)); } else { throw new <API key>("arity = " + arity); } } } private JExpression copyAttributes(JExpression arg0, JExpression arg1) { String combineMethod; switch(overload.<API key>()) { case ALL: combineMethod = "combineAttributes"; break; case SPECIAL: combineMethod = "<API key>"; break; default: throw new <API key>(); } return codeModel.ref(AttributeMap.class).staticInvoke(combineMethod) .arg(arg0) .arg(arg1); } private JExpression copyAttributes(JExpression arg) { if(overload.<API key>() == <API key>.ALL) { return arg.invoke("getAttributes"); } else if(overload.<API key>() == <API key>.SPECIAL) { return arg.invoke("getAttributes").invoke("copyStructural"); } else { throw new <API key>(); } } private void writeConstructor() { // public <API key>(Vector arg0, Vector arg1, AttributeMap attributes) { // super(attributes); // this.x = x; // this.y = y; // this.fn = fn; // this.xLength = x.length(); // this.yLength = y.length(); // this.length = Math.max(xLength, yLength); JMethod ctor = vectorClass.constructor(JMod.PUBLIC); List<JVar> argParams = Lists.newArrayList(); for(int i=0;i!=arity;++i) { argParams.add(ctor.param(Vector.class, "arg" + i)); } ctor.param(AttributeMap.class, "attributes"); ctor.body().directStatement("super(attributes);"); ctor.body().assign(lengthField, lit(0)); for(int i=0;i!=arity;++i) { ctor.body().assign(JExpr._this().ref(arg(i).valueField), argParams.get(i)); ctor.body().assign(arg(i).lengthField, arg(i).valueField.invoke("length")); } if(arity == 1) { ctor.body().assign(lengthField, arg(0).lengthField); } else if(arity == 2) { ctor.body().assign(lengthField, codeModel.ref(Math.class).staticInvoke("max") .arg(arg(0).lengthField) .arg(arg(1).lengthField)); } } private DeferredArgument arg(int i) { return arguments.get(i); } private void implementLength() { JMethod method = vectorClass.method(JMod.PUBLIC, int.class, "length"); method.body()._return(lengthField); } private void <API key>() { JMethod method = vectorClass.method(JMod.PUBLIC | JMod.STATIC, type.accessorType, "compute"); List<JExpression> params = Lists.newArrayList(); for(DeferredArgument argument : arguments) { JVar param = method.param(argument.accessorType(), "p" + argument.index); params.add(argument.convert(param)); } returnValue(method.body(), buildInvocation(params)); } private void implementAccessor() { JMethod method = vectorClass.method(JMod.PUBLIC, type.accessorType, type.accessorName); JVar index = method.param(int.class, "index"); // extract the arguments to the function from the given vectors List<JExpression> argValues = Lists.newArrayList(); for(DeferredArgument arg : arguments) { JExpression elementIndex; if(arity == 1) { elementIndex = index; } else { // avoid using modulus if we can JVar indexVar = method.body().decl(codeModel._ref(int.class), "i" + arg.index); JConditional ifLessThan = method.body()._if(index.lt(arg.lengthField)); ifLessThan._then().assign(indexVar, index); ifLessThan._else().assign(indexVar, index.mod(arg.lengthField)); elementIndex = indexVar; } JVar argValue = method.body().decl(arg.accessorType(), "arg" + arg.index + "_i", arg.invokeAccessor(elementIndex)); argValues.add(arg.convert(argValue)); if(!overload.isPassNA() && arg.type != ArgumentType.BYTE) { method.body()._if(arg.isNA(argValue))._then()._return(na()); } } // invoke the underlying function returnValue(method.body(), buildInvocation(argValues)); } private JInvocation buildInvocation(List<JExpression> argValues) { JInvocation invocation = codeModel .ref(overload.getDeclaringClass()) .staticInvoke(overload.getName()); for(JExpression argValue : argValues) { invocation.arg(argValue); } return invocation; } private JExpression na() { switch (type) { case DOUBLE: return codeModel.ref(DoubleVector.class).staticRef("NA"); case LOGICAL: case INTEGER: return codeModel.ref(IntVector.class).staticRef("NA"); case COMPLEX: return codeModel.ref(ComplexArrayVector.class).staticRef("NA"); } throw new <API key>(type.toString()); } private void returnValue(JBlock parent, JExpression retVal) { if(overload.getReturnType().equals(boolean.class)) { JConditional ifTrue = parent._if(retVal); ifTrue._then()._return(lit(1)); ifTrue._else()._return(lit(0)); } else if(overload.getReturnType().equals(Logical.class)) { parent._return(retVal.invoke("getInternalValue")); } else { parent._return(retVal); } } public void <API key>() { JMethod method = vectorClass.method(JMod.PUBLIC, boolean.class, "isElementNA"); method.param(int.class, "index"); method.body()._return(JExpr.FALSE); } private void <API key>() { // @Override // protected SEXP <API key>(AttributeMap attributes) { // return new <API key>(fn, x, y, attributes); JMethod method = vectorClass.method(JMod.PUBLIC, SEXP.class, "<API key>"); JVar attributes = method.param(AttributeMap.class, "attributes"); JInvocation newInvocation = JExpr._new(vectorClass); for(DeferredArgument arg : arguments) { newInvocation.arg(arg.valueField); } newInvocation.arg(attributes); method.body()._return(newInvocation); } private class DeferredArgument { private JvmMethod.Argument model; private int index; private JFieldVar valueField; private JFieldVar lengthField; private ArgumentType type; private DeferredArgument(JvmMethod.Argument model, int index) { this.model = model; this.index = index; this.valueField = vectorClass.field(JMod.PRIVATE | JMod.FINAL, Vector.class, "arg" + index); this.lengthField = vectorClass.field(JMod.PRIVATE | JMod.FINAL, int.class, "argLength" + index); if(model.getClazz().equals(double.class)) { this.type = ArgumentType.DOUBLE; } else if(model.getClazz().equals(boolean.class)) { this.type = ArgumentType.BOOLEAN; } else if(model.getClazz().equals(int.class)) { this.type = ArgumentType.INTEGER; } else if(model.getClazz().equals(String.class)) { this.type = ArgumentType.STRING; } else if(model.getClazz().equals(Complex.class)) { this.type = ArgumentType.COMPLEX; } else if(model.getClazz().equals(byte.class)) { this.type = ArgumentType.BYTE; } else { throw new <API key>(model.getClazz().toString()); } } public JType type() { return codeModel._ref(model.getClazz()); } public JExpression invokeAccessor(JExpression elementIndex) { return valueField.invoke(type.accessorName).arg(elementIndex); } public JType accessorType() { return codeModel._ref(type.accessorType()); } public JExpression isNA(JExpression expr) { return type.isNa(codeModel, expr); } public JExpression convert(JExpression argValue) { return type.convertToArg(argValue); } } private enum VectorType { DOUBLE(DoubleVector.class, "getElementAsDouble", double.class), LOGICAL(LogicalVector.class, "<API key>", int.class), INTEGER(IntVector.class, "getElementAsInt", int.class), COMPLEX(ComplexVector.class, "getElementAsComplex", Complex.class), RAW(RawVector.class, "getElementAsByte", byte.class); private Class baseClass; private String accessorName; private Class accessorType; private VectorType(Class baseClass, String accessorName, Class accessorType) { this.baseClass = baseClass; this.accessorName = accessorName; this.accessorType = accessorType; } } private enum ArgumentType { DOUBLE(double.class, "getElementAsDouble") { @Override public JExpression isNa(JCodeModel codeModel, JExpression expr) { return codeModel.ref(DoubleVector.class).staticInvoke("isNA").arg(expr); } }, INTEGER(int.class, "getElementAsInt") { @Override public JExpression isNa(JCodeModel codeModel, JExpression expr) { return codeModel.ref(IntVector.class).staticInvoke("isNA").arg(expr); } }, BOOLEAN(boolean.class, "<API key>") { @Override public JExpression convertToArg(JExpression expr) { return expr.ne(lit(0)); } @Override public Class accessorType() { return int.class; } @Override public JExpression isNa(JCodeModel codeModel, JExpression expr) { return codeModel.ref(IntVector.class).staticInvoke("isNA").arg(expr); } }, STRING(String.class, "getElementAsString") { @Override public JExpression isNa(JCodeModel codeModel, JExpression expr) { return codeModel.ref(StringVector.class).staticInvoke("isNA").arg(expr); } }, COMPLEX(Complex.class, "getElementAsComplex" ) { @Override public JExpression isNa(JCodeModel codeModel, JExpression expr) { return codeModel.ref(ComplexVector.class).staticInvoke("isNA").arg(expr); } }, BYTE(byte.class, "getElementAsByte" ) { @Override public JExpression isNa(JCodeModel codeModel, JExpression expr) { return JExpr.lit(false); } }; private Class clazz; private String accessorName; private ArgumentType(Class clazz, String accessorName) { this.clazz = clazz; this.accessorName = accessorName; } public JExpression convertToArg(JExpression expr) { return expr; } public Class accessorType() { return clazz; } public abstract JExpression isNa(JCodeModel codeModel, JExpression expr); } }
package eu.geopaparazzi.core.preferences; import android.content.Context; import android.content.res.TypedArray; import android.preference.DialogPreference; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup.LayoutParams; import android.widget.ArrayAdapter; import android.widget.LinearLayout; import android.widget.Spinner; import eu.geopaparazzi.core.R; import eu.geopaparazzi.library.locale.LocaleUtils; public class <API key> extends DialogPreference { public static final String <API key> = "<API key>";//NON-NLS private Context context; private Spinner localesSpinner; /** * @param ctxt the context to use. * @param attrs attributes. */ public <API key>(Context ctxt, AttributeSet attrs) { super(ctxt, attrs); this.context = ctxt; <API key>(ctxt.getString(android.R.string.ok)); <API key>(ctxt.getString(android.R.string.cancel)); } @Override protected View onCreateDialogView() { LinearLayout mainLayout = new LinearLayout(context); LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT); mainLayout.setLayoutParams(layoutParams); mainLayout.setOrientation(LinearLayout.VERTICAL); mainLayout.setPadding(25, 25, 25, 25); localesSpinner = new Spinner(context); localesSpinner.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); localesSpinner.setPadding(15, 5, 15, 5); final String[] localesArray = context.getResources().getStringArray(R.array.locales); ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, localesArray); adapter.<API key>(android.R.layout.<API key>); localesSpinner.setAdapter(adapter); final String currentLocale = LocaleUtils.getCurrentLocale(context); if (currentLocale != null) { for (int i = 0; i < localesArray.length; i++) { if (localesArray[i].equals(currentLocale.trim())) { localesSpinner.setSelection(i); break; } } } mainLayout.addView(localesSpinner); return mainLayout; } @Override protected void onBindDialogView(View v) { super.onBindDialogView(v); } @Override protected void onDialogClosed(boolean positiveResult) { super.onDialogClosed(positiveResult); if (positiveResult) { String selectedLocale = localesSpinner.getSelectedItem().toString(); LocaleUtils.changeLang(context, selectedLocale); } } @Override protected Object onGetDefaultValue(TypedArray a, int index) { return (a.getString(index)); } @Override protected void onSetInitialValue(boolean restoreValue, Object defaultValue) { } }
<?php class removeAccents extends CommonServices{ private $accented; private $unaccented; public function __construct($string) { $this->accented = $string; $this->unaccented = $this->removeAccents($string); } public function get(){ return $this->unaccented; } private function removeAccents($str, $utf8 = true) { $str = (string) $str; if (is_null($utf8)) { if (!function_exists('mb_detect_encoding')) { $utf8 = (strtolower(mb_detect_encoding($str)) == 'utf-8'); } else { $length = strlen($str); $utf8 = true; for ($i = 0; $i < $length; $i++) { $c = ord($str[$i]); if ($c < 0x80) $n = 0; // 0bbbbbbb elseif (($c & 0xE0) == 0xC0) $n = 1; // 110bbbbb elseif (($c & 0xF0) == 0xE0) $n = 2; // 1110bbbb elseif (($c & 0xF8) == 0xF0) $n = 3; // 11110bbb elseif (($c & 0xFC) == 0xF8) $n = 4; // 111110bb elseif (($c & 0xFE) == 0xFC) $n = 5; // 1111110b else return false; // Does not match any model for ($j = 0; $j < $n; $j++) { // n bytes matching 10bbbbbb follow ? if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80)) { $utf8 = false; break; } } } } } if (!$utf8) { $str = utf8_encode($str); } $transliteration = array( 'IJ' => 'I', 'Ö' => 'O', 'Œ' => 'O', 'Ü' => 'U', 'ä' => 'a', 'æ' => 'a', 'ij' => 'i', 'ö' => 'o', 'œ' => 'o', 'ü' => 'u', 'ß' => 's', 'ſ' => 's', 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A', 'Æ' => 'A', 'Ā' => 'A', 'Ą' => 'A', 'Ă' => 'A', 'Ç' => 'C', 'Ć' => 'C', 'Č' => 'C', 'Ĉ' => 'C', 'Ċ' => 'C', 'Ď' => 'D', 'Đ' => 'D', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ē' => 'E', 'Ę' => 'E', 'Ě' => 'E', 'Ĕ' => 'E', 'Ė' => 'E', 'Ĝ' => 'G', 'Ğ' => 'G', 'Ġ' => 'G', 'Ģ' => 'G', 'Ĥ' => 'H', 'Ħ' => 'H', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', 'Ï' => 'I', 'Ī' => 'I', 'Ĩ' => 'I', 'Ĭ' => 'I', 'Į' => 'I', 'İ' => 'I', 'Ĵ' => 'J', 'Ķ' => 'K', 'Ľ' => 'K', 'Ĺ' => 'K', 'Ļ' => 'K', 'Ŀ' => 'K', 'Ł' => 'L', 'Ñ' => 'N', 'Ń' => 'N', 'Ň' => 'N', 'Ņ' => 'N', 'Ŋ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ø' => 'O', 'Ō' => 'O', 'Ő' => 'O', 'Ŏ' => 'O', 'Ŕ' => 'R', 'Ř' => 'R', 'Ŗ' => 'R', 'Ś' => 'S', 'Ş' => 'S', 'Ŝ' => 'S', 'Ș' => 'S', 'Š' => 'S', 'Ť' => 'T', 'Ţ' => 'T', 'Ŧ' => 'T', 'Ț' => 'T', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ū' => 'U', 'Ů' => 'U', 'Ű' => 'U', 'Ŭ' => 'U', 'Ũ' => 'U', 'Ų' => 'U', 'Ŵ' => 'W', 'Ŷ' => 'Y', 'Ÿ' => 'Y', 'Ý' => 'Y', 'Ź' => 'Z', 'Ż' => 'Z', 'Ž' => 'Z', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ā' => 'a', 'ą' => 'a', 'ă' => 'a', 'å' => 'a', 'ç' => 'c', 'ć' => 'c', 'č' => 'c', 'ĉ' => 'c', 'ċ' => 'c', 'ď' => 'd', 'đ' => 'd', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'ē' => 'e', 'ę' => 'e', 'ě' => 'e', 'ĕ' => 'e', 'ė' => 'e', 'ƒ' => 'f', 'ĝ' => 'g', 'ğ' => 'g', 'ġ' => 'g', 'ģ' => 'g', 'ĥ' => 'h', 'ħ' => 'h', 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ī' => 'i', 'ĩ' => 'i', 'ĭ' => 'i', 'į' => 'i', 'ı' => 'i', 'ĵ' => 'j', 'ķ' => 'k', 'ĸ' => 'k', 'ł' => 'l', 'ľ' => 'l', 'ĺ' => 'l', 'ļ' => 'l', 'ŀ' => 'l', 'ñ' => 'n', 'ń' => 'n', 'ň' => 'n', 'ņ' => 'n', 'ʼn' => 'n', 'ŋ' => 'n', 'ò' => 'o', 'ó' => 'o', 'ô' => 'o', 'õ' => 'o', 'ø' => 'o', 'ō' => 'o', 'ő' => 'o', 'ŏ' => 'o', 'ŕ' => 'r', 'ř' => 'r', 'ŗ' => 'r', 'ś' => 's', 'š' => 's', 'ť' => 't', 'ù' => 'u', 'ú' => 'u', 'û' => 'u', 'ū' => 'u', 'ů' => 'u', 'ű' => 'u', 'ŭ' => 'u', 'ũ' => 'u', 'ų' => 'u', 'ŵ' => 'w', 'ÿ' => 'y', 'ý' => 'y', 'ŷ' => 'y', 'ż' => 'z', 'ź' => 'z', 'ž' => 'z', 'Α' => 'A', 'Ά' => 'A', 'Ἀ' => 'A', 'Ἁ' => 'A', 'Ἂ' => 'A', 'Ἃ' => 'A', 'Ἄ' => 'A', 'Ἅ' => 'A', 'Ἆ' => 'A', 'Ἇ' => 'A', 'ᾈ' => 'A', 'ᾉ' => 'A', 'ᾊ' => 'A', 'ᾋ' => 'A', 'ᾌ' => 'A', 'ᾍ' => 'A', 'ᾎ' => 'A', 'ᾏ' => 'A', 'Ᾰ' => 'A', 'Ᾱ' => 'A', 'Ὰ' => 'A', 'ᾼ' => 'A', 'Β' => 'B', 'Γ' => 'G', 'Δ' => 'D', 'Ε' => 'E', 'Έ' => 'E', 'Ἐ' => 'E', 'Ἑ' => 'E', 'Ἒ' => 'E', 'Ἓ' => 'E', 'Ἔ' => 'E', 'Ἕ' => 'E', 'Ὲ' => 'E', 'Ζ' => 'Z', 'Η' => 'I', 'Ή' => 'I', 'Ἠ' => 'I', 'Ἡ' => 'I', 'Ἢ' => 'I', 'Ἣ' => 'I', 'Ἤ' => 'I', 'Ἥ' => 'I', 'Ἦ' => 'I', 'Ἧ' => 'I', 'ᾘ' => 'I', 'ᾙ' => 'I', 'ᾚ' => 'I', 'ᾛ' => 'I', 'ᾜ' => 'I', 'ᾝ' => 'I', 'ᾞ' => 'I', 'ᾟ' => 'I', 'Ὴ' => 'I', 'ῌ' => 'I', 'Θ' => 'T', 'Ι' => 'I', 'Ί' => 'I', 'Ϊ' => 'I', 'Ἰ' => 'I', 'Ἱ' => 'I', 'Ἲ' => 'I', 'Ἳ' => 'I', 'Ἴ' => 'I', 'Ἵ' => 'I', 'Ἶ' => 'I', 'Ἷ' => 'I', 'Ῐ' => 'I', 'Ῑ' => 'I', 'Ὶ' => 'I', 'Κ' => 'K', 'Λ' => 'L', 'Μ' => 'M', 'Ν' => 'N', 'Ξ' => 'K', 'Ο' => 'O', 'Ό' => 'O', 'Ὀ' => 'O', 'Ὁ' => 'O', 'Ὂ' => 'O', 'Ὃ' => 'O', 'Ὄ' => 'O', 'Ὅ' => 'O', 'Ὸ' => 'O', 'Π' => 'P', 'Ρ' => 'R', 'Ῥ' => 'R', 'Σ' => 'S', 'Τ' => 'T', 'Υ' => 'Y', 'Ύ' => 'Y', 'Ϋ' => 'Y', 'Ὑ' => 'Y', 'Ὓ' => 'Y', 'Ὕ' => 'Y', 'Ὗ' => 'Y', 'Ῠ' => 'Y', 'Ῡ' => 'Y', 'Ὺ' => 'Y', 'Φ' => 'F', 'Χ' => 'X', 'Ψ' => 'P', 'Ω' => 'O', 'Ώ' => 'O', 'Ὠ' => 'O', 'Ὡ' => 'O', 'Ὢ' => 'O', 'Ὣ' => 'O', 'Ὤ' => 'O', 'Ὥ' => 'O', 'Ὦ' => 'O', 'Ὧ' => 'O', 'ᾨ' => 'O', 'ᾩ' => 'O', 'ᾪ' => 'O', 'ᾫ' => 'O', 'ᾬ' => 'O', 'ᾭ' => 'O', 'ᾮ' => 'O', 'ᾯ' => 'O', 'Ὼ' => 'O', 'ῼ' => 'O', 'α' => 'a', 'ά' => 'a', 'ἀ' => 'a', 'ἁ' => 'a', 'ἂ' => 'a', 'ἃ' => 'a', 'ἄ' => 'a', 'ἅ' => 'a', 'ἆ' => 'a', 'ἇ' => 'a', 'ᾀ' => 'a', 'ᾁ' => 'a', 'ᾂ' => 'a', 'ᾃ' => 'a', 'ᾄ' => 'a', 'ᾅ' => 'a', 'ᾆ' => 'a', 'ᾇ' => 'a', 'ὰ' => 'a', 'ᾰ' => 'a', 'ᾱ' => 'a', 'ᾲ' => 'a', 'ᾳ' => 'a', 'ᾴ' => 'a', 'ᾶ' => 'a', 'ᾷ' => 'a', 'β' => 'b', 'γ' => 'g', 'δ' => 'd', 'ε' => 'e', 'έ' => 'e', 'ἐ' => 'e', 'ἑ' => 'e', 'ἒ' => 'e', 'ἓ' => 'e', 'ἔ' => 'e', 'ἕ' => 'e', 'ὲ' => 'e', 'ζ' => 'z', 'η' => 'i', 'ή' => 'i', 'ἠ' => 'i', 'ἡ' => 'i', 'ἢ' => 'i', 'ἣ' => 'i', 'ἤ' => 'i', 'ἥ' => 'i', 'ἦ' => 'i', 'ἧ' => 'i', 'ᾐ' => 'i', 'ᾑ' => 'i', 'ᾒ' => 'i', 'ᾓ' => 'i', 'ᾔ' => 'i', 'ᾕ' => 'i', 'ᾖ' => 'i', 'ᾗ' => 'i', 'ὴ' => 'i', 'ῂ' => 'i', 'ῃ' => 'i', 'ῄ' => 'i', 'ῆ' => 'i', 'ῇ' => 'i', 'θ' => 't', 'ι' => 'i', 'ί' => 'i', 'ϊ' => 'i', 'ΐ' => 'i', 'ἰ' => 'i', 'ἱ' => 'i', 'ἲ' => 'i', 'ἳ' => 'i', 'ἴ' => 'i', 'ἵ' => 'i', 'ἶ' => 'i', 'ἷ' => 'i', 'ὶ' => 'i', 'ῐ' => 'i', 'ῑ' => 'i', 'ῒ' => 'i', 'ῖ' => 'i', 'ῗ' => 'i', 'κ' => 'k', 'λ' => 'l', 'μ' => 'm', 'ν' => 'n', 'ξ' => 'k', 'ο' => 'o', 'ό' => 'o', 'ὀ' => 'o', 'ὁ' => 'o', 'ὂ' => 'o', 'ὃ' => 'o', 'ὄ' => 'o', 'ὅ' => 'o', 'ὸ' => 'o', 'π' => 'p', 'ρ' => 'r', 'ῤ' => 'r', 'ῥ' => 'r', 'σ' => 's', 'ς' => 's', 'τ' => 't', 'υ' => 'y', 'ύ' => 'y', 'ϋ' => 'y', 'ΰ' => 'y', 'ὐ' => 'y', 'ὑ' => 'y', 'ὒ' => 'y', 'ὓ' => 'y', 'ὔ' => 'y', 'ὕ' => 'y', 'ὖ' => 'y', 'ὗ' => 'y', 'ὺ' => 'y', 'ῠ' => 'y', 'ῡ' => 'y', 'ῢ' => 'y', 'ῦ' => 'y', 'ῧ' => 'y', 'φ' => 'f', 'χ' => 'x', 'ψ' => 'p', 'ω' => 'o', 'ώ' => 'o', 'ὠ' => 'o', 'ὡ' => 'o', 'ὢ' => 'o', 'ὣ' => 'o', 'ὤ' => 'o', 'ὥ' => 'o', 'ὦ' => 'o', 'ὧ' => 'o', 'ᾠ' => 'o', 'ᾡ' => 'o', 'ᾢ' => 'o', 'ᾣ' => 'o', 'ᾤ' => 'o', 'ᾥ' => 'o', 'ᾦ' => 'o', 'ᾧ' => 'o', 'ὼ' => 'o', 'ῲ' => 'o', 'ῳ' => 'o', 'ῴ' => 'o', 'ῶ' => 'o', 'ῷ' => 'o', 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'E', 'Ж' => 'Z', 'З' => 'Z', 'И' => 'I', 'Й' => 'I', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'K', 'Ц' => 'T', 'Ч' => 'C', 'Ш' => 'S', 'Щ' => 'S', 'Ы' => 'Y', 'Э' => 'E', 'Ю' => 'Y', 'Я' => 'Y', 'а' => 'A', 'б' => 'B', 'в' => 'V', 'г' => 'G', 'д' => 'D', 'е' => 'E', 'ё' => 'E', 'ж' => 'Z', 'з' => 'Z', 'и' => 'I', 'й' => 'I', 'к' => 'K', 'л' => 'L', 'м' => 'M', 'н' => 'N', 'о' => 'O', 'п' => 'P', 'р' => 'R', 'с' => 'S', 'т' => 'T', 'у' => 'U', 'ф' => 'F', 'х' => 'K', 'ц' => 'T', 'ч' => 'C', 'ш' => 'S', 'щ' => 'S', 'ы' => 'Y', 'э' => 'E', 'ю' => 'Y', 'я' => 'Y', 'ð' => 'd', 'Ð' => 'D', 'þ' => 't', 'Þ' => 'T', 'ა' => 'a', 'ბ' => 'b', 'გ' => 'g', 'დ' => 'd', 'ე' => 'e', 'ვ' => 'v', 'ზ' => 'z', 'თ' => 't', 'ი' => 'i', 'კ' => 'k', 'ლ' => 'l', 'მ' => 'm', 'ნ' => 'n', 'ო' => 'o', 'პ' => 'p', 'ჟ' => 'z', 'რ' => 'r', 'ს' => 's', 'ტ' => 't', 'უ' => 'u', 'ფ' => 'p', 'ქ' => 'k', 'ღ' => 'g', 'ყ' => 'q', 'შ' => 's', 'ჩ' => 'c', 'ც' => 't', 'ძ' => 'd', 'წ' => 't', 'ჭ' => 'c', 'ხ' => 'k', 'ჯ' => 'j', 'ჰ' => 'h', ); return str_replace(array_keys($transliteration), array_values($transliteration), $str); } } ?>
#ifndef FILETOAST_WORKER_H #define FILETOAST_WORKER_H void * worker(void *); char * readfile(t_job *); int senddata(t_job * job); #endif //FILETOAST_WORKER_H
#! /usr/bin/env python # -*- coding: utf-8 -*- # pkpgcounter : a generic Page Description Language parser # This program is free software: you can redistribute it and/or modify # (at your option) any later version. # This program is distributed in the hope that it will be useful, # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the import sys import glob import os import shutil try : from distutils.core import setup except ImportError as msg : sys.stderr.write("%s\n" % msg) sys.stderr.write("You need the DistUtils Python module.\nunder Debian, you may have to install the python-dev package.\nOf course, YMMV.\n") sys.exit(-1) try : from PIL import Image except ImportError : sys.stderr.write("You need the Python Imaging Library (aka PIL).\nYou can grab it from http: sys.exit(-1) sys.path.insert(0, "pkpgpdls") from pkpgpdls.version import __version__, __doc__ data_files = [] mofiles = glob.glob(os.sep.join(["po", "*", "*.mo"])) for mofile in mofiles : lang = mofile.split(os.sep)[1] directory = os.sep.join(["share", "locale", lang, "LC_MESSAGES"]) data_files.append((directory, [ mofile ])) docdir = "share/doc/pkpgcounter" docfiles = ["README", "COPYING", "BUGS", "CREDITS", "AUTHORS", "TODO"] data_files.append((docdir, docfiles)) if os.path.exists("ChangeLog") : data_files.append((docdir, ["ChangeLog"])) directory = os.sep.join(["share", "man", "man1"]) manpages = glob.glob(os.sep.join(["man", "*.1"])) data_files.append((directory, manpages)) setup(name = "pkpgcounter", version = __version__, license = "GNU GPL", description = __doc__, author = "Jerome Alet", author_email = "alet@librelogiciel.com", url = "http: packages = [ "pkpgpdls" ], scripts = [ "bin/pkpgcounter" ], data_files = data_files)
const actions = { // Video ended ended({dispatch,commit}, video) { video.isPlaying = false; dispatch('next', video); commit('PLAYING',video); }, // Add video to queue addToQueue({state, dispatch, commit }, obj) { var index = _.findIndex(state.queue, function(o) { return o.videoId == obj.videoId; }); if (index == -1) commit('ADD_TO_QUEUE', obj); }, // Play a video playVideo({ state, dispatch, commit }, video) { if (!state.playing || state.playing.videoId != video.videoId) { state.player.loadVideoById({ videoId: video.videoId, suggestedQuality: 'small' }); } else { state.player.playVideo(); } video.isPlaying = true; commit('PLAYING',video); dispatch('addToQueue', video); }, // Puase a video pauseVideo({ state, dispatch, commit }, video) { video.isPlaying = false; state.player.pauseVideo(); commit('PLAYING',video); }, // Play next song next({ state, dispatch, commit }) { if (state.queue && state.playing) { var index = _.findIndex(state.queue, function(o) { return o.videoId == state.playing.videoId; }); if (index != -1 && state.queue[index + 1]) { dispatch('playVideo', state.queue[index + 1]); } } }, // Play previous song previous({ state, dispatch, commit }) { if (state.queue && state.playing) { var index = _.findIndex(state.queue, function(o) { return o.videoId == state.playing.videoId; }); if (index && state.queue[index - 1]) { dispatch('playVideo', state.queue[index - 1]); } } }, addToFav({state,commit},video){ var index = _.findIndex(state.favs,function(o){ return o.videoId == video.videoId; }); // Add to favs if not exists if(index == -1) { commit('ADD_TO_FAVS',video); state.localStorage.setItem("favs", state.favs); } else if(index >= 0) { commit('REMOVE_FROM_FAVS',index); state.localStorage.setItem("favs", state.favs); } }, // Add localforge to state and load data from localStorage loadLocalStorage({state,commit},localStorage){ commit('LOAD_LOCAL_STORAGE',localStorage); state.localStorage.getItem('favs').then(function(list) { if(list) commit('ADD_TO_FAVS',list); }).catch(function(err) { console.log(err); }); } } export default actions;
<!DOCTYPE html> <html> <head> <title>Washington State Courts - Supreme Court Calendar </title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="expires" content="0"> <meta http-equiv="Pragma" content="no-cache"> <link rel="icon" type="image/vnd.microsoft.icon" href=" <noscript> <link href="/css/layoutStylesv3.css" type=text/css rel=stylesheet /> <link href="/css/stylesheetv2.css" type=text/css rel=stylesheet /> <link href="/css/tabStyles.css" type=text/css rel=stylesheet /> <link href="/css/subsite_stylesv2.css" rel=stylesheet type=text/css /> </noscript> <script language="JavaScript" src="/includes/AOCScripts.js" type="text/javascript"></script> <script type="text/javascript" language="JavaScript1.2" src="/includes/stm31.js"></script> <script src="/scripts/jquery-1.11.2.min.js" type="text/javascript" language="JavaScript"></script> <script src="/js/modernizr-custom.min.js"></script> <script src="/js/featureDetection.js"></script> <script src="/js/jqueryForForm.js" type="text/javascript"></script> <script src="/js/multiFileUpload.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="/css/libraryStylesv2.css" /> <link rel="stylesheet" type="text/css" href="/css/layoutStylesv3.css" /> <link rel="stylesheet" type="text/css" href="/css/stylesheetv2.css" /> <link rel="stylesheet" type="text/css" href="/css/subsite_stylesv2.css" /> </head> <body> <div id="topLayout"> <div id="newLayout"> <div id="newPageLayout"> <a name="top"></a> <div id="topheader"> <div id="left"><a href="/"><img src="/images/waCourtsLogo.png" border="0" alt="Welcome to Washington State Courts" /></a></div> <div id="right"> <div class="socialMediaBar"> <ul> <li><a href="/notifications/" title="Sign up for Notifications"><img src="/images/iconEmailBlue.png" alt="Sign up for Email Notifications" border="0" /></a></li> <li><a href="/notifications/" title="Sign up for Notifications">Get Email Updates</a></li> <li>|</li> <li><a href="https://aoc.custhelp.com/"><img src="/images/<API key>.png" border="0" /></a></li> <li><a href="https://aoc.custhelp.com/">FAQs & eService Center</a></li> </ul> </div> <div class="topSearchArea"> <form method="post" action="/search/index.cfm?fa=search.start_search"> <input type="text" name="searchTerms" size="36" maxlength="256" placeholder="Search WA Courts Site" class="searchField" value="Search WA Courts Site" onfocus="if (this.value=='Search WA Courts Site'){this.value='';$(this).css('color','#000000','font-style','normal');}" onblur="if (this.value==''){this.value='Search WA Courts Site';$(this).css('color', '#bbbbb7');}"> <input type="image" name="btnSearch" class="searchButton" alt="Search" src="/images/iconSearch.png"> </form> </div> </div> </div> <div id="mainNav"> <ul id="menuBar"> <a href="/forms/" ><li class="menuItem first" >Forms</li></a> <a href="/court_dir/" ><li class="menuItem" >Court Directory</li></a> <a href="/opinions/" ><li class="menuItem">Opinions</li></a> <a href="/court_rules/" ><li class="menuItem">Rules</li></a> <a href="/<API key>/" ><li class="menuItem">Courts</li></a> <a href="/programs_orgs/" ><li class="menuItem">Programs & Organizations</li></a> <a href="/newsinfo/index.cfm?fa=newsinfo.displayContent&theFile=content/<API key>" ><li class="menuItem last">Resources</li></a> </ul> </div> <div id="topline"> <div id="left" class="breadcrumb"><a href="/">Courts Home</a> > <a href="/<API key>/" class="breadcrumb">Courts</a>&nbsp;>&nbsp;<a href="/<API key>/supreme/calendar" class="breadcrumb">Supreme Court Calendar</a></div> </div> <a name="body"></a> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="clear:both;"> <tr> <td width="10">&nbsp;</td> <td valign="top" class="mainPage"> <table width="100%"> <tr> <td valign="top"><h2>Supreme Court Calendar</h2></td> <td valign="top" align="right" width="175"><div class="linkBox"><a href="/<API key>/coaBriefs/index.cfm?fa=coaBriefs.ScHome&courtId=A08">Supreme Court Briefs</a></div></td> </tr> </table> <table border=0 cellspacing="0" cellpadding="2" width="95%"> <tr> <td valign="top" width="45%"><p><b>9:00 A.M. </b> </td> <td valign="top" ><p><b> Olympia </b> </td> <td valign="top"><p><b>Wednesday, January 22, 2003</b> </td></tr></table> <p> <table border="1" cellspacing="0" cellpadding="2" width="95%"> <tr> <td width="288"></td> <td width="295"></td></tr> <tr> <td valign="top" width="288"><p><b>Case No. 1 &#8211; 72412-1</b> </td> <td valign="top" width="295"><p><b><u>COUNSEL</u></b> </td></tr> <tr> <td valign="top" width="288"><p>State of Washington, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v. <br>Viengmone Khounvichai </td> <td valign="top" width="295"><p>Randi Austell <p>Eric Nielsen </td></tr> <tr> <td colspan="2" valign="top" width="583"><p><b>SYNOPSIS:</b> Whether evidence of the defendant&#8217;s drug possession, found in his home, should have been suppressed because police officers who went to his home to talk with him about an unrelated crime failed to inform his grandmother, who answered the door, that she did not have to let them in and could revoke her consent at any time. </td></tr></table> <p> <table border="1" cellspacing="0" cellpadding="2" width="95%"> <tr> <td width="288"></td> <td width="295"></td></tr> <tr> <td valign="top" width="288"><p><b>Case No. 2 &#8211; 72366-4</b> </td> <td valign="top" width="295"><p><b><u>COUNSEL</u></b> </td></tr> <tr> <td valign="top" width="288"><p>In re the Marriage of <p>John Christopher Rideout, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;and <br>Sara Dixon Rideout </td> <td valign="top" width="295"> <p>Charles Szurszewski <br>Kenneth Master/Charles Wiggins <p>Melissa Denton </td></tr> <tr> <td colspan="2" valign="top" width="583"><p><b>SYNOPSIS:</b> What is the proper appellate standard of review where a trial court&#8217;s decision is based solely on documentation, including declarations, and where the credibility of the parties is at issue before the court. Additionally, whether a divorced parent may be held in contempt for bad faith violation of a parenting plan when a child refuses visitation with the noncustodial parent. </td></tr></table> <p></p> <hr noshade align="left" width="95%"> <b>1:30 P.M.</b> <hr noshade align="left" width="95%"> <p> <table border="1" cellspacing="0" cellpadding="2" width="95%"> <tr> <td width="288"></td> <td width="295"></td></tr> <tr> <td valign="top" width="288"><p><b>Case No. 3 &#8211; 72435-1</b> </td> <td valign="top" width="295"><p><b><u>COUNSEL</u></b> </td></tr> <tr> <td valign="top" width="288"><p>State of Washington, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v. <br>Peter H. Moen </td> <td valign="top" width="295"><p>Andrew Metts/Kevin Korsmo <p>Paul Mack </td></tr> <tr> <td colspan="2" valign="top" width="583"><p><b>SYNOPSIS:</b> Whether a prosecutor may condition plea bargaining on a defendant&#8217;s waiver of the right to request the identity of a confidential informant in a related civil action seeking return of forfeited property. </td></tr></table> <p> <table border="1" cellspacing="0" cellpadding="2" width="95%"> <tr> <td width="288"></td> <td width="295"></td></tr> <tr> <td valign="top" width="288"><p><b>Case No. 4 &#8211; 72436-9</b> </td> <td valign="top" width="295"><p><b><u>COUNSEL</u></b> </td></tr> <tr> <td valign="top" width="288"><p>Judy Kloepfel, <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;v. <br>Joseph Bokor </td> <td valign="top" width="295"><p>Charles Conrad <p>Stanley Perdue </td></tr> <tr> <td colspan="2" valign="top" width="583"><p><b>SYNOPSIS:</b> Whether a plaintiff must present medical evidence of objective physical symptoms or manifestations of severe emotional injury in order to prevail on a claim for intentional infliction of emotional distress. </td></tr></table> <p><b>These summaries are not formulated by the Court and are provided for the convenience of the public only.</b> </td> <td width="10">&nbsp;</td> </tr> </table> <div class="footerOuter"> <div class="footerBg"> <div class="footerLayout"> <ul> <span class="footerHeader">Access Records</span> <li><a href="/jislink/">JIS LINK</a></li> <li><a href="http://dw.courts.wa.gov?fa=home.fmcd">Find Your Court Date</a></li> <li><a href="http://dw.courts.wa.gov">Search Case Records</a></li> <li><a href="/newsinfo/publication/?fa=<API key>.recordsRequest">Records Request</a></li> <li><a href="/jis/">Judicial Info System (JIS)</a></li> <li><a href="https://odysseyportal.courts.wa.gov/odyportal">Odyssey Portal</a></li> <li><a href="/caseload">Caseload Reports</a></li> <li> </li> </ul> <ul> <span class="footerHeader">Find Resources</span> <li><a href="/library/">State Law Library</a></li> <li><a href="/education/">Civic Learning</a></li> <li><a href="/newsinfo/index.cfm?fa=newsinfo.displayContent&theFile=content/<API key>">Resources, Publications, &amp; Reports</a></li> <li><a href="/committee/?fa=committee.home&committee_id=143">Court Program Accessibility (ADA)</a></li> <li><a href="/newsinfo/resources/">Jury Service Information</a></li> <li><a href="/Whistleblower/">Whistleblower</a></li> <li><a href="/employ/">Employment</a></li> <li><a href="/procure/">Procurement</a></li> </ul> <ul> <span class="footerHeader">From the Courts</span> <li><a href="/forms/">Court Forms</a></li> <li><a href="/forms/?fa=forms.contribute&formID=16">Domestic Violence Forms</a></li> <li><a href="/opinions/">Court Opinions</a></li> <li><a href="/court_rules/">Court Rules</a></li> <li><a href="/index.cfm?fa=home.contentDisplay&location=<API key>">Pattern Jury Instructions</a></li> <li><a href="/emergency/">Emergency Procedures</a></li> <li><a href="/index.cfm?fa=home.courtClosures">Notice of Court Closures</a></li> </ul> <ul> <span class="footerHeader">Get Organizational Information</span> <li><a href="/<API key>/aocwho/">Administrative Office of the Courts</a></li> <li><a href="/<API key>/SupremeCourt/?fa=supremecourt.welcome">Supreme Court</a></li> <li><a href="/<API key>/">Appellate &amp; Trial Courts</a></li> <li><a href="/programs_orgs/">Programs &amp; Organizations</a></li> <li><a href="/newsinfo/">Washington Court News</a></li> <li><a href="/court_dir/">Court Directory</a></li> </ul> </div> </div> </div> </div> <div class="stayConnected"> <ul style="float:left;"> <li><span class="stayConnectedHeader">Connect with us</span></li> <li><a href="https: <li><a href="https://twitter.com/WACourts"><img src="/images/iconTwitter_gray.png" alt="Follow us on Twitter" border="0" /></a></li> <li><a href="http: <li><a href="/notifications/?fa=notifications.rss"><img src="/images/iconRss_gray.png" alt="Use one of our RSS Feeds" border="0" /></a></li> </ul> <ul style="float:left; padding: 0 0 0 24px;"> <li><span class="stayConnectedHeader">Need Help?</span></li> <li><a href="https://aoc.custhelp.com/"><img src="/images/iconHelp_lg.png" border="0"></a></li> <li><span class="stayConnectedHeader"><a href="https://aoc.custhelp.com/">FAQs & eService Center</a></span></li> </ul> </div> <div class="footerLower"> <ul> <li class="footerText" style="float:left;"><a href="/?fa=home.notice">Privacy & Disclaimer Notices</a> | <a href="/index.cfm?fa=home.sitemap">Sitemap</a></li> <li class="sealPos"><img src="/images/footerSeal.png" alt="WA State Seal" ></li> <li class="footerText" style="float:right;">Copyright AOC &copy; 2014</li> </ul> </div> <div class="accessWA"> <div style="display:inline; padding:0 12px 0 8px;float:left;"><a href="http://access.wa.gov" target="_blank"><img src="/images/AWlogo2_150px.gif" border="0" /></a></div> <div style="display:inline; padding:8px 0;float:left;">For Washington State laws, visit the <a href="http://www1.leg.wa.gov/Legislature/" class="external" target="_blank" style="text-decoration:underline;">Washington State Legislature</a></div> <div style="display:inline; padding:8px 0;float:right; font-size:8px">S3</div> </div> </div> </div> </body> </html>
package com.baeldung.collection.filtering; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Set; import java.util.stream.Collectors; import org.hamcrest.Matchers; import org.junit.Assert; import org.junit.Test; /** * Various filtering examples. * * @author Rodolfo Felipe */ public class <API key> { private List<Employee> buildEmployeeList() { return Arrays.asList(new Employee(1, "Mike", 1), new Employee(2, "John", 1), new Employee(3, "Mary", 1), new Employee(4, "Joe", 2), new Employee(5, "Nicole", 2), new Employee(6, "Alice", 2), new Employee(7, "Bob", 3), new Employee(8, "Scarlett", 3)); } private List<String> employeeNameFilter() { return Arrays.asList("Alice", "Mike", "Bob"); } @Test public void givenEmployeeList_andNameFilterList_thenObtainFilteredEmployeeList_usingForEachLoop() { List<Employee> filteredList = new ArrayList<>(); List<Employee> originalList = buildEmployeeList(); List<String> nameFilter = employeeNameFilter(); for (Employee employee : originalList) { for (String name : nameFilter) { if (employee.getName() .equalsIgnoreCase(name)) { filteredList.add(employee); } } } Assert.assertThat(filteredList.size(), Matchers.is(nameFilter.size())); } @Test public void <API key>() { List<Employee> filteredList; List<Employee> originalList = buildEmployeeList(); List<String> nameFilter = employeeNameFilter(); filteredList = originalList.stream() .filter(employee -> nameFilter.contains(employee.getName())) .collect(Collectors.toList()); Assert.assertThat(filteredList.size(), Matchers.is(nameFilter.size())); } @Test public void givenEmployeeList_andNameFilterList_thenObtainFilteredEmployeeList_usingLambdaAndHashSet() { List<Employee> filteredList; List<Employee> originalList = buildEmployeeList(); Set<String> nameFilterSet = employeeNameFilter().stream() .collect(Collectors.toSet()); filteredList = originalList.stream() .filter(employee -> nameFilterSet.contains(employee.getName())) .collect(Collectors.toList()); Assert.assertThat(filteredList.size(), Matchers.is(nameFilterSet.size())); } }
// core import React from 'react'; import PropTypes from 'react'; // components import Loading from '../../components/loading/Loading'; // styles var style = require('./_index.scss'); // data var Timeline = require('<API key>').Timeline; var Twitter = React.createClass({ getInitialState: function(){ return { isLoading: true } }, componentWillMount: function(){ this.setState({ isLoading: true }) }, componentDidMount: function(){ this.setState({ isLoading: false }) }, render: function(){ if(this.state.isLoading === true){ return ( <Loading /> ) } else { return ( <div className='<TwitterConsumerkey>'> <Timeline className='<TwitterConsumerkey>' dataSource={{ sourceType: 'widget', widgetId: '844245316706566144' }} /> </div> ) } } }); export default Twitter;
<!DOCTYPE HTML PUBLIC "- <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_60) on Sun Oct 25 17:08:11 MDT 2015 --> <title>Generated Documentation (Untitled)</title> <script type="text/javascript"> targetPage = "" + window.location.search; if (targetPage != "" && targetPage != "undefined") targetPage = targetPage.substring(1); if (targetPage.indexOf(":") != -1 || (targetPage != "" && !validURL(targetPage))) targetPage = "undefined"; function validURL(url) { try { url = decodeURIComponent(url); } catch (error) { return false; } var pos = url.indexOf(".html"); if (pos == -1 || pos != url.length - 5) return false; var allowNumber = false; var allowSep = false; var seenDot = false; for (var i = 0; i < url.length - 5; i++) { var ch = url.charAt(i); if ('a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || ch == '$' || ch == '_' || ch.charCodeAt(0) > 127) { allowNumber = true; allowSep = true; } else if ('0' <= ch && ch <= '9' || ch == '-') { if (!allowNumber) return false; } else if (ch == '/' || ch == '.') { if (!allowSep) return false; allowNumber = false; allowSep = false; if (ch == '.') seenDot = true; if (ch == '/' && seenDot) return false; } else { return false; } } return true; } function loadFrames() { if (targetPage != "" && targetPage != "undefined") top.classFrame.location = top.targetPage; } </script> </head> <frameset cols="20%,80%" title="Documentation frame" onload="top.loadFrames()"> <frameset rows="30%,70%" title="Left frames" onload="top.loadFrames()"> <frame src="overview-frame.html" name="packageListFrame" title="All Packages"> <frame src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)"> </frameset> <frame src="overview-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes"> <noframes> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <h2>Frame Alert</h2> <p>This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to <a href="overview-summary.html">Non-frame version</a>.</p> </noframes> </frameset> </html>
#! /bin/bash BASE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" TMP_DIR="$BASE_DIR""/.tmp" BASE_DIR_NAME="$(basename $BASE_DIR)" HTDOCS="$BASE_DIR"'/htdocs' EXPORT_DIR="$BASE_DIR"'/exported-html' FILE_SUFFIX=".html" PATH_TYPE='relative' if [[ ! -d "$EXPORT_DIR" ]]; then echo "Creating export directory: ""$EXPORT_DIR" mkdir "$EXPORT_DIR" fi function render_page () { local page="$1" if [[ "$PATH_TYPE" = "relative" ]]; then echo "Exporting ""$PAGE"" with relative paths and file suffix ""$FILE_SUFFIX" # fix absolute css/js paths # add file suffixes to local links # fix absolute links php htdocs/index.php -u "$page" | sed 's#</head>#<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head>#g' | sed 's#src="/#src="#g' | sed -E 's#href="/([^"]*)#href="\1'"$FILE_SUFFIX"'#g' | sed 's#href="/#href="#g' > "$EXPORT_DIR/$page""$FILE_SUFFIX" else echo "Exporting ""$PAGE"" with file suffix ""$FILE_SUFFIX" php htdocs/index.php -u "$PAGE" | sed 's#</head>#<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"></head>#g' | sed -E 's#href="/([^"]*)#href="\1'"$FILE_SUFFIX"'#g' > "$EXPORT_DIR/$PAGE""$FILE_SUFFIX" fi } echo "Copying files to export directory" cp -RL "$HTDOCS/"* "$EXPORT_DIR/" echo "removing PHP and twig files from export" rm -R "$EXPORT_DIR/"*".html.twig" rm -R "$EXPORT_DIR/"*".php" echo "Compiling HTML from twig files" render_page index for PAGE in $(php htdocs/index.php -p); do render_page "$PAGE" done echo "Done." exit 0
/** * Contains the Ui and actions for the detailed document view and edit and all supplemental uis. */ package eu.ggnet.dwoss.redtapext.ui.cao.document;
using System; using System.Threading; using Viki.LoadRunner.Engine.Core.Scenario.Interfaces; using Viki.LoadRunner.Engine.Strategies.Replay.Interfaces; using Viki.LoadRunner.Engine.Strategies.Replay.Scheduler.Interfaces; namespace Viki.LoadRunner.Playground.Replay { public class ReplayScenario : IReplayScenario<string> { private string _data; private TimeSpan _target = TimeSpan.Zero; public void ScenarioSetup(IIteration context) { Console.Out.WriteLine($"[{context.Timer.Value.TotalSeconds:F2}] Scenario Setup"); } public void SetData(IData<string> data) { _data = data.Value; _target = data.TargetTime; // Lets skip requests between 4-8 seconds if (data.TargetTime > TimeSpan.FromSeconds(4) && data.TargetTime < TimeSpan.FromSeconds(8)) { Console.Out.WriteLine($"[{data.Timer.Value.TotalSeconds:F2}][A:{_target.TotalSeconds:F2}] SetData: [{_data}] SKIP"); data.Execute = false; data.Context.UserData = $"[{data.Context.Timer.Value.TotalSeconds:F2}][A:{_target.TotalSeconds:F2}] SKIP"; } TimeSpan fallenBehind = data.Timer.Value - data.TargetTime; if (fallenBehind > TimeSpan.Zero) Console.WriteLine($@"[{data.Timer.Value.TotalSeconds:F2}][A:{_target.TotalSeconds:F2}] SetData: [{_data}] FALL BEHIND {fallenBehind}"); Console.Out.WriteLine($"[{data.Timer.Value.TotalSeconds:F2}][A:{_target.TotalSeconds:F2}] SetData: [{_data}]"); } public void IterationSetup(IIteration context) { context.UserData = _data; Console.Out.WriteLine($"[{context.Timer.Value.TotalSeconds:F2}][A:{_target.TotalSeconds:F2}] Iteration Setup"); } public void ExecuteScenario(IIteration context) { Console.Out.WriteLine($"[{context.Timer.Value.TotalSeconds:F2}][A:{_target.TotalSeconds:F2}] Execute"); Thread.Sleep(1000); } public void IterationTearDown(IIteration context) { Console.Out.WriteLine($"[{context.Timer.Value.TotalSeconds:F2}][A:{_target.TotalSeconds:F2}] Iteration End"); } public void ScenarioTearDown(IIteration context) { Console.Out.WriteLine($"[{context.Timer.Value.TotalSeconds:F2}][A:{_target.TotalSeconds:F2}] Scenario End"); } } }
#!/usr/bin/env python import sys import glob import serial def serial_ports(): """ Lists serial port names :raises EnvironmentError: On unsupported or unknown platforms :returns: A list of the serial ports available on the system """ if sys.platform.startswith('win'): ports = ['COM%s' % (i + 1) for i in range(256)] elif sys.platform.startswith('linux') or sys.platform.startswith('cygwin'): # this excludes your current terminal "/dev/tty" ports = glob.glob('/dev/cu[A-Za-z]*') elif sys.platform.startswith('darwin'): ports = glob.glob('/dev/cu.*') else: raise EnvironmentError('Unsupported platform') result = [] for port in ports: try: s = serial.Serial(port) s.close() result.append(port) except (OSError, serial.SerialException): pass return result if __name__ == '__main__': print(serial_ports())
function Greeter(person) { return "Hello, " + person; } var RandomGuy = "Random Dude"; alert(Greeter(RandomGuy)); //# sourceMappingURL=HelloWorld.js.map
<?php namespace sebastiangolian\php\logger; /* Logger::getInstance()->addDefaultLog('test'); Logger::getInstance()->addLog(new Message('type', 'message')); echo Logger::getInstance()->generateAllMessages(); */ class Logger { private static $instance; private $messages = []; private function __construct() {} private function __clone() {} /** * @return Logger */ public static function getInstance() { if(self::$instance === null) { self::$instance = new self; } return self::$instance; } /** * Logger::getInstance()->add('XYZ'); * Add new log * @param mixed $var * @param string $type */ public function add($var,$type = 'default') { $message = print_r($var, true); $objMessage = new Message($type, $message); array_push($this->messages, $objMessage); } /** * Return all messages * @return array */ public function getMessages() { return $this->messages; } /** * Return all messages in string with break * @param string $break * @return string */ public function generateAllMessages($break = "<br />") { $ret = ''; foreach ($this->messages as $message) { $ret .= $message->getDateTime()." - [".$message->getType()."] ".$message->getMessage().$break; } return $ret; } }
/** * This file defines the fitness_params object. * * TODOs: * - a few TODOs in the file but ok * * FINISHED! * */ using System; using System.Collections.Generic; using System.Text; using System.Xml; using System.IO; using toolbox; /** * namespace for biogas plant optimization * * Definition of: * - fitness_params * - objective function * - weights used inside objective function * */ namespace biooptim { <summary> definition of fitness parameters used in objective function </summary> public partial class fitness_params { // !!! CONSTRUCTOR METHODS !!! <summary> Standard Constructor creates the fitness_params object with default params </summary> <param name="numDigesters">number of digesters on plant</param> public fitness_params(int numDigesters/*biogas.plant myPlant*/) { <API key>(/*myPlant*/numDigesters); } <summary> Constructor used to read fitness_params out of a XML file </summary> <param name="XMLfile">name of the xml file</param> public fitness_params(string XMLfile) { XmlTextReader reader= new System.Xml.XmlTextReader(XMLfile); <API key>(ref reader); reader.Close(); } // !!! PUBLIC METHODS !!! <summary> set fitness params to values read out of a xml file </summary> <param name="reader"></param> public void <API key>(ref XmlTextReader reader) { string xml_tag = ""; int digester_index = 0; // do not set params, because plant is not known // dessen list leer bleibt // leer geblieben sind mit default werten bool do_while = true; // go through the file while (reader.Read() && do_while) { switch (reader.NodeType) { case System.Xml.XmlNodeType.Element: // this knot is an element xml_tag = reader.Name; while (reader.MoveToNextAttribute()) { // read the attributes, here only the attribute of digester // is of interest, all other attributes are ignored, // actually there usally are no other attributes if (xml_tag == "digester" && reader.Name == "index") { // TODO // index of digester, not used at the moment digester_index = Convert.ToInt32(reader.Value); break; } } if (xml_tag == "weights") { myWeights.<API key>(ref reader); } else if (xml_tag == "setpoints") { mySetpoints.<API key>(ref reader); } break; case System.Xml.XmlNodeType.Text: // text, thus value, of each element switch (xml_tag) { // TODO - use digester_index here, compare with size of pH_min, ... // here we assume that params are given in the correct // order, thus first the first digester, then the 2nd digester, ... case "pH_min": pH_min.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "pH_max": pH_max.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "pH_optimum": pH_optimum.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "TS_max": TS_max.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "VFA_TAC_min": VFA_TAC_min.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "VFA_TAC_max": VFA_TAC_max.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "VFA_min": VFA_min.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "VFA_max": VFA_max.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "TAC_min": TAC_min.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "HRT_min": HRT_min.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "HRT_max": HRT_max.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "OLR_max": OLR_max.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "Snh4_max": Snh4_max.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "Snh3_max": Snh3_max.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "AcVsPro_min": AcVsPro_min.Add(System.Xml.XmlConvert.ToDouble(reader.Value)); break; case "TS_feed_max": _TS_feed_max= System.Xml.XmlConvert.ToDouble(reader.Value); break; case "HRT_plant_min": _HRT_plant_min = System.Xml.XmlConvert.ToDouble(reader.Value); break; case "HRT_plant_max": _HRT_plant_max = System.Xml.XmlConvert.ToDouble(reader.Value); break; case "OLR_plant_max": _OLR_plant_max = System.Xml.XmlConvert.ToDouble(reader.Value); break; // read in manurebonus case "manurebonus": _manurebonus = System.Xml.XmlConvert.ToBoolean(reader.Value); break; case "fitness_function": _fitness_function = reader.Value; break; case "nObjectives": _nObjectives = System.Xml.XmlConvert.ToInt32(reader.Value); break; //case "Ndelta": // _Ndelta = System.Xml.XmlConvert.ToInt32(reader.Value); // break; } break; case System.Xml.XmlNodeType.EndElement: // end of fitness_params if (reader.Name == "fitness_params") do_while = false; // end while loop break; } } } <summary> Returns fitness params as XML string, such that it can be saved in a XML file </summary> <returns></returns> public string <API key>() { StringBuilder sb = new StringBuilder(); sb.Append("<fitness_params>\n"); for (int idigester = 0; idigester < pH_min.Count; idigester++) { sb.Append(String.Format("<digester index= \"{0}\">\n", idigester)); sb.Append(xmlInterface.setXMLTag("pH_min", pH_min[idigester])); sb.Append(xmlInterface.setXMLTag("pH_max", pH_max[idigester])); sb.Append(xmlInterface.setXMLTag("pH_optimum", pH_optimum[idigester])); sb.Append(xmlInterface.setXMLTag("TS_max", TS_max[idigester])); sb.Append(xmlInterface.setXMLTag("VFA_TAC_min", VFA_TAC_min[idigester])); sb.Append(xmlInterface.setXMLTag("VFA_TAC_max", VFA_TAC_max[idigester])); sb.Append(xmlInterface.setXMLTag("VFA_min", VFA_min[idigester])); sb.Append(xmlInterface.setXMLTag("VFA_max", VFA_max[idigester])); sb.Append(xmlInterface.setXMLTag("TAC_min", TAC_min[idigester])); sb.Append(xmlInterface.setXMLTag("HRT_min", HRT_min[idigester])); sb.Append(xmlInterface.setXMLTag("HRT_max", HRT_max[idigester])); sb.Append(xmlInterface.setXMLTag("OLR_max", OLR_max[idigester])); sb.Append(xmlInterface.setXMLTag("Snh4_max", Snh4_max[idigester])); sb.Append(xmlInterface.setXMLTag("Snh3_max", Snh3_max[idigester])); sb.Append(xmlInterface.setXMLTag("AcVsPro_min", AcVsPro_min[idigester])); sb.Append("</digester>\n"); } sb.Append(xmlInterface.setXMLTag("TS_feed_max", TS_feed_max)); // add weights sb.Append(myWeights.<API key>()); sb.Append(xmlInterface.setXMLTag("HRT_plant_min", HRT_plant_min)); sb.Append(xmlInterface.setXMLTag("HRT_plant_max", HRT_plant_max)); sb.Append(xmlInterface.setXMLTag("OLR_plant_max", OLR_plant_max)); // write manurebonus inside file sb.Append(xmlInterface.setXMLTag("manurebonus", manurebonus)); sb.Append(xmlInterface.setXMLTag("fitness_function", fitness_function)); sb.Append(xmlInterface.setXMLTag("nObjectives", nObjectives)); //sb.Append(xmlInterface.setXMLTag("Ndelta", _Ndelta)); // add setpoints sb.Append(mySetpoints.<API key>()); sb.Append("</fitness_params>\n"); return sb.ToString(); } <summary> Saves the fitness_params in a xml file </summary> <param name="XMLfile">name of the xml file</param> public void saveAsXML(string XMLfile) { StreamWriter writer = File.CreateText(XMLfile); writer.Write("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"); writer.Write(<API key>()); writer.Close(); } <summary> Prints the fitness params to a string, such that the string can be written to a console. For Custom Numeric Format Strings see: http://msdn.microsoft.com/en-us/library/0c899ak8.aspx </summary> <returns></returns> public string print() { StringBuilder sb = new StringBuilder(); sb.Append(" for (int idigester = 0; idigester < pH_min.Count; idigester++) { sb.Append(String.Format("digester: {0}\n", idigester)); sb.Append(String.Format("pH_min: {0}\t\t\t", pH_min[idigester])); sb.Append(String.Format("pH_max: {0}\t\t\t", pH_max[idigester])); sb.Append(String.Format("pH_optimum: {0}\n", pH_optimum[idigester])); sb.Append(String.Format("TS_max: {0}\t\t\t", TS_max[idigester])); sb.Append(String.Format("VFA_TAC_min: {0}\t\t\t", VFA_TAC_min[idigester])); sb.Append(String.Format("VFA_TAC_max: {0}\n", VFA_TAC_max[idigester])); sb.Append(String.Format("VFA_min: {0}\t\t\t", VFA_min[idigester])); sb.Append(String.Format("VFA_max: {0}\t\t\t", VFA_max[idigester])); sb.Append(String.Format("TAC_min: {0}\n", TAC_min[idigester])); sb.Append(String.Format("HRT_min: {0}\t\t\t", HRT_min[idigester])); sb.Append(String.Format("HRT_max: {0}\t\t\t", HRT_max[idigester])); sb.Append(String.Format("OLR_max: {0}\n", OLR_max[idigester])); sb.Append(String.Format("Snh4_max: {0}\t\t\t", Snh4_max[idigester])); sb.Append(String.Format("Snh3_max: {0}\t\t\t", Snh3_max[idigester])); sb.Append(String.Format("AcVsPro_min: {0}\r\n", AcVsPro_min[idigester])); } sb.Append(String.Format("TS_feed_max: {0}\r\n", TS_feed_max)); // add weights sb.Append(myWeights.print()); sb.Append(String.Format("\nHRT_plant_min: {0}\t\t\t", HRT_plant_min)); sb.Append(String.Format("HRT_plant_max: {0}\t\t\t", HRT_plant_max)); sb.Append(String.Format("OLR_plant_max: {0}\n", OLR_plant_max)); sb.Append(String.Format("manurebonus: {0}\n", manurebonus)); sb.Append(String.Format("fitness_function: {0}\t\t", fitness_function)); sb.Append(String.Format("nObjectives: {0}\r\n", nObjectives)); //sb.Append(String.Format("Ndelta: {0}\n", _Ndelta)); // add setpoints sb.Append(mySetpoints.print()); sb.Append(" return sb.ToString(); } } }
#include <stdio.h> #include <math.h> #include "context.h" #include "plans.h" #include "tuner_util.h" #include "tuner_exhaust.h" // TUNER INTERFACE cuzmem_plan* <API key> (enum cuzmem_tuner_action action, void* parm) { CUZMEM_CONTEXT ctx = get_context(); // TUNER START if (CUZMEM_TUNER_START == action) { // For now, do nothing special. if (ctx->tune_iter == 0) { // if we are in the 0th tuning cycle, do nothing here. // CUZMEM_TUNER_LOOKUP is determining the search space return NULL; } else { // start timing the iteration ctx->start_time = get_time (); } // Return value currently has no meaning return NULL; } // TUNER LOOKUP else if (CUZMEM_TUNER_LOOKUP == action) { // parm: pointer to size of allocation size_t size = *(size_t*)(parm); CUresult ret; int loopy = 0; cuzmem_plan* entry = NULL; int loc; // default 0th tuning iteration handling if (ctx->tune_iter == 0) { return <API key> (ctx, size); } // handle looping allocations & get current entry if (loopy_entry (ctx, &entry, size)) { return loopy_entry_handler (entry, size); } // exhaustive tuning entry->loc = (ctx->tune_iter >> ctx->current_knob) & 0x0001; loc = entry->loc; ret = alloc_mem (entry, size); // "natural mutation" if (loc != entry->loc) { // add large value to timer to invalidate this plan ctx->start_time -= (0.50*ctx->start_time); } ctx->current_knob++; return entry; } // TUNER END else if (CUZMEM_TUNER_END == action) { int i; double time; cuzmem_plan* entry = NULL; int all_global = 1; int satisfied = 0; unsigned int gpu_mem_free, gpu_mem_total, gpu_mem_req; unsigned int gpu_mem_min; CUresult ret; // standard tuner structure if (ctx->tune_iter == 0) { if (zeroth_end_handler (ctx)) { // everything fits in GPU memory, returning ends search return NULL; } // exhaustive search specific: compute # of tune iterations ctx->tune_iter_max = (unsigned long long)pow (2, ctx->num_knobs); } // get the time to complete this iteration time = get_time() - ctx->start_time; if (time < ctx->best_time) { ctx->best_time = time; ctx->best_plan = ctx->tune_iter; // algorithm dependent } // reset current knob for next tune iteration ctx->current_knob = 0; printf ("libcuzmem: best plan is #%llu of %llu\n", ctx->best_plan, ctx->tune_iter_max); // pull down GPU global memory usage from CUDA driver ret = cuMemGetInfo (&gpu_mem_free, &gpu_mem_total); if (ret != CUDA_SUCCESS) { fprintf (stderr, "libcuzmem: could not retrieve GPU memory info from CUDA Driver!\n"); exit (1); } else { gpu_mem_min = (unsigned int)((float)gpu_mem_free * (float)ctx->gpu_mem_percent * 0.01f); gpu_mem_free -= 20000000; } // check to make sure the next iteration's plan draft meets the GPU // global memory utilization constraint if it doesn't, we will skip it // and subsequent plans until we find one that does. // we also use this oppurtunity to clear out all of our inloop entry's // 1st hit flags i = ctx->tune_iter + 1; do { gpu_mem_req = 0; entry = ctx->plan; while (entry != NULL) { entry->loc = (i >> entry->id) & 0x0001; entry->first_hit = 1; if (entry->loc == 1 && entry->gold_member) { gpu_mem_req += entry->size; } entry = entry->next; } fprintf (stderr, " Request for Plan %i of %llu: %i (min: %i)\n", i, ctx->tune_iter_max, gpu_mem_req, gpu_mem_min ); if ((gpu_mem_req >= gpu_mem_min) && (gpu_mem_req < gpu_mem_free)) { // we subtract one beacuse tune_iter is auto-increment after this // function returns (before the next tune iterations starts) ctx->tune_iter = i - 1; satisfied = 1; } else { i++; } } while (!satisfied); // always end with this <API key> (ctx); return NULL; } // TUNER: UNKNOWN ACTION SPECIFIED else { printf ("libcuzmem: tuner asked to perform unknown action!\n"); exit (1); return NULL; } }
/** NAME : bgraph_bipart_bd.c **/ /** AUTHOR : Francois PELLEGRINI **/ /** FUNCTION : This module builds a band graph around **/ /** the frontier in order to decrease **/ /** problem size for the strategy to be **/ /** applied. **/ /** DATES : # Version 5.0 : from : 27 nov 2006 **/ /** to : 23 dec 2007 **/ /** # Version 5.1 : from : 09 nov 2008 **/ /** to : 26 mar 2011 **/ /** # Version 6.0 : from : 07 nov 2011 **/ /** to : 08 aug 2014 **/ /* ** The defines and includes. */ #define BGRAPH_BIPART_BD #include "module.h" #include "common.h" #include "parser.h" #include "graph.h" #include "arch.h" #include "bgraph.h" #include "bgraph_bipart_bd.h" #include "bgraph_bipart_st.h" /* This is the main routine. */ int bgraphBipartBd ( Bgraph * restrict const orggrafptr, /*+ Active graph +*/ const BgraphBipartBdParam * const paraptr) /*+ Method parameters +*/ { Gnum * restrict queutab; Gnum queuheadval; Gnum queutailval; Gnum distmax; /* Maximum distance allowed */ Gnum * restrict orgindxtax; /* Based access to index array for original graph */ Gnum orgfronnum; Gnum ancfronnum; Gnum bndfronnum; Bgraph bndgrafdat; /* Band graph structure */ Gnum bndvertnbr; /* Number of regular vertices in band graph (without anchors) */ Gnum bndvertnnd; const Gnum * restrict bndvnumtax; /* Band vertex number array, recycling queutab */ Gnum * restrict bndveextax; /* External gain array of band graph, if present */ Gnum bndveexnbr; /* Number of external array vertices */ Gnum bndvelosum; /* Load of regular vertices in band graph */ Gnum bndedlosum; /* Sum of edge loads */ Gnum bndcompsize1; /* Number of regular vertices in part 1 of band graph */ Gnum bndcompload1; /* Load of regular vertices in part 1 */ Gnum bndvlvlnum; /* Index of first band graph vertex to belong to the last layer */ Gnum bndvertnum; Gnum bndeancnbr; /* Number of anchor edges */ Gnum bndedgenbr; /* Upper bound on the number of edges, including anchor edges */ Gnum bndedgenum; Gnum * restrict bndedgetax; Gnum * restrict bndedlotax; Gnum bndedgetmp; Gnum bnddegrmax; Gnum bndcommgainextn; /* Sum of all external gains in band graph */ Gnum bndcommgainextn1; /* Sum of external gains accounted for in load, since in part 1 */ size_t bndedlooftval; /* Offset of edge load array with respect to edge array */ const Gnum * restrict const orgverttax = orggrafptr->s.verttax; /* Fast accesses */ const Gnum * restrict const orgvendtax = orggrafptr->s.vendtax; const Gnum * restrict const orgvelotax = orggrafptr->s.velotax; const Gnum * restrict const orgedgetax = orggrafptr->s.edgetax; const Gnum * restrict const orgedlotax = orggrafptr->s.edlotax; GraphPart * restrict const orgparttax = orggrafptr->parttax; Gnum * restrict const orgfrontab = orggrafptr->frontab; if (orggrafptr->fronnbr == 0) /* If no separator vertices, apply strategy to full (original) graph */ return (bgraphBipartSt (orggrafptr, paraptr->stratorg)); distmax = (Gnum) paraptr->distmax; if (distmax < 1) /* Always at least one layer of vertices around separator */ distmax = 1; if (memAllocGroup ((void **) (void *) &queutab, (size_t) (orggrafptr->s.vertnbr * sizeof (Gnum)), &orgindxtax, (size_t) (orggrafptr->s.vertnbr * sizeof (Gnum)), NULL) == NULL) { errorPrint ("bgraphBipartBd: out of memory (1)"); return (1); } memSet (orgindxtax, ~0, orggrafptr->s.vertnbr * sizeof (Gnum)); /* Initialize index array */ orgindxtax -= orggrafptr->s.baseval; queuheadval = orggrafptr->fronnbr; /* First layer is vertices in frontier array */ for (orgfronnum = 0, bndvertnnd = orggrafptr->s.baseval; /* Flag vertices belonging to frontier as band vertices */ orgfronnum < queuheadval; orgfronnum ++) { Gnum orgvertnum; orgvertnum = orgfrontab[orgfronnum]; orgindxtax[orgvertnum] = bndvertnnd ++; queutab[orgfronnum] = orgvertnum; /* Copy frontier array in queue array */ } bndvelosum = 0; bndedgenbr = 0; /* Estimate upper bound on the number of edges */ bndcompsize1 = 0; bndcompload1 = 0; queutailval = 0; bndvlvlnum = 0; /* Assume first layer is last layer */ while (distmax -- > 0) { /* For all passes except the last one */ Gnum orgvertnum; Gnum orgdistval; bndvlvlnum = queuheadval; /* Record start of last layer */ while (queutailval < bndvlvlnum) { /* For all vertices in queue */ Gnum orgvertnum; Gnum orgedgenum; Gnum orgpartval; orgvertnum = queutab[queutailval ++]; #ifdef <API key> if ((orgvertnum < orggrafptr->s.baseval) || (orgvertnum >= orggrafptr->s.vertnnd)) { errorPrint ("bgraphBipartBd: internal error (1)"); return (1); } #endif /* <API key> */ bndedgenbr += orgvendtax[orgvertnum] - orgverttax[orgvertnum]; /* Exact number of edges */ orgpartval = orgparttax[orgvertnum]; bndcompsize1 += orgpartval; /* Count vertices in part 1 */ if (orgvelotax != NULL) { Gnum orgveloval; orgveloval = orgvelotax[orgvertnum]; bndvelosum += orgveloval; bndcompload1 += orgveloval * orgpartval; } for (orgedgenum = orgverttax[orgvertnum]; orgedgenum < orgvendtax[orgvertnum]; orgedgenum ++) { Gnum orgvertend; orgvertend = orgedgetax[orgedgenum]; if (orgindxtax[orgvertend] == ~0) { /* If vertex not visited yet */ orgindxtax[orgvertend] = bndvertnnd ++; /* Flag it as enqueued */ queutab[queuheadval ++] = orgvertend; /* Enqueue it */ } } } } bndedgenbr += queuheadval - queutailval; /* As many edges from anchors as remaining vertices */ while (queutailval < queuheadval) { /* Process vertices in last layer */ Gnum orgvertnum; Gnum orgpartval; orgvertnum = queutab[queutailval ++]; #ifdef <API key> if ((orgvertnum < orggrafptr->s.baseval) || (orgvertnum >= orggrafptr->s.vertnnd)) { errorPrint ("bgraphBipartBd: internal error (2)"); return (1); } #endif /* <API key> */ bndedgenbr += orgvendtax[orgvertnum] - orgverttax[orgvertnum]; /* Upper bound on number of edges, including anchor edge */ orgpartval = orgparttax[orgvertnum]; bndcompsize1 += orgpartval; /* Count vertices in part 1 */ if (orgvelotax != NULL) { Gnum orgveloval; orgveloval = orgvelotax[orgvertnum]; bndvelosum += orgveloval; bndcompload1 += orgveloval * orgpartval; } } bndvertnbr = bndvertnnd - orggrafptr->s.baseval; if (orgvelotax == NULL) { bndvelosum = bndvertnbr; bndcompload1 = bndcompsize1; } if ((bndcompsize1 >= (orggrafptr->s.vertnbr - orggrafptr->compsize0)) || /* If either part has all of its vertices in band, use plain graph instead */ ((bndvertnbr - bndcompsize1) >= orggrafptr->compsize0)) { memFree (queutab); return (bgraphBipartSt (orggrafptr, paraptr->stratorg)); } /* TRICK: since always at least one missing vertex per part, there is room for anchor vertices */ queutab[bndvertnbr] = /* Anchor vertices do not have original vertex numbers */ queutab[bndvertnbr + 1] = -1; memSet (&bndgrafdat, 0, sizeof (Bgraph)); bndgrafdat.s.flagval = GRAPHFREETABS | GRAPHVERTGROUP | GRAPHEDGEGROUP | BGRAPHHASANCHORS; /* All Bgraph arrays are non-freeable by bgraphExit() */ bndgrafdat.s.baseval = orggrafptr->s.baseval; bndgrafdat.s.vertnbr = bndvertnbr += 2; /* "+ 2" for anchor vertices */ bndgrafdat.s.vertnnd = bndvertnnd + 2; bndveexnbr = (orggrafptr->veextax != NULL) ? bndvertnbr : 0; if (memAllocGroup ((void **) (void *) /* Do not allocate vnumtax but keep queutab instead */ &bndgrafdat.s.verttax, (size_t) ((bndvertnbr + 1) * sizeof (Gnum)), &bndgrafdat.s.velotax, (size_t) (bndvertnbr * sizeof (Gnum)), &bndveextax, (size_t) (bndveexnbr * sizeof (Gnum)), &bndgrafdat.frontab, (size_t) (bndvertnbr * sizeof (Gnum)), &bndgrafdat.parttax, (size_t) (bndvertnbr * sizeof (GraphPart)), NULL) == NULL) { errorPrint ("bgraphBipartBd: out of memory (2)"); memFree (queutab); return (1); } bndgrafdat.parttax -= orggrafptr->s.baseval; /* From now on we should free a Bgraph and not a Graph */ bndgrafdat.s.verttax -= orggrafptr->s.baseval; bndgrafdat.s.vendtax = bndgrafdat.s.verttax + 1; /* Band graph is compact */ bndgrafdat.s.velotax -= orggrafptr->s.baseval; bndgrafdat.s.vnumtax = queutab - orggrafptr->s.baseval; /* TRICK: re-use queue array as vertex number array since vertices taken in queue order; will not be freed as graph vertex arrays are said to be grouped */ bndgrafdat.s.velosum = orggrafptr->s.velosum; bndgrafdat.s.velotax[bndvertnnd] = orggrafptr->compload0 - (bndvelosum - bndcompload1); /* Set loads of anchor vertices */ bndgrafdat.s.velotax[bndvertnnd + 1] = orggrafptr->s.velosum - orggrafptr->compload0 - bndcompload1; if (bndveexnbr != 0) { bndveextax -= orggrafptr->s.baseval; bndgrafdat.veextax = bndveextax; } else bndveextax = NULL; if (memAllocGroup ((void **) (void *) &bndgrafdat.s.edgetax, (size_t) (bndedgenbr * sizeof (Gnum)), &bndgrafdat.s.edlotax, (size_t) (bndedgenbr * sizeof (Gnum)), NULL) == NULL) { errorPrint ("bgraphBipartBd: out of memory (3)"); bgraphExit (&bndgrafdat); memFree (queutab); return (1); } bndgrafdat.s.edgetax -= orggrafptr->s.baseval; bndgrafdat.s.edlotax -= orggrafptr->s.baseval; bndedgetax = bndgrafdat.s.edgetax; bndedlotax = bndgrafdat.s.edlotax; bndvnumtax = bndgrafdat.s.vnumtax; for (bndvertnum = bndedgenum = orggrafptr->s.baseval, bnddegrmax = bndedlosum = bndcommgainextn = bndcommgainextn1 = 0; bndvertnum < bndvlvlnum; bndvertnum ++) { /* Fill index array for vertices not belonging to last level */ Gnum orgvertnum; GraphPart orgpartval; Gnum orgedgenum; Gnum orgedloval; Gnum bnddegrval; orgvertnum = bndvnumtax[bndvertnum]; orgpartval = orgparttax[orgvertnum]; bndgrafdat.s.verttax[bndvertnum] = bndedgenum; bndgrafdat.s.velotax[bndvertnum] = (orgvelotax != NULL) ? orgvelotax[orgvertnum] : 1; bndgrafdat.parttax[bndvertnum] = orgpartval; if (bndveextax != NULL) { Gnum orgveexval; orgveexval = orggrafptr->veextax[orgvertnum]; bndveextax[bndvertnum] = orgveexval; bndcommgainextn += orgveexval; bndcommgainextn1 += orgveexval * (Gnum) orgpartval; } orgedloval = 1; /* Assume unity edge loads if not present */ for (orgedgenum = orgverttax[orgvertnum]; /* All edges of first levels are kept */ orgedgenum < orgvendtax[orgvertnum]; orgedgenum ++, bndedgenum ++) { #ifdef <API key> if ((bndedgenum >= (bndedgenbr + orggrafptr->s.baseval)) || (orgindxtax[orgedgetax[orgedgenum]] < 0)) { errorPrint ("bgraphBipartBd: internal error (3)"); return (1); } #endif /* <API key> */ if (orgedlotax != NULL) orgedloval = orgedlotax[orgedgenum]; bndedlosum += orgedloval; bndedgetax[bndedgenum] = orgindxtax[orgedgetax[orgedgenum]]; bndedlotax[bndedgenum] = orgedloval; } bnddegrval = bndedgenum - bndgrafdat.s.verttax[bndvertnum]; if (bnddegrmax < bnddegrval) bnddegrmax = bnddegrval; } bndeancnbr = 0; for ( ; bndvertnum < bndvertnnd; bndvertnum ++) { /* Fill index array for vertices belonging to last level */ Gnum orgvertnum; Gnum orgedgenum; GraphPart orgpartval; Gnum bnddegrval; Gnum orgedloval; Gnum ancedloval; /* Accumulated edge load for anchor edge */ orgvertnum = bndvnumtax[bndvertnum]; orgpartval = orgparttax[orgvertnum]; bndgrafdat.s.verttax[bndvertnum] = bndedgenum; bndgrafdat.s.velotax[bndvertnum] = (orgvelotax != NULL) ? orgvelotax[orgvertnum] : 1; bndgrafdat.parttax[bndvertnum] = orgpartval; /* Record part for vertices of last level */ if (bndveextax != NULL) { Gnum orgveexval; orgveexval = orggrafptr->veextax[orgvertnum]; bndveextax[bndvertnum] = orgveexval; bndcommgainextn += orgveexval; bndcommgainextn1 += orgveexval * (Gnum) orgpartval; } ancedloval = 0; orgedloval = 1; /* Assume unity edge loads if not present */ for (orgedgenum = orgverttax[orgvertnum]; /* Keep only band edges */ orgedgenum < orgvendtax[orgvertnum]; orgedgenum ++) { Gnum bndvertend; #ifdef <API key> if (bndedgenum >= (bndedgenbr + orggrafptr->s.baseval)) { errorPrint ("bgraphBipartBd: internal error (4)"); return (1); } #endif /* <API key> */ if (orgedlotax != NULL) orgedloval = orgedlotax[orgedgenum]; bndedlosum += orgedloval; /* Normal arcs are accounted for twice; anchor arcs only once */ bndvertend = orgindxtax[orgedgetax[orgedgenum]]; if (bndvertend != ~0) { bndedgetax[bndedgenum] = bndvertend; bndedlotax[bndedgenum ++] = orgedloval; } else ancedloval += orgedloval; /* Accumulate loads of edges linking to anchor vertex */ } bndedlosum += ancedloval; /* Account for anchor edges a second time */ if (ancedloval > 0) { /* If vertex is connected to rest of part */ bndedlotax[bndedgenum] = ancedloval; bndedgetax[bndedgenum ++] = bndvertnnd + (Gnum) orgpartval; /* Add anchor edge to proper anchor vertex */ bndeancnbr ++; } bnddegrval = bndedgenum - bndgrafdat.s.verttax[bndvertnum]; if (bnddegrmax < bnddegrval) bnddegrmax = bnddegrval; } bndgrafdat.parttax[bndvertnnd] = 0; /* Set parts of anchor vertices */ bndgrafdat.parttax[bndvertnnd + 1] = 1; bndgrafdat.s.edlosum = bndedlosum; bndgrafdat.s.verttax[bndvertnnd] = bndedgenum; /* Mark end of regular edge array and start of first anchor edge array */ bndedgetmp = bndedgenum + bndeancnbr; #ifdef <API key> if ((bndedgetmp - 1) >= (bndedgenbr + orggrafptr->s.baseval)) { errorPrint ("bgraphBipartBd: internal error (5)"); return (1); } #endif /* <API key> */ bndgrafdat.s.edgenbr = bndedgetmp - orggrafptr->s.baseval; bndgrafdat.s.verttax[bndvertnnd + 2] = bndedgetmp; /* Mark end of edge array with anchor vertices */ for (bndvertnum = bndvlvlnum; bndvertnum < bndvertnnd; bndvertnum ++) { /* Fill anchor edge arrays */ Gnum orgvertnum; orgvertnum = bndvnumtax[bndvertnum]; if (bndgrafdat.s.verttax[bndvertnum + 1] > bndgrafdat.s.verttax[bndvertnum]) { /* If vertex is not isolated */ Gnum bndedgelst; /* Number of last edge */ Gnum bndvertend; bndedgelst = bndgrafdat.s.verttax[bndvertnum + 1] - 1; bndvertend = bndedgetax[bndedgelst]; /* Get last neighbor of its edge sub-array */ if (bndvertend >= bndvertnnd) { /* If it is an anchor */ Gnum bndedloval; bndedloval = bndedlotax[bndedgelst]; bndedlosum += bndedloval; if (bndvertend == bndvertnnd) { /* Add edge from proper anchor */ bndedgetax[bndedgenum] = bndvertnum; bndedlotax[bndedgenum ++] = bndedloval; } else { bndedgetax[-- bndedgetmp] = bndvertnum; bndedlotax[bndedgetmp] = bndedloval; } } } } bndgrafdat.s.verttax[bndvertnnd + 1] = bndedgenum; /* Mark end of edge array of first anchor and start of second */ #ifdef <API key> if (bndedgenum != bndedgetmp) { errorPrint ("bgraphBipartBd: internal error (6)"); return (1); } #endif /* <API key> */ if ((bndedgenum == bndgrafdat.s.verttax[bndvertnnd]) || /* If any of the anchor edges is isolated */ (bndedgenum == bndgrafdat.s.verttax[bndvertnnd + 2])) { bgraphExit (&bndgrafdat); /* Free all band graph related data */ memFree (queutab); return (bgraphBipartSt (orggrafptr, paraptr->stratorg)); /* Work on original graph */ } if (bnddegrmax < (bndgrafdat.s.verttax[bndvertnnd + 1] - bndgrafdat.s.verttax[bndvertnnd])) bnddegrmax = (bndgrafdat.s.verttax[bndvertnnd + 1] - bndgrafdat.s.verttax[bndvertnnd]); if (bnddegrmax < (bndgrafdat.s.verttax[bndvertnnd + 2] - bndgrafdat.s.verttax[bndvertnnd + 1])) bnddegrmax = (bndgrafdat.s.verttax[bndvertnnd + 2] - bndgrafdat.s.verttax[bndvertnnd + 1]); bndgrafdat.s.degrmax = bnddegrmax; bndedlooftval = bndedlotax - bndedgetax; bndgrafdat.s.edgetax = (Gnum *) memRealloc (bndedgetax + bndgrafdat.s.baseval, (bndedlooftval + bndgrafdat.s.edgenbr) * sizeof (Gnum)) - bndgrafdat.s.baseval; bndgrafdat.s.edlotax = bndgrafdat.s.edgetax + bndedlooftval; /* Use old index into old array as new index */ bndedgetax = bndgrafdat.s.edgetax; bndedlotax = bndgrafdat.s.edlotax; for (bndfronnum = 0, bndvertnum = orggrafptr->s.baseval; /* Fill band frontier array with first vertex indices as they make the separator */ bndfronnum < orggrafptr->fronnbr; bndfronnum ++, bndvertnum ++) bndgrafdat.frontab[bndfronnum] = bndvertnum; if (bndveextax != NULL) { Gnum bndcommloadintn; Gnum bndfronnnd; Gnum bndvertnum; Gnum bndedgenum; Gnum bndedloval; bndedloval = 1; /* Assume unity edge weights */ bndcommloadintn = 0; for (bndvertnum = orggrafptr->s.baseval, bndfronnnd = bndvertnum + orggrafptr->fronnbr; /* Compute communication load at frontier */ bndvertnum < bndfronnnd; bndvertnum ++) { Gnum bndpartval; bndpartval = (Gnum) bndgrafdat.parttax[bndvertnum]; if (bndpartval != 0) /* Process only frontier vertices in part 0 */ continue; for (bndedgenum = bndgrafdat.s.verttax[bndvertnum]; bndedgenum < bndgrafdat.s.vendtax[bndvertnum]; bndedgenum ++) { Gnum bndpartend; bndpartend = (Gnum) bndgrafdat.parttax[bndedgetax[bndedgenum]]; bndedloval = bndedlotax[bndedgenum]; bndcommloadintn += bndedloval * bndpartend; } } bndcommloadintn *= orggrafptr->domndist; bndveextax[bndvertnnd + 1] = (orggrafptr->commload - orggrafptr->commloadextn0 - bndcommloadintn) - bndcommgainextn1; bndveextax[bndvertnnd] = (orggrafptr->commload - orggrafptr->commloadextn0 - bndcommloadintn) - bndcommgainextn + bndcommgainextn1 + orggrafptr->commgainextn; } bndgrafdat.fronnbr = orggrafptr->fronnbr; bndgrafdat.compload0 = orggrafptr->compload0; bndgrafdat.compload0min = orggrafptr->compload0min; bndgrafdat.compload0max = orggrafptr->compload0max; bndgrafdat.compload0avg = orggrafptr->compload0avg; bndgrafdat.compload0dlt = orggrafptr->compload0dlt; bndgrafdat.compsize0 = bndvertnbr - bndcompsize1 - 1; /* "- 1" for anchor vertex in part 0 */ bndgrafdat.commload = orggrafptr->commload; bndgrafdat.commloadextn0 = orggrafptr->commloadextn0; bndgrafdat.commgainextn = orggrafptr->commgainextn; bndgrafdat.commgainextn0 = orggrafptr->commgainextn0; bndgrafdat.domndist = orggrafptr->domndist; bndgrafdat.domnwght[0] = orggrafptr->domnwght[0]; bndgrafdat.domnwght[1] = orggrafptr->domnwght[1]; bndgrafdat.vfixload[0] = orggrafptr->vfixload[0]; bndgrafdat.vfixload[1] = orggrafptr->vfixload[1]; bndgrafdat.bbalval = orggrafptr->bbalval; bndgrafdat.levlnum = orggrafptr->levlnum; #ifdef <API key> if ((graphCheck (&bndgrafdat.s) != 0) || /* Check band graph consistency */ (bgraphCheck (&bndgrafdat) != 0)) { errorPrint ("bgraphBipartBd: inconsistent band graph data"); bgraphExit (&bndgrafdat); memFree (queutab); return (1); } #endif /* <API key> */ if (bgraphBipartSt (&bndgrafdat, paraptr->stratbnd) != 0) { /* Apply strategy to band graph */ errorPrint ("bgraphBipartBd: cannot bipartition band graph"); bgraphExit (&bndgrafdat); memFree (queutab); return (1); } if (bndgrafdat.parttax[bndvertnnd] == /* If band graph was too small and anchors went to the same part, apply strategy on full graph */ bndgrafdat.parttax[bndvertnnd + 1]) { bgraphExit (&bndgrafdat); memFree (queutab); return (bgraphBipartSt (orggrafptr, paraptr->stratorg)); } orggrafptr->compload0 = bndgrafdat.compload0; orggrafptr->compload0dlt = bndgrafdat.compload0dlt; orggrafptr->commload = bndgrafdat.commload; orggrafptr->commgainextn = bndgrafdat.commgainextn; orggrafptr->bbalval = bndgrafdat.bbalval; if (bndgrafdat.parttax[bndvertnnd] != 0) { /* If anchors swapped parts, swap all parts of original vertices */ Gnum orgvertnum; orggrafptr->compsize0 = orggrafptr->s.vertnbr - orggrafptr->compsize0 - bndcompsize1 + bndgrafdat.compsize0 - 1; /* "- 1" for anchor 0 */ for (orgvertnum = orggrafptr->s.baseval; orgvertnum < orggrafptr->s.vertnnd; orgvertnum ++) orgparttax[orgvertnum] ^= 1; } else orggrafptr->compsize0 = orggrafptr->compsize0 - (bndvertnbr - bndcompsize1) + bndgrafdat.compsize0 + 1; /* "+ 1" for anchor 0 */ for (bndvertnum = bndgrafdat.s.baseval; bndvertnum < bndvertnnd; bndvertnum ++) /* Update part array of full graph */ orgparttax[bndvnumtax[bndvertnum]] = bndgrafdat.parttax[bndvertnum]; for (bndfronnum = orgfronnum = ancfronnum = 0; /* Update frontier array of full graph */ bndfronnum < bndgrafdat.fronnbr; bndfronnum ++) { Gnum bndvertnum; Gnum orgvertnum; bndvertnum = bndgrafdat.frontab[bndfronnum]; orgvertnum = bndvnumtax[bndvertnum]; if (orgvertnum != -1) /* If frontier vertex is not an anchor vertex */ orgfrontab[orgfronnum ++] = orgvertnum; /* Record it as original frontier vertex */ else bndgrafdat.frontab[ancfronnum ++] = bndvertnum; /* Else record it for future processing */ } while (ancfronnum > 0) { /* For all recorded frontier anchor vertices */ Gnum bndvertnum; /* Index of frontier anchor vertex in band graph */ GraphPart ancpartval; bndvertnum = bndgrafdat.frontab[-- ancfronnum]; ancpartval = bndgrafdat.parttax[bndvertnum]; for (bndedgenum = bndgrafdat.s.verttax[bndvertnum]; bndedgenum < bndgrafdat.s.vendtax[bndvertnum]; bndedgenum ++) { Gnum bndvertend; /* Index of neighbor of anchor vertex in band graph */ Gnum orgvertnum; /* Index of neighbor of anchor vertex in original graph */ Gnum orgedgenum; bndvertend = bndedgetax[bndedgenum]; if (bndgrafdat.parttax[bndvertend] == ancpartval) /* If neighbor is in same part as anchor, skip to next */ continue; orgvertnum = bndvnumtax[bndvertend]; for (orgedgenum = orgverttax[orgvertnum]; /* For all neighbors of neighbor */ orgedgenum < orgvendtax[orgvertnum]; orgedgenum ++) { Gnum orgvertend; orgvertend = orgedgetax[orgedgenum]; /* Get end vertex in original graph */ if (orgindxtax[orgvertend] == ~0) { /* If vertex never considered before */ #ifdef <API key> if (orgparttax[orgvertend] != ancpartval) { /* Original vertex should always be in same part as anchor */ errorPrint ("bgraphBipartBd: internal error (7)"); return (1); } #endif /* <API key> */ orggrafptr->frontab[orgfronnum ++] = orgvertend; /* Add vertex to frontier array */ orgindxtax[orgvertend] = 0; /* Flag vertex as already enqueued */ } } } } orggrafptr->fronnbr = orgfronnum; bgraphExit (&bndgrafdat); /* Free band graph structures */ memFree (queutab); #ifdef <API key> if (bgraphCheck (orggrafptr) != 0) { errorPrint ("bgraphBipartBd: inconsistent graph data"); return (1); } #endif /* <API key> */ return (0); }
<?php defined('MYAAC') or die('Direct access not allowed!'); class Usage_Statistics { private static $report_url = 'https://my-aac.org/report_usage.php'; public static function report() { $data = json_encode(self::getStats()); $options = array( 'http' => array( 'header' => 'Content-type: application/json' . "\r\n" . 'Content-Length: ' . strlen($data) . "\r\n", 'content' => $data ) ); $context = <API key>($options); $result = file_get_contents(self::$report_url, false, $context); return $result !== false; } public static function getStats() { global $config, $db; $ret = array(); $ret['unique_id'] = hash('sha1', $config['server_path']); $ret['server_os'] = php_uname('s') . ' ' . php_uname('r'); $ret['myaac_version'] = MYAAC_VERSION; $ret['myaac_db_version'] = DATABASE_VERSION; if($db->hasTable('server_config')) { $query = $db->query('SELECT `value` FROM `server_config` WHERE `config` = ' . $db->quote('database_version')); if($query->rowCount() == 1) { $query = $query->fetch(); $ret['otserv_db_version'] = $query['value']; } } $ret['client_version'] = $config['client']; $ret['php_version'] = phpversion(); $query = $db->query('SELECT VERSION() as `version`;'); if($query->rowCount() == 1) { $query = $query->fetch(); $ret['mysql_version'] = $query['version']; } $query = $db->query('SELECT SUM(ROUND(((DATA_LENGTH + INDEX_LENGTH) / 1024 ), 0)) AS "size" FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = "' . $config['database_name'] . '";'); if($query->rowCount() == 1) { $query = $query->fetch(); $ret['database_size'] = $query['size']; } $ret['views_counter'] = getDatabaseConfig('views_counter'); $query = $db->query('SELECT COUNT(`id`) as `size` FROM `accounts`;'); if($query->rowCount() == 1) { $query = $query->fetch(); $ret['accounts_size'] = $query['size']; } $query = $db->query('SELECT COUNT(`id`) as `size` FROM `players`;'); if($query->rowCount() == 1) { $query = $query->fetch(); $ret['players_size'] = $query['size']; } $query = $db->query('SELECT COUNT(`id`) as `size` FROM `' . TABLE_PREFIX . 'monsters`;'); if($query->rowCount() == 1) { $query = $query->fetch(); $ret['monsters_size'] = $query['size']; } $query = $db->query('SELECT COUNT(`id`) as `size` FROM `' . TABLE_PREFIX . 'spells`;'); if($query->rowCount() == 1) { $query = $query->fetch(); $ret['spells_size'] = $query['size']; } $ret['locales'] = get_locales(); $ret['plugins'] = array(); foreach(get_plugins() as $plugin) { $string = file_get_contents(BASE . 'plugins/' . $plugin . '.json'); $plugin_info = json_decode($string, true); if($plugin_info != false) { if(isset($plugin_info['version'])) { $ret['plugins'][$plugin] = $plugin_info['version']; } } } $ret['templates'] = get_templates(); $ret['date_timezone'] = $config['date_timezone']; $ret['backward_support'] = $config['backward_support']; $cache_engine = strtolower($config['cache_engine']); if($cache_engine == 'auto') { $cache_engine = Cache::detect(); } $ret['cache_engine'] = $cache_engine; return $ret; } }
<style> ion-content{ background-color: #00091a; color:#e6eeff; } ion-card{ text-align: right; } /*global CSS*/ #gems{ background-color: inherit; } .more { float: none; } .menu{ transform: translate(-50%, 55%); } /*small devices*/ @media (min-width: 320px) and (max-width: 480px) { .more{ margin-top: 20vh; } .container{ margin-top: 20vh; } #avatar{ float: center; height:50px; width:50px; margin-left: 19vw; margin-top: 2vh; border-radius: 50%; } .menu { position: relative; margin-top: 25%; left: 50%; width: 0px; } .toggle + .style { width: 190px; height: 190px; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%) scale(1); z-index: 5; display: block; max-width: 50vw; margin-bottom: 0; background-size: 200px 200px; background-position: center; background-repeat: no-repeat; color: #fff; font-size: 2.5em; text-align: center; -webkit-transition: all .8s; -moz-transition: all .8s; -o-transition: all .8s; -ms-transition: all .8s; transition: all .8s; } .menu p{ max-width: 20vw; text-align: center; margin: 0 auto; line-height: 25px; padding-top: 30px; font-weight: 300; font-size: 1.5em; } .toggle { display: none; } .toggle + .style:hover{ -webkit-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -moz-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -ms-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -o-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); } .toggle:checked + .style { transform: translate(-50%, -50%) scale(.5); } .menu input[type=checkbox] + label:before { content: ""; position: absolute; } .toggle + .style:before, .toggle + .style:after { content: ""; position: absolute; margin: -3px; border-radius:5px; transition: all 0.3s; } .toggle + .style:before { width: 30px; height: 0px; left: 10px; top: 25px; } .toggle + .style:after { width: 0px; height: 30px; left: 25px; top: 10px; } .toggle:checked + .style:before, .toggle:checked + .style:after { transform: rotate(135deg); } .toggle ~ .tab { position: absolute; background: #008DFF; color: #fff; width: 100px; height: 100px; left: 0px; top: 0px; transform: translate(-50%, -50%) scale(0); transition: all 0.3s; opacity: 0; border-radius: 50%; } .toggle:checked ~ .tab { opacity: 1; transform: translate(-50%, -50%) scale(1); } .menu > .toggle:checked ~ .tab:nth-of-type(1) { top: -110px; left: 0px; transition-delay: 0s; } .menu > .toggle:checked ~ .tab:nth-of-type(2) { top: -60px; left: 110px; transition-delay: 0.125s; } .menu > .toggle:checked ~ .tab:nth-of-type(3) { top: 50px; left: 110px; transition-delay: 0.25s; } .menu > .toggle:checked ~ .tab:nth-of-type(4) { top: 100px; left: 0px; transition-delay: 0.375s; } .menu > .toggle:checked ~ .tab:nth-of-type(5) { top: 45px; left: -100px; transition-delay: 0.5s; } .menu > .toggle:checked ~ .tab:nth-of-type(6) { top: -70px; left: -100px; transition-delay: 0.625s; } .menu > .toggle:checked ~ .tab:nth-of-type(7) { top: 0px; left: -133.33333px; transition-delay: 0.75s; } .menu > .toggle:checked ~ .tab:nth-of-type(8) { top: -94.2809px; left: -94.2809px; transition-delay: 0.875s; } #nickname{ float: right; color: black; font-size: 1.3em; } #conn_status{ margin-top:3vh; margin-left: 21vw; height: 5vh; width: 10vw; float: left; } #gems{ margin-top:3vh; font-size: 4vh; float: left; margin-left: 1vw; } #gem-icon{ margin-top:3vh; float: left; height: 5vh; width: 10vw; } hr{ margin-top:5vh; } } @media (min-width: 481px) and (max-width: 767px) { .more{ float: none; margin-top: 20vh; } .container{ margin-top: 20vh; } #avatar{ float: center; height:80px; width:80px; margin-left: 24vw; margin-top: 2vh; border-radius: 50%; } #style{ background-size: 100% 100%; } .menu { position: relative; margin-top: 25%; left: 50%; width: 0px; transform: translate(-50%, 55%); } .toggle + .style { width: 200px; height: 200px; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%) scale(1); z-index: 5; display: block; max-width: 50vw; margin-bottom: 100px; background-position: center; color: #fff; font-size: 2.5em; padding-top: 40px; text-align: center; -webkit-transition: all .8s; -moz-transition: all .8s; -o-transition: all .8s; -ms-transition: all .8s; transition: all .8s; } .menu p{ max-width: 20vw; text-align: center; margin: 0 auto; line-height: 25px; padding-top: 30px; font-weight: 300; font-size: 1.5em; } .toggle + .style:hover{ -webkit-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -moz-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -ms-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -o-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); } .toggle:checked + .style { transform: translate(-50%, -50%) scale(.5); } .menu input[type=checkbox] + label:before { content: ""; position: absolute; } .toggle + .style:before, .toggle + .style:after { content: ""; position: absolute; margin: -3px; border-radius:5px; transition: all 0.3s; } .toggle + .style:before { width: 30px; height: 0px; left: 10px; top: 25px; } .toggle + .style:after { width: 0px; height: 30px; left: 25px; top: 10px; } .toggle:checked + .style:before, .toggle:checked + .style:after { transform: rotate(135deg); } .toggle ~ .tab { position: absolute; background: #008DFF; color: #fff; width: 100px; height: 100px; left: 0px; top: 10px; transform: translate(-50%, -50%) scale(0); transition: all 0.3s; opacity: 0; border-radius: 50%; } .toggle:checked ~ .tab { opacity: 1; transform: translate(-50%, -50%) scale(1); } .menu > .toggle:checked ~ .tab:nth-of-type(1) { top: -110px; left: 0px; transition-delay: 0s; } .menu > .toggle:checked ~ .tab:nth-of-type(2) { top: -60px; left: 110px; transition-delay: 0.125s; } .menu > .toggle:checked ~ .tab:nth-of-type(3) { top: 50px; left: 110px; transition-delay: 0.25s; } .menu > .toggle:checked ~ .tab:nth-of-type(4) { top: 100px; left: 0px; transition-delay: 0.375s; } .menu > .toggle:checked ~ .tab:nth-of-type(5) { top: 45px; left: -100px; transition-delay: 0.5s; } .menu > .toggle:checked ~ .tab:nth-of-type(6) { top: -70px; left: -100px; transition-delay: 0.625s; } .menu > .toggle:checked ~ .tab:nth-of-type(7) { top: 0px; left: -133.33333px; transition-delay: 0.75s; } .menu > .toggle:checked ~ .tab:nth-of-type(8) { top: -94.2809px; left: -94.2809px; transition-delay: 0.875s; } #nickname { float: right; color: black; font-size: 3vh; } #conn_status{ margin-top:3vh; margin-left: 21vw; height: 5vh; width: 10vw; float: left; } #gems{ margin-top:3vh; font-size: 4vh; float: left; margin-left: 1vw; } #gem-icon{ margin-top:3vh; float: left; height: 5vh; width: 10vw; } hr{ margin-top:15vh; } } @media (min-width: 768px) and (max-width: 1024px) { .more{ float: none; margin-top: 30vh; } .container{ margin-top: 100px; } #avatar{ float: center; height:80px; width:80px; margin-left: 30vw; border-radius: 50%; } .menu { position: relative; margin-top: 25%; left: 50%; width: 0px; transform: translate(-50%, 55%); } .toggle + .style { width: 200px; height: 200px; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%) scale(1); z-index: 5; display: block; max-width: 50vw; margin-bottom: 0; background-size: cover; background-position: center; font-size: 2.5em; padding-top: 75px; text-align: center; -webkit-transition: all .8s; -moz-transition: all .8s; -o-transition: all .8s; -ms-transition: all .8s; transition: all .8s; } .menu p{ max-width: 20vw; text-align: center; margin: 0 auto; line-height: 25px; padding-top: 50px; font-weight: 300; font-size: 1.5em; } .toggle + .style:hover{ -webkit-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -moz-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -ms-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -o-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); } .toggle:checked + .style { transform: translate(-50%, -50%) scale(.5); } .menu input[type=checkbox] + label:before { content: ""; position: absolute; } .toggle:checked + .style:before, .toggle:checked + .style:after { transform: rotate(135deg); } .toggle ~ .tab { position: absolute; background: #008DFF; color: #fff; width: 120px; height: 120px; left: 0px; top: 0px; transform: translate(-50%, -50%) scale(0); transition: all 0.3s; opacity: 0; border-radius: 50%; } .toggle:checked ~ .tab { opacity: 1; transform: translate(-50%, -50%) scale(1); } .menu > .toggle:checked ~ .tab:nth-of-type(1) { top: -130px; left: 0px; transition-delay: 0s; } .menu > .toggle:checked ~ .tab:nth-of-type(2) { top: -70px; left: 120px; transition-delay: 0.125s; } .menu > .toggle:checked ~ .tab:nth-of-type(3) { top: 70px; left: 130px; transition-delay: 0.25s; } .menu > .toggle:checked ~ .tab:nth-of-type(4) { top: 150px; left: 0px; transition-delay: 0.375s; } .menu > .toggle:checked ~ .tab:nth-of-type(5) { top: 80px; left: -120px; transition-delay: 0.5s; } .menu > .toggle:checked ~ .tab:nth-of-type(6) { top: -50px; left: -120px; transition-delay: 0.625s; } .menu > .toggle:checked ~ .tab:nth-of-type(7) { top: 0px; left: -133.33333px; transition-delay: 0.75s; } .menu > .toggle:checked ~ .tab:nth-of-type(8) { top: -94.2809px; left: -94.2809px; transition-delay: 0.875s; } #nickname{ float:right; margin-right: 1vw; color: black; font-size: 2vh; } #conn_status{ margin-top:3vh; margin-left: 220px; height: 50px; width: 50px; float: left; } #gems{ margin-top:2vh; font-size: 2vh; float: left; margin-left: 1vw; } #gem-icon{ margin-top:1vh; float: left; height: 5vh; width: 10vw; } hr{ margin-top:5vh; } #nickname{ float: right; } } @media (min-width: 1025px) and (max-width: 1280px){ .more{ float: none; margin-top: 30vh; } .container{ margin-top: 100px; } #avatar{ float: center; height:100px; width:100px; margin-left: 28vw; border-radius: 50%; } .menu { position: relative; margin-top: 25%; left: 50%; width: 0px; transform: translate(-50%, 55%); } .toggle + .style { width: 200px; height: 200px; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%) scale(1); z-index: 5; display: block; max-width: 50vw; margin-bottom: 0; background: #008DFF; color: #fff; font-size: 2.5em; background-size: 100% 100%; padding-top: 75px; text-align: center; -webkit-transition: all .8s; -moz-transition: all .8s; -o-transition: all .8s; -ms-transition: all .8s; transition: all .8s; } .menu p{ max-width: 20vw; text-align: center; margin: 0 auto; line-height: 25px; padding-top: 50px; font-weight: 300; font-size: 1.5em; } .toggle + .style:hover{ -webkit-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -moz-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -ms-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); -o-box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); box-shadow: 0px 1px 20px 0px rgba(0, 0, 0, .7); } .toggle:checked + .style { transform: translate(-50%, -50%) scale(.5); } .menu input[type=checkbox] + label:before { content: ""; position: absolute; } .toggle:checked + .style:before, .toggle:checked + .style:after { transform: rotate(135deg); } .toggle ~ .tab { position: absolute; background: #008DFF; color: #fff; width: 120px; height: 120px; left: 0px; top: 0px; transform: translate(-50%, -50%) scale(0); transition: all 0.3s; opacity: 0; border-radius: 50%; } .toggle:checked ~ .tab { opacity: 1; transform: translate(-50%, -50%) scale(1); } .menu > .toggle:checked ~ .tab:nth-of-type(1) { top: -130px; left: 0px; transition-delay: 0s; } .menu > .toggle:checked ~ .tab:nth-of-type(2) { top: -70px; left: 120px; transition-delay: 0.125s; } .menu > .toggle:checked ~ .tab:nth-of-type(3) { top: 70px; left: 130px; transition-delay: 0.25s; } .menu > .toggle:checked ~ .tab:nth-of-type(4) { top: 150px; left: 0px; transition-delay: 0.375s; } .menu > .toggle:checked ~ .tab:nth-of-type(5) { top: 80px; left: -120px; transition-delay: 0.5s; } .menu > .toggle:checked ~ .tab:nth-of-type(6) { top: -50px; left: -120px; transition-delay: 0.625s; } .menu > .toggle:checked ~ .tab:nth-of-type(7) { top: 0px; left: -133.33333px; transition-delay: 0.75s; } .menu > .toggle:checked ~ .tab:nth-of-type(8) { top: -94.2809px; left: -94.2809px; transition-delay: 0.875s; } #nickname{ float:right; margin-right: 1vw; color: black; font-size: 3vh; } #conn_status{ margin-top:3vh; margin-left: 220px; height: 50px; width: 50px; float: left; } #gems{ margin-top:3vh; font-size: 4vh; float: left; margin-left: 1vw; } #gem-icon{ margin-top:3vh; float: left; height: 80px; width: 80px; } hr{ margin-top:5vh; } #nickname{ float: right; } } @media (min-width: 1281px) {/*Desktops*/ .container{ margin-top: 50px; } #avatar{ float: right; height:200px; width:300px; border-radius: 50%; } .menu { position: relative; margin-top: 200px; left: 50%; width: 0px; transform: translate(-50%, 55%); } .toggle + .style { width: 700px; height: 200px; border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%) scale(1); z-index: 5; display: block; max-width: 100px; margin-bottom: 0; background: #008DFF; color: #fff; font-size: 2.5em; padding-top: 75px; text-align: center; -webkit-transition: all .8s; -moz-transition: all .8s; -o-transition: all .8s; -ms-transition: all .8s; transition: all .8s; } .menu p{ max-width: 20vw; text-align: center; margin: 0 auto; line-height: 25px; padding-top: 30px; font-weight: 500; font-size: 1.5em; } .toggle:checked + .style { transform: translate(-50%, -50%) scale(.5); } .menu input[type=checkbox] + label:before { content: ""; position: absolute; } .toggle + .style:after { content: ""; position: absolute; margin: -3px; border-radius:5px; transition: all 0.3s; } .toggle + .style:after { width: 100px; height: 30px; left: 25px; top: 10px; } .toggle ~ .tab { position: absolute; background: #008DFF; color: #fff; width: 150px; height: 150px; left: 0px; top: 0px; transform: translate(-50%, -50%) scale(0); transition: all 0.3s; opacity: 0; border-radius: 50%; } .toggle:checked ~ .tab { opacity: 1; transform: translate(-50%, -50%) scale(1); } .menu > .toggle:checked ~ .tab:nth-of-type(1) { top: -180px; left: 0px; transition-delay: 0s; } .menu > .toggle:checked ~ .tab:nth-of-type(2) { top: -90px; left: 150px; transition-delay: 0.125s; } .menu > .toggle:checked ~ .tab:nth-of-type(3) { top: 80px; left: 160px; transition-delay: 0.25s; } .menu > .toggle:checked ~ .tab:nth-of-type(4) { top: 200px; left: 0px; transition-delay: 0.375s; } .menu > .toggle:checked ~ .tab:nth-of-type(5) { top: 100px; left: -150px; transition-delay: 0.5s; } .menu > .toggle:checked ~ .tab:nth-of-type(6) { top: -80px; left: -150px; transition-delay: 0.625s; } .menu > .toggle:checked ~ .tab:nth-of-type(7) { top: 0px; left: -133.33333px; transition-delay: 0.75s; } .menu > .toggle:checked ~ .tab:nth-of-type(8) { top: -94.2809px; left: -94.2809px; transition-delay: 0.875s; } #conn_status{ margin-top:3vh; margin-left: 34vw; height: 10vh; width: 7vw; float: left; } #gems{ margin-top:5vh; font-size: 4vh; float: left; margin-left: 1vw; } #gem-icon{ margin-top:3vh; float: left; height: 10vh; width: 7vw; } hr{ margin-top:10vh; } #nickname{ margin-top: 10vh } } #game{ background-image: url("assets/static/icons/bazi.png"); background-size: 100% 100%; } #history{ background-image: url("assets/static/icons/eftekharat.png"); background-size: 100% 100%; } #about{ background-image: url("assets/static/icons/info.ico"); background-size: 100% 100%; } #news{ background-image: url("assets/static/icons/notif.png"); background-size: 100% 100%; } #store{ background-image: url("assets/static/icons/forushgah.png"); background-size: 100% 100%; } #cup{ background-image: url("assets/static/icons/jam.png"); background-size: 100% 100%; } #best_avatar{ float: left; display: inline; width: 18vw; height: 12vh; } #best_info{ font-size: 1.3em; } </style> <ion-content padding > <div id ="status"> <img id=avatar src='' (click)="myHistory()"><img id='gem-icon' src='assets/static/gem.png' (click)="Store()"><span id='gems'>{{score}}</span><p align=right id=nickname>{{nickname}}</p> </div> <hr> <button ion-button (click)="new_HOME()">new ui</button>> <div class="container"> <div class='menu'> <input id='toggle' class='toggle' type='checkbox' checked > <label id='style' class='style' for='menu' (click)="Avatar()"> <i class="fa fa-bars" aria-hidden="true"></i> </label> <a id="game" class='tab' (click)="Game()" > <p></p> </a> <a id="history" class='tab' (click)="myHistory()"> <p></p> </a> <a id="about" class='tab' (click)="AboutUs()"> <p> </p> </a> <a id="news" class='tab' (click)="News()"> <p></p> </a> <a id="store" class='tab' (click)="Store()"> <P></P> </a> <a id="cup" class='tab' (click)="Cups()"> <P></P> </a> </div> </div> <br><br> <br> <br> <br> <div> <ion-card> <ion-card-header> <img id="best_avatar" src="{{best_player_avatar}}"> <p id="best_info">{{best_player_name}}: {{best_player_gems}}</p> </ion-card-header> <ion-card-content> </ion-card-content> </ion-card> </div> </ion-content>
# piconf ##Before we begin: * This is my first project using Git & GitHub * My first complex C project * First attempt at a autotools project * My Main languages are Java, JScript, Python & BASIC * It will contain stupid / beginners mistakes & bad smelling * The proof on concept was written in python but C has been choosen for the rewrite for preformance perticularly startup times ##Graphical Raspberry Pi settings What about raspi-config? raspi-config is a text based script that isnt all to user friendly, pi-conf uses a Gtk3 UI but it is / will be used as the backend for many features Hang on isnt that rc_gui? No. rc_gui is a dialog for accessing raspi-config featues but still isnt great in its friendless and only has limited funtionality leaving you needing other utilities such a pipanel with yet another incosistant UI So what is it? pi-conf aims to replace the likes of: * ru_gui * pipanel * alacarte with one consistant easy to use extendable application. #What do you mean extendable as in Window Control Panel where that new hardware you added conviniently adds its little icon so anyone can add a page for the app or addon for the pi giving you on centeral configuration platform. How can i use it? piconf is in the early stages but to give it a go grab a copy of this repo open a termnal in the projects roor and enter `autoreconf && ./configure && make all && sudo make install && pi-conf` although you may have to install `libgtk-3-dev` first.
using System; using System.Linq; using LeagueSharp; using LeagueSharp.Common; using Slutty_ryze.Properties; namespace Slutty_ryze { internal class Program { readonly static Random Seeder = new Random(); private static bool _casted; private static int _lastw; #region onload private static void Main(string[] args) { if (args == null) throw new <API key>("args"); // So you can test if it in VS wihout crahses #if !DEBUG CustomEvents.Game.OnGameLoad += OnLoad; #endif } private static void OnLoad(EventArgs args) { if (GlobalManager.GetHero.ChampionName != Champion.ChampName) return; Console.WriteLine(@"Loading Your Slutty Ryze"); Humanizer.AddAction("generalDelay",35.0f); Champion.Q = new Spell(SpellSlot.Q, 865); Champion.Qn = new Spell(SpellSlot.Q, 865); Champion.W = new Spell(SpellSlot.W, 585); Champion.E = new Spell(SpellSlot.E, 585); Champion.R = new Spell(SpellSlot.R); Champion.Q.SetSkillshot(0.26f, 50f, 1700f, true, SkillshotType.SkillshotLine); Champion.Qn.SetSkillshot(0.26f, 50f, 1700f, false, SkillshotType.SkillshotLine); //assign menu from MenuManager to Config Console.WriteLine(@"Loading Your Slutty Menu..."); GlobalManager.Config = MenuManager.GetMenu(); GlobalManager.Config.AddToMainMenu(); Printmsg("Ryze Assembly Loaded"); Printmsg1("Current Version: " + typeof(Program).Assembly.GetName().Version); Printmsg2("Don't Forget To " + "<font color='#00ff00'>[Upvote]</font> <font color='#FFFFFF'>" + "The Assembly In The Databse" + "</font>"); //Other damge inficators in MenuManager ???? GlobalManager.DamageToUnit = Champion.GetComboDamage; Drawing.OnDraw += DrawManager.Drawing_OnDraw; Game.OnUpdate += Game_OnUpdate; #pragma warning disable 618 Interrupter.<API key> += Champion.<API key>; Spellbook.OnCastSpell += Champion.OnProcess; #pragma warning restore 618 Orbwalking.BeforeAttack += Champion.<API key>; //CustomEvents.Unit.OnDash += Champion; ShowDisplayMessage(); } #endregion private static void Printmsg(string message) { Game.PrintChat( "<font color='#6f00ff'>[Slutty Ryze]:</font> <font color='#FFFFFF'>" + message + "</font>"); } private static void Printmsg1(string message) { Game.PrintChat( "<font color='#ff00ff'>[Slutty Ryze]:</font> <font color='#FFFFFF'>" + message + "</font>"); } private static void Printmsg2(string message) { Game.PrintChat( "<font color='#00abff'>[Slutty Ryze]:</font> <font color='#FFFFFF'>" + message + "</font>"); } #region onGameUpdate private static void ShowDisplayMessage() { var r = new Random(); var txt = Resources.display.Split('\n'); switch (r.Next(1, 3)) { case 2: txt = Resources.display2.Split('\n'); break; case 3: txt = Resources.display3.Split('\n'); break; } foreach (var s in txt) Console.WriteLine(s); #region L# does not allow D: //try // string line; // while ((line = sr.ReadLine()) != null) // Console.WriteLine(line); //catch // // ignored #endregion } private static void Game_OnUpdate(EventArgs args) { try // lazy { if (GlobalManager.Config.Item("test").GetValue<KeyBind>().Active) { GlobalManager.GetHero.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos); var targets = TargetSelector.GetTarget(Champion.W.Range, TargetSelector.DamageType.Magical); if (targets == null) return; if (Champion.W.IsReady()) { LaneOptions.CastW(targets); { _lastw = Environment.TickCount; } } if (Environment.TickCount - _lastw >= 700 - Game.Ping) { if (Champion.Q.IsReady()) { LaneOptions.CastQn(targets); _casted = true; } } if (_casted) { LaneOptions.CastE(targets); LaneOptions.CastQn(targets); _casted = false; } } if (GlobalManager.Config.Item("chase").GetValue<KeyBind>().Active) { GlobalManager.GetHero.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos); var targets = TargetSelector.GetTarget(Champion.W.Range + 200, TargetSelector.DamageType.Magical); if (targets == null) return; if (GlobalManager.Config.Item("usewchase").GetValue<bool>()) LaneOptions.CastW(targets); if (GlobalManager.Config.Item("chaser").GetValue<bool>() && targets.Distance(GlobalManager.GetHero) > Champion.W.Range + 200) Champion.R.Cast(); } if (GlobalManager.GetHero.IsDead) return; if (GlobalManager.GetHero.IsRecalling()) return; if (Champion.casted == false) { MenuManager.Orbwalker.SetAttack(true); } var target = TargetSelector.GetTarget(Champion.Q.Range, TargetSelector.DamageType.Magical); if (GlobalManager.Config.Item("doHuman").GetValue<bool>()) { if (!Humanizer.CheckDelay("generalDelay")) // Wait for delay for all other events { Console.WriteLine(@"Waiting on Human delay"); return; } //Console.WriteLine("Seeding Human Delay"); var nDelay = Seeder.Next(GlobalManager.Config.Item("minDelay").GetValue<Slider>().Value, GlobalManager.Config.Item("maxDelay").GetValue<Slider>().Value); // set a new random delay :D Humanizer.ChangeDelay("generalDelay", nDelay); } if (MenuManager.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Combo) { // if (target.IsValidTarget() // && GlobalManager.GetHero.Distance(target) > 400 && (Champion.Q.IsReady() && Champion.W.IsReady() && Champion.E.IsReady())) // MenuManager.Orbwalker.SetAttack(false); // if (target.IsValidTarget() && GlobalManager.GetHero.Distance(target) > 400 // && (GlobalManager.GetPassiveBuff == 4 || GlobalManager.GetHero.HasBuff("ryzepassivecharged")) // ((!Champion.Q.IsReady() && !Champion.W.IsReady() && !Champion.E.IsReady()) || // (Champion.Q.IsReady() && Champion.W.IsReady() && Champion.E.IsReady()))) // MenuManager.Orbwalker.SetAttack(false); Champion.AABlock(); LaneOptions.ImprovedCombo(); if (target.Distance(GlobalManager.GetHero) >= GlobalManager.Config.Item("minaarange").GetValue<Slider>().Value) { MenuManager.Orbwalker.SetAttack(false); } else { MenuManager.Orbwalker.SetAttack(true); } } if (MenuManager.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.Mixed) { LaneOptions.Mixed(); MenuManager.Orbwalker.SetAttack(true); } if (MenuManager.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LaneClear) { if (!GlobalManager.Config.Item("disablelane").GetValue<KeyBind>().Active) LaneOptions.LaneClear(); LaneOptions.JungleClear(); } if (MenuManager.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.LastHit) LaneOptions.LastHit(); if (MenuManager.Orbwalker.ActiveMode == Orbwalking.OrbwalkingMode.None) { if (GlobalManager.Config.Item("tearS").GetValue<KeyBind>().Active) ItemManager.TearStack(); if (GlobalManager.Config.Item("autoPassive").GetValue<KeyBind>().Active) Champion.AutoPassive(); ItemManager.Potion(); MenuManager.Orbwalker.SetAttack(true); } if (GlobalManager.Config.Item("UseQauto").GetValue<bool>() && target != null) { if (Champion.Q.IsReady() && target.IsValidTarget(Champion.Q.Range)) Champion.Q.Cast(target); } // Seplane(); ItemManager.Item(); Champion.KillSteal(); ItemManager.Potion(); if (GlobalManager.Config.Item("level").GetValue<bool>()) { AutoLevelManager.LevelUpSpells(); } if (!GlobalManager.Config.Item("autow").GetValue<bool>() || !target.UnderTurret(true)) return; if (target == null) return; if (!ObjectManager.Get<Obj_AI_Turret>() .Any(turret => turret.IsValidTarget(300) && turret.IsAlly && turret.Health > 0)) return; Champion.W.CastOnUnit(target); // DebugClass.ShowDebugInfo(true); } catch { // ignored } } #endregion /* private static void Seplane() { if (GlobalManager.GetHero.IsValid && GlobalManager.Config.Item("seplane").GetValue<KeyBind>().Active) { ObjectManager.GlobalManager.GetHero.IssueOrder(GameObjectOrder.MoveTo, Game.CursorPos); LaneClear(); } } */ } }
@import "../<API key>/css/agency.min.css"; .text-primary { color: #ff7058; } a { color: #ff7058; } a:hover, a:focus, a:active, a.active { color: #324a5e; } .btn-primary { background-color: #ff7058; border-color: #ff7058; } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active, .open .dropdown-toggle.btn-primary { background-color: #324a5e; border-color: #324a5e; } .btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary, .btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover, .btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus, .btn-primary.disabled:active, .btn-primary[disabled]:active, fieldset[disabled] .btn-primary:active, .btn-primary.disabled.active, .btn-primary[disabled].active, fieldset[disabled] .btn-primary.active { background-color: #ff7058; border-color: #ff7058; } .btn-primary .badge { color: #ff7058; } .btn-xl { background-color: #ff7058; border-color: #ff7058; } .btn-xl:hover, .btn-xl:focus, .btn-xl:active, .btn-xl.active, .open .dropdown-toggle.btn-xl { background-color: #324a5e; border-color: #324a5e; } .btn-xl.disabled, .btn-xl[disabled], fieldset[disabled] .btn-xl, .btn-xl.disabled:hover, .btn-xl[disabled]:hover, fieldset[disabled] .btn-xl:hover, .btn-xl.disabled:focus, .btn-xl[disabled]:focus, fieldset[disabled] .btn-xl:focus, .btn-xl.disabled:active, .btn-xl[disabled]:active, fieldset[disabled] .btn-xl:active, .btn-xl.disabled.active, .btn-xl[disabled].active, fieldset[disabled] .btn-xl.active { background-color: #ff7058; border-color: #ff7058; } .btn-xl .badge { color: #ff7058; } .navbar-custom .navbar-brand { color: #ff7058; } .navbar-custom .navbar-brand:hover, .navbar-custom .navbar-brand:focus, .navbar-custom .navbar-brand:active, .navbar-custom .navbar-brand.active { color: #324a5e; } .navbar-custom .navbar-toggle { background-color: #ff7058; border-color: #ff7058; } .navbar-custom .navbar-toggle:hover, .navbar-custom .navbar-toggle:focus { background-color: #ff7058; } .navbar-custom .nav li a:hover, .navbar-custom .nav li a:focus { color: #ff7058; } .navbar-custom .navbar-nav > .active > a { background-color: #ff7058; } .navbar-custom .navbar-nav > .active > a:hover, .navbar-custom .navbar-nav > .active > a:focus { background-color: #324a5e; } header { background-color: #cccbc9; background-image: url('../img/header-bg.jpg'); } .timeline > li .timeline-image { background-color: #ff7058; } section#contact .form-control:focus { border-color: #ff7058; } ul.social-buttons li a:hover, ul.social-buttons li a:focus, ul.social-buttons li a:active { background-color: #ff7058; } ::-moz-selection { background: #ff7058; } ::selection { background: #ff7058; } body { <API key>: #ff7058; }
/*! * \file journal.h * * \author Marek Vavrusa <marek.vavrusa@nic.cz> * * \brief Journal for storing transactions on permanent storage. * * Journal stores entries on a permanent storage. * Each written entry is guaranteed to persist until * the maximum file size or node count is reached. * Entries are removed from the least recent. * * Journal file structure * <pre> * uint16_t node_count * uint16_t node_queue_head * uint16_t node_queue_tail * journal_entry_t free_segment * node_count *journal_entry_t * ...data... * </pre> * \addtogroup utils * @{ */ #ifndef _KNOTD_JOURNAL_H_ #define _KNOTD_JOURNAL_H_ #include <stdint.h> #include <fcntl.h> #include <pthread.h> #include <stdbool.h> /*! * \brief Journal entry flags. */ typedef enum journal_flag_t { JOURNAL_NULL = 0 << 0, /*!< Invalid journal entry. */ JOURNAL_FREE = 1 << 0, /*!< Free journal entry. */ JOURNAL_VALID = 1 << 1, /*!< Valid journal entry. */ JOURNAL_DIRTY = 1 << 2, /*!< Journal entry cannot be evicted. */ JOURNAL_TRANS = 1 << 3 /*!< Entry is in transaction (uncommited). */ } journal_flag_t; /*! * \brief Journal node structure. * * Each node represents journal entry and points * to position of the data in the permanent storage. */ typedef struct journal_node_t { uint64_t id; /*!< Node ID. */ uint16_t flags; /*!< Node flags. */ uint16_t next; /*!< Next node ptr. */ uint32_t pos; /*!< Position in journal file. */ uint32_t len; /*!< Entry data length. */ } journal_node_t; /*! * \brief Journal structure. * * Journal organizes entries as nodes. * Nodes are stored in-memory for fast lookup and also * backed by a permanent storage. * Each journal has a fixed number of nodes. * * \todo Organize nodes in an advanced structure, like * btree or hash table to improve lookup time (issue #964). */ typedef struct journal_t { int fd; struct flock fl; /*!< File lock. */ pthread_mutex_t mutex; /*!< Synchronization mutex. */ char *path; /*!< Path to journal file. */ uint16_t tmark; /*!< Transaction start mark. */ uint16_t max_nodes; /*!< Number of nodes. */ uint16_t qhead; /*!< Node queue head. */ uint16_t qtail; /*!< Node queue tail. */ uint16_t bflags; /*!< Initial flags for each written node. */ size_t fsize; /*!< Journal file size. */ size_t fslimit; /*!< File size limit. */ journal_node_t free; /*!< Free segment. */ journal_node_t *nodes; /*!< Array of nodes. */ } journal_t; /*! * \brief Entry identifier compare function. * * \retval -n if k1 < k2 * \retval +n if k1 > k2 * \retval 0 if k1 == k2 */ typedef int (*journal_cmp_t)(uint64_t k1, uint64_t k2); /*! * \brief Function prototype for journal_walk() function. * * \param j Associated journal. * \param n Pointer to target node. */ typedef int (*journal_apply_t)(journal_t *j, journal_node_t *n); /* * Journal defaults and constants. */ #define JOURNAL_NCOUNT 1024 /*!< Default node count. */ #define JOURNAL_MAGIC {'k', 'n', 'o', 't', '1', '5', '0'} #define MAGIC_LENGTH 7 /* HEADER = magic, crc, max_entries, qhead, qtail */ #define JOURNAL_HSIZE (MAGIC_LENGTH + sizeof(crc_t) + sizeof(uint16_t) * 3) /*! * \brief Create new journal. * * \param fn Journal file name, will be created if not exist. * \param max_nodes Maximum number of nodes in journal. * * \retval KNOT_EOK if successful. * \retval KNOT_EINVAL if the file with given name cannot be created. * \retval KNOT_ERROR on I/O error. */ int journal_create(const char *fn, uint16_t max_nodes); /*! * \brief Open journal. * * \warning This doesn't open the file yet, just sets up the structure. * Call \fn journal_retain before reading/writing the journal. * * \param fn Journal file name. * \param fslimit File size limit (0 for no limit). * \param bflags Initial flags for each written node. * * \retval new journal instance if successful. * \retval NULL on error. */ journal_t* journal_open(const char *fn, size_t fslimit, uint16_t bflags); /*! * \brief Fetch entry node for given identifier. * * \param journal Associated journal. * \param id Entry identifier. * \param cf Compare function (NULL for equality). * \param dst Destination for journal entry. * * \retval KNOT_EOK if successful. * \retval KNOT_ENOENT if not found. */ int journal_fetch(journal_t *journal, uint64_t id, journal_cmp_t cf, journal_node_t** dst); /*! * \brief Read journal entry data. * * \param journal Associated journal. * \param id Entry identifier. * \param cf Compare function (NULL for equality). * \param dst Pointer to destination memory. * * \retval KNOT_EOK if successful. * \retval KNOT_ENOENT if the entry cannot be found. * \retval KNOT_EINVAL if the entry is invalid. * \retval KNOT_ERROR on I/O error. */ int journal_read(journal_t *journal, uint64_t id, journal_cmp_t cf, char *dst); /*! * \brief Read journal entry data. * * \param journal Associated journal. * \param n Entry. * \param dst Pointer to destination memory. * * \retval KNOT_EOK if successful. * \retval KNOT_ENOENT if the entry cannot be found. * \retval KNOT_EINVAL if the entry is invalid. * \retval KNOT_ERROR on I/O error. */ int journal_read_node(journal_t *journal, journal_node_t *n, char *dst); /*! * \brief Write journal entry data. * * \param journal Associated journal. * \param id Entry identifier. * \param src Pointer to source data. * * \retval KNOT_EOK if successful. * \retval KNOT_EAGAIN if no free node is available, need to remove dirty nodes. * \retval KNOT_ERROR on I/O error. */ int journal_write(journal_t *journal, uint64_t id, const char *src, size_t size); /*! * \brief Map journal entry for read/write. * * \warning New nodes shouldn't be created until the entry is unmapped. * * \param journal Associated journal. * \param id Entry identifier. * \param dst Will contain mapped memory. * * \retval KNOT_EOK if successful. * \retval KNOT_EAGAIN if no free node is available, need to remove dirty nodes. * \retval KNOT_ERROR on I/O error. */ int journal_map(journal_t *journal, uint64_t id, char **dst, size_t size); /*! * \brief Finalize mapped journal entry. * * \param journal Associated journal. * \param id Entry identifier. * \param ptr Mapped memory. * \param finalize Set to true to finalize node or False to discard it. * * \retval KNOT_EOK if successful. * \retval KNOT_ENOENT if the entry cannot be found. * \retval KNOT_EAGAIN if no free node is available, need to remove dirty nodes. * \retval KNOT_ERROR on I/O error. */ int journal_unmap(journal_t *journal, uint64_t id, void *ptr, int finalize); /*! * \brief Return least recent node (journal head). * * \param journal Associated journal. * * \retval node if successful. * \retval NULL if empty. */ static inline journal_node_t *journal_head(journal_t *journal) { return journal->nodes + journal->qhead; } /*! * \brief Return node after most recent node (journal tail). * * \param journal Associated journal. * * \retval node if successful. * \retval NULL if empty. */ static inline journal_node_t *journal_end(journal_t *journal) { return journal->nodes + journal->qtail; } /*! * \brief Apply function to each node. * * \param journal Associated journal. * \param apply Function to apply to each node. * * \retval KNOT_EOK if successful. * \retval KNOT_EINVAL on invalid parameters. */ int journal_walk(journal_t *journal, journal_apply_t apply); /*! * \brief Sync node state to permanent storage. * * \note May be used for journal_walk(). * * \param journal Associated journal. * \param n Pointer to node (must belong to associated journal). * * \retval KNOT_EOK on success. * \retval KNOT_EINVAL on invalid parameters. */ int journal_update(journal_t *journal, journal_node_t *n); /*! * \brief Begin transaction of multiple entries. * * \note Only one transaction at a time is supported. * * \param journal Associated journal. * * \retval KNOT_EOK on success. * \retval KNOT_EINVAL on invalid parameters. * \retval KNOT_EBUSY if transaction is already pending. */ int journal_trans_begin(journal_t *journal); /*! * \brief Commit pending transaction. * * \note Only one transaction at a time is supported. * * \param journal Associated journal. * * \retval KNOT_EOK on success. * \retval KNOT_EINVAL on invalid parameters. * \retval KNOT_ENOENT if no transaction is pending. */ int <API key>(journal_t *journal); /*! * \brief Rollback pending transaction. * * \note Only one transaction at a time is supported. * * \param journal Associated journal. * * \retval KNOT_EOK on success. * \retval KNOT_EINVAL on invalid parameters. * \retval KNOT_ENOENT if no transaction is pending. */ int <API key>(journal_t *journal); /*! * \brief Close journal file. * * \param journal Associated journal. * * \retval KNOT_EOK on success. * \retval KNOT_EINVAL on invalid parameter. */ int journal_close(journal_t *journal); /*! * \brief Check if the journal file is used or not. * * \param journal Journal. * * \return true or false */ bool journal_is_used(journal_t *journal); /*! * \brief Retain journal for use. * * \param journal Journal. * * \retval KNOT_EOK * \retval KNOT_EBUSY * \retval KNOT_EINVAL * \retval KNOT_ERROR */ int journal_retain(journal_t *journal); /*! * \brief Release retained journal. * * \param journal Retained journal. */ void journal_release(journal_t *journal); /*! * \brief Recompute journal CRC. * * \warning Use only if you altered the journal file somehow * and need it to pass CRC checks. CRC check normally * checks file integrity, so you should not touch it unless * you know what you're doing. * * \param fd Open journal file. * * \retval KNOT_EOK on success. * \retval KNOT_EINVAL if not valid fd. */ int journal_update_crc(int fd); #endif /* _KNOTD_JOURNAL_H_ */
#ifndef <API key> #define <API key> #include <QObject> class TNuiColorStream; class <API key> : public QObject { Q_OBJECT public: <API key>(TNuiColorStream *stream); void setEnabled(bool enabled); bool isEnabled() const { return m_enabled; } void draw(uchar *data, uint length); signals: void enabledChanged(bool enabled); protected: virtual void updateFrameData(uchar *data, uint length) = 0; TNuiColorStream *m_colorStream; bool m_enabled; }; #endif // <API key>
#include "../lib/includes.h" #include "../lib/utils.h" #include "../lib/methnum.h" #include "../Enum_type.h" #include "../Var/var.h" #include "../T0/t0.h" #include "upot.h" void test_der ( Upot * U , U_type upot_t , T0_type t0_t, bool phi_eq_phibar ); #define TD_T(f,df,nf,str) do{ testderiv(f,df,Tmin ,Tmax ,N,0.001,nf,str); } while(0) #define TD_phi(f,df,nf,str) do{ testderiv(f,df,phimin,phimax,N,0.001,nf,str); } while(0) #define TD_mu(f,df,nf,str) do{ testderiv(f,df,mumin ,mumax ,N,0.001,nf,str); } while(0) #define TOTO(i) do{ printf("toto %d\n", i); } while(0) int main ( void ) { bool all_test = false ; printf ("testing Gluonic potential derivatives \n" ); bool phi_eq_phibar = true ; Upot * U = Upot_alloc_32 ( U_POW, T0_CST, C_ANA, 0.650, phi_eq_phibar ); test_der ( U , U_POW , T0_T2, true ); if ( false ){ test_der ( U , U_POW , T0_CST, phi_eq_phibar ); test_der ( U , U_POW , T0_T1, phi_eq_phibar ); test_der ( U , U_POW , T0_T2, phi_eq_phibar ); } if ( false ) { test_der ( U , U_POW , T0_T2, phi_eq_phibar ); test_der ( U , U_LOG , T0_T2, phi_eq_phibar ); test_der ( U , U_FUK , T0_T2, phi_eq_phibar ); test_der ( U , U_DEX , T0_T2, phi_eq_phibar ); } if ( all_test ) { test_der ( U , U_POW , T0_CST, phi_eq_phibar ); test_der ( U , U_POW , T0_T1, phi_eq_phibar ); test_der ( U , U_POW , T0_T2, phi_eq_phibar ); test_der ( U , U_LOG , T0_CST, phi_eq_phibar ); test_der ( U , U_LOG , T0_T1, phi_eq_phibar ); test_der ( U , U_LOG , T0_T2, phi_eq_phibar ); test_der ( U , U_FUK , T0_CST, phi_eq_phibar ); test_der ( U , U_DEX , T0_CST, phi_eq_phibar ); test_der ( U , U_DEX , T0_T1, phi_eq_phibar ); test_der ( U , U_DEX , T0_T2, phi_eq_phibar ); } Upot_free ( U ); return 0 ; } void test_der ( Upot * U , U_type upot_t , T0_type t0_t, bool phi_eq_phibar ) { // Upot_set_type ( U , upot_t, t0_t, ANA ); double T_ = 0.1 , phi_ = 0.5 , phibar_= 0.7, mu_= 0.1 ; double Tmin= 0.1, Tmax=0.5, mumin=0., mumax=0.2, phimin=0.01,phimax=0.1 ; int N = 40 ; char pref[128], nf[256] ; Var * V = Var_alloc ( ); if ( upot_t == U_POW ) { Upot_set_pow_std ( U , t0_t, phi_eq_phibar); if ( phi_eq_phibar ) { if ( t0_t == T0_CST ) sprintf (pref ,"%s" ,"<API key>" ); else if ( t0_t == T0_T1 ) sprintf (pref ,"%s" ,"<API key>" ); else if ( t0_t == T0_T2 ) sprintf (pref ,"%s" ,"<API key>" ); else { Var_free ( V ); Upot_free ( U ); ERROR ( stdout , "T0 type error"); } } else { if ( t0_t == T0_CST ) sprintf (pref ,"%s" ,"Upow_T0_cst" ); else if ( t0_t == T0_T1 ) sprintf (pref ,"%s" ,"Upow_T0_t1" ); else if ( t0_t == T0_T2 ) sprintf (pref ,"%s" ,"Upow_T0_t2" ); else { Var_free ( V ); Upot_free ( U ); ERROR ( stdout , "T0 type error"); } } } else if ( upot_t == U_LOG ) { Upot_set_log_std ( U , t0_t, phi_eq_phibar); if ( phi_eq_phibar ) { if ( t0_t == T0_CST ) sprintf (pref ,"%s" ,"<API key>" ); else if ( t0_t == T0_T1 ) sprintf (pref ,"%s" ,"<API key>" ); else if ( t0_t == T0_T2 ) sprintf (pref ,"%s" ,"<API key>" ); else { Var_free ( V ); Upot_free ( U ); ERROR ( stdout , "T0 type error");} } else { if ( t0_t == T0_CST ) sprintf (pref ,"%s" ,"Ulog_T0_cst" ); else if ( t0_t == T0_T1 ) sprintf (pref ,"%s" ,"Ulog_T0_t1" ); else if ( t0_t == T0_T2 ) sprintf (pref ,"%s" ,"Ulog_T0_t2" ); else { Var_free ( V ); Upot_free ( U ); ERROR ( stdout , "T0 type error");} } } else if ( upot_t == U_FUK ) { Upot_set_fuk_std ( U , t0_t, 0.650, phi_eq_phibar); if ( phi_eq_phibar ) sprintf (pref ,"%s" ,"Ufuk_phi_eq_phibar" ); else sprintf (pref ,"%s" ,"Ufuk" ); } else if ( upot_t == U_DEX ) { Upot_set_dex_std ( U , t0_t, phi_eq_phibar); if ( phi_eq_phibar ) { if ( t0_t == T0_CST ) sprintf (pref ,"%s" ,"<API key>" ); else if ( t0_t == T0_T1 ) sprintf (pref ,"%s" ,"<API key>" ); else if ( t0_t == T0_T2 ) sprintf (pref ,"%s" ,"<API key>" ); else { Var_free ( V ); Upot_free ( U );ERROR ( stdout , "T0 type error"); } } else { if ( t0_t == T0_CST ) sprintf (pref ,"%s" ,"Udex_T0_cst" ); else if ( t0_t == T0_T1 ) sprintf (pref ,"%s" ,"Udex_T0_t1" ); else if ( t0_t == T0_T2 ) sprintf (pref ,"%s" ,"Udex_T0_t2" ); else { Var_free ( V ); Upot_free ( U );ERROR ( stdout , "T0 type error"); } } } else { Var_free ( V ); Upot_free ( U );ERROR ( stdout , "U type error"); } if ( !phi_eq_phibar ) { ///////// GRAND POTENTIAL / double u_phi ( double phi ) { <API key> ( V, T_, mu_, phi , phibar_); return U->Ug( U->P , U->T0, V ); } double u_phibar ( double phibar ) { <API key> ( V, T_, mu_, phi_, phibar ); return U->Ug( U->P , U->T0, V ); } double u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->Ug( U->P , U->T0, V ); } double u_mu ( double mu ) { <API key> ( V, T_, mu , phi_, phibar_); return U->Ug( U->P , U->T0, V ); } sprintf ( nf , "%s_phi" , pref ); plot_2D ( u_phi , phimin,phimax,N,nf,"set xla \"phi\"; set xzeroaxis" , false ); sprintf ( nf , "%s_phibar", pref ); plot_2D ( u_phibar, phimin,phimax,N,nf,"set xla \"phibar\"; set xzeroaxis", false ); sprintf ( nf , "%s_T" , pref ); plot_2D ( u_T , Tmin ,Tmax ,N,nf,"set xla \"T\"; set xzeroaxis" , false ); sprintf ( nf , "%s_mu" , pref ); plot_2D ( u_mu , mumin ,mumax ,N,nf,"set xla \"mu\"; set xzeroaxis" , false ); ///////// 1ST DERIVATIVES / double dphi_u_phi ( double phi ) { <API key> ( V, T_, mu_, phi , phibar_); return U->dphi_Ug ( U->P , U->T0, V ); } double dphibar_u_phibar ( double phibar ) { <API key> ( V, T_, mu_, phi_, phibar ); return U->dphibar_Ug( U->P , U->T0, V ); } double dT_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dT_Ug ( U->P , U->T0, V ); } double dmu_u_mu ( double mu ) { <API key> ( V, T_, mu , phi_, phibar_); return U->dmu_Ug ( U->P , U->T0, V ); } sprintf ( nf , "dphi_%s_phi" , pref ); TD_phi(u_phi ,dphi_u_phi ,nf,"set xla\"phi\""); sprintf ( nf , "dphibar_%s_phibar", pref ); TD_phi(u_phibar,dphibar_u_phibar,nf,"set xla\"phibar\""); sprintf ( nf , "dT_%s_T" , pref ); TD_T (u_T ,dT_u_T ,nf,"set xla\"T\""); sprintf ( nf , "dmu_%s_mu" , pref ); TD_mu (u_mu ,dmu_u_mu ,nf,"set xla\"mu\""); ///////// 2ND DERIVATIVES / double dT2_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dT2_Ug ( U->P , U->T0, V ); } double dTmu_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dTmu_Ug ( U->P , U->T0, V ); } double dmu_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dmu_Ug ( U->P , U->T0, V ); } double dTphi_u_T( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dTphi_Ug ( U->P , U->T0, V ); } double dphi_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dphi_Ug ( U->P , U->T0, V ); } double dTphibar_u_T( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dTphibar_Ug ( U->P , U->T0, V ); } double dphibar_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dphibar_Ug ( U->P , U->T0, V ); } double dmu2_u_mu ( double mu ) { <API key> ( V, T_, mu , phi_, phibar_); return U->dmu2_Ug ( U->P , U->T0, V ); } double dmuphi_u_mu ( double mu ){ <API key> ( V, T_, mu , phi_, phibar_); return U->dmuphi_Ug ( U->P , U->T0, V ); } double dphi_u_mu( double mu ){ <API key> ( V, T_, mu , phi_, phibar_); return U->dphi_Ug ( U->P , U->T0, V ); } double dmuphibar_u_mu ( double mu ){ <API key> ( V, T_, mu , phi_, phibar_); return U->dmuphibar_Ug ( U->P , U->T0, V ); } double dphibar_u_mu( double mu ){ <API key> ( V, T_, mu , phi_, phibar_); return U->dphibar_Ug ( U->P , U->T0, V ); } double dphi2_u_phi ( double phi ) { <API key> ( V, T_, mu_, phi , phibar_); return U->dphi2_Ug ( U->P , U->T0, V ); } double dphiphibar_u_phi ( double phi ) { <API key> ( V, T_, mu_, phi , phibar_); return U->dphiphibar_Ug ( U->P , U->T0, V ); } double dphibar_u_phi ( double phi ) { <API key> ( V, T_, mu_, phi , phibar_); return U->dphibar_Ug ( U->P , U->T0, V ); } double dphibar2_u_phibar ( double phibar ) { <API key> ( V, T_, mu_, phi_, phibar ); return U->dphibar2_Ug( U->P , U->T0, V ); } sprintf ( nf , "dT2_%s_T", pref ); TD_T(dT_u_T, dT2_u_T,nf , "set xla\"T\""); sprintf ( nf , "dTmu_%s_T", pref ); TD_T(dmu_u_T, dTmu_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTphi_%s_T", pref ); TD_T(dphi_u_T, dTphi_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTphibar_%s_T", pref ); TD_T(dphibar_u_T, dTphibar_u_T,nf,"set xla\"T\""); sprintf ( nf , "dmu2_%s_mu", pref ); TD_mu (dmu_u_mu,dmu2_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dmuphi_%s_mu", pref ); TD_mu (dphi_u_mu,dmuphi_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dmuphibar_%s_mu", pref ); TD_mu (dphibar_u_mu,dmuphibar_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dphi2_%s_phi" , pref ); TD_phi(dphi_u_phi,dphi2_u_phi,nf,"set xla\"phi\""); sprintf ( nf , "dphiphibar_%s_phi" , pref ); TD_phi(dphibar_u_phi,dphiphibar_u_phi,nf,"set xla\"phi\""); sprintf ( nf , "dphibar2_%s_phibar", pref ); TD_phi(dphibar_u_phibar,dphibar2_u_phibar,nf,"set xla\"phibar\""); ///////// 3RD DERIVATIVES / double dT3_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dT3_Ug ( U->P , U->T0, V ); } double dT2mu_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dT2mu_Ug ( U->P , U->T0, V ); } double dT2phi_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dT2phi_Ug ( U->P , U->T0, V ); } double dT2phibar_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dT2phibar_Ug ( U->P , U->T0, V ); } double dTmu2_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dTmu2_Ug ( U->P , U->T0, V ); } double dmu2_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dmu2_Ug ( U->P , U->T0, V ); } double dTmuphi_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dTmuphi_Ug ( U->P , U->T0, V ); } double dmuphi_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dmuphi_Ug ( U->P , U->T0, V ); } double dTmuphibar_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dTmuphibar_Ug ( U->P , U->T0, V ); } double dmuphibar_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dmuphibar_Ug ( U->P , U->T0, V ); } double dTphi2_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dTphi2_Ug ( U->P , U->T0, V ); } double dphi2_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dphi2_Ug ( U->P , U->T0, V ); } double dTphiphibar_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dTphiphibar_Ug ( U->P , U->T0, V ); } double dphiphibar_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dphiphibar_Ug ( U->P , U->T0, V ); } double dTphibar2_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dTphibar2_Ug ( U->P , U->T0, V ); } double dphibar2_u_T ( double T ) { <API key> ( V, T , mu_, phi_, phibar_); return U->dphibar2_Ug ( U->P , U->T0, V ); } double dmu3_u_mu ( double mu ) { <API key> ( V, T_, mu , phi_, phibar_); return U->dmu3_Ug ( U->P , U->T0, V ); } double dmu2phi_u_mu ( double mu ) { <API key> ( V, T_, mu , phi_, phibar_); return U->dmu2phi_Ug ( U->P , U->T0, V ); } double dmu2phibar_u_mu ( double mu ) { <API key> ( V, T_, mu , phi_, phibar_); return U->dmu2phibar_Ug ( U->P , U->T0, V ); } double dmuphi2_u_mu ( double mu ) { <API key> ( V, T_, mu , phi_, phibar_); return U->dmuphi2_Ug ( U->P , U->T0, V ); } double dphi2_u_mu ( double mu ) {<API key> ( V, T_, mu , phi_, phibar_); return U->dphi2_Ug ( U->P , U->T0, V ); } double dmuphiphibar_u_mu ( double mu ) { <API key> ( V, T_, mu , phi_, phibar_); return U->dmuphiphibar_Ug ( U->P , U->T0, V ); } double dphiphibar_u_mu ( double mu ) {<API key> ( V, T_, mu , phi_, phibar_); return U->dphiphibar_Ug ( U->P , U->T0, V ); } double dmuphibar2_u_mu ( double mu ) { <API key> ( V, T_, mu , phi_, phibar_); return U->dmuphibar2_Ug ( U->P , U->T0, V ); } double dphibar2_u_mu ( double mu ) { <API key> ( V, T_, mu , phi_, phibar_); return U->dphibar2_Ug ( U->P , U->T0, V ); } double dphi3_u_phi ( double phi ) { <API key> ( V, T_, mu_, phi , phibar_); return U->dphi3_Ug ( U->P , U->T0, V ); } double dphi2phibar_u_phi ( double phi ) { <API key> ( V, T_, mu_, phi , phibar_); return U->dphi2phibar_Ug ( U->P , U->T0, V ); } double dphiphibar2_u_phi ( double phi ) {<API key> ( V, T_, mu_, phi , phibar_); return U->dphiphibar2_Ug ( U->P , U->T0, V ); } double dphibar2_u_phi ( double phi ){<API key> ( V, T_, mu_, phi , phibar_); return U->dphibar2_Ug ( U->P , U->T0, V ); } double dphibar3_u_phibar ( double phibar ) { <API key>( V, T_, mu_, phi_, phibar ); return U->dphibar3_Ug( U->P , U->T0, V ); } sprintf ( nf , "dT3_%s_T", pref ); TD_T(dT2_u_T, dT3_u_T,nf,"set xla\"T\""); sprintf ( nf , "dT2mu_%s_T", pref ); TD_T(dTmu_u_T, dT2mu_u_T,nf,"set xla\"T\""); sprintf ( nf , "dT2phi_%s_T", pref ); TD_T(dTphi_u_T, dT2phi_u_T,nf,"set xla\"T\""); sprintf ( nf , "dT2phibar_%s_T", pref ); TD_T(dTphibar_u_T, dT2phibar_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTmu2_%s_T", pref ); TD_T(dmu2_u_T, dTmu2_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTmuphi_%s_T", pref ); TD_T(dmuphi_u_T, dTmuphi_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTmuphibar_%s_T", pref ); TD_T(dmuphibar_u_T, dTmuphibar_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTphi2_%s_T", pref ); TD_T(dphi2_u_T, dTphi2_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTphiphibar_%s_T", pref ); TD_T(dphiphibar_u_T, dTphiphibar_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTphibar2_%s_T", pref ); TD_T(dphibar2_u_T, dTphibar2_u_T,nf,"set xla\"T\""); sprintf ( nf , "dmu3_%s_mu", pref ); TD_mu (dmu2_u_mu,dmu3_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dmu2phi_%s_mu", pref ); TD_mu (dmuphi_u_mu,dmu2phi_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dmu2phibar_%s_mu", pref ); TD_mu (dmuphibar_u_mu,dmu2phibar_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dmuphi2_%s_mu", pref ); TD_mu (dphi2_u_mu,dmuphi2_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dmuphiphibar_%s_mu", pref ); TD_mu (dphiphibar_u_mu,dmuphiphibar_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dmuphibar2_%s_mu", pref ); TD_mu (dphibar2_u_mu,dmuphibar2_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dphi3_%s_phi", pref ); TD_phi(dphi2_u_phi,dphi3_u_phi,nf,"set xla\"phi\""); sprintf ( nf , "dphiphibar_%s_phi", pref ); TD_phi(dphiphibar_u_phi,dphi2phibar_u_phi,nf,"set xla\"phi\""); sprintf ( nf , "dphiphibar2_%s_phi", pref ); TD_phi(dphibar2_u_phi,dphiphibar2_u_phi,nf,"set xla\"phi\""); sprintf ( nf , "dphibar3_%s_phibar", pref ); TD_phi(dphibar2_u_phibar,dphibar3_u_phibar,nf,"set xla\"phibar\""); } else // phi = phibar { ///////// GRAND POTENTIAL / double u_phi ( double phi ) { Var_set_Tmuphi ( V, T_, mu_, phi ); return U->Ug( U->P , U->T0, V ); } double u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->Ug( U->P , U->T0, V ); } double u_mu ( double mu ) { Var_set_Tmuphi ( V, T_, mu , phi_); return U->Ug( U->P , U->T0, V ); } sprintf ( nf , "%s_phi" , pref ); plot_2D ( u_phi , phimin,phimax,N,nf,"set xla \"phi\"; set xzeroaxis" , false ); sprintf ( nf , "%s_T" , pref ); plot_2D ( u_T , Tmin ,Tmax ,N,nf,"set xla \"T\"; set xzeroaxis" , false ); sprintf ( nf , "%s_mu" , pref ); plot_2D ( u_mu , mumin ,mumax ,N,nf,"set xla \"mu\"; set xzeroaxis" , false ); ///////// 1ST DERIVATIVES / double dphi_u_phi ( double phi ) { Var_set_Tmuphi ( V, T_, mu_, phi ); return U->dphi_Ug ( U->P , U->T0, V ); } double dT_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dT_Ug ( U->P , U->T0, V ); } double dmu_u_mu ( double mu ) { Var_set_Tmuphi ( V, T_, mu , phi_); return U->dmu_Ug ( U->P , U->T0, V ); } sprintf ( nf , "dphi_%s_phi" , pref ); TD_phi(u_phi ,dphi_u_phi ,nf,"set xla\"phi\""); sprintf ( nf , "dT_%s_T" , pref ); TD_T (u_T ,dT_u_T ,nf,"set xla\"T\""); sprintf ( nf , "dmu_%s_mu" , pref ); TD_mu (u_mu ,dmu_u_mu ,nf,"set xla\"mu\""); ///////// 2ND DERIVATIVES / double dT2_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dT2_Ug ( U->P , U->T0, V ); } double dTmu_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dTmu_Ug ( U->P , U->T0, V ); } double dmu_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dmu_Ug ( U->P , U->T0, V ); } double dTphi_u_T( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dTphi_Ug ( U->P , U->T0, V ); } double dphi_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dphi_Ug ( U->P , U->T0, V ); } double dmu2_u_mu ( double mu ) { Var_set_Tmuphi ( V, T_, mu , phi_); return U->dmu2_Ug ( U->P , U->T0, V ); } double dmuphi_u_mu ( double mu ){ Var_set_Tmuphi ( V, T_, mu , phi_); return U->dmuphi_Ug ( U->P , U->T0, V ); } double dphi_u_mu( double mu ){ Var_set_Tmuphi ( V, T_, mu , phi_); return U->dphi_Ug ( U->P , U->T0, V ); } double dphi2_u_phi ( double phi ) { Var_set_Tmuphi ( V, T_, mu_, phi ); return U->dphi2_Ug ( U->P , U->T0, V ); } //if ( false ) { sprintf ( nf , "dT2_%s_T", pref ); TD_T(dT_u_T, dT2_u_T,nf , "set xla\"T\""); sprintf ( nf , "dTmu_%s_T", pref ); TD_T(dmu_u_T, dTmu_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTphi_%s_T", pref ); TD_T(dphi_u_T, dTphi_u_T,nf,"set xla\"T\""); sprintf ( nf , "dmu2_%s_mu", pref ); TD_mu (dmu_u_mu,dmu2_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dmuphi_%s_mu", pref ); TD_mu (dphi_u_mu,dmuphi_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dphi2_%s_phi" , pref ); TD_phi(dphi_u_phi,dphi2_u_phi,nf,"set xla\"phi\""); ///////// 3RD DERIVATIVES / double dT3_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dT3_Ug ( U->P , U->T0, V ); } double dT2mu_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dT2mu_Ug ( U->P , U->T0, V ); } double dT2phi_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dT2phi_Ug ( U->P , U->T0, V ); } double dTmu2_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dTmu2_Ug ( U->P , U->T0, V ); } double dmu2_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dmu2_Ug ( U->P , U->T0, V ); } double dTmuphi_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dTmuphi_Ug ( U->P , U->T0, V ); } double dmuphi_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dmuphi_Ug ( U->P , U->T0, V ); } double dTphi2_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dTphi2_Ug ( U->P , U->T0, V ); } double dphi2_u_T ( double T ) { Var_set_Tmuphi ( V, T , mu_, phi_); return U->dphi2_Ug ( U->P , U->T0, V ); } double dmu3_u_mu ( double mu ) { Var_set_Tmuphi ( V, T_, mu , phi_); return U->dmu3_Ug ( U->P , U->T0, V ); } double dmu2phi_u_mu ( double mu ) { Var_set_Tmuphi ( V, T_, mu , phi_); return U->dmu2phi_Ug ( U->P , U->T0, V ); } double dmuphi2_u_mu ( double mu ) { Var_set_Tmuphi ( V, T_, mu , phi_); return U->dmuphi2_Ug ( U->P , U->T0, V ); } double dphi2_u_mu ( double mu ) {Var_set_Tmuphi ( V, T_, mu , phi_); return U->dphi2_Ug ( U->P , U->T0, V ); } double dphi3_u_phi ( double phi ) { Var_set_Tmuphi ( V, T_, mu_, phi ); return U->dphi3_Ug ( U->P , U->T0, V ); } //if ( false ){ sprintf ( nf , "dT3_%s_T", pref ); TD_T(dT2_u_T, dT3_u_T,nf,"set xla\"T\""); sprintf ( nf , "dT2mu_%s_T", pref ); TD_T(dTmu_u_T, dT2mu_u_T,nf,"set xla\"T\""); sprintf ( nf , "dT2phi_%s_T", pref ); TD_T(dTphi_u_T, dT2phi_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTmu2_%s_T", pref ); TD_T(dmu2_u_T, dTmu2_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTmuphi_%s_T", pref ); TD_T(dmuphi_u_T, dTmuphi_u_T,nf,"set xla\"T\""); sprintf ( nf , "dTphi2_%s_T", pref ); TD_T(dphi2_u_T, dTphi2_u_T,nf,"set xla\"T\""); sprintf ( nf , "dmu3_%s_mu", pref ); TD_mu (dmu2_u_mu,dmu3_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dmu2phi_%s_mu", pref ); TD_mu (dmuphi_u_mu,dmu2phi_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dmuphi2_%s_mu", pref ); TD_mu (dphi2_u_mu,dmuphi2_u_mu ,nf,"set xla\"mu\""); sprintf ( nf , "dphi3_%s_phi", pref ); TD_phi(dphi2_u_phi,dphi3_u_phi,nf,"set xla\"phi\""); /* double dphi2_u ( double phi ) */ /* Var_set_Tmuphi( V, T_, mu_, phi ); */ /* double dphi_u( double phi ) */ /* Var_set_Tmuphi( V, T_, mu_, phi); */ /* double u ( double phi ) */ /* Var_set_Tmuphi( V, T_, mu_, phi); */ /* return <API key>( U->P, U->T0, V ); */ /* return deriv ( u, phi, 0.001 ) ; */ /* return deriv( dphi_u, phi, 0.001 ) ; */ /* sprintf( nf, "all-num__dphi3_%s_phi", pref ) ; TD_phi( dphi2_u, dphi3_u_phi,nf, "set xla\"phi\"" ); */ } Var_free ( V ); }
<!DOCTYPE html PUBLIC "- <html> <head> <title>top section: About This Document</title> <meta name="description" content="top section: About This Document"> <meta name="keywords" content="top section: About This Document"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="texi2html"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="index.html#Top" rel="start" title="top section"> <link href="section-node.html#SEC_Contents" rel="contents" title="Table of Contents"> <link href="#SEC_About" rel="help" title="About This Document"> <style type="text/css"> <! a.summary-letter {text-decoration: none} blockquote.smallquotation {font-size: smaller} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} div.lisp {margin-left: 3.2em} div.smalldisplay {margin-left: 3.2em} div.smallexample {margin-left: 3.2em} div.smalllisp {margin-left: 3.2em} pre.display {font-family: serif} pre.format {font-family: serif} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} pre.smalldisplay {font-family: serif; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: serif; font-size: smaller} pre.smalllisp {font-size: smaller} span.nocodebreak {white-space:pre} span.nolinebreak {white-space:pre} span.roman {font-family:serif; font-weight:normal} span.sansserif {font-family:sans-serif; font-weight:normal} ul.no-bullet {list-style: none} </style> </head> <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> <a name="SEC_About"></a> <table class="header" cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">node: </td> <td valign="middle" align="left"></td> <td valign="middle" align="left"></td> <td valign="middle" align="left">,</td> <td valign="middle" align="left"></td> <td valign="middle" align="left">,</td> <td valign="middle" align="left"></td> <td valign="middle" align="left">[ &gt; ]</td> </tr></table> <hr> <h1>About This Document</h1> <p> This document was generated on <em>a sunny day</em> using <a href="http: </p> <p> The buttons in the navigation panels have the following meaning: </p> <table border="1"> <tr> <th> Button </th> <th> Name </th> <th> Go to </th> <th> From 1.2.3 go to</th> </tr> <tr> <td align="center"> [ &gt; ] </td> <td align="center">NodeForward</td> <td>Next node in node reading order</td> <td>1.2.4</td> </tr> </table> <p> where the <strong> Example </strong> assumes that the current position is at <strong> Subsubsection One-Two-Three </strong> of a document of the following structure: </p> <ul> <li> 1. Section One <ul> <li>1.1 Subsection One-One <ul> <li>...</li> </ul> </li> <li>1.2 Subsection One-Two <ul> <li>1.2.1 Subsubsection One-Two-One</li> <li>1.2.2 Subsubsection One-Two-Two</li> <li>1.2.3 Subsubsection One-Two-Three &nbsp; &nbsp; <strong>&lt;== Current Position </strong></li> <li>1.2.4 Subsubsection One-Two-Four</li> </ul> </li> <li>1.3 Subsection One-Three <ul> <li>...</li> </ul> </li> <li>1.4 Subsection One-Four</li> </ul> </li> </ul> <hr> <table class="header" cellpadding="1" cellspacing="1" border="0"> <tr><td valign="middle" align="left">node: </td> <td valign="middle" align="left"></td> <td valign="middle" align="left"></td> <td valign="middle" align="left">,</td> <td valign="middle" align="left"></td> <td valign="middle" align="left">,</td> <td valign="middle" align="left"></td> <td valign="middle" align="left">[ &gt; ]</td> </tr></table> <p> <font size="-1"> This document was generated on <em>a sunny day</em> using <a href="http: </font> <br> </p> </body> </html>
/* global window, document, define, jQuery, setInterval, clearInterval */ ;(function(factory) { 'use strict'; if (typeof define === 'function' && define.amd) { define(['jquery'], factory); } else if (typeof exports !== 'undefined') { module.exports = factory(require('jquery')); } else { factory(jQuery); } }(function($) { 'use strict'; var Slick = window.Slick || {}; Slick = (function() { var instanceUid = 0; function Slick(element, settings) { var _ = this, dataSettings; _.defaults = { accessibility: true, adaptiveHeight: false, appendArrows: $(element), appendDots: $(element), arrows: true, asNavFor: null, prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', autoplay: false, autoplaySpeed: 3000, centerMode: false, centerPadding: '50px', cssEase: 'ease', customPaging: function(slider, i) { return $('<button type="button" />').text(i + 1); }, dots: false, dotsClass: 'slick-dots', draggable: true, easing: 'linear', edgeFriction: 0.35, fade: false, focusOnSelect: false, focusOnChange: false, infinite: true, initialSlide: 0, lazyLoad: 'ondemand', mobileFirst: false, pauseOnHover: true, pauseOnFocus: true, pauseOnDotsHover: false, respondTo: 'window', responsive: null, rows: 1, rtl: false, slide: '', slidesPerRow: 1, slidesToShow: 1, slidesToScroll: 1, speed: 500, swipe: true, swipeToSlide: false, touchMove: true, touchThreshold: 5, useCSS: true, useTransform: true, variableWidth: false, vertical: false, verticalSwiping: false, waitForAnimate: true, zIndex: 1000 }; _.initials = { animating: false, dragging: false, autoPlayTimer: null, currentDirection: 0, currentLeft: null, currentSlide: 0, direction: 1, $dots: null, listWidth: null, listHeight: null, loadIndex: 0, $nextArrow: null, $prevArrow: null, scrolling: false, slideCount: null, slideWidth: null, $slideTrack: null, $slides: null, sliding: false, slideOffset: 0, swipeLeft: null, swiping: false, $list: null, touchObject: {}, transformsEnabled: false, unslicked: false }; $.extend(_, _.initials); _.activeBreakpoint = null; _.animType = null; _.animProp = null; _.breakpoints = []; _.breakpointSettings = []; _.cssTransitions = false; _.focussed = false; _.interrupted = false; _.hidden = 'hidden'; _.paused = true; _.positionProp = null; _.respondTo = null; _.rowCount = 1; _.shouldClick = true; _.$slider = $(element); _.$slidesCache = null; _.transformType = null; _.transitionType = null; _.visibilityChange = 'visibilitychange'; _.windowWidth = 0; _.windowTimer = null; dataSettings = $(element).data('slick') || {}; _.options = $.extend({}, _.defaults, settings, dataSettings); _.currentSlide = _.options.initialSlide; _.originalSettings = _.options; if (typeof document.mozHidden !== 'undefined') { _.hidden = 'mozHidden'; _.visibilityChange = 'mozvisibilitychange'; } else if (typeof document.webkitHidden !== 'undefined') { _.hidden = 'webkitHidden'; _.visibilityChange = '<API key>'; } _.autoPlay = $.proxy(_.autoPlay, _); _.autoPlayClear = $.proxy(_.autoPlayClear, _); _.autoPlayIterator = $.proxy(_.autoPlayIterator, _); _.changeSlide = $.proxy(_.changeSlide, _); _.clickHandler = $.proxy(_.clickHandler, _); _.selectHandler = $.proxy(_.selectHandler, _); _.setPosition = $.proxy(_.setPosition, _); _.swipeHandler = $.proxy(_.swipeHandler, _); _.dragHandler = $.proxy(_.dragHandler, _); _.keyHandler = $.proxy(_.keyHandler, _); _.instanceUid = instanceUid++; // A simple way to check for HTML strings // Strict HTML recognition (must start with <) // Extracted from jQuery v1.11 source _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/; _.registerBreakpoints(); _.init(true); } return Slick; }()); Slick.prototype.activateADA = function() { var _ = this; _.$slideTrack.find('.slick-active').attr({ 'aria-hidden': 'false' }).find('a, input, button, select').attr({ 'tabindex': '0' }); }; Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) { var _ = this; if (typeof(index) === 'boolean') { addBefore = index; index = null; } else if (index < 0 || (index >= _.slideCount)) { return false; } _.unload(); if (typeof(index) === 'number') { if (index === 0 && _.$slides.length === 0) { $(markup).appendTo(_.$slideTrack); } else if (addBefore) { $(markup).insertBefore(_.$slides.eq(index)); } else { $(markup).insertAfter(_.$slides.eq(index)); } } else { if (addBefore === true) { $(markup).prependTo(_.$slideTrack); } else { $(markup).appendTo(_.$slideTrack); } } _.$slides = _.$slideTrack.children(this.options.slide); _.$slideTrack.children(this.options.slide).detach(); _.$slideTrack.append(_.$slides); _.$slides.each(function(index, element) { $(element).attr('data-slick-index', index); }); _.$slidesCache = _.$slides; _.reinit(); }; Slick.prototype.animateHeight = function() { var _ = this; if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); _.$list.animate({ height: targetHeight }, _.options.speed); } }; Slick.prototype.animateSlide = function(targetLeft, callback) { var animProps = {}, _ = this; _.animateHeight(); if (_.options.rtl === true && _.options.vertical === false) { targetLeft = -targetLeft; } if (_.transformsEnabled === false) { if (_.options.vertical === false) { _.$slideTrack.animate({ left: targetLeft }, _.options.speed, _.options.easing, callback); } else { _.$slideTrack.animate({ top: targetLeft }, _.options.speed, _.options.easing, callback); } } else { if (_.cssTransitions === false) { if (_.options.rtl === true) { _.currentLeft = -(_.currentLeft); } $({ animStart: _.currentLeft }).animate({ animStart: targetLeft }, { duration: _.options.speed, easing: _.options.easing, step: function(now) { now = Math.ceil(now); if (_.options.vertical === false) { animProps[_.animType] = 'translate(' + now + 'px, 0px)'; _.$slideTrack.css(animProps); } else { animProps[_.animType] = 'translate(0px,' + now + 'px)'; _.$slideTrack.css(animProps); } }, complete: function() { if (callback) { callback.call(); } } }); } else { _.applyTransition(); targetLeft = Math.ceil(targetLeft); if (_.options.vertical === false) { animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)'; } else { animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)'; } _.$slideTrack.css(animProps); if (callback) { setTimeout(function() { _.disableTransition(); callback.call(); }, _.options.speed); } } } }; Slick.prototype.getNavTarget = function() { var _ = this, asNavFor = _.options.asNavFor; if ( asNavFor && asNavFor !== null ) { asNavFor = $(asNavFor).not(_.$slider); } return asNavFor; }; Slick.prototype.asNavFor = function(index) { var _ = this, asNavFor = _.getNavTarget(); if ( asNavFor !== null && typeof asNavFor === 'object' ) { asNavFor.each(function() { var target = $(this).slick('getSlick'); if(!target.unslicked) { target.slideHandler(index, true); } }); } }; Slick.prototype.applyTransition = function(slide) { var _ = this, transition = {}; if (_.options.fade === false) { transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase; } else { transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase; } if (_.options.fade === false) { _.$slideTrack.css(transition); } else { _.$slides.eq(slide).css(transition); } }; Slick.prototype.autoPlay = function() { var _ = this; _.autoPlayClear(); if ( _.slideCount > _.options.slidesToShow ) { _.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed ); } }; Slick.prototype.autoPlayClear = function() { var _ = this; if (_.autoPlayTimer) { clearInterval(_.autoPlayTimer); } }; Slick.prototype.autoPlayIterator = function() { var _ = this, slideTo = _.currentSlide + _.options.slidesToScroll; if ( !_.paused && !_.interrupted && !_.focussed ) { if ( _.options.infinite === false ) { if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) { _.direction = 0; } else if ( _.direction === 0 ) { slideTo = _.currentSlide - _.options.slidesToScroll; if ( _.currentSlide - 1 === 0 ) { _.direction = 1; } } } _.slideHandler( slideTo ); } }; Slick.prototype.buildArrows = function() { var _ = this; if (_.options.arrows === true ) { _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow'); _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow'); if( _.slideCount > _.options.slidesToShow ) { _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); if (_.htmlExpr.test(_.options.prevArrow)) { _.$prevArrow.prependTo(_.options.appendArrows); } if (_.htmlExpr.test(_.options.nextArrow)) { _.$nextArrow.appendTo(_.options.appendArrows); } if (_.options.infinite !== true) { _.$prevArrow .addClass('slick-disabled') .attr('aria-disabled', 'true'); } } else { _.$prevArrow.add( _.$nextArrow ) .addClass('slick-hidden') .attr({ 'aria-disabled': 'true', 'tabindex': '-1' }); } } }; Slick.prototype.buildDots = function() { var _ = this, i, dot; if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { _.$slider.addClass('slick-dotted'); dot = $('<ul />').addClass(_.options.dotsClass); for (i = 0; i <= _.getDotCount(); i += 1) { dot.append($('<li />').append(_.options.customPaging.call(this, _, i))); } _.$dots = dot.appendTo(_.options.appendDots); _.$dots.find('li').first().addClass('slick-active'); } }; Slick.prototype.buildOut = function() { var _ = this; _.$slides = _.$slider .children( _.options.slide + ':not(.slick-cloned)') .addClass('slick-slide'); _.slideCount = _.$slides.length; _.$slides.each(function(index, element) { $(element) .attr('data-slick-index', index) .data('originalStyling', $(element).attr('style') || ''); }); _.$slider.addClass('slick-slider'); _.$slideTrack = (_.slideCount === 0) ? $('<div class="slick-track"/>').appendTo(_.$slider) : _.$slides.wrapAll('<div class="slick-track"/>').parent(); _.$list = _.$slideTrack.wrap( '<div class="slick-list"/>').parent(); _.$slideTrack.css('opacity', 0); if (_.options.centerMode === true || _.options.swipeToSlide === true) { _.options.slidesToScroll = 1; } $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading'); _.setupInfinite(); _.buildArrows(); _.buildDots(); _.updateDots(); _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); if (_.options.draggable === true) { _.$list.addClass('draggable'); } }; Slick.prototype.buildRows = function() { var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection; newSlides = document.<API key>(); originalSlides = _.$slider.children(); if(_.options.rows > 0) { slidesPerSection = _.options.slidesPerRow * _.options.rows; numOfSlides = Math.ceil( originalSlides.length / slidesPerSection ); for(a = 0; a < numOfSlides; a++){ var slide = document.createElement('div'); for(b = 0; b < _.options.rows; b++) { var row = document.createElement('div'); for(c = 0; c < _.options.slidesPerRow; c++) { var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c)); if (originalSlides.get(target)) { row.appendChild(originalSlides.get(target)); } } slide.appendChild(row); } newSlides.appendChild(slide); } _.$slider.empty().append(newSlides); _.$slider.children().children().children() .css({ 'width':(100 / _.options.slidesPerRow) + '%', 'display': 'inline-block' }); } }; Slick.prototype.checkResponsive = function(initial, forceUpdate) { var _ = this, breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false; var sliderWidth = _.$slider.width(); var windowWidth = window.innerWidth || $(window).width(); if (_.respondTo === 'window') { respondToWidth = windowWidth; } else if (_.respondTo === 'slider') { respondToWidth = sliderWidth; } else if (_.respondTo === 'min') { respondToWidth = Math.min(windowWidth, sliderWidth); } if ( _.options.responsive && _.options.responsive.length && _.options.responsive !== null) { targetBreakpoint = null; for (breakpoint in _.breakpoints) { if (_.breakpoints.hasOwnProperty(breakpoint)) { if (_.originalSettings.mobileFirst === false) { if (respondToWidth < _.breakpoints[breakpoint]) { targetBreakpoint = _.breakpoints[breakpoint]; } } else { if (respondToWidth > _.breakpoints[breakpoint]) { targetBreakpoint = _.breakpoints[breakpoint]; } } } } if (targetBreakpoint !== null) { if (_.activeBreakpoint !== null) { if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) { _.activeBreakpoint = targetBreakpoint; if (_.breakpointSettings[targetBreakpoint] === 'unslick') { _.unslick(targetBreakpoint); } else { _.options = $.extend({}, _.originalSettings, _.breakpointSettings[ targetBreakpoint]); if (initial === true) { _.currentSlide = _.options.initialSlide; } _.refresh(initial); } triggerBreakpoint = targetBreakpoint; } } else { _.activeBreakpoint = targetBreakpoint; if (_.breakpointSettings[targetBreakpoint] === 'unslick') { _.unslick(targetBreakpoint); } else { _.options = $.extend({}, _.originalSettings, _.breakpointSettings[ targetBreakpoint]); if (initial === true) { _.currentSlide = _.options.initialSlide; } _.refresh(initial); } triggerBreakpoint = targetBreakpoint; } } else { if (_.activeBreakpoint !== null) { _.activeBreakpoint = null; _.options = _.originalSettings; if (initial === true) { _.currentSlide = _.options.initialSlide; } _.refresh(initial); triggerBreakpoint = targetBreakpoint; } } // only trigger breakpoints during an actual break. not on initialize. if( !initial && triggerBreakpoint !== false ) { _.$slider.trigger('breakpoint', [_, triggerBreakpoint]); } } }; Slick.prototype.changeSlide = function(event, dontAnimate) { var _ = this, $target = $(event.currentTarget), indexOffset, slideOffset, unevenOffset; // If target is a link, prevent default action. if($target.is('a')) { event.preventDefault(); } // If target is not the <li> element (ie: a child), find the <li>. if(!$target.is('li')) { $target = $target.closest('li'); } unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0); indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll; switch (event.data.message) { case 'previous': slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset; if (_.slideCount > _.options.slidesToShow) { _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate); } break; case 'next': slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset; if (_.slideCount > _.options.slidesToShow) { _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate); } break; case 'index': var index = event.data.index === 0 ? 0 : event.data.index || $target.index() * _.options.slidesToScroll; _.slideHandler(_.checkNavigable(index), false, dontAnimate); $target.children().trigger('focus'); break; default: return; } }; Slick.prototype.checkNavigable = function(index) { var _ = this, navigables, prevNavigable; navigables = _.getNavigableIndexes(); prevNavigable = 0; if (index > navigables[navigables.length - 1]) { index = navigables[navigables.length - 1]; } else { for (var n in navigables) { if (index < navigables[n]) { index = prevNavigable; break; } prevNavigable = navigables[n]; } } return index; }; Slick.prototype.cleanUpEvents = function() { var _ = this; if (_.options.dots && _.$dots !== null) { $('li', _.$dots) .off('click.slick', _.changeSlide) .off('mouseenter.slick', $.proxy(_.interrupt, _, true)) .off('mouseleave.slick', $.proxy(_.interrupt, _, false)); if (_.options.accessibility === true) { _.$dots.off('keydown.slick', _.keyHandler); } } _.$slider.off('focus.slick blur.slick'); if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide); _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide); if (_.options.accessibility === true) { _.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler); _.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler); } } _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler); _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler); _.$list.off('touchend.slick mouseup.slick', _.swipeHandler); _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler); _.$list.off('click.slick', _.clickHandler); $(document).off(_.visibilityChange, _.visibility); _.cleanUpSlideEvents(); if (_.options.accessibility === true) { _.$list.off('keydown.slick', _.keyHandler); } if (_.options.focusOnSelect === true) { $(_.$slideTrack).children().off('click.slick', _.selectHandler); } $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange); $(window).off('resize.slick.slick-' + _.instanceUid, _.resize); $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault); $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition); }; Slick.prototype.cleanUpSlideEvents = function() { var _ = this; _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true)); _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false)); }; Slick.prototype.cleanUpRows = function() { var _ = this, originalSlides; if(_.options.rows > 0) { originalSlides = _.$slides.children().children(); originalSlides.removeAttr('style'); _.$slider.empty().append(originalSlides); } }; Slick.prototype.clickHandler = function(event) { var _ = this; if (_.shouldClick === false) { event.<API key>(); event.stopPropagation(); event.preventDefault(); } }; Slick.prototype.destroy = function(refresh) { var _ = this; _.autoPlayClear(); _.touchObject = {}; _.cleanUpEvents(); $('.slick-cloned', _.$slider).detach(); if (_.$dots) { _.$dots.remove(); } if ( _.$prevArrow && _.$prevArrow.length ) { _.$prevArrow .removeClass('slick-disabled slick-arrow slick-hidden') .removeAttr('aria-hidden aria-disabled tabindex') .css('display',''); if ( _.htmlExpr.test( _.options.prevArrow )) { _.$prevArrow.remove(); } } if ( _.$nextArrow && _.$nextArrow.length ) { _.$nextArrow .removeClass('slick-disabled slick-arrow slick-hidden') .removeAttr('aria-hidden aria-disabled tabindex') .css('display',''); if ( _.htmlExpr.test( _.options.nextArrow )) { _.$nextArrow.remove(); } } if (_.$slides) { _.$slides .removeClass('slick-slide slick-active slick-center slick-visible slick-current') .removeAttr('aria-hidden') .removeAttr('data-slick-index') .each(function(){ $(this).attr('style', $(this).data('originalStyling')); }); _.$slideTrack.children(this.options.slide).detach(); _.$slideTrack.detach(); _.$list.detach(); _.$slider.append(_.$slides); } _.cleanUpRows(); _.$slider.removeClass('slick-slider'); _.$slider.removeClass('slick-initialized'); _.$slider.removeClass('slick-dotted'); _.unslicked = true; if(!refresh) { _.$slider.trigger('destroy', [_]); } }; Slick.prototype.disableTransition = function(slide) { var _ = this, transition = {}; transition[_.transitionType] = ''; if (_.options.fade === false) { _.$slideTrack.css(transition); } else { _.$slides.eq(slide).css(transition); } }; Slick.prototype.fadeSlide = function(slideIndex, callback) { var _ = this; if (_.cssTransitions === false) { _.$slides.eq(slideIndex).css({ zIndex: _.options.zIndex }); _.$slides.eq(slideIndex).animate({ opacity: 1 }, _.options.speed, _.options.easing, callback); } else { _.applyTransition(slideIndex); _.$slides.eq(slideIndex).css({ opacity: 1, zIndex: _.options.zIndex }); if (callback) { setTimeout(function() { _.disableTransition(slideIndex); callback.call(); }, _.options.speed); } } }; Slick.prototype.fadeSlideOut = function(slideIndex) { var _ = this; if (_.cssTransitions === false) { _.$slides.eq(slideIndex).animate({ opacity: 0, zIndex: _.options.zIndex - 2 }, _.options.speed, _.options.easing); } else { _.applyTransition(slideIndex); _.$slides.eq(slideIndex).css({ opacity: 0, zIndex: _.options.zIndex - 2 }); } }; Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) { var _ = this; if (filter !== null) { _.$slidesCache = _.$slides; _.unload(); _.$slideTrack.children(this.options.slide).detach(); _.$slidesCache.filter(filter).appendTo(_.$slideTrack); _.reinit(); } }; Slick.prototype.focusHandler = function() { var _ = this; _.$slider .off('focus.slick blur.slick') .on('focus.slick blur.slick', '*', function(event) { event.<API key>(); var $sf = $(this); setTimeout(function() { if( _.options.pauseOnFocus ) { _.focussed = $sf.is(':focus'); _.autoPlay(); } }, 0); }); }; Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() { var _ = this; return _.currentSlide; }; Slick.prototype.getDotCount = function() { var _ = this; var breakPoint = 0; var counter = 0; var pagerQty = 0; if (_.options.infinite === true) { if (_.slideCount <= _.options.slidesToShow) { ++pagerQty; } else { while (breakPoint < _.slideCount) { ++pagerQty; breakPoint = counter + _.options.slidesToScroll; counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; } } } else if (_.options.centerMode === true) { pagerQty = _.slideCount; } else if(!_.options.asNavFor) { pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll); }else { while (breakPoint < _.slideCount) { ++pagerQty; breakPoint = counter + _.options.slidesToScroll; counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; } } return pagerQty - 1; }; Slick.prototype.getLeft = function(slideIndex) { var _ = this, targetLeft, verticalHeight, verticalOffset = 0, targetSlide, coef; _.slideOffset = 0; verticalHeight = _.$slides.first().outerHeight(true); if (_.options.infinite === true) { if (_.slideCount > _.options.slidesToShow) { _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1; coef = -1 if (_.options.vertical === true && _.options.centerMode === true) { if (_.options.slidesToShow === 2) { coef = -1.5; } else if (_.options.slidesToShow === 1) { coef = -2 } } verticalOffset = (verticalHeight * _.options.slidesToShow) * coef; } if (_.slideCount % _.options.slidesToScroll !== 0) { if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) { if (slideIndex > _.slideCount) { _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1; verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1; } else { _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1; verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1; } } } } else { if (slideIndex + _.options.slidesToShow > _.slideCount) { _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth; verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight; } } if (_.slideCount <= _.options.slidesToShow) { _.slideOffset = 0; verticalOffset = 0; } if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) { _.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2); } else if (_.options.centerMode === true && _.options.infinite === true) { _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth; } else if (_.options.centerMode === true) { _.slideOffset = 0; _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2); } if (_.options.vertical === false) { targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset; } else { targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset; } if (_.options.variableWidth === true) { if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); } else { targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow); } if (_.options.rtl === true) { if (targetSlide[0]) { targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; } else { targetLeft = 0; } } else { targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; } if (_.options.centerMode === true) { if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); } else { targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1); } if (_.options.rtl === true) { if (targetSlide[0]) { targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; } else { targetLeft = 0; } } else { targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; } targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2; } } return targetLeft; }; Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) { var _ = this; return _.options[option]; }; Slick.prototype.getNavigableIndexes = function() { var _ = this, breakPoint = 0, counter = 0, indexes = [], max; if (_.options.infinite === false) { max = _.slideCount; } else { breakPoint = _.options.slidesToScroll * -1; counter = _.options.slidesToScroll * -1; max = _.slideCount * 2; } var fs = 0; while (breakPoint < max) { indexes.push(breakPoint); breakPoint = counter + _.options.slidesToScroll; counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; fs++; if ( fs > 200 ) { console.log( 'WARNING! Infinite loop!' ); break; } } return indexes; }; Slick.prototype.getSlick = function() { return this; }; Slick.prototype.getSlideCount = function() { var _ = this, slidesTraversed, swipedSlide, centerOffset; centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0; if (_.options.swipeToSlide === true) { _.$slideTrack.find('.slick-slide').each(function(index, slide) { if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) { swipedSlide = slide; return false; } }); slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1; return slidesTraversed; } else { return _.options.slidesToScroll; } }; Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) { var _ = this; _.changeSlide({ data: { message: 'index', index: parseInt(slide) } }, dontAnimate); }; Slick.prototype.init = function(creation) { var _ = this; if (!$(_.$slider).hasClass('slick-initialized')) { $(_.$slider).addClass('slick-initialized'); _.buildRows(); _.buildOut(); _.setProps(); _.startLoad(); _.loadSlider(); _.initializeEvents(); _.updateArrows(); _.updateDots(); _.checkResponsive(true); _.focusHandler(); } if (creation) { _.$slider.trigger('init', [_]); } if (_.options.accessibility === true) { _.initADA(); } if ( _.options.autoplay ) { _.paused = false; _.autoPlay(); } }; Slick.prototype.initADA = function() { var _ = this, numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow), tabControlIndexes = _.getNavigableIndexes().filter(function(val) { return (val >= 0) && (val < _.slideCount); }); _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({ 'aria-hidden': 'true', 'tabindex': '-1' }).find('a, input, button, select').attr({ 'tabindex': '-1' }); if (_.$dots !== null) { _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) { var slideControlIndex = tabControlIndexes.indexOf(i); $(this).attr({ 'role': 'tabpanel', 'id': 'slick-slide' + _.instanceUid + i, 'tabindex': -1 }); if (slideControlIndex !== -1) { var ariaButtonControl = 'slick-slide-control' + _.instanceUid + slideControlIndex if ($('#' + ariaButtonControl).length) { $(this).attr({ 'aria-describedby': ariaButtonControl }); } } }); _.$dots.attr('role', 'tablist').find('li').each(function(i) { var mappedSlideIndex = tabControlIndexes[i]; $(this).attr({ 'role': 'presentation' }); $(this).find('button').first().attr({ 'role': 'tab', 'id': 'slick-slide-control' + _.instanceUid + i, 'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex, 'aria-label': (i + 1) + ' of ' + numDotGroups, 'aria-selected': null, 'tabindex': '-1' }); }).eq(_.currentSlide).find('button').attr({ 'aria-selected': 'true', 'tabindex': '0' }).end(); } for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) { if (_.options.focusOnChange) { _.$slides.eq(i).attr({'tabindex': '0'}); } else { _.$slides.eq(i).removeAttr('tabindex'); } } _.activateADA(); }; Slick.prototype.initArrowEvents = function() { var _ = this; if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { _.$prevArrow .off('click.slick') .on('click.slick', { message: 'previous' }, _.changeSlide); _.$nextArrow .off('click.slick') .on('click.slick', { message: 'next' }, _.changeSlide); if (_.options.accessibility === true) { _.$prevArrow.on('keydown.slick', _.keyHandler); _.$nextArrow.on('keydown.slick', _.keyHandler); } } }; Slick.prototype.initDotEvents = function() { var _ = this; if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { $('li', _.$dots).on('click.slick', { message: 'index' }, _.changeSlide); if (_.options.accessibility === true) { _.$dots.on('keydown.slick', _.keyHandler); } } if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.slideCount > _.options.slidesToShow) { $('li', _.$dots) .on('mouseenter.slick', $.proxy(_.interrupt, _, true)) .on('mouseleave.slick', $.proxy(_.interrupt, _, false)); } }; Slick.prototype.initSlideEvents = function() { var _ = this; if ( _.options.pauseOnHover ) { _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true)); _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false)); } }; Slick.prototype.initializeEvents = function() { var _ = this; _.initArrowEvents(); _.initDotEvents(); _.initSlideEvents(); _.$list.on('touchstart.slick mousedown.slick', { action: 'start' }, _.swipeHandler); _.$list.on('touchmove.slick mousemove.slick', { action: 'move' }, _.swipeHandler); _.$list.on('touchend.slick mouseup.slick', { action: 'end' }, _.swipeHandler); _.$list.on('touchcancel.slick mouseleave.slick', { action: 'end' }, _.swipeHandler); _.$list.on('click.slick', _.clickHandler); $(document).on(_.visibilityChange, $.proxy(_.visibility, _)); if (_.options.accessibility === true) { _.$list.on('keydown.slick', _.keyHandler); } if (_.options.focusOnSelect === true) { $(_.$slideTrack).children().on('click.slick', _.selectHandler); } $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _)); $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _)); $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault); $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition); $(_.setPosition); }; Slick.prototype.initUI = function() { var _ = this; if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { _.$prevArrow.show(); _.$nextArrow.show(); } if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { _.$dots.show(); } }; Slick.prototype.keyHandler = function(event) { var _ = this; //Dont slide if the cursor is inside the form fields and arrow keys are pressed if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) { if (event.keyCode === 37 && _.options.accessibility === true) { _.changeSlide({ data: { message: _.options.rtl === true ? 'next' : 'previous' } }); } else if (event.keyCode === 39 && _.options.accessibility === true) { _.changeSlide({ data: { message: _.options.rtl === true ? 'previous' : 'next' } }); } } }; Slick.prototype.lazyLoad = function() { var _ = this, loadRange, cloneRange, rangeStart, rangeEnd; function loadImages(imagesScope) { $('img[data-lazy]', imagesScope).each(function() { var image = $(this), imageSource = $(this).attr('data-lazy'), imageSrcSet = $(this).attr('data-srcset'), imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'), imageToLoad = document.createElement('img'); imageToLoad.onload = function() { image .animate({ opacity: 0 }, 100, function() { if (imageSrcSet) { image .attr('srcset', imageSrcSet ); if (imageSizes) { image .attr('sizes', imageSizes ); } } image .attr('src', imageSource) .animate({ opacity: 1 }, 200, function() { image .removeAttr('data-lazy data-srcset data-sizes') .removeClass('slick-loading'); }); _.$slider.trigger('lazyLoaded', [_, image, imageSource]); }); }; imageToLoad.onerror = function() { image .removeAttr( 'data-lazy' ) .removeClass( 'slick-loading' ) .addClass( '<API key>' ); _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); }; imageToLoad.src = imageSource; }); } if (_.options.centerMode === true) { if (_.options.infinite === true) { rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1); rangeEnd = rangeStart + _.options.slidesToShow + 2; } else { rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1)); rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide; } } else { rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide; rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow); if (_.options.fade === true) { if (rangeStart > 0) rangeStart if (rangeEnd <= _.slideCount) rangeEnd++; } } loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd); if (_.options.lazyLoad === 'anticipated') { var prevSlide = rangeStart - 1, nextSlide = rangeEnd, $slides = _.$slider.find('.slick-slide'); for (var i = 0; i < _.options.slidesToScroll; i++) { if (prevSlide < 0) prevSlide = _.slideCount - 1; loadRange = loadRange.add($slides.eq(prevSlide)); loadRange = loadRange.add($slides.eq(nextSlide)); prevSlide nextSlide++; } } loadImages(loadRange); if (_.slideCount <= _.options.slidesToShow) { cloneRange = _.$slider.find('.slick-slide'); loadImages(cloneRange); } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow) { cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow); loadImages(cloneRange); } else if (_.currentSlide === 0) { cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1); loadImages(cloneRange); } }; Slick.prototype.loadSlider = function() { var _ = this; _.setPosition(); _.$slideTrack.css({ opacity: 1 }); _.$slider.removeClass('slick-loading'); _.initUI(); if (_.options.lazyLoad === 'progressive') { _.progressiveLazyLoad(); } }; Slick.prototype.next = Slick.prototype.slickNext = function() { var _ = this; _.changeSlide({ data: { message: 'next' } }); }; Slick.prototype.orientationChange = function() { var _ = this; _.checkResponsive(); _.setPosition(); }; Slick.prototype.pause = Slick.prototype.slickPause = function() { var _ = this; _.autoPlayClear(); _.paused = true; }; Slick.prototype.play = Slick.prototype.slickPlay = function() { var _ = this; _.autoPlay(); _.options.autoplay = true; _.paused = false; _.focussed = false; _.interrupted = false; }; Slick.prototype.postSlide = function(index) { var _ = this; if( !_.unslicked ) { _.$slider.trigger('afterChange', [_, index]); _.animating = false; if (_.slideCount > _.options.slidesToShow) { _.setPosition(); } _.swipeLeft = null; if ( _.options.autoplay ) { _.autoPlay(); } if (_.options.accessibility === true) { _.initADA(); if (_.options.focusOnChange) { var $currentSlide = $(_.$slides.get(_.currentSlide)); $currentSlide.attr('tabindex', 0).focus(); } } } }; Slick.prototype.prev = Slick.prototype.slickPrev = function() { var _ = this; _.changeSlide({ data: { message: 'previous' } }); }; Slick.prototype.preventDefault = function(event) { event.preventDefault(); }; Slick.prototype.progressiveLazyLoad = function( tryCount ) { tryCount = tryCount || 1; var _ = this, $imgsToLoad = $( 'img[data-lazy]', _.$slider ), image, imageSource, imageSrcSet, imageSizes, imageToLoad; if ( $imgsToLoad.length ) { image = $imgsToLoad.first(); imageSource = image.attr('data-lazy'); imageSrcSet = image.attr('data-srcset'); imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes'); imageToLoad = document.createElement('img'); imageToLoad.onload = function() { if (imageSrcSet) { image .attr('srcset', imageSrcSet ); if (imageSizes) { image .attr('sizes', imageSizes ); } } image .attr( 'src', imageSource ) .removeAttr('data-lazy data-srcset data-sizes') .removeClass('slick-loading'); if ( _.options.adaptiveHeight === true ) { _.setPosition(); } _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]); _.progressiveLazyLoad(); }; imageToLoad.onerror = function() { if ( tryCount < 3 ) { /** * try to load the image 3 times, * leave a slight delay so we don't get * servers blocking the request. */ setTimeout( function() { _.progressiveLazyLoad( tryCount + 1 ); }, 500 ); } else { image .removeAttr( 'data-lazy' ) .removeClass( 'slick-loading' ) .addClass( '<API key>' ); _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); _.progressiveLazyLoad(); } }; imageToLoad.src = imageSource; } else { _.$slider.trigger('allImagesLoaded', [ _ ]); } }; Slick.prototype.refresh = function( initializing ) { var _ = this, currentSlide, lastVisibleIndex; lastVisibleIndex = _.slideCount - _.options.slidesToShow; // in non-infinite sliders, we don't want to go past the // last visible index. if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) { _.currentSlide = lastVisibleIndex; } // if less slides than to show, go to start. if ( _.slideCount <= _.options.slidesToShow ) { _.currentSlide = 0; } currentSlide = _.currentSlide; _.destroy(true); $.extend(_, _.initials, { currentSlide: currentSlide }); _.init(); if( !initializing ) { _.changeSlide({ data: { message: 'index', index: currentSlide } }, false); } }; Slick.prototype.registerBreakpoints = function() { var _ = this, breakpoint, currentBreakpoint, l, responsiveSettings = _.options.responsive || null; if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) { _.respondTo = _.options.respondTo || 'window'; for ( breakpoint in responsiveSettings ) { l = _.breakpoints.length-1; if (responsiveSettings.hasOwnProperty(breakpoint)) { currentBreakpoint = responsiveSettings[breakpoint].breakpoint; // loop through the breakpoints and cut out any existing // ones with the same breakpoint number, we don't want dupes. while( l >= 0 ) { if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) { _.breakpoints.splice(l,1); } l } _.breakpoints.push(currentBreakpoint); _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings; } } _.breakpoints.sort(function(a, b) { return ( _.options.mobileFirst ) ? a-b : b-a; }); } }; Slick.prototype.reinit = function() { var _ = this; _.$slides = _.$slideTrack .children(_.options.slide) .addClass('slick-slide'); _.slideCount = _.$slides.length; if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) { _.currentSlide = _.currentSlide - _.options.slidesToScroll; } if (_.slideCount <= _.options.slidesToShow) { _.currentSlide = 0; } _.registerBreakpoints(); _.setProps(); _.setupInfinite(); _.buildArrows(); _.updateArrows(); _.initArrowEvents(); _.buildDots(); _.updateDots(); _.initDotEvents(); _.cleanUpSlideEvents(); _.initSlideEvents(); _.checkResponsive(false, true); if (_.options.focusOnSelect === true) { $(_.$slideTrack).children().on('click.slick', _.selectHandler); } _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); _.setPosition(); _.focusHandler(); _.paused = !_.options.autoplay; _.autoPlay(); _.$slider.trigger('reInit', [_]); }; Slick.prototype.resize = function() { var _ = this; if ($(window).width() !== _.windowWidth) { clearTimeout(_.windowDelay); _.windowDelay = window.setTimeout(function() { _.windowWidth = $(window).width(); _.checkResponsive(); if( !_.unslicked ) { _.setPosition(); } }, 50); } }; Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) { var _ = this; if (typeof(index) === 'boolean') { removeBefore = index; index = removeBefore === true ? 0 : _.slideCount - 1; } else { index = removeBefore === true ? --index : index; } if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) { return false; } _.unload(); if (removeAll === true) { _.$slideTrack.children().remove(); } else { _.$slideTrack.children(this.options.slide).eq(index).remove(); } _.$slides = _.$slideTrack.children(this.options.slide); _.$slideTrack.children(this.options.slide).detach(); _.$slideTrack.append(_.$slides); _.$slidesCache = _.$slides; _.reinit(); }; Slick.prototype.setCSS = function(position) { var _ = this, positionProps = {}, x, y; if (_.options.rtl === true) { position = -position; } x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px'; y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px'; positionProps[_.positionProp] = position; if (_.transformsEnabled === false) { _.$slideTrack.css(positionProps); } else { positionProps = {}; if (_.cssTransitions === false) { positionProps[_.animType] = 'translate(' + x + ', ' + y + ')'; _.$slideTrack.css(positionProps); } else { positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)'; _.$slideTrack.css(positionProps); } } }; Slick.prototype.setDimensions = function() { var _ = this; if (_.options.vertical === false) { if (_.options.centerMode === true) { _.$list.css({ padding: ('0px ' + _.options.centerPadding) }); } } else { _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow); if (_.options.centerMode === true) { _.$list.css({ padding: (_.options.centerPadding + ' 0px') }); } } _.listWidth = _.$list.width(); _.listHeight = _.$list.height(); if (_.options.vertical === false && _.options.variableWidth === false) { _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow); _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length))); } else if (_.options.variableWidth === true) { _.$slideTrack.width(5000 * _.slideCount); } else { _.slideWidth = Math.ceil(_.listWidth); _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length))); } var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width(); if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset); }; Slick.prototype.setFade = function() { var _ = this, targetLeft; _.$slides.each(function(index, element) { targetLeft = (_.slideWidth * index) * -1; if (_.options.rtl === true) { $(element).css({ position: 'relative', right: targetLeft, top: 0, zIndex: _.options.zIndex - 2, opacity: 0 }); } else { $(element).css({ position: 'relative', left: targetLeft, top: 0, zIndex: _.options.zIndex - 2, opacity: 0 }); } }); _.$slides.eq(_.currentSlide).css({ zIndex: _.options.zIndex - 1, opacity: 1 }); }; Slick.prototype.setHeight = function() { var _ = this; if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); _.$list.css('height', targetHeight); } }; Slick.prototype.setOption = Slick.prototype.slickSetOption = function() { /** * accepts arguments in format of: * * - for changing a single option's value: * .slick("setOption", option, value, refresh ) * * - for changing a set of responsive options: * .slick("setOption", 'responsive', [{}, ...], refresh ) * * - for updating multiple values at once (not responsive) * .slick("setOption", { 'option': value, ... }, refresh ) */ var _ = this, l, item, option, value, refresh = false, type; if( $.type( arguments[0] ) === 'object' ) { option = arguments[0]; refresh = arguments[1]; type = 'multiple'; } else if ( $.type( arguments[0] ) === 'string' ) { option = arguments[0]; value = arguments[1]; refresh = arguments[2]; if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) { type = 'responsive'; } else if ( typeof arguments[1] !== 'undefined' ) { type = 'single'; } } if ( type === 'single' ) { _.options[option] = value; } else if ( type === 'multiple' ) { $.each( option , function( opt, val ) { _.options[opt] = val; }); } else if ( type === 'responsive' ) { for ( item in value ) { if( $.type( _.options.responsive ) !== 'array' ) { _.options.responsive = [ value[item] ]; } else { l = _.options.responsive.length-1; // loop through the responsive object and splice out duplicates. while( l >= 0 ) { if( _.options.responsive[l].breakpoint === value[item].breakpoint ) { _.options.responsive.splice(l,1); } l } _.options.responsive.push( value[item] ); } } } if ( refresh ) { _.unload(); _.reinit(); } }; Slick.prototype.setPosition = function() { var _ = this; _.setDimensions(); _.setHeight(); if (_.options.fade === false) { _.setCSS(_.getLeft(_.currentSlide)); } else { _.setFade(); } _.$slider.trigger('setPosition', [_]); }; Slick.prototype.setProps = function() { var _ = this, bodyStyle = document.body.style; _.positionProp = _.options.vertical === true ? 'top' : 'left'; if (_.positionProp === 'top') { _.$slider.addClass('slick-vertical'); } else { _.$slider.removeClass('slick-vertical'); } if (bodyStyle.WebkitTransition !== undefined || bodyStyle.MozTransition !== undefined || bodyStyle.msTransition !== undefined) { if (_.options.useCSS === true) { _.cssTransitions = true; } } if ( _.options.fade ) { if ( typeof _.options.zIndex === 'number' ) { if( _.options.zIndex < 3 ) { _.options.zIndex = 3; } } else { _.options.zIndex = _.defaults.zIndex; } } if (bodyStyle.OTransform !== undefined) { _.animType = 'OTransform'; _.transformType = '-o-transform'; _.transitionType = 'OTransition'; if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; } if (bodyStyle.MozTransform !== undefined) { _.animType = 'MozTransform'; _.transformType = '-moz-transform'; _.transitionType = 'MozTransition'; if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false; } if (bodyStyle.webkitTransform !== undefined) { _.animType = 'webkitTransform'; _.transformType = '-webkit-transform'; _.transitionType = 'webkitTransition'; if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; } if (bodyStyle.msTransform !== undefined) { _.animType = 'msTransform'; _.transformType = '-ms-transform'; _.transitionType = 'msTransition'; if (bodyStyle.msTransform === undefined) _.animType = false; } if (bodyStyle.transform !== undefined && _.animType !== false) { _.animType = 'transform'; _.transformType = 'transform'; _.transitionType = 'transition'; } _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false); }; Slick.prototype.setSlideClasses = function(index) { var _ = this, centerOffset, allSlides, indexOffset, remainder; allSlides = _.$slider .find('.slick-slide') .removeClass('slick-active slick-center slick-current') .attr('aria-hidden', 'true'); _.$slides .eq(index) .addClass('slick-current'); if (_.options.centerMode === true) { var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0; centerOffset = Math.floor(_.options.slidesToShow / 2); if (_.options.infinite === true) { if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) { _.$slides .slice(index - centerOffset + evenCoef, index + centerOffset + 1) .addClass('slick-active') .attr('aria-hidden', 'false'); } else { indexOffset = _.options.slidesToShow + index; allSlides .slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2) .addClass('slick-active') .attr('aria-hidden', 'false'); } if (index === 0) { allSlides .eq(allSlides.length - 1 - _.options.slidesToShow) .addClass('slick-center'); } else if (index === _.slideCount - 1) { allSlides .eq(_.options.slidesToShow) .addClass('slick-center'); } } _.$slides .eq(index) .addClass('slick-center'); } else { if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) { _.$slides .slice(index, index + _.options.slidesToShow) .addClass('slick-active') .attr('aria-hidden', 'false'); } else if (allSlides.length <= _.options.slidesToShow) { allSlides .addClass('slick-active') .attr('aria-hidden', 'false'); } else { remainder = _.slideCount % _.options.slidesToShow; indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index; if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) { allSlides .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder) .addClass('slick-active') .attr('aria-hidden', 'false'); } else { allSlides .slice(indexOffset, indexOffset + _.options.slidesToShow) .addClass('slick-active') .attr('aria-hidden', 'false'); } } } if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') { _.lazyLoad(); } }; Slick.prototype.setupInfinite = function() { var _ = this, i, slideIndex, infiniteCount; if (_.options.fade === true) { _.options.centerMode = false; } if (_.options.infinite === true && _.options.fade === false) { slideIndex = null; if (_.slideCount > _.options.slidesToShow) { if (_.options.centerMode === true) { infiniteCount = _.options.slidesToShow + 1; } else { infiniteCount = _.options.slidesToShow; } for (i = _.slideCount; i > (_.slideCount - infiniteCount); i -= 1) { slideIndex = i - 1; $(_.$slides[slideIndex]).clone(true).attr('id', '') .attr('data-slick-index', slideIndex - _.slideCount) .prependTo(_.$slideTrack).addClass('slick-cloned'); } for (i = 0; i < infiniteCount + _.slideCount; i += 1) { slideIndex = i; $(_.$slides[slideIndex]).clone(true).attr('id', '') .attr('data-slick-index', slideIndex + _.slideCount) .appendTo(_.$slideTrack).addClass('slick-cloned'); } _.$slideTrack.find('.slick-cloned').find('[id]').each(function() { $(this).attr('id', ''); }); } } }; Slick.prototype.interrupt = function( toggle ) { var _ = this; if( !toggle ) { _.autoPlay(); } _.interrupted = toggle; }; Slick.prototype.selectHandler = function(event) { var _ = this; var targetElement = $(event.target).is('.slick-slide') ? $(event.target) : $(event.target).parents('.slick-slide'); var index = parseInt(targetElement.attr('data-slick-index')); if (!index) index = 0; if (_.slideCount <= _.options.slidesToShow) { _.slideHandler(index, false, true); return; } _.slideHandler(index); }; Slick.prototype.slideHandler = function(index, sync, dontAnimate) { var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null, _ = this, navTarget; sync = sync || false; if (_.animating === true && _.options.waitForAnimate === true) { return; } if (_.options.fade === true && _.currentSlide === index) { return; } if (sync === false) { _.asNavFor(index); } targetSlide = index; targetLeft = _.getLeft(targetSlide); slideLeft = _.getLeft(_.currentSlide); _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft; if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) { if (_.options.fade === false) { targetSlide = _.currentSlide; if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { _.animateSlide(slideLeft, function() { _.postSlide(targetSlide); }); } else { _.postSlide(targetSlide); } } return; } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) { if (_.options.fade === false) { targetSlide = _.currentSlide; if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { _.animateSlide(slideLeft, function() { _.postSlide(targetSlide); }); } else { _.postSlide(targetSlide); } } return; } if ( _.options.autoplay ) { clearInterval(_.autoPlayTimer); } if (targetSlide < 0) { if (_.slideCount % _.options.slidesToScroll !== 0) { animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll); } else { animSlide = _.slideCount + targetSlide; } } else if (targetSlide >= _.slideCount) { if (_.slideCount % _.options.slidesToScroll !== 0) { animSlide = 0; } else { animSlide = targetSlide - _.slideCount; } } else { animSlide = targetSlide; } _.animating = true; _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]); oldSlide = _.currentSlide; _.currentSlide = animSlide; _.setSlideClasses(_.currentSlide); if ( _.options.asNavFor ) { navTarget = _.getNavTarget(); navTarget = navTarget.slick('getSlick'); if ( navTarget.slideCount <= navTarget.options.slidesToShow ) { navTarget.setSlideClasses(_.currentSlide); } } _.updateDots(); _.updateArrows(); if (_.options.fade === true) { if (dontAnimate !== true) { _.fadeSlideOut(oldSlide); _.fadeSlide(animSlide, function() { _.postSlide(animSlide); }); } else { _.postSlide(animSlide); } _.animateHeight(); return; } if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { _.animateSlide(targetLeft, function() { _.postSlide(animSlide); }); } else { _.postSlide(animSlide); } }; Slick.prototype.startLoad = function() { var _ = this; if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { _.$prevArrow.hide(); _.$nextArrow.hide(); } if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { _.$dots.hide(); } _.$slider.addClass('slick-loading'); }; Slick.prototype.swipeDirection = function() { var xDist, yDist, r, swipeAngle, _ = this; xDist = _.touchObject.startX - _.touchObject.curX; yDist = _.touchObject.startY - _.touchObject.curY; r = Math.atan2(yDist, xDist); swipeAngle = Math.round(r * 180 / Math.PI); if (swipeAngle < 0) { swipeAngle = 360 - Math.abs(swipeAngle); } if ((swipeAngle <= 45) && (swipeAngle >= 0)) { return (_.options.rtl === false ? 'left' : 'right'); } if ((swipeAngle <= 360) && (swipeAngle >= 315)) { return (_.options.rtl === false ? 'left' : 'right'); } if ((swipeAngle >= 135) && (swipeAngle <= 225)) { return (_.options.rtl === false ? 'right' : 'left'); } if (_.options.verticalSwiping === true) { if ((swipeAngle >= 35) && (swipeAngle <= 135)) { return 'down'; } else { return 'up'; } } return 'vertical'; }; Slick.prototype.swipeEnd = function(event) { var _ = this, slideCount, direction; _.dragging = false; _.swiping = false; if (_.scrolling) { _.scrolling = false; return false; } _.interrupted = false; _.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true; if ( _.touchObject.curX === undefined ) { return false; } if ( _.touchObject.edgeHit === true ) { _.$slider.trigger('edge', [_, _.swipeDirection() ]); } if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) { direction = _.swipeDirection(); switch ( direction ) { case 'left': case 'down': slideCount = _.options.swipeToSlide ? _.checkNavigable( _.currentSlide + _.getSlideCount() ) : _.currentSlide + _.getSlideCount(); _.currentDirection = 0; break; case 'right': case 'up': slideCount = _.options.swipeToSlide ? _.checkNavigable( _.currentSlide - _.getSlideCount() ) : _.currentSlide - _.getSlideCount(); _.currentDirection = 1; break; default: } if( direction != 'vertical' ) { _.slideHandler( slideCount ); _.touchObject = {}; _.$slider.trigger('swipe', [_, direction ]); } } else { if ( _.touchObject.startX !== _.touchObject.curX ) { _.slideHandler( _.currentSlide ); _.touchObject = {}; } } }; Slick.prototype.swipeHandler = function(event) { var _ = this; if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) { return; } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) { return; } _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ? event.originalEvent.touches.length : 1; _.touchObject.minSwipe = _.listWidth / _.options .touchThreshold; if (_.options.verticalSwiping === true) { _.touchObject.minSwipe = _.listHeight / _.options .touchThreshold; } switch (event.data.action) { case 'start': _.swipeStart(event); break; case 'move': _.swipeMove(event); break; case 'end': _.swipeEnd(event); break; } }; Slick.prototype.swipeMove = function(event) { var _ = this, edgeWasHit = false, curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength; touches = event.originalEvent !== undefined ? event.originalEvent.touches : null; if (!_.dragging || _.scrolling || touches && touches.length !== 1) { return false; } curLeft = _.getLeft(_.currentSlide); _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX; _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY; _.touchObject.swipeLength = Math.round(Math.sqrt( Math.pow(_.touchObject.curX - _.touchObject.startX, 2))); verticalSwipeLength = Math.round(Math.sqrt( Math.pow(_.touchObject.curY - _.touchObject.startY, 2))); if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) { _.scrolling = true; return false; } if (_.options.verticalSwiping === true) { _.touchObject.swipeLength = verticalSwipeLength; } swipeDirection = _.swipeDirection(); if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) { _.swiping = true; event.preventDefault(); } positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1); if (_.options.verticalSwiping === true) { positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1; } swipeLength = _.touchObject.swipeLength; _.touchObject.edgeHit = false; if (_.options.infinite === false) { if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) { swipeLength = _.touchObject.swipeLength * _.options.edgeFriction; _.touchObject.edgeHit = true; } } if (_.options.vertical === false) { _.swipeLeft = curLeft + swipeLength * positionOffset; } else { _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset; } if (_.options.verticalSwiping === true) { _.swipeLeft = curLeft + swipeLength * positionOffset; } if (_.options.fade === true || _.options.touchMove === false) { return false; } if (_.animating === true) { _.swipeLeft = null; return false; } _.setCSS(_.swipeLeft); }; Slick.prototype.swipeStart = function(event) { var _ = this, touches; _.interrupted = true; if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) { _.touchObject = {}; return false; } if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) { touches = event.originalEvent.touches[0]; } _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX; _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY; _.dragging = true; }; Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() { var _ = this; if (_.$slidesCache !== null) { _.unload(); _.$slideTrack.children(this.options.slide).detach(); _.$slidesCache.appendTo(_.$slideTrack); _.reinit(); } }; Slick.prototype.unload = function() { var _ = this; $('.slick-cloned', _.$slider).remove(); if (_.$dots) { _.$dots.remove(); } if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) { _.$prevArrow.remove(); } if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) { _.$nextArrow.remove(); } _.$slides .removeClass('slick-slide slick-active slick-visible slick-current') .attr('aria-hidden', 'true') .css('width', ''); }; Slick.prototype.unslick = function(fromBreakpoint) { var _ = this; _.$slider.trigger('unslick', [_, fromBreakpoint]); _.destroy(); }; Slick.prototype.updateArrows = function() { var _ = this, centerOffset; centerOffset = Math.floor(_.options.slidesToShow / 2); if ( _.options.arrows === true && _.slideCount > _.options.slidesToShow && !_.options.infinite ) { _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); if (_.currentSlide === 0) { _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) { _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) { _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); } } }; Slick.prototype.updateDots = function() { var _ = this; if (_.$dots !== null) { _.$dots .find('li') .removeClass('slick-active') .end(); _.$dots .find('li') .eq(Math.floor(_.currentSlide / _.options.slidesToScroll)) .addClass('slick-active'); } }; Slick.prototype.visibility = function() { var _ = this; if ( _.options.autoplay ) { if ( document[_.hidden] ) { _.interrupted = true; } else { _.interrupted = false; } } }; $.fn.slick = function() { var _ = this, opt = arguments[0], args = Array.prototype.slice.call(arguments, 1), l = _.length, i, ret; for (i = 0; i < l; i++) { if (typeof opt == 'object' || typeof opt == 'undefined') _[i].slick = new Slick(_[i], opt); else ret = _[i].slick[opt].apply(_[i].slick, args); if (typeof ret != 'undefined') return ret; } return _; }; $( document ).ready(function() { $( '.<API key>.slick-carousel' ).each(function ( idx, item ) { var carouselId = "slick-carousel" + idx; var data = $( this ).parent( '.<API key>' ).data( 'carousel' ); if ( typeof data !== "undefined" ) { this.id = carouselId; $( this ).slick({ autoplay: ( data.autoplay === 'false' ) ? false : true, arrows: ( data.arrows === 'false' ) ? false : true, autoplaySpeed: data.autoplay_speed, infinite: ( data.infinite === 'false' ) ? false : true, speed: parseInt( data.speed ), pauseOnHover: ( data.pause_on_hover === 'false' ) ? false : true, dots: ( data.dots === 'false' ) ? false : true, adaptiveHeight: ( data.adaptive_height === 'false' ) ? false : true, mobileFirst: ( data.mobile_first === 'false' ) ? false : true, slidesPerRow: parseInt( data.slides_per_row ), slidesToShow: parseInt( data.slides_to_show ), slidesToScroll: parseInt( data.slides_to_scroll ), useTransform: ( data.use_transform === 'false' ) ? false : true, }); } }); }); }));
namespace BarionClientLibrary.Operations.Common { public class ShippingAddress { public string Country { get; set; } public string City { get; set; } public string Region { get; set; } public string Zip { get; set; } public string Street { get; set; } public string Street2 { get; set; } public string Street3 { get; set; } public string FullName { get; set; } } }
#ifndef OBJ_NPC_H #define OBJ_NPC_H #include <string> #include <common_features/size.h> #include <ConfigPackManager/level/config_npc.h> #include "../graphics/graphics.h" #include "spawn_effect_def.h" // //Defines:// // // obj_npc // // npc_Markers // struct obj_npc { /* OpenGL */ bool isInit; PGE_Texture *image; GLuint textureID; int textureArrayId; int animator_ID; PGE_Size image_size; /* OpenGL */ //! Generic NPC settings and parameters NpcSetup setup; SpawnEffectDef effect_1_def; SpawnEffectDef effect_2_def; enum blockSpawn { spawn_warp = 0, spawn_bump }; //!Type of NPC spawn from block unsigned int block_spawn_type; //!NPC's initial Y Velocity after spawn from block double block_spawn_speed; //!Play sound on spawn from block (if false - spawn without 'radish' sound) bool block_spawn_sound; }; struct NPC_GlobalSetup { // ;Defines for SMBX64 uint64_t bubble; // bubble=283 ; NPC-Container for packed in bubble uint64_t egg; // egg=96 ; NPC-Container for packed in egg uint64_t lakitu; // lakitu=284 ; NPC-Container for spawn by lakitu uint64_t buried; // burred=91 ; NPC-Container for packed in herb uint64_t ice_cube; // icecube=263 ; NPC-Container for frozen NPCs // ;markers uint64_t iceball; // iceball=265 uint64_t fireball; // fireball=13 uint64_t hammer; // hammer=171 uint64_t boomerang;// boomerang=292 uint64_t coin_in_block; // coin-in-block=10 // some physics settings double phs_gravity_accel; double phs_max_fall_speed; //effects uint64_t eff_lava_burn; //Lava burn effect [Effect to spawn on contact with lava] //projectile properties SpawnEffectDef projectile_effect; uint64_t projectile_sound_id; double projectile_speed; //Talking NPC's properties std::string talking_sign_img; }; #endif // OBJ_NPC_H
/*! \file st.h \brief Class representing FPU's ST register. */ #ifdef ST_H #error Already included #else #define ST_H class st: public reg { public: st(); st(std::string const &name); ~st(); st &operator()(size_t i); std::string name() const override; private: std::string const m_name; public: st(const st &instance) = default; st(st &&instance) = default; st &operator=(const st &instance) = delete; st &operator=(const st &&instance) = delete; }; #endif
#include <iostream> #include <stdexcept> #include <vector> #include "latticeBase.hpp" #include "collisionBase.hxx" #include "latticeNode.hxx" #include "latticeModel.hxx" #include "ZouHeNode.hpp" #include "latticeNode.hxx" ZouHeNode::ZouHeNode ( latticeBase &lb, collisionBase &cb, latticeModelD2Q9 &D2Q9, fluidField &field ) : boundaryNode(false, false, lb), nodes {}, cb_ (cb), is_normal_flow_ {false}, beta1_ {}, beta2_ {}, beta3_ {}, D2Q9_ (D2Q9), field_ (field) { const auto c = lb_.getLatticeSpeed(); const auto cs_sqr = c * c / 3.0; beta1_ = c / (9.0 *cs_sqr); beta2_ = 0.5 / c; beta3_ = beta2_ - beta1_; } void ZouHeNode::addNode ( std::size_t x, std::size_t y, double u_x, double u_y ) { const auto nx = lb_.getNumberOfNx(); const auto ny = lb_.getNumberOfNy(); const auto n = y * nx + x; const auto left = x == 0; const auto right = x == nx - 1; const auto bottom = y == 0; const auto top = y == ny - 1; auto edge_i = -1; if (right) edge_i = 0; if (top) edge_i = 1; if (left) edge_i = 2; if (bottom) edge_i = 3; // adds a corner node if ((top || bottom) && (left || right)) { auto corner_i = -1; if (bottom && left) corner_i = 0; if (bottom && right) corner_i = 1; if (top && left) corner_i = 2; if (top && right) corner_i = 3; nodes.push_back(latticeNode(x, y, n, u_x, u_y, true, corner_i)); } // adds a side node else { nodes.push_back(latticeNode(x, y, n, u_x, u_y, false, edge_i)); } } void ZouHeNode::updateNode ( std::vector<std::vector<double>> &df, bool is_modify_stream ) { if (!is_modify_stream) { for (auto node : nodes) { if (node.corner) { ZouHeNode::updateCorner(df, node); } else { ZouHeNode::updateEdge(df, node); } } } } void ZouHeNode::updateEdge ( std::vector<std::vector<double>> &df, latticeNode &node ) { const auto n = node.n_node; const auto nx = lb_.getNumberOfNx(); const auto c = lb_.getLatticeSpeed(); switch(node.index_i) { case 0: { // right auto vel = is_normal_flow_ ? field_.u[n - 1] : node.u_node; const auto rho_node = (df[n][0] + df[n][D2Q9_.N] + df[n][D2Q9_.S] + 2.0 * (df[n][D2Q9_.E] + df[n][D2Q9_.NE] + df[n][D2Q9_.SE])) / (1.0 + vel[0] / c); const auto df_diff = 0.5 * (df[n][D2Q9_.S] - df[n][D2Q9_.N]); for (auto &u : vel) u *= rho_node; df[n][D2Q9_.W] = df[n][D2Q9_.E] - 2.0 * beta1_ * vel[0]; df[n][D2Q9_.NW] = df[n][D2Q9_.SE] + df_diff - beta3_ * vel[0] + beta2_ * vel[1]; df[n][D2Q9_.SW] = df[n][D2Q9_.NE] - df_diff - beta3_ * vel[0] - beta2_ * vel[1]; break; } case 1: { // top auto vel = is_normal_flow_ ? field_.u[n - nx] : node.u_node; const auto rho_node = (df[n][0] + df[n][D2Q9_.E] + df[n][D2Q9_.W] + 2.0 * (df[n][D2Q9_.N] + df[n][D2Q9_.NE] + df[n][D2Q9_.NW])) / (1.0 + vel[1] / c); const auto df_diff = 0.5 * (df[n][D2Q9_.E] - df[n][D2Q9_.W]); for (auto &u : vel) u *= rho_node; df[n][D2Q9_.S] = df[n][D2Q9_.N] - 2.0 * beta1_ * vel[1]; df[n][D2Q9_.SW] = df[n][D2Q9_.NE] + df_diff - beta2_ * vel[0] - beta3_ * vel[1]; df[n][D2Q9_.SE] = df[n][D2Q9_.NW] - df_diff + beta2_ * vel[0] - beta3_ * vel[1]; break; } case 2: { // left auto vel = is_normal_flow_ ? field_.u[n + 1] : node.u_node; const auto rho_node = (df[n][0] + df[n][D2Q9_.N] + df[n][D2Q9_.S] + 2.0 * (df[n][D2Q9_.W] + df[n][D2Q9_.NW] + df[n][D2Q9_.SW])) / (1.0 - vel[0] / c); const auto df_diff = 0.5 * (df[n][D2Q9_.S] - df[n][D2Q9_.N]); for (auto &u : vel) u *= rho_node; df[n][D2Q9_.E] = df[n][D2Q9_.W] + 2.0 * beta1_ * vel[0]; df[n][D2Q9_.NE] = df[n][D2Q9_.SW] + df_diff + beta3_ * vel[0] + beta2_ * vel[1]; df[n][D2Q9_.SE] = df[n][D2Q9_.NW] - df_diff + beta3_ * vel[0] - beta2_ * vel[1]; break; } case 3: { // bottom auto vel = is_normal_flow_ ? field_.u[n + nx] : node.u_node; const auto rho_node = (df[n][0] + df[n][D2Q9_.E] + df[n][D2Q9_.W] + 2.0 * (df[n][D2Q9_.S] + df[n][D2Q9_.SW] + df[n][D2Q9_.SE])) / (1.0 - vel[1] / c); const auto df_diff = 0.5 * (df[n][D2Q9_.W] - df[n][D2Q9_.E]); for (auto &u : vel) u *= rho_node; df[n][D2Q9_.N] = df[n][D2Q9_.S] + 2.0 * beta1_ * vel[1]; df[n][D2Q9_.NE] = df[n][D2Q9_.SW] + df_diff + beta2_ * vel[0] + beta3_ * vel[1]; df[n][D2Q9_.NW] = df[n][D2Q9_.SE] - df_diff - beta2_ * vel[0] + beta3_ * vel[1]; break; } default: { throw std::runtime_error("Not a side"); } } } void ZouHeNode::updateCorner ( std::vector<std::vector<double>> &df, latticeNode &node ) { const auto n = node.n_node; auto vel = node.u_node; const auto nx = lb_.getNumberOfNx(); const auto nc = lb_.<API key>(); switch (node.index_i) { case 0: { // bottom-left auto rho_node = 0.5 * (cb_.rho_[n + nx] + cb_.rho_[n + 1]); for (auto &u : vel) u *= rho_node; df[n][D2Q9_.E] = df[n][D2Q9_.W] + 2.0 * beta1_ * vel[0]; df[n][D2Q9_.N] = df[n][D2Q9_.S] + 2.0 * beta1_ * vel[1]; df[n][D2Q9_.NE] = df[n][D2Q9_.SW] + 0.5 * beta1_ * vel[0] + 0.5 * beta1_ * vel[1]; df[n][D2Q9_.NW] = -0.5 * beta3_ * vel[0] + 0.5 * beta3_ * vel[1]; df[n][D2Q9_.SE] = 0.5 * beta3_ * vel[0] - 0.5 * beta3_ * vel[1]; for (auto i = 1u; i < nc; ++i) rho_node -= df[n][i]; df[n][0] = rho_node; break; } case 1: { // bottom-right auto rho_node = 0.5 * (cb_.rho_[n + nx] + cb_.rho_[n - 1]); for (auto &u : vel) u *= rho_node; df[n][D2Q9_.W] = df[n][D2Q9_.E] - 2.0 * beta1_ * vel[0]; df[n][D2Q9_.N] = df[n][D2Q9_.S] + 2.0 * beta1_ * vel[1]; df[n][D2Q9_.NW] = df[n][D2Q9_.SE] - 0.5 * beta1_ * vel[0] + 0.5 * beta1_ * vel[1]; df[n][D2Q9_.NE] = 0.5 * beta3_ * vel[0] + 0.5 * beta3_ * vel[1]; df[n][D2Q9_.SW] = -0.5 * beta3_ * vel[0] - 0.5 * beta3_ * vel[1]; for (auto i = 1u; i < nc; ++i) rho_node -= df[n][i]; df[n][0] = rho_node; break; } case 2: { // top-left auto rho_node = 0.5 * (cb_.rho_[n - nx] + cb_.rho_[n + 1]); for (auto &u : vel) u *= rho_node; df[n][D2Q9_.E] = df[n][D2Q9_.W] + 2.0 * beta1_ * vel[0]; df[n][D2Q9_.S] = df[n][D2Q9_.N] - 2.0 * beta1_ * vel[1]; df[n][D2Q9_.SE] = df[n][D2Q9_.NW] + 0.5 * beta1_ * vel[0] - 0.5 * beta1_ * vel[1]; df[n][D2Q9_.NE] = 0.5 * beta3_ * vel[0] + 0.5 * beta3_ * vel[1]; df[n][D2Q9_.SW] = -0.5 * beta3_ * vel[0] - 0.5 * beta3_ * vel[1]; for (auto i = 1u; i < nc; ++i) rho_node -= df[n][i]; df[n][0] = rho_node; break; } case 3: { // top-right auto rho_node = 0.5 * (cb_.rho_[n - nx] + cb_.rho_[n - 1]); for (auto &u : vel) u *= rho_node; df[n][D2Q9_.W] = df[n][D2Q9_.E] - 2.0 * beta1_ * vel[0]; df[n][D2Q9_.S] = df[n][D2Q9_.N] - 2.0 * beta1_ * vel[1]; df[n][D2Q9_.SW] = df[n][D2Q9_.NE] - 0.5 * beta1_ * vel[0] - 0.5 * beta1_ * vel[1]; df[n][D2Q9_.NW] = -0.5 * beta3_ * vel[0] + 0.5 * beta3_ * vel[1]; df[n][D2Q9_.SE] = 0.5 * beta3_ * vel[0] - 0.5 * beta3_ * vel[1]; for (auto i = 1u; i < nc; ++i) rho_node -= df[n][i]; df[n][0] = rho_node; break; } default: { throw std::runtime_error("Not a corner"); } } } void ZouHeNode::toggleNormalFlow() { is_normal_flow_ = true; }
package net.minecraft.server; import java.io.IOException; public class <API key> implements Packet<<API key>> { private int a; private byte b; public <API key>() {} public <API key>(Entity entity, byte b0) { this.a = entity.getId(); this.b = b0; } public void a(<API key> <API key>) throws IOException { this.a = <API key>.g(); this.b = <API key>.readByte(); } public void b(<API key> <API key>) throws IOException { <API key>.d(this.a); <API key>.writeByte(this.b); } public void a(<API key> <API key>) { <API key>.a(this); } }
@{ # Script module or binary module file associated with this manifest. ModuleToProcess = 'AntivirusBypass.psm1' # Version number of this module. ModuleVersion = '3.0.0.0' # ID used to uniquely identify this module GUID = '<API key>' # Author of this module Author = 'Matthew Graeber' Copyright = 'BSD 3-Clause' # Description of the functionality provided by this module Description = 'PowerSploit Antivirus Avoidance/Bypass Module' # Minimum version of the Windows PowerShell engine required by this module PowerShellVersion = '2.0' # Functions to export from this module FunctionsToExport = '*' # List of all files packaged with this module FileList = 'AntivirusBypass.psm1', 'AntivirusBypass.psd1', 'Find-AVSignature.ps1', 'Usage.md' }
@charset "utf-8"; /* CSS Document */ *{margin:0;padding:0;} ul{list-style:none;} a{text-decoration:none;} img,input,textarea{border:none;} .clear{clear:both;} ::-moz-selection{background:#41EC49;} ::selection{background:#41EC49;} @font-face{ font-family:ziti; src:url(../fonts/Munro.eot),url(../fonts/Munro.otf),url(../fonts/Munro.svg),url(../fonts/Munro.ttf),url(../fonts/Munro.woff); } @keyframes sunny{ 0%{text-shadow:0 0 0 #fff;} 25%{text-shadow:0 0 10px rgba(255,255,255,1);} 50%{text-shadow:0 0 10px rgba(255,255,255,1),0 0 20px rgba(255,255,255,1);} 75%{text-shadow:0 0 10px rgba(255,255,255,1);} 100%{text-shadow:0 0 0 #fff;} } .inner{width:1000px;margin:0 auto;} header{width:100%;background-color:#e5e5e5;} header .logo{float:left;font-family:ziti;color:#49879e;font-size:37px;line-height:101px;padding-top:9px;} header i{margin-right:21px;} header .nav{float:right;padding-top:36px;} .one{background-image:linear-gradient(45deg,#9dc66a 5%,#4fa59a 30%,#4361c3);} .one .inner{text-align:center;padding:100px 0;} .one .icon i{font-size:80px;color:#fff;animation:sunny 5s infinite linear;} .one h1{font:36px/60px arial;color:#fff;padding-bottom:14px;} .one h1 span{font-weight:bolder;} .one h1 a{color:#fff;border-bottom:1px dotted #fff;position:relative;} .one h1 a:before{content:"";color:#fff;border-bottom:1px dotted #fff;position:absolute;width:100%;top:100%;left:0;opacity:0;transition:all 0.7s;} .one h1 a:hover:before{top:0;left:0;opacity:1;} .one p{padding-bottom:33px;font:18px/40px arial;color:#fff;} .one .btn a{display:inline-block;width:175px;height:50px;border:1px solid #fff;line-height:50px;font-size:21px;color:#fff;border-radius:4px;text-transform:uppercase;position:relative;transition:all 1s;} .one .btn a:after{content:"";background-color:#fff;width:1px;height:100px;position:absolute;top:51px;left:50%;} .one .btn a:hover{padding:0 30px;background-color:rgba(255,255,255,.5);} .two{background-color:#eaf9fe;padding:104px 0 127px 0;} .two .icon_list{float:left;width:500px;} .two .icon_list li{display:inline-block;border:1px solid #6e98ae;border-radius:4px;margin:40px;transform:rotate(45deg);overflow:hidden;transition:all 0.7s;} .two .icon_list li:hover{background-color:#31D7D4;} .two .icon_list li a{display:inline-block;width:140px;height:140px;text-align:center;line-height:140px;font-size:60px;transform:rotate(-45deg);transition:all 0.7s;} .two .icon_list li:nth-child(1) a{color:#c3e6a2;} .two .icon_list li:nth-child(1):hover a{transform:rotate(-45deg) scale(1.8);} .two .icon_list li:nth-child(2) a{color:#86d9ab;} .two .icon_list li:nth-child(2):hover a{transform:rotate(315deg);} .two .icon_list li:nth-child(3) a{color:#6cd4c9;} .two .icon_list li:nth-child(3):hover a{transform:rotate(-45deg) skewX(45deg);} .two .icon_list li:nth-child(4) a{color:#5fb3d8;} .two .icon_list li:nth-child(4):hover a{transform:rotate(180deg) scale(1.8)} .two .icon_list li:nth-child(5) a{color:#4e84ce;} .two .icon_list li:nth-child(5):hover a{transform:rotate(-45deg) scale(0.5);} .two .icon_list li:nth-child(6) a{color:#6c87f0;} .two .icon_list li:nth-child(6):hover a{transform:rotate(-45deg) translateY(-20px);} .two .icon_list li a:hover i{color:#fff;text-shadow:0 0 10px #fff;} .two .text{float:right;width:500px;} .two .text h2{font:30px/52px arial;font-weight:bolder;color:#45899c;position:relative;padding-bottom:57px;} .two .text h2:after{content:"";width:160px;height:1px;background-color:#4984a2;position:absolute;top:130px;left:0;} .two .text p{font:15px/32px arial;padding-top:31px;} footer{background-image:linear-gradient(45deg,#9dc66a 5%,#4fa59a 30%,#4361c3);padding:51px 0;text-align:center;} footer .icon ul li{display:inline-block;transition:all 0.7s;} footer .icon ul li:nth-child(1):hover{transform:scale(1.8);} footer .icon ul li:nth-child(2):hover{transform:scale(1.8) rotate(360deg);} footer .icon ul li:nth-child(3):hover{transform:scale(0.8) skewX(45deg);} footer .icon ul li:nth-child(4):hover{transform:scale(1.8) translateY(-20px);} footer .icon ul li:nth-child(5):hover{transform:scale(0.8) translateY(20px);} footer i{padding:0 14px 21px 14px;color:#fff;font-size:20px !important;} footer p{font:16px/23px "";color:#00000d;} footer span{font:13px/16px arial;color:#1a0000;} footer span a{color:#551b93;border-bottom:1px solid #551b93;}
package cmake.icons; import com.intellij.openapi.util.IconLoader; import javax.swing.*; public class CMakeIcons { public static final Icon FILE = IconLoader.getIcon("/icons/cmake.png"); public static final Icon MACRO = IconLoader.getIcon("/icons/hashtag.png"); public static final Icon FUN = IconLoader.getIcon("/icons/fun.jpg"); public static final Icon LOOP = IconLoader.getIcon("/icons/loop.png"); }
# Initialise # Load lib functions if not already loaded unless($_SHARED{lib}) { spi_exec_query("select lib()"); } my $lib = $_SHARED{lib}; $lib->{clear_cache}();
#include "umsdevice.h" #include "utils.h" #include "<API key>.h" #include "<API key>.h" #include "actiondialog.h" #include "localize.h" #include <QDir> #include <QFile> #include <QFileInfo> #include <QTextStream> static const QLatin1String constSettingsFile("/.is_audio_player"); static const QLatin1String constMusicFolderKey("audio_folder"); UmsDevice::UmsDevice(MusicModel *m, Solid::Device &dev) : FsDevice(m, dev) , access(dev.as<Solid::StorageAccess>()) { spaceInfo.setPath(access->filePath()); setup(); } UmsDevice::~UmsDevice() { } void UmsDevice::<API key>() { if (isConnected()) { spaceInfo.setPath(access->filePath()); setup(); if (opts.autoScan || scanned){ // Only scan if we are set to auto scan, or we have already scanned before... rescan(false); // Read from cache if we have it! } else { setStatusMessage(i18n("Not Scanned")); } } else { clear(); } } void UmsDevice::toggle() { if (solidDev.isValid() && access && access->isValid()) { if (access->isAccessible()) { if (scanner) { scanner->stop(); } access->teardown(); } else { access->setup(); } } } bool UmsDevice::isConnected() const { return solidDev.isValid() && access && access->isValid() && access->isAccessible(); } double UmsDevice::usedCapacity() { if (cacheProgress>-1) { return (cacheProgress*1.0)/100.0; } if (!isConnected()) { return -1.0; } return spaceInfo.size()>0 ? (spaceInfo.used()*1.0)/(spaceInfo.size()*1.0) : -1.0; } QString UmsDevice::capacityString() { if (cacheProgress>-1) { return statusMessage(); } if (!isConnected()) { return i18n("Not Connected"); } return i18n("%1 free", Utils::formatByteSize(spaceInfo.size()-spaceInfo.used())); } qint64 UmsDevice::freeSpace() { if (!isConnected()) { return 0; } return spaceInfo.size()-spaceInfo.used(); } void UmsDevice::setup() { if (!isConnected()) { return; } QString path=spaceInfo.path(); audioFolder = path; QFile file(path+constSettingsFile); QString audioFolderSetting; opts=DeviceOptions(); if (file.open(QIODevice::ReadOnly|QIODevice::Text)) { configured=true; QTextStream in(&file); while (!in.atEnd()) { QString line = in.readLine(); if (line.startsWith(constMusicFolderKey+"=")) { audioFolderSetting=audioFolder=Utils::cleanPath(path+'/'+line.section('=', 1, 1)); if (!QDir(audioFolder).exists()) { audioFolder = path; } } else if (line.startsWith(<API key>+"=")) { QString scheme = line.section('=', 1, 1); //protect against empty setting. if( !scheme.isEmpty() ) { opts.scheme = scheme; } } else if (line.startsWith(constVfatSafeKey+"=")) { opts.vfatSafe = QLatin1String("true")==line.section('=', 1, 1); } else if (line.startsWith(constAsciiOnlyKey+"=")) { opts.asciiOnly = QLatin1String("true")==line.section('=', 1, 1); } else if (line.startsWith(constIgnoreTheKey+"=")) { opts.ignoreThe = QLatin1String("true")==line.section('=', 1, 1); } else if (line.startsWith(<API key>+"=")) { opts.replaceSpaces = QLatin1String("true")==line.section('=', 1, 1); } else { unusedParams+=line; } } } bool haveOpts=FsDevice::readOpts(path+<API key>, opts, false); if (!configured) { configured=haveOpts; } if (opts.coverName.isEmpty()) { opts.coverName=<API key>; } // No setting, see if any standard dirs exist in path... if (audioFolderSetting.isEmpty() || audioFolderSetting!=audioFolder) { QStringList dirs; dirs << QLatin1String("Music") << QLatin1String("MUSIC") << QLatin1String("Albums") << QLatin1String("ALBUMS"); foreach (const QString &d, dirs) { if (QDir(path+d).exists()) { audioFolder=path+d; break; } } } if (!audioFolder.endsWith('/')) { audioFolder+='/'; } if (opts.autoScan || scanned){ // Only scan if we are set to auto scan, or we have already scanned before... rescan(false); // Read from cache if we have it! } else { setStatusMessage(i18n("Not Scanned")); } } void UmsDevice::configure(QWidget *parent) { if (!isIdle()) { return; } <API key> *dlg=new <API key>(parent); connect(dlg, SIGNAL(updatedSettings(const QString &, const DeviceOptions &)), SLOT(saveProperties(const QString &, const DeviceOptions &))); if (!configured) { connect(dlg, SIGNAL(cancelled()), SLOT(saveProperties())); } dlg->show(audioFolder, opts, qobject_cast<ActionDialog *>(parent) ? (<API key>::<API key>::Prop_Folder) : <API key>::Prop_All); } void UmsDevice::saveProperties() { saveProperties(audioFolder, opts); } static inline QString toString(bool b) { return b ? QLatin1String("true") : QLatin1String("false"); } void UmsDevice::saveOptions() { if (!isConnected()) { return; } QString path=spaceInfo.path(); QFile file(path+constSettingsFile); QString fixedPath(audioFolder); if (fixedPath.startsWith(path)) { fixedPath=QLatin1String("./")+fixedPath.mid(path.length()); } DeviceOptions def; if (file.open(QIODevice::WriteOnly|QIODevice::Text)) { QTextStream out(&file); if (!fixedPath.isEmpty()) { out << constMusicFolderKey << '=' << fixedPath << '\n'; } if (opts.scheme!=def.scheme) { out << <API key> << '=' << opts.scheme << '\n'; } if (opts.scheme!=def.scheme) { out << constVfatSafeKey << '=' << toString(opts.vfatSafe) << '\n'; } if (opts.asciiOnly!=def.asciiOnly) { out << constAsciiOnlyKey << '=' << toString(opts.asciiOnly) << '\n'; } if (opts.ignoreThe!=def.ignoreThe) { out << constIgnoreTheKey << '=' << toString(opts.ignoreThe) << '\n'; } if (opts.replaceSpaces!=def.replaceSpaces) { out << <API key> << '=' << toString(opts.replaceSpaces) << '\n'; } foreach (const QString &u, unusedParams) { out << u << '\n'; } } } void UmsDevice::saveProperties(const QString &newPath, const DeviceOptions &newOpts) { QString nPath=Utils::fixPath(newPath); if (configured && opts==newOpts && nPath==audioFolder) { return; } configured=true; bool diffCacheSettings=opts.useCache!=newOpts.useCache; opts=newOpts; if (diffCacheSettings) { if (opts.useCache) { saveCache(); } else { removeCache(); } } emit <API key>(); QString oldPath=audioFolder; if (!isConnected()) { return; } audioFolder=nPath; saveOptions(); FsDevice::writeOpts(spaceInfo.path()+<API key>, opts, false); if (oldPath!=audioFolder) { rescan(); // Path changed, so we can ignore cache... } }
HostCMS 6.7 = <API key>
def _setup_pkgresources(): import pkg_resources import os import plistlib pl = plistlib.readPlist(os.path.join( os.path.dirname(os.getenv('RESOURCEPATH')), "Info.plist")) appname = pl.get('CFBundleIdentifier') if appname is None: appname = pl['CFBundleDisplayName'] path = os.path.expanduser('~/Library/Caches/%s/python-eggs' % (appname,)) pkg_resources.set_extraction_path(path) _setup_pkgresources()
<?php defined ( '_JEXEC' ) or die (); class plgKunenaJoomla extends JPlugin { public function __construct(&$subject, $config) { // Do not load if Kunena version is not supported or Kunena is offline if (!(class_exists('KunenaForum') && KunenaForum::isCompatible('2.0') && KunenaForum::installed())) return; parent::__construct ( $subject, $config ); $this->loadLanguage ( 'plg_kunena_joomla.sys', JPATH_ADMINISTRATOR ) || $this->loadLanguage ( 'plg_kunena_joomla.sys', KPATH_ADMIN ); $this->path = dirname ( __FILE__ ); } /* * Get Kunena access control object. * * @return KunenaAccess */ public function <API key>() { if (!$this->params->get('access', 1)) return; require_once "{$this->path}/access.php"; return new KunenaAccessJoomla($this->params); } /* * Get Kunena login integration object. * * @return KunenaLogin */ public function onKunenaGetLogin() { if (!$this->params->get('login', 1)) return; require_once "{$this->path}/login.php"; return new KunenaLoginJoomla($this->params); } }
#!/bin/bash #change to develop branch git checkout develop #create new branch from develop git checkout -b feature/dummy git add dummy.py git commit -m"added dummy.py" #push to remote git push -u origin feature/dummy #after that is sufficient git push
#include "gremlin.h" void cs_kroneckerIupdate(const cs *A, int nI, const cs *C){ int i, j, k, cnt, an, am; double *Ax; an = A->n; am = A->m; Ax = A->x; cnt = 0; for(i = 0; i < an; i++){ for(j = 0 ; j < nI ; j++){ for(k = 0; k < am; k++){ C->x[cnt] = Ax[i*an+k]; cnt++; } } } }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <style> table.head, table.foot { width: 100%; } td.head-rtitle, td.foot-os { text-align: right; } td.head-vol { text-align: center; } table.foot td { width: 50%; } table.head td { width: 33%; } div.spacer { margin: 1em 0; } </style> <title> <API key>(3P)</title> </head> <body> <div class="mandoc"> <table class="head"> <tbody> <tr> <td class="head-ltitle"> <API key>(3P)</td> <td class="head-vol"> POSIX Programmer's Manual</td> <td class="head-rtitle"> <API key>(3P)</td> </tr> </tbody> </table> <div class="section"> <h1>PROLOG</h1> This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.<div style="height: 1.00em;"> &#160;</div> </div> <div class="section"> <h1>NAME</h1> <API key> &#8212; set the process-shared condition variable attribute</div> <div class="section"> <h1>SYNOPSIS</h1><br/> #include &lt;pthread.h&gt;<div class="spacer"> </div> int <API key>(pthread_condattr_t *<i>attr</i>,<br/> int <i>pshared</i>);<br/> </div> <div class="section"> <h1>DESCRIPTION</h1> Refer to <i><i><API key></i>()</i>.</div> <div class="section"> <h1>COPYRIGHT</h1> Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, Copyright (C) 2013 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. (This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http: &#160;</div> Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https: <table class="foot"> <tr> <td class="foot-date"> 2013</td> <td class="foot-os"> IEEE/The Open Group</td> </tr> </table> </div> </body> </html>
<?php /** * Automatically loads the specified file. * * @package PluginName\Lib */ namespace PluginName\Lib; /** * Automatically loads the specified file. * * Examines the fully qualified class name, separates it into components, then creates * a string that represents where the file is loaded on disk. * * @package PluginName\Lib */ <API key>( function ( $filename ) { // First, separate the components of the incoming file. $file_path = explode( '\\', $filename ); /** * - The first index will always be WCATL since it's part of the plugin. * - All but the last index will be the path to the file. */ // Get the last index of the array. This is the class we're loading. if ( isset( $file_path[ count( $file_path ) - 1 ] ) ) { $class_file = strtolower( $file_path[ count( $file_path ) - 1 ] ); // The classname has an underscore, so we need to replace it with a hyphen for the file name. $class_file = str_ireplace( '_', '-', $class_file ); $class_file = "class-$class_file.php"; } /** * Find the fully qualified path to the class file by iterating through the $file_path array. * We ignore the first index since it's always the top-level package. The last index is always * the file so we append that at the end. */ $<API key> = trailingslashit( dirname( dirname( __FILE__ ) ) ); for ( $i = 1; $i < count( $file_path ) - 1; $i++ ) { $dir = strtolower( $file_path[ $i ] ); $<API key> .= trailingslashit( $dir ); } $<API key> .= $class_file; // Now we include the file. if ( file_exists( $<API key> ) ) { include_once( $<API key> ); } });
#include <stdlib.h> #include <signal.h> #include <stdio.h> #include <string.h> #include <sys/socket.h> #include <netdb.h> #include <pthread.h> #include <errno.h> #include <ert/util/util.hpp> #include <ert/res_util/arg_pack.hpp> #include <ert/job_queue/queue_driver.hpp> #include <ert/job_queue/rsh_driver.hpp> struct rsh_job_struct { <API key>; bool active; /* Means that it allocated - not really in use */ job_status_type status; pthread_t run_thread; const char * host_name; /* Currently not set */ char * run_path; }; typedef struct { char * host_name; int max_running; /* How many can the host handle. */ int running; /* How many are currently running on the host (goverened by this driver instance that is). */ pthread_mutex_t host_mutex; } rsh_host_type; #define RSH_DRIVER_TYPE_ID 44963256 #define RSH_JOB_TYPE_ID 63256701 struct rsh_driver_struct { <API key>; pthread_mutex_t submit_lock; pthread_attr_t thread_attr; char * rsh_command; int num_hosts; int last_host_index; rsh_host_type **host_list; hash_type *__host_hash; /* Stupid redundancy ... */ }; static <API key>( rsh_driver , RSH_DRIVER_TYPE_ID ) static <API key>( rsh_driver , RSH_DRIVER_TYPE_ID ) static <API key>( rsh_job , RSH_JOB_TYPE_ID ) /** If the host is for some reason not available, NULL should be returned. Will also return NULL if some funny guy tries to allocate with max_running <= 0. */ static rsh_host_type * rsh_host_alloc(const char * host_name , int max_running) { if (max_running > 0) { struct addrinfo * result; if (getaddrinfo(host_name , NULL , NULL , &result) == 0) { rsh_host_type * host = (rsh_host_type*)util_malloc(sizeof * host ); host->host_name = <API key>(host_name); host->max_running = max_running; host->running = 0; pthread_mutex_init( &host->host_mutex , NULL ); freeaddrinfo( result ); return host; } else { fprintf(stderr,"** Warning: could not locate server: %s \n",host_name); return NULL; } } else return NULL; } static void rsh_host_free(rsh_host_type * rsh_host) { free(rsh_host->host_name); free(rsh_host); } static bool rsh_host_available(rsh_host_type * rsh_host) { bool available; pthread_mutex_lock( &rsh_host->host_mutex ); { available = false; if ((rsh_host->max_running - rsh_host->running) > 0) { // The host has free slots() available = true; rsh_host->running++; } } <API key>( &rsh_host->host_mutex ); return available; } static void rsh_host_submit_job(rsh_host_type * rsh_host , rsh_job_type * job, const char * rsh_cmd , const char * submit_cmd , int num_cpu , int job_argc , const char ** job_argv) { /* Observe that this job has already been added to the running jobs in the rsh_host_available function. */ int argc = job_argc + 2; const char ** argv = (const char**)util_malloc( argc * sizeof * argv ); argv[0] = rsh_host->host_name; argv[1] = submit_cmd; { int iarg; for (iarg = 0; iarg < job_argc; iarg++) argv[iarg + 2] = job_argv[iarg]; } util_spawn_blocking(rsh_cmd, argc, argv, NULL, NULL); /* This call is blocking. */ job->status = JOB_QUEUE_DONE; pthread_mutex_lock( &rsh_host->host_mutex ); rsh_host->running <API key>( &rsh_host->host_mutex ); free( argv ); } /* static const char * <API key>(const rsh_host_type * host) { return host->host_name; } */ static void * <API key>(void * __arg_pack) { arg_pack_type * arg_pack = arg_pack_safe_cast(__arg_pack); char * rsh_cmd = (char *) arg_pack_iget_ptr(arg_pack , 0); rsh_host_type * rsh_host = (rsh_host_type *)arg_pack_iget_ptr(arg_pack , 1); char * submit_cmd = (char *) arg_pack_iget_ptr(arg_pack , 2); int num_cpu = arg_pack_iget_int(arg_pack , 3); int argc = arg_pack_iget_int(arg_pack , 4); const char ** argv = (const char **) arg_pack_iget_ptr(arg_pack , 5); rsh_job_type * job = (rsh_job_type*) arg_pack_iget_ptr(arg_pack , 6); rsh_host_submit_job(rsh_host , job , rsh_cmd , submit_cmd , num_cpu , argc , argv); pthread_exit( NULL ); arg_pack_free( arg_pack ); } rsh_job_type * rsh_job_alloc(const char * run_path) { rsh_job_type * job; job = (rsh_job_type*)util_malloc(sizeof * job ); job->active = false; job->status = JOB_QUEUE_WAITING; job->run_path = <API key>(run_path); UTIL_TYPE_ID_INIT( job , RSH_JOB_TYPE_ID ); return job; } void rsh_job_free(rsh_job_type * job) { free(job->run_path); free(job); } job_status_type <API key>(void * __driver , void * __job) { if (__job == NULL) /* The job has not been registered at all ... */ return <API key>; else { rsh_job_type * job = rsh_job_safe_cast( __job ); { if (job->active == false) { util_abort("%s: internal error - should not query status on inactive jobs \n" , __func__); return <API key>; /* Dummy to shut up compiler */ } else return job->status; } } } void rsh_driver_free_job( void * __job ) { rsh_job_type * job = rsh_job_safe_cast( __job ); rsh_job_free(job); } void rsh_driver_kill_job(void * __driver ,void * __job) { rsh_job_type * job = rsh_job_safe_cast( __job ); if (job->active) pthread_cancel( job->run_thread ); rsh_job_free( job ); } void * <API key>(void * __driver, const char * submit_cmd , int num_cpu , /* Ignored */ const char * run_path , const char * job_name , int argc, const char ** argv ) { rsh_driver_type * driver = <API key>( __driver ); rsh_job_type * job = NULL; { /* command is freed in the start_routine() function */ pthread_mutex_lock( &driver->submit_lock ); { rsh_host_type * host = NULL; int ihost; int host_index = 0; if (driver->num_hosts == 0) util_abort("%s: fatal error - no hosts added to the rsh driver.\n",__func__); for (ihost = 0; ihost < driver->num_hosts; ihost++) { host_index = (ihost + driver->last_host_index) % driver->num_hosts; if (rsh_host_available(driver->host_list[host_index])) { host = driver->host_list[host_index]; break; } } driver->last_host_index = (host_index + 1) % driver->num_hosts; if (host != NULL) { /* A host is available */ arg_pack_type * arg_pack = arg_pack_alloc(); /* The arg_pack is freed() in the <API key>() function. freeing it here is dangerous, because we might free it before the thread-called function is finished with it. */ job = rsh_job_alloc(run_path); arg_pack_append_ptr(arg_pack , driver->rsh_command); arg_pack_append_ptr(arg_pack , host); arg_pack_append_ptr(arg_pack , (char *) submit_cmd); arg_pack_append_int(arg_pack , num_cpu ); arg_pack_append_int(arg_pack , argc ); arg_pack_append_ptr(arg_pack , argv ); arg_pack_append_ptr(arg_pack , job); { int <API key> = pthread_create( &job->run_thread , &driver->thread_attr , <API key> , arg_pack); if (<API key> != 0) util_abort("%s failed to create thread ERROR:%d \n", __func__ , <API key>); } job->status = JOB_QUEUE_RUNNING; job->active = true; } } <API key>( &driver->submit_lock ); } return job; } void <API key>( rsh_driver_type * driver ) { int ihost; for (ihost =0; ihost < driver->num_hosts; ihost++) rsh_host_free(driver->host_list[ihost]); free(driver->host_list); driver->num_hosts = 0; driver->host_list = NULL; driver->last_host_index = 0; } void rsh_driver_free(rsh_driver_type * driver) { <API key>( driver ); <API key> ( &driver->thread_attr ); free(driver->rsh_command ); hash_free( driver->__host_hash ); free(driver); driver = NULL; } void rsh_driver_free__(void * __driver) { rsh_driver_type * driver = <API key>( __driver ); rsh_driver_free( driver ); } void <API key>( rsh_driver_type * rsh_driver , const hash_type * rsh_host_list) { <API key>( rsh_driver ); if (rsh_host_list != NULL) { hash_iter_type * hash_iter = hash_iter_alloc( rsh_host_list ); while (!<API key>( hash_iter )) { const char * host = <API key>( hash_iter ); int max_running = hash_get_int( rsh_host_list , host ); rsh_driver_add_host(rsh_driver , host , max_running); } if (rsh_driver->num_hosts == 0) util_abort("%s: failed to add any valid RSH hosts - aborting.\n",__func__); } } void * rsh_driver_alloc( ) { rsh_driver_type * rsh_driver = (rsh_driver_type*)util_malloc( sizeof * rsh_driver ); UTIL_TYPE_ID_INIT( rsh_driver , RSH_DRIVER_TYPE_ID ); pthread_mutex_init( &rsh_driver->submit_lock , NULL ); pthread_attr_init( &rsh_driver->thread_attr ); <API key>( &rsh_driver->thread_attr , <API key> ); /** To simplify the Python wrapper it is possible to pass in NULL as rsh_host_list pointer, and then subsequently add hosts with rsh_driver_add_host(). */ rsh_driver->num_hosts = 0; rsh_driver->host_list = NULL; rsh_driver->last_host_index = 0; rsh_driver->rsh_command = NULL; rsh_driver->__host_hash = hash_alloc(); return rsh_driver; } void rsh_driver_add_host(rsh_driver_type * rsh_driver , const char * hostname , int host_max_running) { rsh_host_type * new_host = rsh_host_alloc(hostname , host_max_running); /* Could in principle update an existing node if the host name is old. */ if (new_host != NULL) { rsh_driver->num_hosts++; rsh_driver->host_list = (rsh_host_type**)util_realloc(rsh_driver->host_list , rsh_driver->num_hosts * sizeof * rsh_driver->host_list ); rsh_driver->host_list[(rsh_driver->num_hosts - 1)] = new_host; } } /** Hostname should be a string as host:max_running, the ":max_running" part is optional, and will default to 1. */ void <API key>(rsh_driver_type * rsh_driver , const char * hostname) { int host_max_running; char ** tmp; char * host; int tokens; util_split_string( hostname , ":" , &tokens , &tmp); if (tokens > 1) { if (!util_sscanf_int( tmp[tokens - 1] , &host_max_running)) util_abort("%s: failed to parse out integer from: %s \n",__func__ , hostname); host = <API key>((const char **) tmp , tokens - 1 , ":"); } else host = <API key>( tmp[0] ); rsh_driver_add_host( rsh_driver , host , host_max_running ); <API key>( tmp , tokens ); free( host ); } bool <API key>( void * __driver , const char * option_key , const void * value_ ) { const char * value = (const char*) value_; rsh_driver_type * driver = <API key>( __driver ); bool has_option = true; { if (strcmp(RSH_HOST , option_key) == 0) /* Add one host - value should be hostname:max */ <API key>( driver , value ); else if (strcmp(RSH_HOSTLIST , option_key) == 0) { /* Set full host list - value should be hash of integers. */ if (value != NULL) { const hash_type * hash_value = <API key>( value ); <API key>( driver , hash_value ); } } else if (strcmp( RSH_CLEAR_HOSTLIST , option_key) == 0) /* Value is not considered - this is an action, and not a _set operation. */ <API key>( driver , NULL ); else if (strcmp( RSH_CMD , option_key) == 0) driver->rsh_command = <API key>( driver->rsh_command , value ); else has_option = false; } return has_option; } const void * <API key>( const void * __driver , const char * option_key ) { const rsh_driver_type * driver = <API key>( __driver ); { if (strcmp( RSH_CMD , option_key ) == 0) return driver->rsh_command; else if (strcmp( RSH_HOSTLIST , option_key) == 0) { int ihost; hash_clear( driver->__host_hash ); for (ihost = 0; ihost < driver->num_hosts; ihost++) { rsh_host_type * host = driver->host_list[ ihost ]; hash_insert_int( driver->__host_hash , host->host_name , host->max_running); } return driver->__host_hash; } else { util_abort("%s: get not implemented fro option_id:%s for rsh \n",__func__ , option_key ); return NULL; } } } void <API key>(stringlist_type * option_list) { <API key>(option_list, RSH_HOST); <API key>(option_list, RSH_HOSTLIST); <API key>(option_list, RSH_CMD); <API key>(option_list, RSH_CLEAR_HOSTLIST); } #undef RSH_JOB_ID
require 'package' class Harfbuzz < Package description 'HarfBuzz is an OpenType text shaping engine.' homepage 'https: version '1.7.6-0' source_url 'https://github.com/harfbuzz/harfbuzz/releases/download/1.7.6/harfbuzz-1.7.6.tar.bz2' source_sha256 '<SHA256-like>' binary_url ({ aarch64: 'https://dl.bintray.com/chromebrew/chromebrew/harfbuzz-1.7.6-0-chromeos-armv7l.tar.xz', armv7l: 'https://dl.bintray.com/chromebrew/chromebrew/harfbuzz-1.7.6-0-chromeos-armv7l.tar.xz', i686: 'https://dl.bintray.com/chromebrew/chromebrew/harfbuzz-1.7.6-0-chromeos-i686.tar.xz', x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/harfbuzz-1.7.6-0-chromeos-x86_64.tar.xz', }) binary_sha256 ({ aarch64: '<SHA256-like>', armv7l: '<SHA256-like>', i686: '<SHA256-like>', x86_64: '<SHA256-like>', }) depends_on 'glib' depends_on 'icu4c' depends_on 'freetype_sub' def self.build system "./configure --prefix=#{CREW_PREFIX} --libdir=#{CREW_LIB_PREFIX}" system "make" end def self.install system "pip install six" system "make", "DESTDIR=#{CREW_DEST_DIR}", "install" system "pip uninstall --yes six" end end
title: "2017-09-14 Indentation" date: 2017-09-13T20:38:45-05:00 tags: - haskell draft: false description: Indentation matters. A lot. Indentation is significant in Haskell. Haskell uses indentation to group pieces of code together. This is similar to Python, but there are "false cognates" - similar code that is indented differently in the two languages. In Racket, grouping is done only by parentheses. ## Indenting to the same level {{% notice tip %}} "All grouped expressions must be exactly aligned." {{% /notice %}} Example 1a: good indentation haskell if x `mod` 3 == 0 && x `mod` 5 == 0 -- good. aligned with top x. Example 1a: bad indentation haskell if x `mod` 3 == 0 && x `mod` 5 == 0 -- wrong. not aligned with top x ## Indenting further {{% notice warning %}} "Code which is part of some expression [must] be indented further than the beginning of that expression. {{% /notice %}} Not enough indentation On one hand, this means that if you do not indent, you are not continuing a preceding expression. Example 2: haskell if x `mod` 3 == 0 && x `mod` 5 == 0 then -- wrong; needs to be indented further than the if x else -- wrong again 0 Too much indentation On the other hand, if you do indent, you may be continuing something you wrote previously. How could this be an issue? If you write one function and then indent a later function, Haskell thinks you want the second function to be inside the first function (as in, a "sub-function"). Example: haskell main = do putStrLn $ helper 5 -- all this space does not change anything... -- answer x = 200 * x helper x = answer x + 1 Notice how `answer` is indented more than `main`? That makes the `answer` function live inside of `main`... this will cause all sorts of problems, but the first one is that `helper` cannot see `answer` because `helper` cannot see anything inside of another function like `main`. The source for all quotes in this article is the [Haskell article on indentation][1]. Other example issues came from observations in class. [1]: https://en.wikibooks.org/wiki/Haskell/Indentation
package com.brejza.matt.habmodem; import group.pals.android.lib.ui.filechooser.FileChooserActivity; import group.pals.android.lib.ui.filechooser.io.localfile.LocalFile; import java.io.File; import java.util.List; import android.os.Bundle; import android.os.Environment; import android.os.Parcelable; import android.preference.PreferenceManager; import android.app.Activity; import android.app.DialogFragment; import android.app.FragmentManager; import android.content.Intent; import android.view.Menu; public class StartActivity extends Activity implements FirstRunMessage.<API key>, MapFileMessage.<API key> { private static final int _ReqChooseFile = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_start); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_start, menu); return true; } @Override public void onResume() { super.onResume(); boolean firstrun = <API key>("PREFERENCE", MODE_PRIVATE).getBoolean("firstrun1", false); if (!firstrun){ FragmentManager fm = getFragmentManager(); FirstRunMessage di = new FirstRunMessage(); di.show(fm, "firstrun"); } else { String mapst = PreferenceManager.<API key>(this.<API key>()).getString("pref_map_path", ""); File file = new File(mapst); if(file.exists()) { //start main activity Intent intent = new Intent(this, Map_Activity.class); intent.addFlags(Intent.<API key> ); startActivity(intent); finish(); } else { FragmentManager fm = getFragmentManager(); MapFileMessage di = new MapFileMessage(); di.show(fm, "mapmessage"); } } } @Override public void <API key>(DialogFragment dialog) { // TODO Auto-generated method stub <API key>("PREFERENCE", MODE_PRIVATE) .edit() .putBoolean("firstrun1", true) .commit(); FragmentManager fm = getFragmentManager(); MapFileMessage di = new MapFileMessage(); di.show(fm, "mapmessage"); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { switch (requestCode) { case _ReqChooseFile: if (resultCode == RESULT_OK) { List<LocalFile> files = (List<LocalFile>) data.<API key>(FileChooserActivity._Results); for (File f : files) { PreferenceManager.<API key>(this.<API key>()).edit().putString("pref_map_path", f.getPath()).commit(); System.out.println(f.toString()); } } break; } } private void showMapChooser() { Intent intent = new Intent(StartActivity.this, FileChooserActivity.class); intent.putExtra(FileChooserActivity._Rootpath, (Parcelable) new LocalFile(Environment.<API key>().getPath() )); intent.putExtra(FileChooserActivity.<API key>, "(?si).*\\.(map)$"); intent.putExtra(FileChooserActivity._Theme, android.R.style.Theme_Dialog); <API key>(intent, _ReqChooseFile); } @Override public void <API key>(DialogFragment dialog) { // TODO Auto-generated method stub this.finish(); } @Override public void <API key>(DialogFragment dialog) { // TODO Auto-generated method stub showMapChooser(); } @Override public void <API key>(DialogFragment dialog) { // TODO Auto-generated method stub Intent intent = new Intent(this, StatusScreen.class); startActivity(intent); } }
#!/usr/bin/env python # sample module from jira.client import JIRA def main(): jira = JIRA() JIRA(options={'server': 'http://localhost:8100'}) projects = jira.projects() print projects for project in projects: print project.key # Standard boilerplate to call the main() function. if __name__ == '__main__': main()
package ai.hellbound; import l2s.commons.util.Rnd; import l2s.gameserver.ai.CtrlEvent; import l2s.gameserver.ai.Mystic; import l2s.gameserver.model.Creature; import l2s.gameserver.model.Playable; import l2s.gameserver.model.World; import l2s.gameserver.model.instances.NpcInstance; import bosses.BelethManager; /** * @author pchayka */ public class Beleth extends Mystic { private long <API key> = 0; private static final int CLONE = 29119; public Beleth(NpcInstance actor) { super(actor); } @Override protected void onEvtDead(Creature killer) { BelethManager.setBelethDead(); super.onEvtDead(killer); } @Override protected void onEvtAttacked(Creature attacker, int damage) { NpcInstance actor = getActor(); if(System.currentTimeMillis() - <API key> > <API key>) { <API key> = System.currentTimeMillis(); for(NpcInstance npc : World.getAroundNpc(actor)) if(npc.getNpcId() == CLONE) npc.getAI().notifyEvent(CtrlEvent.EVT_AGGRESSION, attacker, Rnd.get(1, 100)); } super.onEvtAttacked(attacker, damage); } @Override protected boolean randomWalk() { return false; } @Override protected boolean randomAnimation() { return false; } @Override public boolean canSeeInSilentMove(Playable target) { return true; } @Override public boolean canSeeInHide(Playable target) { return true; } @Override public void addTaskAttack(Creature target) { return; } }
#ifndef <API key> #define <API key> #include "ATOOLS/Math/Vector.H" namespace PHOTONS { class <API key> { private: double m_b1; double m_b2; double m_c; double m_theta; double m_phi; ATOOLS::Vec4D m_dir; double CalculateBeta(const ATOOLS::Vec4D&); void GenerateDipoleAngle(); void GenerateNullVector(); public: <API key>(ATOOLS::Vec4D, ATOOLS::Vec4D); <API key>(const double&, const double&); ~<API key>(); inline double GetCosTheta() { return m_c; } inline double GetTheta() { return m_theta; } inline double GetPhi() { return m_phi; } inline const ATOOLS::Vec4D& GetVector() { return m_dir; } }; /*! \file <API key>.H \brief contains the class <API key> */ /*! \class <API key> \brief generates the photon angular distribution in dipoles */ // Description of the member variables for <API key> /*! \var double <API key>::m_b1 \brief \f$ \beta_1 \f$ */ /*! \var double <API key>::m_b2 \brief \f$ \beta_2 \f$ */ /*! \var double <API key>::m_c \brief \f$ c = \cos\theta \f$ */ /*! \var double <API key>::m_theta \brief \f$ \theta \f$ */ /*! \var double <API key>::m_phi \brief \f$ \varphi \f$ */ /*! \var Vec4D <API key>::m_dir \brief null vector of unit spatial length in direction \f$ (\theta,\varphi) \f$ */ // Description of member methods for <API key> /*! \fn <API key>::<API key>(Vec4D, Vec4D) \brief generates dipole angles for two arbitrary timelike 4-vectors \f$ p_1 \f$ and \f$ p_2 \f$ \f$ p_1 \f$ and \f$ p_2 \f$ are boosted in their CMS, there the photon angles are calculated and m_dir is generated. Finally, m_dir is boosted to the original system of \f$ p_1 \f$ and \f$ p_2 \f$ and \f$ \theta \f$ and \f$ \varphi \f$ are recalculated. This constructor is used by the <API key> class. */ /*! \fn <API key>::<API key>(double, double) \brief generates dipole angles for two 4-vectors with \f$ \beta_1 \f$ and \f$ \beta_2 \f$ assumed to be in their CMS and aligned along the z-axis Both angles are calculated via <tt>GenerateDipoleAngle()</tt>. No null vector will be produced. This constructor is used by the Generate_One_Photon class. */ /*! \fn double <API key>::CalculateBeta(Vec4D) \brief calculates \f$ \beta \f$ for a given 4-vector */ /*! \fn void <API key>::GenerateDipoleAngle() \brief generates both photon angles Works in the dipole's CMS. \f$ \varphi \f$ is distributed uniformly, \f$ \theta \f$ according to the eikonal factor \f$ \tilde{S}_{ij} \f$ . */ /*! \fn void <API key>::GenerateNullVector() \brief m_dir is generated This null vector can be Poincare transformed to any frame to have the photon angular configuration there. To get the full photon its energy/3-momentum simply has to be multiplied by the generated energy. */ /*! \fn double <API key>::GetCosTheta() \brief returns m_c ( \f$ c = \cos\theta \f$ ) */ /*! \fn double <API key>::GetTheta() \brief returns m_theta ( \f$ \theta \f$ ) */ /*! \fn double <API key>::GetPhi() \brief returns m_phi ( \f$ \varphi \f$ ) */ /*! \fn Vec4D <API key>::GetVector() \brief returns m_dir */ } // this class will take two four vectors and generate a null vector of unit 3D length which is distributed according to eikonal factor // if two doubles (b1,b2) are given it assumed they are in their respective rest frame and then this vector is generated in that frame #endif
package be.ipl.mobile.projet.historypub; import android.app.Application; import android.test.ApplicationTestCase; public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
#include "Exception.h" #include "MDB/MDBRow.h" MDB::MDBRow:: MDBRow(MDBField** fields_, int numcols_ ) : field_m(fields_), numcols_m(numcols_) { } MDB::MDBRow:: ~MDBRow() { for(int i=0; i< numcols_m; i++) { delete field_m[i]; } delete [] field_m; } MDB::MDBField& MDB::MDBRow:: operator [] (int index_) { if(index_ >= numcols_m || index_ < 0) { Throw("Row index out of range", MException::ME_OUTRANGE); } return **(field_m + index_); }
// of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // all copies or substantial portions of the Software. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. #pragma once #include "../../Graphics/ShaderProgram.h" #include "../../Graphics/VertexDeclaration.h" #include "../../Math/Color.h" #include <d3d9.h> namespace Urho3D { #define URHO3D_SAFE_RELEASE(p) if (p) { ((IUnknown*)p)->Release(); p = 0; } #define URHO3D_LOGD3DERROR(msg, hr) URHO3D_LOGERRORF("%s (HRESULT %x)", msg, (unsigned)hr) using ShaderProgramMap = HashMap<Pair<ShaderVariation*, ShaderVariation*>, SharedPtr<ShaderProgram> >; using <API key> = HashMap<unsigned long long, SharedPtr<VertexDeclaration> >; %Graphics implementation. Holds API-specific objects. class URHO3D_API GraphicsImpl { friend class Graphics; public: Construct. GraphicsImpl(); Return Direct3D device. IDirect3DDevice9* GetDevice() const { return device_; } Return device capabilities. const D3DCAPS9& GetDeviceCaps() const { return deviceCaps_; } Return adapter identifier. const <API key>& <API key>() const { return adapterIdentifier_; } Return whether a texture format and usage is supported. bool CheckFormatSupport(D3DFORMAT format, DWORD usage, D3DRESOURCETYPE type); Return whether a multisample level is supported. bool <API key>(D3DFORMAT format, int level); private: Direct3D interface. IDirect3D9* interface_; Direct3D device. IDirect3DDevice9* device_; Default color surface. IDirect3DSurface9* <API key>; Default depth-stencil surface. IDirect3DSurface9* <API key>; Frame query for flushing the GPU command queue. IDirect3DQuery9* frameQuery_; Adapter number. DWORD adapter_; Device type. D3DDEVTYPE deviceType_; Device capabilities. D3DCAPS9 deviceCaps_; Adapter identifier. <API key> adapterIdentifier_; Direct3D presentation parameters. <API key> presentParams_; Texture min filter modes in use. <API key> minFilters_[MAX_TEXTURE_UNITS]; Texture mag filter modes in use. <API key> magFilters_[MAX_TEXTURE_UNITS]; Texture mip filter modes in use. <API key> mipFilters_[MAX_TEXTURE_UNITS]; Texture U coordinate addressing modes in use. D3DTEXTUREADDRESS uAddressModes_[MAX_TEXTURE_UNITS]; Texture V coordinate addressing modes in use. D3DTEXTUREADDRESS vAddressModes_[MAX_TEXTURE_UNITS]; Texture W coordinate addressing modes in use. D3DTEXTUREADDRESS wAddressModes_[MAX_TEXTURE_UNITS]; Texture anisotropy setting in use. unsigned maxAnisotropy_[MAX_TEXTURE_UNITS]; Texture border colors in use. Color borderColors_[MAX_TEXTURE_UNITS]; Device lost flag. bool deviceLost_; Frame query issued flag. bool queryIssued_; sRGB mode in use. bool sRGBModes_[MAX_TEXTURE_UNITS]; sRGB write flag. bool sRGBWrite_; Color surfaces in use. IDirect3DSurface9* colorSurfaces_[MAX_RENDERTARGETS]; Depth-stencil surface in use. IDirect3DSurface9* <API key>; Blending enabled flag. DWORD blendEnable_; Source blend mode. D3DBLEND srcBlend_; Destination blend mode. D3DBLEND destBlend_; Blend operation. D3DBLENDOP blendOp_; Vertex declarations. <API key> vertexDeclarations_; Stream frequencies by vertex buffer. unsigned streamFrequencies_[MAX_VERTEX_STREAMS]; Stream offsets by vertex buffer. unsigned streamOffsets_[MAX_VERTEX_STREAMS]; Vertex declaration in use. VertexDeclaration* vertexDeclaration_; Shader programs. ShaderProgramMap shaderPrograms_; Shader program in use. ShaderProgram* shaderProgram_; }; }
CREATE TABLE `UserState`( `StateId` NVARCHAR(64) NOT NULL UNIQUE, `Description` NVARCHAR(512), PRIMARY KEY(`StateId`) ); INSERT INTO `UserState` VALUES ('Active','Пользователь активен'), ('Bloked','Пользователь заблокирован');
<!-- Admin info view --> <!-- Title --> <h2 class="accordion-toggle chevron"> <!-- Toggle --> <button type="button" aria-expanded="false" bb-accordion> <span> <i class="fas fa-info-circle fa-fw"></i> {{_t('info')}} </span> </button> </h2> <!-- Content --> <div class="accordion" hidden> <div class="form form-inline form-page"> <div class="fieldset"> <h3>{{_t('software_info')}}</h3> <table class="table table-report"> <tbody> <tr> <td>{{_t('firmware_version')}}</td> <td class="td20">{{controllerInfo.<API key>}}</td> </tr> <tr> <td>{{_t('ui_version')}}</td> <td class="td20">{{cfg.app_version}}</td> </tr> <tr> <td>{{_t('built_date')}}</td> <td class="td20">{{builtInfo.built}}</td> </tr> <tr> <td>{{_t('<API key>')}}</td> <td class="td20">{{controllerInfo.capabillities}}</td> </tr> </tbody> </table> </div> <div class="fieldset"> <h3>{{_t('translation')}}</h3> <div> {{_t('<API key>')}} </div> </div> </div> </div>
<?php // include.php - Handles options for subscribe2 // DO NOT EDIT THIS FILE AS IT IS SET BY THE OPTIONS PAGE if (!isset($this->subscribe2_options['autosub'])) { $this->subscribe2_options['autosub'] = "no"; } // option to autosubscribe registered users to new categories if (!isset($this->subscribe2_options['newreg_override'])) { $this->subscribe2_options['newreg_override'] = "no"; } // option to autosubscribe registered users to new categories if (!isset($this->subscribe2_options['wpregdef'])) { $this->subscribe2_options['wpregdef'] = "no"; } // option to check registration form box by default if (!isset($this->subscribe2_options['autoformat'])) { $this->subscribe2_options['autoformat'] = "post"; } // option for default auto-subscription email format if (!isset($this->subscribe2_options['show_autosub'])) { $this->subscribe2_options['show_autosub'] = "yes"; } // option to display auto-subscription option to registered users if (!isset($this->subscribe2_options['autosub_def'])) { $this->subscribe2_options['autosub_def'] = "yes"; } // option for user default auto-subscription to new categories if (!isset($this->subscribe2_options['comment_subs'])) { $this->subscribe2_options['comment_subs'] = "no"; } // option for commenters to subscribe as public subscribers if (!isset($this->subscribe2_options['comment_def'])) { $this->subscribe2_options['comment_def'] = "no"; } // option for comments box to be checked by default if (!isset($this->subscribe2_options['one_click_profile'])) { $this->subscribe2_options['one_click_profile'] = "no"; } // option for displaying 'one-click' option on profile page if (!isset($this->subscribe2_options['bcclimit'])) { $this->subscribe2_options['bcclimit'] = 1; } // option for default bcc limit on email notifications if (!isset($this->subscribe2_options['admin_email'])) { $this->subscribe2_options['admin_email'] = "subs"; } // option for sending new subscriber notifications to admins if (!isset($this->subscribe2_options['tracking'])) { $this->subscribe2_options['tracking'] = ""; } // option for tracking if (!isset($this->subscribe2_options['s2page'])) { $this->subscribe2_options['s2page'] = 0; } // option for default WordPress page for Subscribe2 to use if (!isset($this->subscribe2_options['stylesheet'])) { $this->subscribe2_options['stylesheet'] = "yes"; } // option to include link to theme stylesheet from HTML notifications if (!isset($this->subscribe2_options['pages'])) { $this->subscribe2_options['pages'] = "no"; } // option for sending notifications for WordPress pages if (!isset($this->subscribe2_options['password'])) { $this->subscribe2_options['password'] = "no"; } // option for sending notifications for posts that are password protected if (!isset($this->subscribe2_options['stickies'])) { $this->subscribe2_options['stickies'] = "no"; } // option for including sticky posts in digest notifications if (!isset($this->subscribe2_options['private'])) { $this->subscribe2_options['private'] = "no"; } // option for sending notifications for posts that are private if (!isset($this->subscribe2_options['email_freq'])) { $this->subscribe2_options['email_freq'] = "never"; } // option for sending emails per-post or as a digest email on a cron schedule if (!isset($this->subscribe2_options['cron_order'])) { $this->subscribe2_options['cron_order'] = "desc"; } // option for ordering of posts in digest email if (!isset($this->subscribe2_options['compulsory'])) { $this->subscribe2_options['compulsory'] = ""; } // option for compulsory categories if (!isset($this->subscribe2_options['exclude'])) { $this->subscribe2_options['exclude'] = ""; } // option for excluded categories if (!isset($this->subscribe2_options['sender'])) { $this->subscribe2_options['sender'] = "blogname"; } // option for email notification sender if (!isset($this->subscribe2_options['reg_override'])) { $this->subscribe2_options['reg_override'] = "1"; } // option for excluded categories to be overriden for registered users if (!isset($this->subscribe2_options['show_meta'])) { $this->subscribe2_options['show_meta'] = "0"; } // option to display link to subscribe2 page from 'meta' if (!isset($this->subscribe2_options['show_button'])) { $this->subscribe2_options['show_button'] = "1"; } // option to show Subscribe2 button on Write page if (!isset($this->subscribe2_options['ajax'])) { $this->subscribe2_options['ajax'] = "0"; } // option to enable an AJAX style form if (!isset($this->subscribe2_options['widget'])) { $this->subscribe2_options['widget'] = "1"; } // option to enable Subscribe2 Widget if (!isset($this->subscribe2_options['counterwidget'])) { $this->subscribe2_options['counterwidget'] = "0"; } // option to enable Subscribe2 Counter Widget if (!isset($this->subscribe2_options['s2meta_default'])) { $this->subscribe2_options['s2meta_default'] = "0"; } // option for Subscribe2 over ride postmeta to be checked by default if (!isset($this->subscribe2_options['entries'])) { $this->subscribe2_options['entries'] = 25; } // option for the number of subscribers displayed on each page if (!isset($this->subscribe2_options['barred'])) { $this->subscribe2_options['barred'] = ""; } // option containing domains barred from public registration if (!isset($this->subscribe2_options['exclude_formats'])) { $this->subscribe2_options['exclude_formats'] = ""; } // option for excluding post formats as supported by the current theme if (!isset($this->subscribe2_options['mailtext'])) { $this->subscribe2_options['mailtext'] = __("{BLOGNAME} has posted a new item, '{TITLE}'\n\n{POST}\n\nYou may view the latest post at\n{PERMALINK}\n\nYou received this e-mail because you asked to be notified when new updates are posted.\nBest regards,\n{MYNAME}\n{EMAIL}", "subscribe2"); } // Default notification email text if (!isset($this->subscribe2_options['<API key>'])) { $this->subscribe2_options['<API key>'] = "[{BLOGNAME}] {TITLE}"; } // Default notification email subject if (!isset($this->subscribe2_options['confirm_email'])) { $this->subscribe2_options['confirm_email'] = __("{BLOGNAME} has received a request to {ACTION} for this email address. To complete your request please click on the link below:\n\n{LINK}\n\nIf you did not request this, please feel free to disregard this notice!\n\nThank you,\n{MYNAME}.", "subscribe2"); } // Default confirmation email text if (!isset($this->subscribe2_options['confirm_subject'])) { $this->subscribe2_options['confirm_subject'] = "[{BLOGNAME}] " . __('Please confirm your request', 'subscribe2'); } // Default confirmation email subject if (!isset($this->subscribe2_options['remind_email'])) { $this->subscribe2_options['remind_email'] = __("This email address was subscribed for notifications at {BLOGNAME} ({BLOGLINK}) but the subscription remains incomplete.\n\nIf you wish to complete your subscription please click on the link below:\n\n{LINK}\n\nIf you do not wish to complete your subscription please ignore this email and your address will be removed from our database.\n\nRegards,\n{MYNAME}", "subscribe2"); } // Default reminder email text if (!isset($this->subscribe2_options['remind_subject'])) { $this->subscribe2_options['remind_subject'] = "[{BLOGNAME}] " . __('Subscription Reminder', 'subscribe2');; } // Default reminder email subject ?>