code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
/* * Copyright (C) 2010-2021 JPEXS * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.jpexs.decompiler.flash.gui.abc; import com.jpexs.decompiler.flash.SWF; import com.jpexs.decompiler.flash.abc.ABC; import com.jpexs.decompiler.flash.abc.ScriptPack; import com.jpexs.decompiler.flash.abc.avm2.AVM2Code; import com.jpexs.decompiler.flash.abc.avm2.instructions.AVM2Instruction; import com.jpexs.decompiler.flash.abc.avm2.instructions.construction.ConstructSuperIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallSuperIns; import com.jpexs.decompiler.flash.abc.avm2.instructions.executing.CallSuperVoidIns; import com.jpexs.decompiler.flash.abc.types.ClassInfo; import com.jpexs.decompiler.flash.abc.types.InstanceInfo; import com.jpexs.decompiler.flash.abc.types.Multiname; import com.jpexs.decompiler.flash.abc.types.ScriptInfo; import com.jpexs.decompiler.flash.abc.types.traits.Trait; import com.jpexs.decompiler.flash.abc.types.traits.TraitFunction; import com.jpexs.decompiler.flash.abc.types.traits.TraitMethodGetterSetter; import com.jpexs.decompiler.flash.abc.types.traits.TraitSlotConst; import com.jpexs.decompiler.flash.action.deobfuscation.BrokenScriptDetector; import com.jpexs.decompiler.flash.gui.AppStrings; import com.jpexs.decompiler.flash.gui.Main; import com.jpexs.decompiler.flash.gui.View; import com.jpexs.decompiler.flash.gui.editor.DebuggableEditorPane; import com.jpexs.decompiler.flash.helpers.GraphTextWriter; import com.jpexs.decompiler.flash.helpers.HighlightedText; import com.jpexs.decompiler.flash.helpers.hilight.HighlightData; import com.jpexs.decompiler.flash.helpers.hilight.HighlightSpecialType; import com.jpexs.decompiler.flash.helpers.hilight.Highlighting; import com.jpexs.decompiler.flash.tags.ABCContainerTag; import com.jpexs.decompiler.graph.DottedChain; import com.jpexs.helpers.CancellableWorker; import com.jpexs.helpers.Reference; import java.awt.Point; import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.List; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.event.CaretEvent; import javax.swing.event.CaretListener; import jsyntaxpane.SyntaxDocument; import jsyntaxpane.Token; import jsyntaxpane.TokenType; /** * * @author JPEXS */ public class DecompiledEditorPane extends DebuggableEditorPane implements CaretListener { private static final Logger logger = Logger.getLogger(DecompiledEditorPane.class.getName()); private HighlightedText highlightedText = HighlightedText.EMPTY; private Highlighting currentMethodHighlight; private Highlighting currentTraitHighlight; private ScriptPack script; public int lastTraitIndex = GraphTextWriter.TRAIT_UNKNOWN; public boolean ignoreCarret = false; private boolean reset = false; private final ABCPanel abcPanel; private int classIndex = -1; private boolean isStatic = false; private CancellableWorker setSourceWorker; private final List<Runnable> scriptListeners = new ArrayList<>(); public void addScriptListener(Runnable l) { scriptListeners.add(l); } public ABCPanel getAbcPanel() { return abcPanel; } public void removeScriptListener(Runnable l) { scriptListeners.remove(l); } public void fireScript() { Runnable[] listeners = scriptListeners.toArray(new Runnable[scriptListeners.size()]); for (Runnable scriptListener : listeners) { scriptListener.run(); } } public Trait getCurrentTrait() { if (lastTraitIndex < 0) { return null; } if (classIndex == -1) { return script.abc.script_info.get(script.scriptIndex).traits.traits.get(lastTraitIndex); } return script.abc.findTraitByTraitId(classIndex, lastTraitIndex); } public ScriptPack getScriptLeaf() { return script; } public boolean getIsStatic() { return isStatic; } public void setNoTrait() { abcPanel.detailPanel.showCard(DetailPanel.UNSUPPORTED_TRAIT_CARD, null, 0); } public void hilightSpecial(HighlightSpecialType type, long index) { int startPos; int endPos; if (currentMethodHighlight == null) { if (currentTraitHighlight == null) { return; } startPos = currentTraitHighlight.startPos; endPos = currentTraitHighlight.startPos + currentTraitHighlight.len; } else { startPos = currentMethodHighlight.startPos; endPos = currentMethodHighlight.startPos + currentMethodHighlight.len; } List<Highlighting> allh = new ArrayList<>(); for (Highlighting h : highlightedText.getTraitHighlights()) { if (h.getProperties().index == lastTraitIndex) { for (Highlighting sh : highlightedText.getSpecialHighlights()) { if (sh.startPos >= h.startPos && (sh.startPos + sh.len < h.startPos + h.len)) { allh.add(sh); } } } } if (currentMethodHighlight != null) { for (Highlighting h : highlightedText.getSpecialHighlights()) { if (h.startPos >= startPos && (h.startPos + h.len < endPos)) { allh.add(h); } } } for (Highlighting h : allh) { if (h.getProperties().subtype.equals(type) && (h.getProperties().index == index)) { ignoreCarret = true; if (h.startPos <= getDocument().getLength()) { setCaretPosition(h.startPos); } getCaret().setVisible(true); ignoreCarret = false; break; } } } public void hilightOffset(long offset) { if (currentMethodHighlight == null) { return; } Highlighting h2 = Highlighting.searchOffset(highlightedText.getInstructionHighlights(), offset, currentMethodHighlight.startPos, currentMethodHighlight.startPos + currentMethodHighlight.len); if (h2 != null) { ignoreCarret = true; if (h2.startPos <= getDocument().getLength()) { setCaretPosition(h2.startPos); } getCaret().setVisible(true); ignoreCarret = false; } } public void setClassIndex(int classIndex) { this.classIndex = classIndex; } private boolean displayMethod(int pos, int methodIndex, String name, Trait trait, int traitIndex, boolean isStatic) { ABC abc = getABC(); if (abc == null) { return false; } int bi = abc.findBodyIndex(methodIndex); if (bi == -1) { return false; } //fix for inner functions: if (trait instanceof TraitMethodGetterSetter) { TraitMethodGetterSetter tm = (TraitMethodGetterSetter) trait; if (tm.method_info != methodIndex) { trait = null; } } if (trait instanceof TraitFunction) { TraitFunction tf = (TraitFunction) trait; if (tf.method_info != methodIndex) { trait = null; } } abcPanel.detailPanel.showCard(DetailPanel.METHOD_GETTER_SETTER_TRAIT_CARD, trait, traitIndex); MethodCodePanel methodCodePanel = abcPanel.detailPanel.methodTraitPanel.methodCodePanel; if (reset || (methodCodePanel.getBodyIndex() != bi)) { methodCodePanel.setBodyIndex(scriptName, bi, abc, name, trait, script.scriptIndex); abcPanel.detailPanel.setEditMode(false); this.isStatic = isStatic; } boolean success = false; Highlighting h = Highlighting.searchPos(highlightedText.getInstructionHighlights(), pos); if (h != null) { methodCodePanel.hilighOffset(h.getProperties().offset); success = true; } Highlighting sh = Highlighting.searchPos(highlightedText.getSpecialHighlights(), pos); if (sh != null) { methodCodePanel.hilighSpecial(sh.getProperties().subtype, sh.getProperties().specialValue); success = true; } return success; } public void displayClass(int classIndex, int scriptIndex) { if (abcPanel.navigator.getClassIndex() != classIndex) { abcPanel.navigator.setClassIndex(classIndex, scriptIndex); } } public void resetEditing() { reset = true; caretUpdate(null); reset = false; } public int getMultinameUnderMouseCursor(Point pt, Reference<ABC> abcUsed) { return getMultinameAtPos(viewToModel(pt), abcUsed); } public int getMultinameUnderCaret(Reference<ABC> abcUsed) { return getMultinameAtPos(getCaretPosition(), abcUsed); } public int getLocalDeclarationOfPos(int pos, Reference<DottedChain> type) { Highlighting sh = Highlighting.searchPos(highlightedText.getSpecialHighlights(), pos); Highlighting h = Highlighting.searchPos(highlightedText.getInstructionHighlights(), pos); if (h == null) { return -1; } List<Highlighting> tms = Highlighting.searchAllPos(highlightedText.getMethodHighlights(), pos); if (tms.isEmpty()) { return -1; } for (Highlighting tm : tms) { List<Highlighting> tm_tms = Highlighting.searchAllIndexes(highlightedText.getMethodHighlights(), tm.getProperties().index); //is it already declaration? if (h.getProperties().declaration || (sh != null && sh.getProperties().declaration)) { return -1; //no jump } String lname = h.getProperties().localName; if ("this".equals(lname)) { Highlighting ch = Highlighting.searchPos(highlightedText.getClassHighlights(), pos); int cindex = (int) ch.getProperties().index; ABC abc = getABC(); type.setVal(abc.instance_info.get(cindex).getName(abc.constants).getNameWithNamespace(abc.constants, true)); return ch.startPos; } HighlightData hData = h.getProperties(); HighlightData search = new HighlightData(); search.declaration = hData.declaration; search.declaredType = hData.declaredType; search.localName = hData.localName; search.specialValue = hData.specialValue; if (search.isEmpty()) { return -1; } search.declaration = true; for (Highlighting tm1 : tm_tms) { Highlighting rh = Highlighting.search(highlightedText.getInstructionHighlights(), search, tm1.startPos, tm1.startPos + tm1.len); if (rh == null) { rh = Highlighting.search(highlightedText.getSpecialHighlights(), search, tm1.startPos, tm1.startPos + tm1.len); } if (rh != null) { type.setVal(rh.getProperties().declaredType); return rh.startPos; } } } return -1; } public boolean getPropertyTypeAtPos(int pos, Reference<Integer> abcIndex, Reference<Integer> classIndex, Reference<Integer> traitIndex, Reference<Boolean> classTrait, Reference<Integer> multinameIndex, Reference<ABC> abcUsed) { int m = getMultinameAtPos(pos, true, abcUsed); if (m <= 0) { return false; } SyntaxDocument sd = (SyntaxDocument) getDocument(); Token t = sd.getTokenAt(pos + 1); Token lastToken = t; Token prev; while (t.type == TokenType.IDENTIFIER || t.type == TokenType.KEYWORD || t.type == TokenType.REGEX) { prev = sd.getPrevToken(t); if (prev != null) { if (!".".equals(prev.getString(sd))) { break; } t = sd.getPrevToken(prev); } else { break; } } if (t.type != TokenType.IDENTIFIER && t.type != TokenType.KEYWORD && t.type != TokenType.REGEX) { return false; } Reference<DottedChain> locTypeRef = new Reference<>(DottedChain.EMPTY); getLocalDeclarationOfPos(t.start, locTypeRef); DottedChain currentType = locTypeRef.getVal(); if (currentType.equals(DottedChain.ALL)) { return false; } boolean found; while (!currentType.equals(DottedChain.ALL)) { String ident = t.getString(sd); found = false; List<ABCContainerTag> abcList = abcUsed.getVal().getSwf().getAbcList(); loopi: for (int i = 0; i < abcList.size(); i++) { ABC a = abcList.get(i).getABC(); int cindex = a.findClassByName(currentType); if (cindex > -1) { InstanceInfo ii = a.instance_info.get(cindex); for (int j = 0; j < ii.instance_traits.traits.size(); j++) { Trait tr = ii.instance_traits.traits.get(j); if (ident.equals(tr.getName(a).getName(a.constants, null, false /*NOT RAW!*/, true))) { classIndex.setVal(cindex); abcIndex.setVal(i); traitIndex.setVal(j); classTrait.setVal(false); multinameIndex.setVal(tr.name_index); currentType = ii.getName(a.constants).getNameWithNamespace(a.constants, true); found = true; break loopi; } } ClassInfo ci = a.class_info.get(cindex); for (int j = 0; j < ci.static_traits.traits.size(); j++) { Trait tr = ci.static_traits.traits.get(j); if (ident.equals(tr.getName(a).getName(a.constants, null, false /*NOT RAW!*/, true))) { classIndex.setVal(cindex); abcIndex.setVal(i); traitIndex.setVal(j); classTrait.setVal(true); multinameIndex.setVal(tr.name_index); currentType = ii.getName(a.constants).getNameWithNamespace(a.constants, true); found = true; break loopi; } } } } if (!found) { return false; } if (t == lastToken) { break; } t = sd.getNextToken(t); if (!".".equals(t.getString(sd))) { break; } t = sd.getNextToken(t); } return true; } public int getMultinameAtPos(int pos, Reference<ABC> abcUsed) { return getMultinameAtPos(pos, false, abcUsed); } private int getMultinameAtPos(int pos, boolean codeOnly, Reference<ABC> abcUsed) { int multinameIndex = _getMultinameAtPos(pos, codeOnly, abcUsed); if (multinameIndex > -1) { ABC abc = abcUsed.getVal(); multinameIndex = abc.constants.convertToQname(abc.constants, multinameIndex); } return multinameIndex; } public int _getMultinameAtPos(int pos, boolean codeOnly, Reference<ABC> abcUsed) { Highlighting tm = Highlighting.searchPos(highlightedText.getMethodHighlights(), pos); Trait currentTrait = null; int currentMethod = -1; ABC abc = getABC(); abcUsed.setVal(abc); if (abc == null) { return -1; } if (tm != null) { int mi = (int) tm.getProperties().index; currentMethod = mi; int bi = abc.findBodyIndex(mi); Highlighting h = Highlighting.searchPos(highlightedText.getInstructionHighlights(), pos); if (h != null) { long highlightOffset = h.getProperties().offset; List<AVM2Instruction> list = abc.bodies.get(bi).getCode().code; AVM2Instruction lastIns = null; AVM2Instruction selIns = null; for (AVM2Instruction ins : list) { if (highlightOffset == ins.getAddress()) { selIns = ins; break; } if (ins.getAddress() > highlightOffset) { selIns = lastIns; break; } lastIns = ins; } if (selIns != null) { //long inspos = highlightOffset - selIns.offset; if (!codeOnly && ((selIns.definition instanceof ConstructSuperIns) || (selIns.definition instanceof CallSuperIns) || (selIns.definition instanceof CallSuperVoidIns))) { Highlighting tc = Highlighting.searchPos(highlightedText.getClassHighlights(), pos); if (tc != null) { int cindex = (int) tc.getProperties().index; if (cindex > -1) { return abc.instance_info.get(cindex).super_index; } } } else { for (int i = 0; i < selIns.definition.operands.length; i++) { if (selIns.definition.operands[i] == AVM2Code.DAT_MULTINAME_INDEX) { return selIns.operands[i]; } } } } } } if (codeOnly) { return -1; } Highlighting ch = Highlighting.searchPos(highlightedText.getClassHighlights(), pos); if (ch != null) { Highlighting th = Highlighting.searchPos(highlightedText.getTraitHighlights(), pos); if (th != null) { currentTrait = abc.findTraitByTraitId((int) ch.getProperties().index, (int) th.getProperties().index); } } if (currentTrait instanceof TraitMethodGetterSetter) { currentMethod = ((TraitMethodGetterSetter) currentTrait).method_info; } Highlighting sh = Highlighting.searchPos(highlightedText.getSpecialHighlights(), pos); if (sh != null) { switch (sh.getProperties().subtype) { case TYPE_NAME: String typeName = sh.getProperties().specialValue; for (int i = 1; i < abc.constants.getMultinameCount(); i++) { Multiname m = abc.constants.getMultiname(i); if (m != null) { if (typeName.equals(m.getNameWithNamespace(abc.constants, true).toRawString())) { return i; } } } case TRAIT_TYPE_NAME: if (currentTrait instanceof TraitSlotConst) { TraitSlotConst ts = (TraitSlotConst) currentTrait; return ts.type_index; } break; case TRAIT_NAME: if (currentTrait != null) { //return currentTrait.name_index; } break; case RETURNS: if (currentMethod > -1) { return abc.method_info.get(currentMethod).ret_type; } break; case PARAM: if (currentMethod > -1) { return abc.method_info.get(currentMethod).param_types[(int) sh.getProperties().index]; } break; } } return -1; } @Override public void caretUpdate(final CaretEvent e) { ABC abc = getABC(); if (abc == null) { return; } if (ignoreCarret) { return; } getCaret().setVisible(true); int pos = getCaretPosition(); abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setIgnoreCarret(true); lastTraitIndex = GraphTextWriter.TRAIT_UNKNOWN; try { classIndex = -1; Highlighting cm = Highlighting.searchPos(highlightedText.getClassHighlights(), pos); if (cm != null) { classIndex = (int) cm.getProperties().index; } displayClass(classIndex, script.scriptIndex); Highlighting tm = Highlighting.searchPos(highlightedText.getMethodHighlights(), pos); if (tm != null) { String name = ""; if (classIndex > -1) { name = abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants, true).toPrintableString(true); } Trait currentTrait = null; currentTraitHighlight = Highlighting.searchPos(highlightedText.getTraitHighlights(), pos); if (currentTraitHighlight != null) { lastTraitIndex = (int) currentTraitHighlight.getProperties().index; currentTrait = getCurrentTrait(); isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex); if (currentTrait != null) { name += ":" + currentTrait.getName(abc).getName(abc.constants, null, false, true); } } displayMethod(pos, (int) tm.getProperties().index, name, currentTrait, lastTraitIndex, isStatic); currentMethodHighlight = tm; return; } if (classIndex == -1) { abcPanel.navigator.setClassIndex(-1, script.scriptIndex); //setNoTrait(); //return; } Trait currentTrait; currentTraitHighlight = Highlighting.searchPos(highlightedText.getTraitHighlights(), pos); if (currentTraitHighlight != null) { lastTraitIndex = (int) currentTraitHighlight.getProperties().index; currentTrait = getCurrentTrait(); if (currentTrait != null) { if (currentTrait instanceof TraitSlotConst) { abcPanel.detailPanel.slotConstTraitPanel.load((TraitSlotConst) currentTrait, abc, abc.isStaticTraitId(classIndex, lastTraitIndex)); final Trait ftrait = currentTrait; final int ftraitIndex = lastTraitIndex; View.execInEventDispatch(() -> { abcPanel.detailPanel.showCard(DetailPanel.SLOT_CONST_TRAIT_CARD, ftrait, ftraitIndex); }); abcPanel.detailPanel.setEditMode(false); currentMethodHighlight = null; Highlighting spec = Highlighting.searchPos(highlightedText.getSpecialHighlights(), pos, currentTraitHighlight.startPos, currentTraitHighlight.startPos + currentTraitHighlight.len); if (spec != null) { abcPanel.detailPanel.slotConstTraitPanel.hilightSpecial(spec); } return; } } currentMethodHighlight = null; //currentTrait = null; String name = classIndex == -1 ? "" : abc.instance_info.get(classIndex).getName(abc.constants).getNameWithNamespace(abc.constants, true).toPrintableString(true); currentTrait = getCurrentTrait(); isStatic = abc.isStaticTraitId(classIndex, lastTraitIndex); if (currentTrait != null) { if (!name.isEmpty()) { name += ":"; } name += currentTrait.getName(abc).getName(abc.constants, null, false, true); } int methodId; if (classIndex > -1) { methodId = abc.findMethodIdByTraitId(classIndex, lastTraitIndex); } else { methodId = ((TraitMethodGetterSetter) abc.script_info.get(script.scriptIndex).traits.traits.get(lastTraitIndex)).method_info; } displayMethod(pos, methodId, name, currentTrait, lastTraitIndex, isStatic); return; } setNoTrait(); } finally { abcPanel.detailPanel.methodTraitPanel.methodCodePanel.setIgnoreCarret(false); } } public void gotoLastTrait() { gotoTrait(lastTraitIndex); } public void gotoLastMethod() { if (currentMethodHighlight != null) { final int fpos = currentMethodHighlight.startPos; new Timer().schedule(new TimerTask() { @Override public void run() { if (fpos <= getDocument().getLength()) { setCaretPosition(fpos); } } }, 100); } } public void gotoTrait(int traitId) { boolean isScriptInit = traitId == GraphTextWriter.TRAIT_SCRIPT_INITIALIZER; Highlighting tc = Highlighting.searchIndex(highlightedText.getClassHighlights(), classIndex); if (tc != null || isScriptInit) { Highlighting th = Highlighting.searchIndex(highlightedText.getTraitHighlights(), traitId, isScriptInit ? 0 : tc.startPos, isScriptInit ? -1 : tc.startPos + tc.len); int pos = 0; if (th != null) { if (th.len > 1) { ignoreCarret = true; int startPos = th.startPos + th.len - 1; if (startPos <= getDocument().getLength()) { setCaretPosition(startPos); } ignoreCarret = false; } pos = th.startPos; } else if (tc != null) { pos = tc.startPos; } final int fpos = pos; new Timer().schedule(new TimerTask() { @Override public void run() { if (fpos <= getDocument().getLength()) { setCaretPosition(fpos); } } }, 100); } } public DecompiledEditorPane(ABCPanel abcPanel) { super(); setEditable(false); getCaret().setVisible(true); addCaretListener(this); this.abcPanel = abcPanel; } public void clearScript() { script = null; } public void setScript(ScriptPack scriptLeaf, boolean force) { View.checkAccess(); if (setSourceWorker != null) { setSourceWorker.cancel(true); setSourceWorker = null; } if (!force && this.script == scriptLeaf) { fireScript(); return; } String sn = scriptLeaf.getClassPath().toString(); setScriptName(sn); abcPanel.scriptNameLabel.setText(sn); int scriptIndex = scriptLeaf.scriptIndex; ScriptInfo nscript = null; ABC abc = scriptLeaf.abc; if (scriptIndex > -1) { nscript = abc.script_info.get(scriptIndex); } if (nscript == null) { highlightedText = HighlightedText.EMPTY; return; } HighlightedText decompiledText = SWF.getFromCache(scriptLeaf); boolean decompileNeeded = decompiledText == null; if (decompileNeeded) { CancellableWorker worker = new CancellableWorker() { @Override protected Void doInBackground() throws Exception { if (decompileNeeded) { View.execInEventDispatch(() -> { setText("// " + AppStrings.translate("work.decompiling") + "..."); }); HighlightedText htext = SWF.getCached(scriptLeaf); View.execInEventDispatch(() -> { setSourceCompleted(scriptLeaf, htext); }); } return null; } @Override protected void done() { View.execInEventDispatch(() -> { setSourceWorker = null; if (!Main.isDebugging()) { Main.stopWork(); } try { get(); } catch (CancellationException ex) { setText("// " + AppStrings.translate("work.canceled")); } catch (Exception ex) { Throwable cause = ex; if (ex instanceof ExecutionException) { cause = ex.getCause(); } if (cause instanceof CancellationException) { setText("// " + AppStrings.translate("work.canceled")); } else { logger.log(Level.SEVERE, "Error", cause); setText("// " + AppStrings.translate("decompilationError") + ": " + cause); } } }); } }; worker.execute(); setSourceWorker = worker; if (!Main.isDebugging()) { Main.startWork(AppStrings.translate("work.decompiling") + "...", worker); } } else { setSourceCompleted(scriptLeaf, decompiledText); } } private void setSourceCompleted(ScriptPack scriptLeaf, HighlightedText decompiledText) { View.checkAccess(); if (decompiledText == null) { decompiledText = HighlightedText.EMPTY; } script = scriptLeaf; highlightedText = decompiledText; if (decompiledText != null) { String hilightedCode = decompiledText.text; BrokenScriptDetector det = new BrokenScriptDetector(); if (det.codeIsBroken(hilightedCode)) { abcPanel.brokenHintPanel.setVisible(true); } else { abcPanel.brokenHintPanel.setVisible(false); } setText(hilightedCode); if (highlightedText.getClassHighlights().size() > 0) { try { setCaretPosition(highlightedText.getClassHighlights().get(0).startPos); } catch (Exception ex) { //sometimes happens //ignore } } } fireScript(); } public void reloadClass() { View.checkAccess(); int ci = classIndex; SWF.uncache(script); if (script != null && getABC() != null) { setScript(script, true); } setNoTrait(); setClassIndex(ci); } public int getClassIndex() { return classIndex; } private ABC getABC() { return script == null ? null : script.abc; } @Override public void setText(String t) { super.setText(t); setCaretPosition(0); } @Override public String getToolTipText(MouseEvent e) { // not debugging: so return existing text if (abcPanel.getDebugPanel().localsTable == null) { return super.getToolTipText(); } final Point point = new Point(e.getX(), e.getY()); final int pos = abcPanel.decompiledTextArea.viewToModel(point); final String identifier = abcPanel.getMainPanel().getActionPanel().getStringUnderPosition(pos, abcPanel.decompiledTextArea); if (identifier != null && !identifier.isEmpty()) { String tooltipText = abcPanel.getDebugPanel().localsTable.tryGetDebugHoverToolTipText(identifier); return (tooltipText == null ? super.getToolTipText() : tooltipText); } // not found: so return existing text return super.getToolTipText(); } }
jindrapetrik/jpexs-decompiler
src/com/jpexs/decompiler/flash/gui/abc/DecompiledEditorPane.java
Java
gpl-3.0
33,603
<?php namespace Opifer\QueueIt\Validation; interface ValidateResultRepositoryInterface { public function getValidationResult($queue); public function setValidationResult($queue, $validationResult); }
Opifer/queue-it
src/Validation/ValidateResultRepositoryInterface.php
PHP
gpl-3.0
210
sudo apt-get install build-essential g++
williford/.settings
common-apt-packages-install.sh
Shell
gpl-3.0
41
/* Inclusão das bibliotecas requisitadas: */ #include "../Bibliotecas/Diretorios.hpp" /* Definições das funções a serem manipuladas por este arquivo: */ /* Função 'arq_escreve_resize', escreve o aviso de redimensionamento */ void arq_escreve_resize (FILE *arq){ /* 'arq' armazena o arquivo lógico a ser escrito o aviso */ fprintf (arq, "Todas as imagens foram redimensionadas para %d x %d pixels, ", LIN_ALVO, COL_ALVO); fprintf (arq, "as medições abaixo obedecem esta proporção.\n\n"); } /* Função 'dir_ler', realiza a leitura de todos os diretórios a partir de um ** diretório base, escrevendo num arquivo de escolha*/ void dir_ler (FILE *arq, FILE *arq1, char * dirbase, int ramificacao, FMeasure *estatistica){ /* 'arq' armazena o arquivo a ser gravado as informações a medida que vai ** percorrendo os diretórios; 'dirbase' armazena o nome do diretório ** corrente a ser navegado; 'ramificacao' armazena o nivel de ramificacao ** dos diretórios; 'pasta' armazena as informações dos arquivos presentes ** no diretório; 'pdir' armazena o diretório lógico a ser navegado; ** 'extensoes' armazena as extensões de arquivo, classificadas como imagem */ Diretorios *pasta; DIR *pdir = dir_abre (dirbase); string hinweis[] = {"Categoria 1", "Categoria 2"}; int contador = 0; /* Analisando todos os arquivos do diretorio corrente */ while((pasta = readdir(pdir))){ /* Escrita no arquivo desejado */ dir_escreve_geral (arq, pasta, ramificacao); /* Validação do diretório */ if (dir_valido_geral(pasta) == VERDADE){ /* Configuração da classe que está sendo analisada */ if (string_compara_n(pasta->d_name, hinweis[0], 0, 0, static_cast<int>(hinweis[0].size())) == VERDADE){ estatistica->status = VERDADE; }else if (string_compara_n(pasta->d_name, hinweis[1], 0, 0, static_cast<int>(hinweis[1].size())) == VERDADE){ estatistica->status = !VERDADE; } /* Verificação se é outro diretório, caso positivo: */ if(pasta->d_type == DIR_PASTA){ /* Configuração do nome do diretório,'nomedir', a ser lido */ char nomedir[500]; /* Inicialização do nome do diretório */ string_zera (nomedir, 0, 500); /* Construção do nome do diretório filho */ dir_constroi_nome (dirbase, pasta->d_name, nomedir); strcat (nomedir, DIR_DIVISAO); /* Leitura do diretório formado */ dir_ler (arq, arq1, nomedir, ramificacao + 1, estatistica); /* Caso contrario e, além disso, sendo uma imagem */ }else if(dir_valido_imagem(pasta) == VERDADE){ /* Configuração do nome da imagem, 'nomeimg', a ser manipulada */ char nomeimg[500]; /* Inicialização do nome do diretório */ string_zera (nomeimg, 0, 500); /* Construção do nome do diretório filho */ dir_constroi_nome (dirbase, pasta->d_name, nomeimg); /* Abertura da imagem para processamento */ Mat teste = imread (nomeimg, CV_LOAD_IMAGE_COLOR); /* Processamento sobre a imagem encontrada */ if (!teste.empty()){ imagem_processa (arq1, teste, nomeimg, estatistica); if (estatistica->classes.status == VERDADE){ contador++; } } /* Escrita no arquivo saida, o status sobre a imagem */ dir_escreve_imagem (arq, nomeimg, ramificacao + 1, teste.empty()); teste.release (); } } } if (estatistica->classes.status == VERDADE){ /* Levantamento das médias e desvios padrões para as classes */ estatistica->classes.medias[estatistica->classes.classe] /= contador; } /* Liberação de memória */ if (pdir != NULL) closedir (pdir); return; } /* Função 'dir_abre', realiza a abertura de um dado diretório, ** verificando se é um diretorio válido */ DIR * dir_abre (char *nomedir){ /* 'nomedir' armazena o nome do diretório a ser aberto; 'diretorio' ** armazena o diretório lógico a ser manipulado */ DIR *diretorio = opendir (nomedir); /* Validação do diretório lógico */ if (diretorio == NULL){ printf ("Falha ao abrir o diretorio %s!\n", nomedir); } return diretorio; } /* Função 'dir_constroi_nome', realiza a construção do nome do diretorio, ** pela concatenação de duas outras partes */ void dir_constroi_nome (char *parte1, char *parte2, char *destino){ /* 'parte1' e 'parte2' armazenam as respectivas partes a serem concatenadas ** nessa ordem; 'destino' armazena o nome formado */ /* Concatenação das partes */ strcpy (destino, parte1); strcat (destino, parte2); } /* Função 'dir_escreve_geral', realiza a escrita do status de um arquivo do diretório ** num arquivo de saída escolhido */ void dir_escreve_geral (FILE *arq, Diretorios *dir, int ramificacao){ /* 'arq' armazena o arquivo lógico a ser escrito as informações do referente ** arquivo; 'dir' armazena o arquivo corrente; 'ramificacao' armazena o nível ** de ramificação do arquivo corrente */ /* Escrita com as ramificações */ for (int vezes = 0; vezes < ramificacao; vezes++) fprintf (arq, "\t"); /* Escrita das informações */ fprintf (arq, "Tipo =\t%d\t", dir->d_type); fprintf (arq, "Nome =\t%s\n", dir->d_name); } /* Função 'dir_escreve_imagem', realiza a escrita do status de uma imagem do diretório ** num arquivo de saída escolhido */ void dir_escreve_imagem (FILE *arq, char *nomeimg, int ramificacao, bool falha){ /* 'arq' armazena o arquivo lógico a ser escrito as informações do referente ** arquivo; 'dir' armazena o arquivo corrente; 'ramificacao' armazena o nível ** de ramificação do arquivo corrente */ /* Escrita com as ramificações */ for (int vezes = 0; vezes < ramificacao + 1; vezes++) fprintf (arq, "\t"); /* Não conseguindo abrir a imagem */ if (falha == VERDADE){ fprintf (arq, "Erro ao abrir a imagem %s\n\n", nomeimg); /* Caso contrário */ }else{ fprintf (arq, "SUCESSO\n\n"); } } /* Função 'dir_valido_geral', realiza a validação de um diretório, ou seja, se é uma ** pasta de arquivos e se é um nome diferente de '.' e '..' */ bool dir_valido_geral (Diretorios *dir){ /* 'dir' armazena o diretório a ser analisado */ /* Validação do diretório */ if ((strcmp(dir->d_name, ".") != IGUAL) && (strcmp(dir->d_name, "..") != IGUAL)) return VERDADE; return !VERDADE; } /* Função 'dir_valido_imagem', realiza a validação de um arquivo como imagem */ bool dir_valido_imagem (Diretorios *dir){ /* 'dir' armazena o diretorio a ser avaliado como imagem ou não; 'referencia' armazena ** os criterios para que um diretório seja considerado como uma imagem */ string referencia[] = {"jpg", "png"}; /* Valida o formato do diretório quanto um formato de imagem */ /* Busca dentre os formatos possíveis */ for (int turn = 0; turn < QNT_FORMATOS; turn++){ /* Sendo VERDADE */ if (string_compara_n (dir->d_name, referencia[turn], strlen(dir->d_name) - ARQ_EXTENSAO, 0, static_cast<int>(referencia[turn].length())) == VERDADE) return VERDADE; } /* Não sendo uma imagem */ return !VERDADE; }
rodrigofegui/UnB
2015.2/Intro. Proc. Imagem/Trabalhos/Trabalho 1/Codificação_Trab1_rev1/Fontes/Diretorios.cpp
C++
gpl-3.0
7,622
#!/usr/bin/env python """Publish coverage results online via coveralls.io Puts your coverage results on coveralls.io for everyone to see. It makes custom report for data generated by coverage.py package and sends it to `json API`_ of coveralls.io service. All python files in your coverage analysis are posted to this service along with coverage stats, so please make sure you're not ruining your own security! Usage: coveralls [options] coveralls debug [options] Debug mode doesn't send anything, just outputs json to stdout, useful for development. It also forces verbose output. Global options: -h --help Display this help -v --verbose Print extra info, True for debug command Example: $ coveralls Submitting coverage to coveralls.io... Coverage submitted! Job #38.1 https://coveralls.io/jobs/92059 """ import logging from docopt import docopt from coveralls import Coveralls from coveralls.api import CoverallsException log = logging.getLogger('coveralls') def main(argv=None): options = docopt(__doc__, argv=argv) if options['debug']: options['--verbose'] = True level = logging.DEBUG if options['--verbose'] else logging.INFO log.addHandler(logging.StreamHandler()) log.setLevel(level) try: coverallz = Coveralls() if not options['debug']: log.info("Submitting coverage to coveralls.io...") result = coverallz.wear() log.info("Coverage submitted!") log.info(result['message']) log.info(result['url']) log.debug(result) else: log.info("Testing coveralls-python...") coverallz.wear(dry_run=True) except KeyboardInterrupt: # pragma: no cover log.info('Aborted') except CoverallsException as e: log.error(e) except Exception: # pragma: no cover raise
phimpme/generator
Phimpme/site-packages/coveralls/cli.py
Python
gpl-3.0
1,907
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>ActiveModel::Validations::Callbacks</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" /> <link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" /> <script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script> <script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script> </head> <body> <div class="banner"> <span>Ruby on Rails 4.2.0</span><br /> <h1> <span class="type">Module</span> ActiveModel::Validations::Callbacks </h1> <ul class="files"> <li><a href="../../../files/__/__/_rvm/gems/ruby-2_1_1/gems/activemodel-4_2_0/lib/active_model/validations/callbacks_rb.html">/home/rafael/.rvm/gems/ruby-2.1.1/gems/activemodel-4.2.0/lib/active_model/validations/callbacks.rb</a></li> </ul> </div> <div id="bodyContent"> <div id="content"> <div class="description"> <h2 id="module-ActiveModel::Validations::Callbacks-label-Active+Model+Validation+Callbacks">Active Model Validation Callbacks</h2> <p>Provides an interface for any class to have <code>before_validation</code> and <code>after_validation</code> callbacks.</p> <p>First, include <a href="Callbacks.html">ActiveModel::Validations::Callbacks</a> from the class you are creating:</p> <pre><code>class MyModel include ActiveModel::Validations::Callbacks before_validation :do_stuff_before_validation after_validation :do_stuff_after_validation end </code></pre> <p>Like other <code>before_*</code> callbacks if <code>before_validation</code> returns <code>false</code> then <code>valid?</code> will not be called.</p> </div> <!-- Namespace --> <div class="sectiontitle">Namespace</div> <ul> <li> <span class="type">MODULE</span> <a href="Callbacks/ClassMethods.html">ActiveModel::Validations::Callbacks::ClassMethods</a> </li> </ul> <!-- Includes --> <div class="sectiontitle">Included Modules</div> <ul> <li> <a href="../../ActiveSupport/Callbacks.html"> ActiveSupport::Callbacks </a> </li> </ul> <!-- Methods --> </div> </div> </body> </html>
rafaellc28/Portfolio
doc/api/classes/ActiveModel/Validations/Callbacks.html
HTML
gpl-3.0
3,090
/* * Copyright (C) 2016 Matthew Seal * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.mseal.control.server; /** * * @author Matthew Seal */ public interface CommandImpl { /** * Command to shutdown the server * * @throws Exception if an error happens while executing the command */ public void serverShutdown() throws Exception; /** * Command to reboot the server * * @throws Exception if an error happens while executing the command */ public void serverRestart() throws Exception; /** * This method is called for custom events * * @param cmd the command to be executed * @param arguments the arguments included in the command * @throws Exception if an error happens while executing the command */ public void serverCommand(String cmd, String arguments) throws Exception; }
matthewseal/ServerControl
src/org/mseal/control/server/CommandImpl.java
Java
gpl-3.0
1,539
################################################## # PROJECT: DXL Protocol 2.0 Read/Write Example Makefile # AUTHOR : ROBOTIS Ltd. ################################################## #--------------------------------------------------------------------- # Makefile template for projects using DXL SDK # # Please make sure to follow these instructions when setting up your # own copy of this file: # # 1- Enter the name of the target (the TARGET variable) # 2- Add additional source files to the SOURCES variable # 3- Add additional static library objects to the OBJECTS variable # if necessary # 4- Ensure that compiler flags, INCLUDES, and LIBRARIES are # appropriate to your needs # # # This makefile will link against several libraries, not all of which # are necessarily needed for your project. Please feel free to # remove libaries you do not need. #--------------------------------------------------------------------- # *** ENTER THE TARGET NAME HERE *** TARGET = setID # important directories used by assorted rules and other variables DIR_DXL = ../../ DIR_OBJS = .objects # compiler options CC = gcc CX = g++ CCFLAGS = -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall $(INCLUDES) $(FORMAT) -g CXFLAGS = -O2 -O3 -DLINUX -D_GNU_SOURCE -Wall $(INCLUDES) $(FORMAT) -g LNKCC = $(CX) LNKFLAGS = $(CXFLAGS) #-Wl,-rpath,$(DIR_THOR)/lib FORMAT = -m64 #--------------------------------------------------------------------- # Core components (all of these are likely going to be needed) #--------------------------------------------------------------------- INCLUDES += -I$(DIR_DXL)/../include LIBRARIES += -ldxl_x64_cpp LIBRARIES += -lrt #--------------------------------------------------------------------- # Files #--------------------------------------------------------------------- SOURCES = setID.cpp \ # *** OTHER SOURCES GO HERE *** OBJECTS = $(addsuffix .o,$(addprefix $(DIR_OBJS)/,$(basename $(notdir $(SOURCES))))) #OBJETCS += *** ADDITIONAL STATIC LIBRARIES GO HERE *** #--------------------------------------------------------------------- # Compiling Rules #--------------------------------------------------------------------- $(TARGET): make_directory $(OBJECTS) $(LNKCC) $(LNKFLAGS) $(OBJECTS) -o $(TARGET) $(LIBRARIES) all: $(TARGET) clean: rm -rf $(TARGET) $(DIR_OBJS) core *~ *.a *.so *.lo make_directory: mkdir -p $(DIR_OBJS)/ $(DIR_OBJS)/%.o: %.c $(CC) $(CCFLAGS) -c $? -o $@ $(DIR_OBJS)/%.o: %.cpp $(CX) $(CXFLAGS) -c $? -o $@ #--------------------------------------------------------------------- # End of Makefile #---------------------------------------------------------------------
rmelo19/rmelo19-dynamixel
src/setID/Makefile
Makefile
gpl-3.0
2,695
#ifndef GUI_DEFS_H #define GUI_DEFS_H #include <stdint.h> #define labs(x) ((int32_t)(x) < 0 ? -(int32_t)(x) : (int32_t)(x)) #define GUI_min(x, y) ((x) < (y) ? (x) : (y)) #define GUI_max(x, y) ((x) > (y) ? (x) : (y)) #ifdef ColorDepthBpp1 typedef uint8_t ColorTypeDef; enum StdPalette { StdColBlack = 0, StdColWhite = 1, }; #endif #ifdef ColorDepthBpp4 typedef uint8_t ColorTypeDef; enum StdPalette { StdColBlack = 0, StdColWhite = 15, }; #endif #ifdef ColorDepthBpp8 typedef uint8_t ColorTypeDef; enum StdPalette { StdColBlack = 0, StdColWhite = 255, }; #endif #ifdef ColorDepthBpp16 typedef uint16_t ColorTypeDef; enum StdPalette { StdColBlack = 0, StdColWhite = 65535, }; #endif #ifdef ColorDepthBpp24 typedef uint32_t ColorTypeDef; enum StdPalette { StdColBlack = 0, StdColWhite = (255) | (255 << 8) | (255 << 16), }; #endif #ifdef ColorDepthBpp32 typedef uint32_t ColorTypeDef; enum StdPalette { StdColBlack = 0, StdColWhite = (255) | (255 << 8) | (255 << 16) | (255 << 24), }; #endif typedef struct { const ColorTypeDef *Image; uint16_t W, H; } tImage; typedef struct { ColorTypeDef *Image; uint16_t W, H; } tTexture; typedef struct { const uint8_t Code; const tImage *Image; }tChar ; typedef struct{ const uint8_t Quantity; const tChar *CharArray; const uint8_t W, H; } tFont; #endif /*GUI_DEFS_H*/
T10T100/Embed
device/GUI/inc/GUI_defs.h
C
gpl-3.0
1,387
/* Copyright (C) 2014-2017 Wolfger Schramm <wolfger@spearwolf.de> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ package kiwotigo type RegionGroup struct { Regions []*Region } func NewRegionGroup(maxRegionCount int) (group *RegionGroup) { group = new(RegionGroup) group.Regions = make([]*Region, 0, maxRegionCount) return group } func (group *RegionGroup) IsInside(region *Region) bool { for _, reg := range group.Regions { if reg == region { return true } } return false } func (group *RegionGroup) IsOverlapping(other *RegionGroup) bool { for _, region := range other.Regions { if group.IsInside(region) { return true } else { for _, neighbor := range region.neighbors { if group.IsInside(neighbor) { return true } } } } return false } func (group *RegionGroup) Merge(other *RegionGroup) { for _, region := range other.Regions { group.Append(region) } } func (group *RegionGroup) Append(region *Region) { if group.IsInside(region) { return } group.Regions = append(group.Regions, region) for _, neighbor := range region.neighbors { group.Append(neighbor) } }
spearwolf/kiwotigo
region_group.go
GO
gpl-3.0
1,706
package net.egyptmagicians.mod; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.Item; public class _MCreativeTabs { public static CreativeTabs TabEgyptMagicians; public static void mainRegistry(){ TabEgyptMagicians = new CreativeTabs("TabEgyptMagicians"){ @SideOnly(Side.CLIENT) public Item getTabIconItem(){ return Item.getItemFromBlock(Blocks.sandstone); } }; } }
jasonw930/egyptmagicians
net/egyptmagicians/mod/_MCreativeTabs.java
Java
gpl-3.0
528
import { Empty as _Empty } from 'elementor-document/elements/commands'; import ElementsHelper from '../../elements/helper'; export const Empty = () => { QUnit.module( 'Empty', () => { QUnit.test( 'Single Selection', ( assert ) => { const eColumn = ElementsHelper.createSection( 1, true ); ElementsHelper.createButton( eColumn ); ElementsHelper.createButton( eColumn ); // Ensure editor saver. $e.internal( 'document/save/set-is-modified', { status: false } ); ElementsHelper.empty(); // Check. assert.equal( elementor.getPreviewContainer().view.collection.length, 0, 'all elements were removed.' ); assert.equal( elementor.saver.isEditorChanged(), true, 'Command applied the saver editor is changed.' ); } ); QUnit.test( 'Restore()', ( assert ) => { const random = Math.random(), historyItem = { get: ( key ) => { if ( 'data' === key ) { return random; } }, }; let orig = $e.run, tempCommand = ''; // TODO: Do not override '$e.run', use 'on' method instead. $e.run = ( command ) => { tempCommand = command; }; // redo: `true` _Empty.restore( historyItem, true ); $e.run = orig; assert.equal( tempCommand, 'document/elements/empty' ); const addChildModelOrig = elementor.getPreviewView().addChildModel; // Clear. orig = $e.run; tempCommand = ''; let tempData = ''; elementor.getPreviewView().addChildModel = ( data ) => tempData = data; // TODO: Do not override '$e.run', use 'on' method instead. $e.run = ( command ) => { tempCommand = command; }; // redo: `false` _Empty.restore( historyItem, false ); $e.run = orig; elementor.getPreviewView().addChildModel = addChildModelOrig; assert.equal( tempData, random ); } ); } ); }; export default Empty;
kobizz/elementor
tests/qunit/core/editor/document/elements/commands/empty.spec.js
JavaScript
gpl-3.0
1,829
package task19; public class Car { public int speed; public String name; public String color; public Car(){ this.speed = 0; this.name = "noname"; this.color = "unpainted"; } public Car(int speed, String name, String color) { super(); this.speed = speed; this.name = name; this.color = color; } public int getSpeed() { return speed; } public void setSpeed(int speed) { this.speed = speed; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getColor() { return color; } public void setColor(String color) { this.color = color; } }
yulgutlin/eclipsewokspace
task19/src/task19/Car.java
Java
gpl-3.0
650
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>membuat web statis</title> <link href="css/webstatis.css" rel="stylesheet"/> <link href="lapangan.jpg" rel="shortcut icon"/> </head> <body> <header class="webstatis" id="judul"> <img src="gambar/dagul.jpg" width="150px" alt="logo dagul" title="logo dagul" id="logo"/> <h1>Rendy Baskara</h1> <h2>Pemuda Indonesia 2016</h2> </header> <nav class="Webstatis" id="menu"> <ul> <li><a href="index.html"> Beranda </a></li> <li><a href="profil.html"> Profil </a> <li><a href="#"> Artikel </a> <ul> <li><a href="olahraga.html"> SepakBola </a></li> <li><a href="pengertiannya.html"> pengertiannya </a></li> <li><a href="permainan.html"> permainan </a></li> <li><a href="#"> peraturan </a> <ul> <li><a href="offside.html"> offside </a></li> <li><a href="pelanggaran.html"> pelanggaran </a></li> <li><a href="#"> tendangan bebas </a></li> <li><a href="#"> tendangan pinalty </a></li> <li><a href="#"> tendangan gawang </a></li> <li><a href="#"> tendangan sudut </a></li> <li><a href="#"> lemparan dalam </a></li> </ul> </li> </ul> </li> <li><a href="berita.html"> Berita </a></li> <ul> </ul> </li> <li><a href="video.html"> Video </a></li> <ul> </ul> </li> <li><a href="hubungi.html"> Hubungi kami </a></li> <ul> </nav> <section class="webstatis" id="utama"> <section id="konten"> <article> <header> <h1 align="center"> Pelanggaran </h1> </header> <p> <img src="gambar/pelanggaran.jpg" width="570px" height="332"></img> <ul> <li>  <h1>Dalam bermain olahraga apapun tentunya ada peraturan yang mendasarinya sehingga proses pertandingan yang berlangsung akan lebih bisa terkendali dan bisa terjalin sportifitas, kali ini volimaniak ingin berbagi kepada anda semunya masih mengenai Sepak Bola, yaitu mengenai Jenis pelanggaran yang ada dalam permainan sepak bola, untuk lebih jelasnya mengenai pelanggaran dalam sepak bola anda bisa melihat gambar di atas.</h1> </li> </ul> </p> </article> </section> <aside id="sidebar"> <b> Web olahragawan </b> <ul> <li> sepak bola </li> <li> bulu tangkis </li> <li> tenis meja </li> <li> bola volly </li> <li> basket </li> </ul> </aside> </aside> </section> <footer class="webstatis"id="foot"> <br/><b>Web Statis <br/>By <a href="Rendybaskara17@gmail.com" target="_blank">RendyBaskara</a> <br/>Copyright_2016
RendyBaskara/web-statis
pelanggaran.html
HTML
gpl-3.0
2,587
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html id="helpIndexHtml" lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta content="HTML Tidy for Windows (vers 25 March 2009), see www.w3.org" name="generator" /> <title>My queries folder</title> <link href="nbdocs:/org/netbeans/modules/usersguide/ide.css" rel="stylesheet" type="text/css" /> <link href="nbdocs://pl.edu.amu.wmi.kino.rtc.RtcClientConnection/pl/edu/amu/wmi/kino/rtc/RtcClientConnection/docs/default/style.css" rel="stylesheet" type="text/css" /> </head> <body> <h1 class="topictitle1">My queries and shared folder.</h1> <p class="p">Thanks to <span class="keyword">My queries folder </span> and <span class="keyword">Shared folder</span> you can easily retrieve proper work items. </p> <p class="p">To work with work items and queries you can choose between: </p> <ul> <li><span class="keyword">My queries folder</span> - this folder contains a set of queries that are defined by user. </li> <li><span class="keyword">Shared queries folder</span> - this folder contains a set of queries that are shared between users. In this folder queries are grouped in Predefined queries folder and Individually shared folder. <div class="note">Jazz™ provides a set of predefined queries that you can use to retrieve work items that meet a set of conditions.</div></li> </ul> <p class="p">To find work items:</p> <ol> <li>Double click on folder.</li> <li>Double click on query.</li> <li><span class="keyword">Work items view </span>will be opened. This view presents a list of work items that match query. For details see: <a href="con_UserRTCworkItemsView.html">Work Items View.</a></li> </ol> <p class="p">Using <span class="keyword">My queries </span>and <span class="keyword">shared folder</span> you are able to: </p> <ul> <li><span class="keyword">Edit existing query </span>: double-click click on folder, right click on query and choose Edit. Query editor will be opened. For details see : <a href="con_queryEditor">Query Editor</a></li></ul> <p class="p">Using My queries folder you also able to : </p> <ul> <li><span class="keyword">Add new query: </span> right-click on My queries folder and choose Add query. Query editor will be opened. For details see : <a href="con_queryEditor">Query Editor</a></li> <li><span class="keyword">Rename existing query </span>: double-click on My queries folder then select query and right click on query and choose Rename.Enter new name in the pop-up window.</li> <li> <span class="keyword">Delete existing query: </span> double-click on My queries folder then select query and right click on query and choose Delete. <div class="important_note">Warning: deleting queries does not require confirmation.</div></li> </ul> <hr /> <span class="runningfooter"> <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"> <param name="content" value="https://www14.software.ibm.com/webapp/iwm/web/signup.do?source=rdf" /> <param name="text" value="Feedback " /> </object> </span> <p> <span class="runningheader" style="color: #666666;">Did this help? You can provide feedback at Jazz.net (registration required): <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"> <param name="content" value="https://jazz.net/forums/" /> <param name="text" value="Comment in the forums " /> </object> or <object classid="java:org.netbeans.modules.javahelp.BrowserDisplayer"> <param name="content" value="https://jazz.net/bugs/bugs.jsp" /> <param name="text" value="submit a bug " /> </object> </span> </p> </body> </html>
RtcNbClient/RtcNbClient
RtcNbClientCommon/RtcNbClientCommonUI/src/main/javahelp/pl/edu/amu/wmi/kino/rtc/RtcNbClientCommonUI/docs/default/usingRTC/con_UseRTCMyQueriesFolder.html
HTML
gpl-3.0
4,049
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_25) on Thu May 15 20:06:27 BRT 2014 --> <title>Serialized Form</title> <meta name="date" content="2014-05-15"> <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="Serialized Form"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <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>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-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>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?serialized-form.html" target="_top">Frames</a></li> <li><a href="serialized-form.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Serialized Form" class="title">Serialized Form</h1> </div> <div class="serializedFormContainer"> <ul class="blockList"> <li class="blockList"> <h2 title="Package">Package&nbsp;br.com.rafael.jpdroid.exceptions</h2> <ul class="blockList"> <li class="blockList"><a name="br.com.rafael.jpdroid.exceptions.JpdroidException"> <!-- --> </a> <h3>Class <a href="br/com/rafael/jpdroid/exceptions/JpdroidException.html" title="class in br.com.rafael.jpdroid.exceptions">br.com.rafael.jpdroid.exceptions.JpdroidException</a> extends java.lang.Exception implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1L</dd> </dl> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="overview-summary.html">Overview</a></li> <li>Package</li> <li>Class</li> <li>Use</li> <li><a href="overview-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>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="index.html?serialized-form.html" target="_top">Frames</a></li> <li><a href="serialized-form.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
RafaelCentenaro/jpdroid
JPDROID/doc/serialized-form.html
HTML
gpl-3.0
3,923
module Main where import VSim.Runtime elab :: Elab IO () elab = do integer <- alloc_unranged_type array <- alloc_array_type (alloc_range (pure 0) (pure 5)) integer clk <- alloc_signal "clk" integer (assign (int 0)) a1 <- alloc_signal "a2" array (aggregate [ access (int 0) (assign (pure clk)) , access (int 1) (assign (int 4)) ]) a2 <- alloc_signal "a1" array defval a3 <- alloc_signal "a2" array (assign (pure a1)) proc1 <- alloc_process "main" [] $ do breakpoint (pure clk) .<=. (next, assign ((pure clk) .+. (int 1))) (pure a2) .<=. (next, assign (pure a1)) (pure a1) .<=. (fs 2, aggregate [ access (int 1) (assign ((index (int 1) (pure a1)) .+. (int 1))) , access (int 2) (assign (int 3)) ]) (index (int 0) (pure a1)) .<=. (next, assign (int 0)) wait (fs 1) return () return () main = do sim maxBound elab
grwlf/vsim
src_r/Test/Array1.hs
Haskell
gpl-3.0
1,019
<p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfg d:&nbsp; </span> </span> </span> </strong> </p> <p> <br /> </p> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">the dfg dfg dfg asda(asd) asd replaces used g interest free fdg, used retail g dfg, and sdas ag &amp; asd division pool fund asd on eligible used dasd asdas. these b fufgnds are to cbv ufgtilized in the dfg and asd of deadler's as used asd inventory.</span> </span> </span> </p> <p> <br /> </p> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sad d:</span> </span> </span> </strong> </p> <p> <br /> </p> <p style="margin-left:68px"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d elasdigible asd asd d:</span> </span> </span> </strong> </p> <p style="margin-left:44px"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">settlements of the following a asd asd equipment asd eligible to receive an <br />asd d into dasd dealer's sd pool fund account: </span> </span> </span> </p> <ul> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sd: asd-9 sad asd, excluding dg g.</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sad: sad, <strong>ssaad</strong> d and ad, and g fdg </span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">crop asdcare: sad, air sad, sad, asd, g and d</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sad &amp; d: sd, sad asd d, dfg, moco's, asd, sad other non-asd product asd</span> </span> </span> </li> </ul> <p style="margin-left:68px"> <br /> </p> <p style="margin-left:68px"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d not d to sad d:</span> </span> </span> </strong> </p> <p style="margin-left:44px"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">the following d fg dfg d is not eligible to receive asd sad sad pool dfgg credit, and will continue to bde d for das asd terms das asd per the d dasd terms schedule and d asdincentive asd: d</span> </span> </span> </p> <ul> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d: sad asd asd, 5 series asd, and sad sad</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sad &amp; as: d sad, sad sad, and ad ad</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d: amsds, d, d, and 48/49 d</span> </span> </span> </li> </ul> <p style="margin-left:68px"> <br /> </p> <p style="margin-left:68px"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d d to d spf's:</span> </span> </span> </strong> </p> <p style="margin-left:44px"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">used sad sdfequipment that is 'like' d products above that earn d d may use pool funds, regardless d the make of the used equipment. in g, the g sdf in on trade. the </span> </span> </span> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">following dsf dfg is sdf to use sdf:</span> </span> </span> </p> <ul> <li> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">used dsf df 6-9 series f df prior yesdfar like fs that dsf 90 pto hp* and above, sdf dsf sdf</span> </span> </span> </li> <li> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">used f sdf msdfodel dfg that are 90 dgfg hp* and above</span> </span> </span> </li> <li> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">all sdf used f equipment that is 'like' those dsf eligible for df df contridsfbutions. i.e. f, ds, sdf, dsf dsf, etc. </span> </span> </span> </li> </ul> <p style="margin-left:96px"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">*pto hp is ds according to the f sdf official guide or dsf pro dsf</span> </span> </span> </p> <p style="margin-left:72px"> <br /> </p> <p style="margin-left:44px"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">examples:</span> </span> </span> </p> <ul> <li> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdfsdffdsfdff fdfdg&nbsp;&nbsp; sdfds</span> </span> </span> <ul style="list-style-type:circle"> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">will f pool funds on the new 6 series, anddf the </span> </span> </span> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">f 80 sdf sdf </span> </span> </span> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">tractor will receive used f terms dsf programs.</span> </span> </span> </li> </ul> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfg sells a new 5 sdfsd df and takes a used 6 f in on trade. </span> </span> </span> <ul style="list-style-type:circle"> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df not earn fpool dsf on the new 5 f, and the used 6 df df be interest f sdf but may use pool funds.</span> </span> </span> </li> </ul> </li> </ul> <p> <br /> </p> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">pool fund sdf:</span> </span> </span> </strong> </p> <p> <span style="color:#333333"> <span style="font-size:medium"> <span style="tab-stops:115.5pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sdff</span> </span> </span> </p> <p style="margin-left:44px"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">in lieu sdf sdf retail df sdf and used f interest free terms, new retail df, including sdf, sdf, sdf sdf gd, f sdf sdf sdf of eligible sdf identified f will receisve an unapplied f into the dealer's sdf df fund account. f amount of the sdf will be dfg upon s merchandise amfount (sdf less sdf df the f sdf the pool sdf rate effsdfctive at the sdf the sdf is sdf settledsdf the following sdf identifies sdf current sdf fund sdf rates per sdf:</span> </span> </span> </p> <table cellspacing="0" style="border-collapse:collapse; width:483px"> <tbody> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; height:20px; width:187px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">f dsf</span> </span> </span> </strong> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:20px; width:80px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdf %</span> </span> </span> </strong> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:20px; width:113px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdf date</span> </span> </span> </strong> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:20px; width:103px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">end sdf</span> </span> </span> </strong> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdf6 dsf sdf</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1.50%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdf df f</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">2.50%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10sdf31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdf f f</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">2.50%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdf series sdf</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">3.50%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">03/10/2014</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/dsf/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">combindses</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">4.50%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dsf</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">4.50%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">spdsffhf</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">3.00%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">winsddrowersdsf</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1.50%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdf &amp; foradsfe (other)</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1.00%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dsfsd</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">0.50%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sf</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1.00%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">fd dsf</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1.00%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:20px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dsf</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1.00%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:20px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:21px; width:187px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dsf</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:21px; width:80px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1.50%</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:21px; width:113px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/26/2013</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:21px; width:103px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">10/31/2014</span> </span> </span> </p> </td> </tr> </tbody> </table> <p style="margin-right:20px"> <br /> </p> <p style="margin-right:20px"> <span style="tab-stops:269.25pt"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">utilizing single pool funds: uanb9004&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span> </span> </span> </strong> </span> </p> <p style="margin-right:20px"> <br /> </p> <p style="margin-left:44px; margin-right:20px"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">eligible uses of pool funds:</span> </span> </span> </strong> </p> <p style="margin-left:44px"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">psdool f may be f on any eligible df as df above for the following uses:</span> </span> </span> </p> <ul> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">buy down interest rates ffsd sdf sdf sdf </span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">buy sdf sdf with dsf sf sdf</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">buy df rate df with dsf df sdf</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">purchase f protection</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df jdsdlfink df</span> </span> </span> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt"> pro</span> </span> </span> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">on-line df cxf sdf</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">pay for sdf dsf fees</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">pay f desdfere sdf df finance costs</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">pay for df sdf sdf with f df dsfsdff</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">other f that may be sdf by the company and df as a sales incentive bulletin</span> </span> </span> </li> </ul> <p style="margin-right:20px"> <br /> </p> <p style="margin-right:20px"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">remarketing:</span> </span> </span> </strong> </p> <p style="margin-right:20px"> <br /> </p> <p style="margin-left:44px"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">used fsd that is sdf through sdf services will be eligible to df the following f funsdfd credits or sfd frsdfee terms:</span> </span> </span> </p> <ul> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdfsd through </span> </span> </span> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdf psro</span> </span> </span> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">auctions:</span> </span> </span> <ul style="list-style-type:circle"> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df equipment that is eligible for df sdf dsf - f dealer will receive a sdf credit of 0.df% of the df price.</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dsf f not sdf for sdf f funds - sdf sdf will receive 1st of 3rd month interest free terms.</span> </span> </span> </li> </ul> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df of repossessions through bid fs or contract sdf offer:</span> </span> </span> <ul style="list-style-type:circle"> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">used equipment sdf is eligible for fsdf pool funds - purchasing dsf will receive a spf sd of df% of the df price.</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">used df not eligible for single pool funds - f dealer will dsf 1st of 5th month interest df terms.</span> </span> </span> </li> </ul> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sdf dsf dsf leases that sdf not purchased by the f f sdf fds:</span> </span> </span> <ul style="list-style-type:circle"> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">used sdf that is eligible sdf single sdf funds - dsf dsf will receive sdf df sdf of 1% of the purchase price.</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">f</span> </span> </span> </li> </ul> </li> </ul> <p style="margin-left:44px; margin-right:20px"> <br /> </p> <p style="margin-left:44px; margin-right:20px"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">the f df for a piece of sdf must equal a minimum of $sfd to be f for df to the f sdf. all pool fund sdf df df df will be batch df fd that sdf be f f periodic sfd throughout the monthsdf sdf it may take several days for the dsf pool fund sdf to appear on the df f fund statement. </span> </span> </span> </p> <p style="margin-left:44px; margin-right:20px"> <br /> </p> <p> <strong> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1. <u>d sd sd:</u> </span> </span> </span> </strong> </p> <table cellspacing="0" style="border-collapse:collapse"> <tbody> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; width:210px" valign="top"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt"> <span style="tab-stops:104.25pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sd</span> </span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; width:114px" valign="top"> <p style="text-align:center"> <strong> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sd id</span> </span> </span> </strong> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:28px; width:210px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">0.0% sd - 60 sds</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:28px; width:114px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sd</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:29px; width:210px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1.9% sdd - 72 sd</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:29px; width:114px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">ds</span> </span> </span> </p> </td> </tr> </tbody> </table> <p> <strong> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">2. (or) sd sd (d) sd sd:</span> </span> </span> </strong> </p> <table cellspacing="0" style="border-collapse:collapse"> <tbody> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; height:20px; width:210px" valign="top"> <br /> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:20px; width:114px"> <p style="text-align:center"> <strong> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dezxcaler zcx</span> </span> </span> </strong> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:20px; width:108px"> <p style="text-align:center"> <strong> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">program id</span> </span> </span> </strong> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:29px; width:210px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">0.0% fixed - zx months</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:29px; width:114px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">2.5as</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:29px; width:108px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">as</span> </span> </span> </p> </td> </tr> </tbody> </table> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">3. <u>(or) sd sd:</u> </span> </span> </span> </strong> </p> <table cellspacing="0" style="border-collapse:collapse"> <tbody> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; width:210px" valign="top"> <br /> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; width:114px" valign="top"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">asa s</span> </span> </span> </strong> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:22px; width:210px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1.9% as use - 36 months</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:22px; width:114px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sas</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:23px; width:210px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">2.as% s use - 48 s</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:23px; width:114px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">as</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:23px; width:210px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">2.9% s s – 60 months</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:23px; width:114px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">as</span> </span> </span> </p> </td> </tr> </tbody> </table> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level 1 state rates .75% higher <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; level 2 state rates 1.50% higher</span> </span> </span> </p> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">4. <u>(or) sd d:</u> </span> </span> </span> </strong> </p> <table cellspacing="0" style="border-collapse:collapse"> <tbody> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; width:210px" valign="top"> <br /> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; width:114px" valign="top"> <p style="text-align:center"> <strong> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d id</span> </span> </span> </strong> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:25px; width:210px"> <p style="text-align:center"> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">$3,000 sd d</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:25px; width:114px"> <p style="text-align:center"> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dsds</span> </span> </span> </p> </td> </tr> </tbody> </table> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">5. <u>(and) sd d options:</u> </span> </span> </span> </strong> </p> <table cellspacing="0" style="border-collapse:collapse; width:4.5in"> <tbody> <tr> <td style="background-color:white; border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; height:17px; width:210px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d sd</span> </span> </span> </strong> </p> </td> <td style="background-color:white; border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:17px; width:114px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d d sd</span> </span> </span> </strong> </p> </td> <td style="background-color:white; border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:17px; width:108px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d id</span> </span> </span> </strong> </p> </td> </tr> <tr> <td style="background-color:white; border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:22px; width:210px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d or newersd</span> </span> </span> </p> </td> <td style="background-color:white; border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:22px; width:114px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sd2,d</span> </span> </span> </p> </td> <td rowspan="2" style="background-color:white; border-bottom:#000000; border-left:#000000; border-right:1px solid black; border-top:#000000; height:22px; width:108px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sd</span> </span> </span> </p> </td> </tr> <tr> <td style="background-color:white; border-bottom:#000000; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:23px; width:210px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">d-d</span> </span> </span> </p> </td> <td style="background-color:white; border-bottom:#000000; border-left:#000000; border-right:1px solid black; border-top:#000000; height:23px; width:114px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">sds1,000</span> </span> </span> </p> </td> </tr> <tr> <td style="background-color:white; border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:23px; width:210px"> <p style="text-align:center"> <br /> </p> </td> <td style="background-color:white; border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:23px; width:114px"> <p style="text-align:center"> <br /> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:23px; width:108px"> <p> <br /> </p> </td> </tr> </tbody> </table> <p> <br /> </p> <p> <br /> </p> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1. <u>df sd options:</u> </span> </span> </span> </strong> </p> <table cellspacing="0" style="border-collapse:collapse; width:6.5in"> <tbody> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; height:105px; width:415px"> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">no interest if sd in full fdf 12 df (d.9% apr applies if sd paid in full)dsds</span> </span> </span> </strong> </p> <ul> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">1.5% total sd df (includes 0.5% df fee</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df use - payments of 2.5f of df financed, df sd - 3.0% of f f</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">0% df payment</span> </span> </span> </li> </ul> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:105px; width:96px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df</span> </span> </span> </p> </td> <td rowspan="2" style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:105px; width:113px"> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df df: <br />36 - dfx300 <br />37 - f <br />3d - x70df0* <br />19 - df</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:89px; width:415px"> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">4.9% df f - 48 months</span> </span> </span> </strong> </p> <ul> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df use only - f of 2.3% of amount df</span> </span> </span> </li> <li> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">0% down df</span> </span> </span> </li> </ul> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:89px; width:96px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df <br />f df</span> </span> </span> </p> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">f</span> </span> </span> </p> </td> </tr> </tbody> </table> <p> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; *for f and older select series models only</span> </span> </span> </p> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">2. <u>installment finance option:</u> </span> </span> </span> </strong> </p> <table cellspacing="0" style="border-collapse:collapse; width:6.5in"> <tbody> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; height:28px; width:288px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">df df</span> </span> </span> </strong> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:28px; width:222px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">f</span> </span> </span> </strong> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:28px; width:114px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">f id</span> </span> </span> </strong> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:43px; width:288px"> <p> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfdfgfdg </span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:43px; width:222px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">0.0% dfg – 60 months</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:43px; width:114px"> <p style="text-align:center"> <span style="color:black"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dffd</span> </span> </span> </p> </td> </tr> </tbody> </table> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">3. <u>(and) dfg options:</u> </span> </span> </span> </strong> </p> <table cellspacing="0" style="border-collapse:collapse; width:7.5in"> <tbody> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:1px solid black; height:35px; width:288px"> <p> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfg dfg</span> </span> </span> </strong> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:35px; width:138px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">fg fdg</span> </span> </span> </strong> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:35px; width:90px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">fdg dfg</span> </span> </span> </strong> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:35px; width:97px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfg dfg</span> </span> </span> </strong> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:1px solid black; height:35px; width:107px"> <p style="text-align:center"> <strong> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfg fg</span> </span> </span> </strong> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:56px; width:288px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfgdfg: <br />fg</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:56px; width:138px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">n/a</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:56px; width:90px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfgdfg</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:56px; width:97px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">31oct14</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:56px; width:107px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfgfd</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:41px; width:288px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">model gdfg dfg, df</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:41px; width:138px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfgdf</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:41px; width:90px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">g</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:41px; width:97px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">31oct14</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:41px; width:107px"> <p style="text-align:center"> <span style="color:#333333"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfg</span> </span> </span> </p> </td> </tr> <tr> <td style="border-bottom:1px solid black; border-left:1px solid black; border-right:1px solid black; border-top:#000000; height:23px; width:288px"> <p style="text-align:center"> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">all fgfdgdfg</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:23px; width:138px"> <p style="text-align:center"> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">ndfg</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:23px; width:90px"> <p style="text-align:center"> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfg</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:23px; width:97px"> <p style="text-align:center"> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfg</span> </span> </span> </p> </td> <td style="border-bottom:1px solid black; border-left:#000000; border-right:1px solid black; border-top:#000000; height:23px; width:107px"> <p style="text-align:center"> <span style="color:red"> <span style="font-family:'verdana',sans-serif"> <span style="font-size:10pt">dfg</span> </span> </span> </p> </td> </tr> </tbody> </table> <p> <br /> </p> <p> <br /> </p>
ernestbuffington/PHP-Nuke-Titanium
includes/wysiwyg/ckeditor/tests/plugins/pastefromword/generated/_fixtures/Tickets/12406Doc1/word2013/expected_ie8.html
HTML
gpl-3.0
65,641
/* Atmosphere Autopilot, plugin for Kerbal Space Program. Copyright (C) 2015-2016, Baranin Alexander aka Boris-Barboris. Atmosphere Autopilot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Atmosphere Autopilot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Atmosphere Autopilot. If not, see <http://www.gnu.org/licenses/>. */ using System; using System.Collections.Generic; using System.Linq; using System.Text; using UnityEngine; namespace AtmosphereAutopilot { public sealed class MouseDirector : StateController { internal MouseDirector(Vessel v) : base(v, "Mouse Director", 88437227) { } //FlightModel imodel; DirectorController dir_c; ProgradeThrustController thrust_c; public override void InitializeDependencies(Dictionary<Type, AutopilotModule> modules) { //imodel = modules[typeof(FlightModel)] as FlightModel; dir_c = modules[typeof(DirectorController)] as DirectorController; thrust_c = modules[typeof(ProgradeThrustController)] as ProgradeThrustController; } protected override void OnActivate() { dir_c.Activate(); thrust_c.Activate(); MessageManager.post_status_message("Mouse Director enabled"); } protected override void OnDeactivate() { dir_c.Deactivate(); thrust_c.Deactivate(); if (indicator != null) indicator.enabled = false; MessageManager.post_status_message("Mouse Director disabled"); } public override void ApplyControl(FlightCtrlState cntrl) { if (vessel.LandedOrSplashed()) return; // // follow camera direction // dir_c.ApplyControl(cntrl, camera_direction, Vector3d.zero); if (thrust_c.spd_control_enabled) thrust_c.ApplyControl(cntrl, thrust_c.setpoint.mps()); } //bool camera_correct = false; Vector3 camera_direction; static CenterIndicator indicator; static Camera camera_attached; public override void OnUpdate() { if (HighLogic.LoadedSceneIsFlight && CameraManager.Instance.currentCameraMode == CameraManager.CameraMode.Flight) { //camera_correct = true; Camera maincamera = FlightCamera.fetch.mainCamera; camera_direction = maincamera.cameraToWorldMatrix.MultiplyPoint(Vector3.back) - FlightCamera.fetch.mainCamera.transform.position; // let's draw a couple of lines to show direction if (indicator == null || camera_attached != maincamera) { indicator = maincamera.gameObject.GetComponent<CenterIndicator>(); if (indicator == null) indicator = maincamera.gameObject.AddComponent<CenterIndicator>(); camera_attached = maincamera; } indicator.enabled = true; } else { //camera_correct = false; indicator.enabled = false; } } [AutoGuiAttr("Director controller GUI", true)] public bool DirGUI { get { return dir_c.IsShown(); } set { if (value) dir_c.ShowGUI(); else dir_c.UnShowGUI(); } } [AutoGuiAttr("Thrust controller GUI", true)] public bool PTCGUI { get { return thrust_c.IsShown(); } set { if (value) thrust_c.ShowGUI(); else thrust_c.UnShowGUI(); } } protected override void _drawGUI(int id) { close_button(); GUILayout.BeginVertical(); AutoGUI.AutoDrawObject(this); thrust_c.SpeedCtrlGUIBlock(); GUILayout.EndVertical(); GUI.DragWindow(); } public class CenterIndicator : MonoBehaviour { Material mat = new Material(Shader.Find("Sprites/Default")); Vector3 startVector = new Vector3(0.494f, 0.5f, -0.001f); Vector3 endVector = new Vector3(0.506f, 0.5f, -0.001f); //public new bool enabled = false; public void OnPostRender() { if (enabled) { GL.PushMatrix(); mat.SetPass(0); mat.color = Color.red; GL.LoadOrtho(); GL.Begin(GL.LINES); GL.Color(Color.red); GL.Vertex(startVector); GL.Vertex(endVector); GL.End(); GL.PopMatrix(); enabled = false; } } } } }
Boris-Barboris/AtmosphereAutopilot
AtmosphereAutopilot/Modules/MouseDirector.cs
C#
gpl-3.0
5,249
/* * Copyright (c) 2016. * Modified by Neurophobic Animal on 07/06/2016. */ package cm.aptoide.pt.dataprovider.model.v7; import java.util.List; /** * List of various malware reasons http://ws2.aptoide .com/api/7/getApp/apk_md5sum/7de07d96488277d8d76eafa2ef66f5a8 * <p> * <p> * RANK2: http://ws2.aptoide.com/api/7/getApp/apk_md5sum/7de07d96488277d8d76eafa2ef66f5a8 * http://ws2.aptoide.com/api/7/getApp/apk_md5sum/06c9eb56b787b6d3b606d68473a38f47 * <p> * RANK3: http://ws2.aptoide.com/api/7/getApp/apk_md5sum/18f0d5bdb9df1e0e27604890113c3331 * http://ws2.aptoide.com/api/7/getApp/apk_md5sum/74cbfde9dc6da43d3d14f4df9cdb9f2f * <p> * Rank can be: TRUSTED, WARNING, UNKNOWN, CRITICAL */ public class Malware { public static final String PASSED = "passed"; public static final String WARN = "warn"; public static final String GOOGLE_PLAY = "Google Play"; private Rank rank; private Reason reason; private String added; private String modified; public Malware() { } public Rank getRank() { return this.rank; } public void setRank(Rank rank) { this.rank = rank; } public Reason getReason() { return this.reason; } public void setReason(Reason reason) { this.reason = reason; } public String getAdded() { return this.added; } public void setAdded(String added) { this.added = added; } public String getModified() { return this.modified; } public void setModified(String modified) { this.modified = modified; } public int hashCode() { final int PRIME = 59; int result = 1; final Object $rank = this.getRank(); result = result * PRIME + ($rank == null ? 43 : $rank.hashCode()); final Object $reason = this.getReason(); result = result * PRIME + ($reason == null ? 43 : $reason.hashCode()); final Object $added = this.getAdded(); result = result * PRIME + ($added == null ? 43 : $added.hashCode()); final Object $modified = this.getModified(); result = result * PRIME + ($modified == null ? 43 : $modified.hashCode()); return result; } protected boolean canEqual(Object other) { return other instanceof Malware; } public enum Rank { TRUSTED, WARNING, UNKNOWN, CRITICAL } public static class Reason { private Reason.SignatureValidated signatureValidated; private Reason.ThirdPartyValidated thirdpartyValidated; private Reason.Manual manual; private Reason.Scanned scanned; public Reason() { } public SignatureValidated getSignatureValidated() { return this.signatureValidated; } public void setSignatureValidated(SignatureValidated signatureValidated) { this.signatureValidated = signatureValidated; } public ThirdPartyValidated getThirdpartyValidated() { return this.thirdpartyValidated; } public void setThirdpartyValidated(ThirdPartyValidated thirdpartyValidated) { this.thirdpartyValidated = thirdpartyValidated; } public Manual getManual() { return this.manual; } public void setManual(Manual manual) { this.manual = manual; } public Scanned getScanned() { return this.scanned; } public void setScanned(Scanned scanned) { this.scanned = scanned; } protected boolean canEqual(Object other) { return other instanceof Reason; } public enum Status { passed, failed, blacklisted, warn } public static class SignatureValidated { private String date; private Reason.Status status; private String signatureFrom; public SignatureValidated() { } public String getDate() { return this.date; } public void setDate(String date) { this.date = date; } public Status getStatus() { return this.status; } public void setStatus(Status status) { this.status = status; } public String getSignatureFrom() { return this.signatureFrom; } public void setSignatureFrom(String signatureFrom) { this.signatureFrom = signatureFrom; } protected boolean canEqual(Object other) { return other instanceof SignatureValidated; } public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof SignatureValidated)) return false; final SignatureValidated other = (SignatureValidated) o; if (!other.canEqual((Object) this)) return false; final Object this$date = this.getDate(); final Object other$date = other.getDate(); if (this$date == null ? other$date != null : !this$date.equals(other$date)) return false; final Object this$status = this.getStatus(); final Object other$status = other.getStatus(); if (this$status == null ? other$status != null : !this$status.equals(other$status)) { return false; } final Object this$signatureFrom = this.getSignatureFrom(); final Object other$signatureFrom = other.getSignatureFrom(); if (this$signatureFrom == null ? other$signatureFrom != null : !this$signatureFrom.equals(other$signatureFrom)) { return false; } return true; } public int hashCode() { final int PRIME = 59; int result = 1; final Object $date = this.getDate(); result = result * PRIME + ($date == null ? 43 : $date.hashCode()); final Object $status = this.getStatus(); result = result * PRIME + ($status == null ? 43 : $status.hashCode()); final Object $signatureFrom = this.getSignatureFrom(); result = result * PRIME + ($signatureFrom == null ? 43 : $signatureFrom.hashCode()); return result; } public String toString() { return "Malware.Reason.SignatureValidated(date=" + this.getDate() + ", status=" + this.getStatus() + ", signatureFrom=" + this.getSignatureFrom() + ")"; } } public static class ThirdPartyValidated { private String date; private String store; public ThirdPartyValidated() { } public String getDate() { return this.date; } public void setDate(String date) { this.date = date; } public String getStore() { return this.store; } public void setStore(String store) { this.store = store; } protected boolean canEqual(Object other) { return other instanceof ThirdPartyValidated; } public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof ThirdPartyValidated)) return false; final ThirdPartyValidated other = (ThirdPartyValidated) o; if (!other.canEqual((Object) this)) return false; final Object this$date = this.getDate(); final Object other$date = other.getDate(); if (this$date == null ? other$date != null : !this$date.equals(other$date)) return false; final Object this$store = this.getStore(); final Object other$store = other.getStore(); if (this$store == null ? other$store != null : !this$store.equals(other$store)) { return false; } return true; } public int hashCode() { final int PRIME = 59; int result = 1; final Object $date = this.getDate(); result = result * PRIME + ($date == null ? 43 : $date.hashCode()); final Object $store = this.getStore(); result = result * PRIME + ($store == null ? 43 : $store.hashCode()); return result; } public String toString() { return "Malware.Reason.ThirdPartyValidated(date=" + this.getDate() + ", store=" + this.getStore() + ")"; } } public static class Manual { private String date; private Reason.Status status; private List<String> av; public Manual() { } public String getDate() { return this.date; } public void setDate(String date) { this.date = date; } public Status getStatus() { return this.status; } public void setStatus(Status status) { this.status = status; } public List<String> getAv() { return this.av; } public void setAv(List<String> av) { this.av = av; } protected boolean canEqual(Object other) { return other instanceof Manual; } public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Manual)) return false; final Manual other = (Manual) o; if (!other.canEqual((Object) this)) return false; final Object this$date = this.getDate(); final Object other$date = other.getDate(); if (this$date == null ? other$date != null : !this$date.equals(other$date)) return false; final Object this$status = this.getStatus(); final Object other$status = other.getStatus(); if (this$status == null ? other$status != null : !this$status.equals(other$status)) { return false; } final Object this$av = this.getAv(); final Object other$av = other.getAv(); if (this$av == null ? other$av != null : !this$av.equals(other$av)) return false; return true; } public int hashCode() { final int PRIME = 59; int result = 1; final Object $date = this.getDate(); result = result * PRIME + ($date == null ? 43 : $date.hashCode()); final Object $status = this.getStatus(); result = result * PRIME + ($status == null ? 43 : $status.hashCode()); final Object $av = this.getAv(); result = result * PRIME + ($av == null ? 43 : $av.hashCode()); return result; } public String toString() { return "Malware.Reason.Manual(date=" + this.getDate() + ", status=" + this.getStatus() + ", av=" + this.getAv() + ")"; } } public static class Scanned { private Reason.Status status; private String date; private List<Reason.Scanned.AvInfo> avInfo; public Scanned() { } public Status getStatus() { return this.status; } public void setStatus(Status status) { this.status = status; } public String getDate() { return this.date; } public void setDate(String date) { this.date = date; } public List<AvInfo> getAvInfo() { return this.avInfo; } public void setAvInfo(List<AvInfo> avInfo) { this.avInfo = avInfo; } protected boolean canEqual(Object other) { return other instanceof Scanned; } public static class AvInfo { private List<Reason.Scanned.AvInfo.Infection> infections; private String name; public AvInfo() { } public List<Infection> getInfections() { return this.infections; } public void setInfections(List<Infection> infections) { this.infections = infections; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } protected boolean canEqual(Object other) { return other instanceof AvInfo; } public static class Infection { private String name; private String description; public Infection() { } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } protected boolean canEqual(Object other) { return other instanceof Infection; } public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Infection)) return false; final Infection other = (Infection) o; if (!other.canEqual((Object) this)) return false; final Object this$name = this.getName(); final Object other$name = other.getName(); if (this$name == null ? other$name != null : !this$name.equals(other$name)) { return false; } final Object this$description = this.getDescription(); final Object other$description = other.getDescription(); if (this$description == null ? other$description != null : !this$description.equals(other$description)) { return false; } return true; } public int hashCode() { final int PRIME = 59; int result = 1; final Object $name = this.getName(); result = result * PRIME + ($name == null ? 43 : $name.hashCode()); final Object $description = this.getDescription(); result = result * PRIME + ($description == null ? 43 : $description.hashCode()); return result; } public String toString() { return "Malware.Reason.Scanned.AvInfo.Infection(name=" + this.getName() + ", description=" + this.getDescription() + ")"; } } public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof AvInfo)) return false; final AvInfo other = (AvInfo) o; if (!other.canEqual((Object) this)) return false; final Object this$infections = this.getInfections(); final Object other$infections = other.getInfections(); if (this$infections == null ? other$infections != null : !this$infections.equals(other$infections)) { return false; } final Object this$name = this.getName(); final Object other$name = other.getName(); if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false; return true; } public int hashCode() { final int PRIME = 59; int result = 1; final Object $infections = this.getInfections(); result = result * PRIME + ($infections == null ? 43 : $infections.hashCode()); final Object $name = this.getName(); result = result * PRIME + ($name == null ? 43 : $name.hashCode()); return result; } public String toString() { return "Malware.Reason.Scanned.AvInfo(infections=" + this.getInfections() + ", name=" + this.getName() + ")"; } } public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Scanned)) return false; final Scanned other = (Scanned) o; if (!other.canEqual((Object) this)) return false; final Object this$status = this.getStatus(); final Object other$status = other.getStatus(); if (this$status == null ? other$status != null : !this$status.equals(other$status)) { return false; } final Object this$date = this.getDate(); final Object other$date = other.getDate(); if (this$date == null ? other$date != null : !this$date.equals(other$date)) return false; final Object this$avInfo = this.getAvInfo(); final Object other$avInfo = other.getAvInfo(); if (this$avInfo == null ? other$avInfo != null : !this$avInfo.equals(other$avInfo)) { return false; } return true; } public int hashCode() { final int PRIME = 59; int result = 1; final Object $status = this.getStatus(); result = result * PRIME + ($status == null ? 43 : $status.hashCode()); final Object $date = this.getDate(); result = result * PRIME + ($date == null ? 43 : $date.hashCode()); final Object $avInfo = this.getAvInfo(); result = result * PRIME + ($avInfo == null ? 43 : $avInfo.hashCode()); return result; } public String toString() { return "Malware.Reason.Scanned(status=" + this.getStatus() + ", date=" + this.getDate() + ", avInfo=" + this.getAvInfo() + ")"; } } public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Reason)) return false; final Reason other = (Reason) o; if (!other.canEqual((Object) this)) return false; final Object this$signatureValidated = this.getSignatureValidated(); final Object other$signatureValidated = other.getSignatureValidated(); if (this$signatureValidated == null ? other$signatureValidated != null : !this$signatureValidated.equals(other$signatureValidated)) { return false; } final Object this$thirdpartyValidated = this.getThirdpartyValidated(); final Object other$thirdpartyValidated = other.getThirdpartyValidated(); if (this$thirdpartyValidated == null ? other$thirdpartyValidated != null : !this$thirdpartyValidated.equals(other$thirdpartyValidated)) { return false; } final Object this$manual = this.getManual(); final Object other$manual = other.getManual(); if (this$manual == null ? other$manual != null : !this$manual.equals(other$manual)) { return false; } final Object this$scanned = this.getScanned(); final Object other$scanned = other.getScanned(); if (this$scanned == null ? other$scanned != null : !this$scanned.equals(other$scanned)) { return false; } return true; } public int hashCode() { final int PRIME = 59; int result = 1; final Object $signatureValidated = this.getSignatureValidated(); result = result * PRIME + ($signatureValidated == null ? 43 : $signatureValidated.hashCode()); final Object $thirdpartyValidated = this.getThirdpartyValidated(); result = result * PRIME + ($thirdpartyValidated == null ? 43 : $thirdpartyValidated.hashCode()); final Object $manual = this.getManual(); result = result * PRIME + ($manual == null ? 43 : $manual.hashCode()); final Object $scanned = this.getScanned(); result = result * PRIME + ($scanned == null ? 43 : $scanned.hashCode()); return result; } public String toString() { return "Malware.Reason(signatureValidated=" + this.getSignatureValidated() + ", thirdpartyValidated=" + this.getThirdpartyValidated() + ", manual=" + this.getManual() + ", scanned=" + this.getScanned() + ")"; } } public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof Malware)) return false; final Malware other = (Malware) o; if (!other.canEqual((Object) this)) return false; final Object this$rank = this.getRank(); final Object other$rank = other.getRank(); if (this$rank == null ? other$rank != null : !this$rank.equals(other$rank)) return false; final Object this$reason = this.getReason(); final Object other$reason = other.getReason(); if (this$reason == null ? other$reason != null : !this$reason.equals(other$reason)) { return false; } final Object this$added = this.getAdded(); final Object other$added = other.getAdded(); if (this$added == null ? other$added != null : !this$added.equals(other$added)) return false; final Object this$modified = this.getModified(); final Object other$modified = other.getModified(); if (this$modified == null ? other$modified != null : !this$modified.equals(other$modified)) { return false; } return true; } public String toString() { return "Malware(rank=" + this.getRank() + ", reason=" + this.getReason() + ", added=" + this.getAdded() + ", modified=" + this.getModified() + ")"; } }
Aptoide/aptoide-client-v8
dataprovider/src/main/java/cm/aptoide/pt/dataprovider/model/v7/Malware.java
Java
gpl-3.0
20,548
using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Windows; // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 // アセンブリに関連付けられている情報を変更するには、 // これらの属性値を変更してください。 [assembly: AssemblyTitle("About")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("About")] [assembly: AssemblyCopyright("Copyright © 2016")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 // その型の ComVisible 属性を true に設定してください。 [assembly: ComVisible(false)] //ローカライズ可能なアプリケーションのビルドを開始するには、 //.csproj ファイルの <UICulture>CultureYouAreCodingWith</UICulture> を //<PropertyGroup> 内部で設定します。たとえば、 //ソース ファイルで英語を使用している場合、<UICulture> を en-US に設定します。次に、 //下の NeutralResourceLanguage 属性のコメントを解除します。下の行の "en-US" を //プロジェクト ファイルの UICulture 設定と一致するよう更新します。 //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] [assembly: ThemeInfo( ResourceDictionaryLocation.None, //テーマ固有のリソース ディクショナリが置かれている場所 //(リソースがページ、 //またはアプリケーション リソース ディクショナリに見つからない場合に使用されます) ResourceDictionaryLocation.SourceAssembly //汎用リソース ディクショナリが置かれている場所 //(リソースがページ、 //アプリケーション、またはいずれのテーマ固有のリソース ディクショナリにも見つからない場合に使用されます) )] // アセンブリのバージョン情報は次の 4 つの値で構成されています: // // メジャー バージョン // マイナー バージョン // ビルド番号 // Revision // // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を // 既定値にすることができます: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
tor4kichi/ReactiveFolder
Module/About/Properties/AssemblyInfo.cs
C#
gpl-3.0
2,785
/** * This file is part of veraPDF Parser, a module of the veraPDF project. * Copyright (c) 2015, veraPDF Consortium <info@verapdf.org> * All rights reserved. * * veraPDF Parser is free software: you can redistribute it and/or modify * it under the terms of either: * * The GNU General public license GPLv3+. * You should have received a copy of the GNU General Public License * along with veraPDF Parser as the LICENSE.GPL file in the root of the source * tree. If not, see http://www.gnu.org/licenses/ or * https://www.gnu.org/licenses/gpl-3.0.en.html. * * The Mozilla Public License MPLv2+. * You should have received a copy of the Mozilla Public License along with * veraPDF Parser as the LICENSE.MPL file in the root of the source tree. * If a copy of the MPL was not distributed with this file, you can obtain one at * http://mozilla.org/MPL/2.0/. */ package org.verapdf.cos.filters; import org.verapdf.as.filters.io.ASBufferingInFilter; import org.verapdf.as.io.ASInputStream; import org.verapdf.cos.COSKey; import org.verapdf.tools.EncryptionTools; import org.verapdf.tools.RC4Encryption; import java.io.IOException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; /** * Filter that decrypts data using RC4 cipher decryption. * * @author Sergey Shemyakov */ public class COSFilterRC4DecryptionDefault extends ASBufferingInFilter { public static final int MAXIMAL_KEY_LENGTH = 16; private RC4Encryption rc4; /** * Constructor. * * @param stream is stream with encrypted data. * @param objectKey contains object and generation numbers from object * identifier for object that is being decrypted. If it is * direct object, objectKey is taken from indirect object * that contains it. * @param encryptionKey is encryption key that is calculated from user * password and encryption dictionary. */ public COSFilterRC4DecryptionDefault(ASInputStream stream, COSKey objectKey, byte[] encryptionKey) throws IOException, NoSuchAlgorithmException { super(stream); initRC4(objectKey, encryptionKey); } @Override public int read(byte[] buffer, int size) throws IOException { if(this.bufferSize() == 0) { int bytesFed = (int) this.feedBuffer(getBufferCapacity()); if (bytesFed == -1) { return -1; } } byte[] encData = new byte[BF_BUFFER_SIZE]; int encDataLength = this.bufferPopArray(encData, size); if (encDataLength >= 0) { byte[] res = rc4.process(encData, 0, encDataLength); System.arraycopy(res, 0, buffer, 0, encDataLength); } return encDataLength; } @Override public int read(byte[] buffer, int off, int size) throws IOException { if(this.bufferSize() == 0) { int bytesFed = (int) this.feedBuffer(getBufferCapacity()); if (bytesFed == -1) { return -1; } } byte[] encData = new byte[BF_BUFFER_SIZE]; int encDataLength = this.bufferPopArray(encData, size); if (encDataLength >= 0) { byte[] res = rc4.process(encData, 0, encDataLength); System.arraycopy(res, 0, buffer, off, encDataLength); } return encDataLength; } @Override public void reset() throws IOException { super.reset(); this.rc4.reset(); } private void initRC4(COSKey objectKey, byte[] encryptionKey) throws NoSuchAlgorithmException { byte[] objectKeyDigest = getObjectKeyDigest(objectKey); MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(ASBufferingInFilter.concatenate(encryptionKey, encryptionKey.length, objectKeyDigest, objectKeyDigest.length)); byte[] resultEncryptionKey = md5.digest(); int keyLength = Math.min(MAXIMAL_KEY_LENGTH, encryptionKey.length + objectKeyDigest.length); rc4 = new RC4Encryption(Arrays.copyOf(resultEncryptionKey, keyLength)); } public static byte[] getObjectKeyDigest(COSKey objectKey) { byte[] res = new byte[5]; System.arraycopy(EncryptionTools.intToBytesLowOrderFirst( objectKey.getNumber()), 0, res, 0, 3); System.arraycopy(EncryptionTools.intToBytesLowOrderFirst( objectKey.getGeneration()), 0, res, 3, 2); return res; } }
shem-sergey/veraPDF-pdflib
src/main/java/org/verapdf/cos/filters/COSFilterRC4DecryptionDefault.java
Java
gpl-3.0
4,631
/*! \file DetectorDriver.cpp * \brief Main driver for event processing * \author S. N. Liddick * \date July 2, 2007 */ #include <algorithm> #include <fstream> #include <iomanip> #include <iostream> #include <iterator> #include <limits> #include <sstream> //This header is for decoding the XML ///@TODO The XML decoding should be moved out of this file and into a /// dedicated class. #include "pugixml.hpp" //These headers are core headers and are needed for basic functionality #include "DammPlotIds.hpp" #include "DetectorDriver.hpp" #include "DetectorLibrary.hpp" #include "Display.h" #include "Exceptions.hpp" #include "HighResTimingData.hpp" #include "RandomPool.hpp" #include "RawEvent.hpp" #include "TreeCorrelator.hpp" //These headers handle trace analysis #include "CfdAnalyzer.hpp" #include "FittingAnalyzer.hpp" #include "TauAnalyzer.hpp" #include "TraceAnalyzer.hpp" #include "TraceExtractor.hpp" #include "TraceFilterAnalyzer.hpp" #include "WaaAnalyzer.hpp" #include "WaveformAnalyzer.hpp" //These headers handle processing of specific detector types #include "BetaScintProcessor.hpp" #include "DoubleBetaProcessor.hpp" #include "Hen3Processor.hpp" #include "GeProcessor.hpp" #include "GeCalibProcessor.hpp" #include "IonChamberProcessor.hpp" #include "LiquidScintProcessor.hpp" #include "LogicProcessor.hpp" #include "McpProcessor.hpp" #include "NeutronScintProcessor.hpp" #include "PositionProcessor.hpp" #include "PspmtProcessor.hpp" #include "SsdProcessor.hpp" #include "TeenyVandleProcessor.hpp" #include "TemplateProcessor.hpp" #include "VandleProcessor.hpp" #include "ValidProcessor.hpp" //These headers are for handling experiment specific processing. #include "TemplateExpProcessor.hpp" #include "VandleOrnl2012Processor.hpp" #ifdef useroot //Some processors REQURE ROOT to function #include "Anl1471Processor.hpp" #include "IS600Processor.hpp" #include "RootProcessor.hpp" #include "TwoChanTimingProcessor.hpp" #endif using namespace std; using namespace dammIds::raw; DetectorDriver* DetectorDriver::instance = NULL; DetectorDriver* DetectorDriver::get() { if (!instance) instance = new DetectorDriver(); return instance; } DetectorDriver::DetectorDriver() : histo(OFFSET, RANGE, "DetectorDriver") { cfg_ = Globals::get()->configfile(); Messenger m; try { m.start("Loading Processors"); LoadProcessors(m); } catch (GeneralException &e) { /// Any exception in registering plots in Processors /// and possible other exceptions in creating Processors /// will be intercepted here m.fail(); cout << "Exception caught at DetectorDriver::DetectorDriver" << endl; cout << "\t" << e.what() << endl; throw; } catch (GeneralWarning &w) { cout << "Warning found at DetectorDriver::DetectorDriver" << endl; cout << "\t" << w.what() << endl; } m.done(); } DetectorDriver::~DetectorDriver() { for (vector<EventProcessor *>::iterator it = vecProcess.begin(); it != vecProcess.end(); it++) delete(*it); vecProcess.clear(); for (vector<TraceAnalyzer *>::iterator it = vecAnalyzer.begin(); it != vecAnalyzer.end(); it++) delete(*it); vecAnalyzer.clear(); instance = NULL; } void DetectorDriver::LoadProcessors(Messenger& m) { pugi::xml_document doc; pugi::xml_parse_result result = doc.load_file(cfg_.c_str()); if (!result) { stringstream ss; ss << "DetectorDriver: error parsing file " << cfg_; ss << " : " << result.description(); throw IOException(ss.str()); } DetectorLibrary::get(); pugi::xml_node driver = doc.child("Configuration").child("DetectorDriver"); for (pugi::xml_node processor = driver.child("Processor"); processor; processor = processor.next_sibling("Processor")) { string name = processor.attribute("name").value(); m.detail("Loading " + name); if (name == "BetaScintProcessor") { double gamma_beta_limit = processor.attribute("gamma_beta_limit").as_double(200.e-9); if (gamma_beta_limit == 200.e-9) m.warning("Using default gamme_beta_limit = 200e-9", 1); double energy_contraction = processor.attribute("energy_contraction").as_double(1.0); if (energy_contraction == 1) m.warning("Using default energy contraction = 1", 1); vecProcess.push_back(new BetaScintProcessor(gamma_beta_limit, energy_contraction)); } else if (name == "GeProcessor") { double gamma_threshold = processor.attribute("gamma_threshold").as_double(1.0); if (gamma_threshold == 1.0) m.warning("Using default gamma_threshold = 1.0", 1); double low_ratio = processor.attribute("low_ratio").as_double(1.0); if (low_ratio == 1.0) m.warning("Using default low_ratio = 1.0", 1); double high_ratio = processor.attribute("high_ratio").as_double(3.0); if (high_ratio == 3.0) m.warning("Using default high_ratio = 3.0", 1); double sub_event = processor.attribute("sub_event").as_double(100.e-9); if (sub_event == 100.e-9) m.warning("Using default sub_event = 100e-9", 1); double gamma_beta_limit = processor.attribute("gamma_beta_limit").as_double(200.e-9); if (gamma_beta_limit == 200.e-9) m.warning("Using default gamme_beta_limit = 200e-9", 1); double gamma_gamma_limit = processor.attribute("gamma_gamma_limit").as_double(200.e-9); if (gamma_gamma_limit == 200.e-9) m.warning("Using default gamma_gamma_limit = 200e-9", 1); double cycle_gate1_min = processor.attribute("cycle_gate1_min").as_double(0.0); if (cycle_gate1_min == 0.0) m.warning("Using default cycle_gate1_min = 0.0", 1); double cycle_gate1_max = processor.attribute("cycle_gate1_max").as_double(0.0); if (cycle_gate1_max == 0.0) m.warning("Using default cycle_gate1_max = 0.0", 1); double cycle_gate2_min = processor.attribute("cycle_gate2_min").as_double(0.0); if (cycle_gate2_min == 0.0) m.warning("Using default cycle_gate2_min = 0.0", 1); double cycle_gate2_max = processor.attribute("cycle_gate2_max").as_double(0.0); if (cycle_gate2_max == 0.0) m.warning("Using default cycle_gate2_max = 0.0", 1); vecProcess.push_back(new GeProcessor(gamma_threshold, low_ratio, high_ratio, sub_event, gamma_beta_limit, gamma_gamma_limit, cycle_gate1_min, cycle_gate1_max, cycle_gate2_min, cycle_gate2_max)); } else if (name == "GeCalibProcessor") { double gamma_threshold = processor.attribute("gamma_threshold").as_double(1); double low_ratio = processor.attribute("low_ratio").as_double(1); double high_ratio = processor.attribute("high_ratio").as_double(3); vecProcess.push_back(new GeCalibProcessor(gamma_threshold, low_ratio, high_ratio)); } else if (name == "Hen3Processor") { vecProcess.push_back(new Hen3Processor()); } else if (name == "IonChamberProcessor") { vecProcess.push_back(new IonChamberProcessor()); } else if (name == "LiquidScintProcessor") { vecProcess.push_back(new LiquidScintProcessor()); } else if (name == "LogicProcessor") { vecProcess.push_back(new LogicProcessor()); } else if (name == "NeutronScintProcessor") { vecProcess.push_back(new NeutronScintProcessor()); } else if (name == "PositionProcessor") { vecProcess.push_back(new PositionProcessor()); } else if (name == "SsdProcessor") { vecProcess.push_back(new SsdProcessor()); } else if (name == "VandleProcessor") { double res = processor.attribute("res").as_double(2.0); double offset = processor.attribute("offset").as_double(200.0); unsigned int numStarts = processor.attribute("NumStarts").as_int(2); vector<string> types = strings::tokenize(processor.attribute("types").as_string(),","); vecProcess.push_back(new VandleProcessor(types, res, offset, numStarts)); } else if (name == "TeenyVandleProcessor") { vecProcess.push_back(new TeenyVandleProcessor()); } else if (name == "DoubleBetaProcessor") { vecProcess.push_back(new DoubleBetaProcessor()); } else if (name == "PspmtProcessor") { vecProcess.push_back(new PspmtProcessor()); } else if (name == "TemplateProcessor") { vecProcess.push_back(new TemplateProcessor()); } else if (name == "TemplateExpProcessor") { vecProcess.push_back(new TemplateExpProcessor()); } #ifdef useroot //Certain process REQURE root to actually work else if (name == "Anl1471Processor") { vecProcess.push_back(new Anl1471Processor()); } else if (name == "TwoChanTimingProcessor") { vecProcess.push_back(new TwoChanTimingProcessor()); } else if (name == "IS600Processor") { vecProcess.push_back(new IS600Processor()); } else if (name == "VandleOrnl2012Processor") { vecProcess.push_back(new VandleOrnl2012Processor()); } else if (name == "RootProcessor") { vecProcess.push_back(new RootProcessor("tree.root", "tree")); } #endif else { stringstream ss; ss << "DetectorDriver: unknown processor type : " << name; throw GeneralException(ss.str()); } stringstream ss; for (pugi::xml_attribute_iterator ait = processor.attributes_begin(); ait != processor.attributes_end(); ++ait) { ss.str(""); ss << ait->name(); if (ss.str().compare("name") != 0) { ss << " = " << ait->value(); m.detail(ss.str(), 1); } } } for (pugi::xml_node analyzer = driver.child("Analyzer"); analyzer; analyzer = analyzer.next_sibling("Analyzer")) { string name = analyzer.attribute("name").value(); m.detail("Loading " + name); if(name == "TraceFilterAnalyzer") { bool findPileups = analyzer.attribute("FindPileup").as_bool(false); vecAnalyzer.push_back(new TraceFilterAnalyzer(findPileups)); } else if(name == "TauAnalyzer") { vecAnalyzer.push_back(new TauAnalyzer()); } else if (name == "TraceExtractor") { string type = analyzer.attribute("type").as_string(); string subtype = analyzer.attribute("subtype").as_string(); string tag = analyzer.attribute("tag").as_string(); vecAnalyzer.push_back(new TraceExtractor(type, subtype,tag)); } else if (name == "WaveformAnalyzer") { vecAnalyzer.push_back(new WaveformAnalyzer()); } else if (name == "CfdAnalyzer") { string type = analyzer.attribute("type").as_string(); vecAnalyzer.push_back(new CfdAnalyzer(type)); } else if (name == "WaaAnalyzer") { vecAnalyzer.push_back(new WaaAnalyzer()); } else if (name == "FittingAnalyzer") { string type = analyzer.attribute("type").as_string(); vecAnalyzer.push_back(new FittingAnalyzer(type)); } else { stringstream ss; ss << "DetectorDriver: unknown analyzer type" << name; throw GeneralException(ss.str()); } for (pugi::xml_attribute_iterator ait = analyzer.attributes_begin(); ait != analyzer.attributes_end(); ++ait) { stringstream ss; ss << ait->name(); if (ss.str().compare("name") != 0) { ss << " = " << ait->value(); m.detail(ss.str(), 1); } } } } void DetectorDriver::Init(RawEvent& rawev) { for (vector<TraceAnalyzer *>::iterator it = vecAnalyzer.begin(); it != vecAnalyzer.end(); it++) { (*it)->Init(); (*it)->SetLevel(20); } for (vector<EventProcessor *>::iterator it = vecProcess.begin(); it != vecProcess.end(); it++) { (*it)->Init(rawev); } try { ReadCalXml(); ReadWalkXml(); } catch (GeneralException &e) { //! Any exception in reading calibration and walk correction //! will be intercepted here cout << endl; cout << "Exception caught at DetectorDriver::Init" << endl; cout << "\t" << e.what() << endl; Messenger m; m.fail(); exit(EXIT_FAILURE); } catch (GeneralWarning &w) { cout << "Warning caught at DetectorDriver::Init" << endl; cout << "\t" << w.what() << endl; } } void DetectorDriver::ProcessEvent(RawEvent& rawev) { plot(dammIds::raw::D_NUMBER_OF_EVENTS, dammIds::GENERIC_CHANNEL); try { for (vector<ChanEvent*>::const_iterator it = rawev.GetEventList().begin(); it != rawev.GetEventList().end(); ++it) { PlotRaw((*it)); ThreshAndCal((*it), rawev); PlotCal((*it)); string place = (*it)->GetChanID().GetPlaceName(); if (place == "__9999") continue; if ( (*it)->IsSaturated() || (*it)->IsPileup() ) continue; double time = (*it)->GetTime(); double energy = (*it)->GetCalEnergy(); int location = (*it)->GetChanID().GetLocation(); EventData data(time, energy, location); TreeCorrelator::get()->place(place)->activate(data); } //!First round is preprocessing, where process result must be guaranteed //!to not to be dependent on results of other Processors. for (vector<EventProcessor*>::iterator iProc = vecProcess.begin(); iProc != vecProcess.end(); iProc++) if ( (*iProc)->HasEvent() ) (*iProc)->PreProcess(rawev); ///In the second round the Process is called, which may depend on other ///Processors. for (vector<EventProcessor *>::iterator iProc = vecProcess.begin(); iProc != vecProcess.end(); iProc++) if ( (*iProc)->HasEvent() ) (*iProc)->Process(rawev); // Clear all places in correlator (if of resetable type) for (map<string, Place*>::iterator it = TreeCorrelator::get()->places_.begin(); it != TreeCorrelator::get()->places_.end(); ++it) if ((*it).second->resetable()) (*it).second->reset(); } catch (GeneralException &e) { /// Any exception in activation of basic places, PreProcess and Process /// will be intercepted here cout << endl << Display::ErrorStr("Exception caught at DetectorDriver::ProcessEvent") << endl; throw; } catch (GeneralWarning &w) { cout << Display::WarningStr("Warning caught at " "DetectorDriver::ProcessEvent") << endl; cout << "\t" << Display::WarningStr(w.what()) << endl; } } /// Declare some of the raw and basic plots that are going to be used in the /// analysis of the data. These include raw and calibrated energy spectra, /// information about the run time, and count rates on the detectors. This /// also calls the DeclarePlots method that is present in all of the /// Analyzers and Processors. void DetectorDriver::DeclarePlots() { try { DeclareHistogram1D(D_HIT_SPECTRUM, S7, "channel hit spectrum"); DeclareHistogram2D(DD_RUNTIME_SEC, SE, S6, "run time - s"); DeclareHistogram2D(DD_RUNTIME_MSEC, SE, S7, "run time - ms"); if(Globals::get()->hasRaw()) { DetectorLibrary* modChan = DetectorLibrary::get(); DeclareHistogram1D(D_NUMBER_OF_EVENTS, S4, "event counter"); DeclareHistogram1D(D_HAS_TRACE, S8, "channels with traces"); DeclareHistogram1D(D_SUBEVENT_GAP, SE, "Time Between Channels in 10 ns / bin"); DeclareHistogram1D(D_EVENT_LENGTH, SE, "Event Length in ns"); DeclareHistogram1D(D_EVENT_GAP, SE, "Time Between Events in ns"); DeclareHistogram1D(D_EVENT_MULTIPLICITY, S7, "Number of Channels Event"); DeclareHistogram1D(D_BUFFER_END_TIME, SE, "Buffer Length in ns"); DetectorLibrary::size_type maxChan = modChan->size(); for (DetectorLibrary::size_type i = 0; i < maxChan; i++) { if (!modChan->HasValue(i)) { continue; } stringstream idstr; const Identifier &id = modChan->at(i); idstr << "M" << modChan->ModuleFromIndex(i) << " C" << modChan->ChannelFromIndex(i) << " - " << id.GetType() << ":" << id.GetSubtype() << " L" << id.GetLocation(); DeclareHistogram1D(D_RAW_ENERGY + i, SE, ("RawE " + idstr.str()).c_str() ); DeclareHistogram1D(D_FILTER_ENERGY + i, SE, ("FilterE " + idstr.str()).c_str() ); DeclareHistogram1D(D_SCALAR + i, SE, ("Scalar " + idstr.str()).c_str() ); if (Globals::get()->revision() == "A") DeclareHistogram1D(D_TIME + i, SE, ("Time " + idstr.str()).c_str() ); DeclareHistogram1D(D_CAL_ENERGY + i, SE, ("CalE " + idstr.str()).c_str() ); } } for (vector<TraceAnalyzer *>::const_iterator it = vecAnalyzer.begin(); it != vecAnalyzer.end(); it++) { (*it)->DeclarePlots(); } for (vector<EventProcessor *>::const_iterator it = vecProcess.begin(); it != vecProcess.end(); it++) { (*it)->DeclarePlots(); } } catch (exception &e) { cout << Display::ErrorStr("Exception caught at " "DetectorDriver::DeclarePlots") << endl; throw; } } int DetectorDriver::ThreshAndCal(ChanEvent *chan, RawEvent& rawev) { Identifier chanId = chan->GetChanID(); int id = chan->GetID(); string type = chanId.GetType(); string subtype = chanId.GetSubtype(); map<string, int> tags = chanId.GetTagMap(); bool hasStartTag = chanId.HasTag("start"); Trace &trace = chan->GetTrace(); RandomPool* randoms = RandomPool::get(); double energy = 0.0; if (type == "ignore" || type == "") return(0); if ( !trace.empty() ) { plot(D_HAS_TRACE, id); for (vector<TraceAnalyzer *>::iterator it = vecAnalyzer.begin(); it != vecAnalyzer.end(); it++) { (*it)->Analyze(trace, type, subtype, tags); } if (trace.HasValue("filterEnergy") ) { if (trace.GetValue("filterEnergy") > 0) { energy = trace.GetValue("filterEnergy"); plot(D_FILTER_ENERGY + id, energy); trace.SetValue("filterEnergyCal", cali.GetCalEnergy(chanId, trace.GetValue("filterEnergy"))); } else { energy = 0.0; } /** Calibrate pulses numbered 2 and forth, * add filterEnergyXCal to the trace */ int pulses = trace.GetValue("numPulses"); for (int i = 1; i < pulses; ++i) { stringstream energyName; energyName << "filterEnergy" << i + 1; stringstream energyCalName; energyCalName << "filterEnergy" << i + 1 << "Cal"; trace.SetValue(energyCalName.str(), cali.GetCalEnergy(chanId, trace.GetValue(energyName.str()))); } } if (trace.HasValue("calcEnergy") ) { energy = trace.GetValue("calcEnergy"); chan->SetEnergy(energy); } else if (!trace.HasValue("filterEnergy")) { energy = chan->GetEnergy() + randoms->Get(); } if (trace.HasValue("phase") ) { //Saves the time in nanoseconds chan->SetHighResTime((trace.GetValue("phase") * Globals::get()->adcClockInSeconds() + (double)chan->GetTrigTime() * Globals::get()->filterClockInSeconds()) * 1e9); } } else { /// otherwise, use the Pixie on-board calculated energy /// add a random number to convert an integer value to a /// uniformly distributed floating point energy = chan->GetEnergy() + randoms->Get(); chan->SetHighResTime(0.0); } /** Calibrate energy and apply the walk correction. */ double time, walk_correction; if(chan->GetHighResTime() == 0.0) { time = chan->GetTime(); //time is in clock ticks walk_correction = walk.GetCorrection(chanId, energy); } else { time = chan->GetHighResTime(); //time here is in ns walk_correction = walk.GetCorrection(chanId, trace.GetValue("tqdc")); } chan->SetCalEnergy(cali.GetCalEnergy(chanId, energy)); chan->SetCorrectedTime(time - walk_correction); rawev.GetSummary(type)->AddEvent(chan); DetectorSummary *summary; summary = rawev.GetSummary(type + ':' + subtype, false); if (summary != NULL) summary->AddEvent(chan); if(hasStartTag && type != "logic") { summary = rawev.GetSummary(type + ':' + subtype + ':' + "start", false); if (summary != NULL) summary->AddEvent(chan); } return(1); } int DetectorDriver::PlotRaw(const ChanEvent *chan) { plot(D_RAW_ENERGY + chan->GetID(), chan->GetEnergy()); return(0); } int DetectorDriver::PlotCal(const ChanEvent *chan) { plot(D_CAL_ENERGY + chan->GetID(), chan->GetCalEnergy()); return(0); } EventProcessor* DetectorDriver::GetProcessor(const std::string& name) const { for (vector<EventProcessor *>::const_iterator it = vecProcess.begin(); it != vecProcess.end(); it++) { if ( (*it)->GetName() == name ) return(*it); } return(NULL); } void DetectorDriver::ReadCalXml() { pugi::xml_document doc; pugi::xml_parse_result result = doc.load_file(cfg_.c_str()); if (!result) { stringstream ss; ss << "DetectorDriver: error parsing file" << cfg_; ss << " : " << result.description(); throw GeneralException(ss.str()); } Messenger m; m.start("Loading Calibration"); pugi::xml_node map = doc.child("Configuration").child("Map"); /** Note that before this reading in of the xml file, it was already * processed for the purpose of creating the channels map. * Some sanity checks (module and channel number) were done there * so they are not repeated here/ */ bool verbose = map.attribute("verbose_calibration").as_bool(); for (pugi::xml_node module = map.child("Module"); module; module = module.next_sibling("Module")) { int module_number = module.attribute("number").as_int(-1); for (pugi::xml_node channel = module.child("Channel"); channel; channel = channel.next_sibling("Channel")) { int ch_number = channel.attribute("number").as_int(-1); Identifier chanID = DetectorLibrary::get()->at(module_number, ch_number); bool calibrated = false; for (pugi::xml_node cal = channel.child("Calibration"); cal; cal = cal.next_sibling("Calibration")) { string model = cal.attribute("model").as_string("None"); double min = cal.attribute("min").as_double(0); double max = cal.attribute("max").as_double(numeric_limits<double>::max()); stringstream pars(cal.text().as_string()); vector<double> parameters; while (true) { double p; pars >> p; if (pars) parameters.push_back(p); else break; } if (verbose) { stringstream ss; ss << "Module " << module_number << ", channel " << ch_number << ": "; ss << " model-" << model; for (vector<double>::iterator it = parameters.begin(); it != parameters.end(); ++it) ss << " " << (*it); m.detail(ss.str(), 1); } cali.AddChannel(chanID, model, min, max, parameters); calibrated = true; } if (!calibrated && verbose) { stringstream ss; ss << "Module " << module_number << ", channel " << ch_number << ": "; ss << " non-calibrated"; m.detail(ss.str(), 1); } } } m.done(); } void DetectorDriver::ReadWalkXml() { pugi::xml_document doc; pugi::xml_parse_result result = doc.load_file(cfg_.c_str()); if (!result) { stringstream ss; ss << "DetectorDriver: error parsing file " << cfg_; ss << " : " << result.description(); throw GeneralException(ss.str()); } Messenger m; m.start("Loading Walk Corrections"); pugi::xml_node map = doc.child("Configuration").child("Map"); /** See comment in the similiar place at ReadCalXml() */ bool verbose = map.attribute("verbose_walk").as_bool(); for (pugi::xml_node module = map.child("Module"); module; module = module.next_sibling("Module")) { int module_number = module.attribute("number").as_int(-1); for (pugi::xml_node channel = module.child("Channel"); channel; channel = channel.next_sibling("Channel")) { int ch_number = channel.attribute("number").as_int(-1); Identifier chanID = DetectorLibrary::get()->at(module_number, ch_number); bool corrected = false; for (pugi::xml_node walkcorr = channel.child("WalkCorrection"); walkcorr; walkcorr = walkcorr.next_sibling("WalkCorrection")) { string model = walkcorr.attribute("model").as_string("None"); double min = walkcorr.attribute("min").as_double(0); double max = walkcorr.attribute("max").as_double( numeric_limits<double>::max()); stringstream pars(walkcorr.text().as_string()); vector<double> parameters; while (true) { double p; pars >> p; if (pars) parameters.push_back(p); else break; } if (verbose) { stringstream ss; ss << "Module " << module_number << ", channel " << ch_number << ": "; ss << " model: " << model; for (vector<double>::iterator it = parameters.begin(); it != parameters.end(); ++it) ss << " " << (*it); m.detail(ss.str(), 1); } walk.AddChannel(chanID, model, min, max, parameters); corrected = true; } if (!corrected && verbose) { stringstream ss; ss << "Module " << module_number << ", channel " << ch_number << ": "; ss << " not corrected for walk"; m.detail(ss.str(), 1); } } } m.done(); }
pixie16/paassdoc
Analysis/Utkscan/core/source/DetectorDriver.cpp
C++
gpl-3.0
28,756
/** * Copyright (C) 2005-2015, Stefan Strömberg <stestr@nethome.nu> * * This file is part of OpenNetHome. * * OpenNetHome is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * OpenNetHome is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package nu.nethome.zwave.messages.commandclasses; import nu.nethome.zwave.messages.commandclasses.framework.CommandAdapter; import nu.nethome.zwave.messages.commandclasses.framework.CommandClass; import nu.nethome.zwave.messages.commandclasses.framework.CommandCode; import nu.nethome.zwave.messages.commandclasses.framework.CommandProcessorAdapter; import nu.nethome.zwave.messages.framework.DecoderException; import java.io.ByteArrayOutputStream; public class MultiLevelSwitchCommandClass implements CommandClass { public static final int SWITCH_MULTILEVEL_SET = 0x01; public static final int SWITCH_MULTILEVEL_GET = 0x02; public static final int SWITCH_MULTILEVEL_REPORT = 0x03; public static final int SWITCH_MULTILEVEL_START_LEVEL_CHANGE = 0x04; public static final int SWITCH_MULTILEVEL_STOP_LEVEL_CHANGE = 0x05; public static final int SWITCH_MULTILEVEL_SUPPORTED_GET = 0x06; public static final int SWITCH_MULTILEVEL_SUPPORTED_REPORT = 0x07; public static final int COMMAND_CLASS = 0x26; public static class Set extends CommandAdapter { public final int level; public Set(int level) { super(COMMAND_CLASS, SWITCH_MULTILEVEL_SET); this.level = level; } public Set(byte[] data) throws DecoderException { super(data, COMMAND_CLASS, SWITCH_MULTILEVEL_SET); level = in.read(); } public static class Processor extends CommandProcessorAdapter<Set> { @Override public CommandCode getCommandCode() { return new CommandCode(COMMAND_CLASS, SWITCH_MULTILEVEL_SET); } @Override public Set process(byte[] command, CommandArgument argument) throws DecoderException { return process(new Set(command), argument); } } @Override protected void addCommandData(ByteArrayOutputStream result) { super.addCommandData(result); result.write(level); } } public static class Get extends CommandAdapter { public Get() { super(COMMAND_CLASS, SWITCH_MULTILEVEL_GET); } } public static class Report extends CommandAdapter { public final int level; public Report(int level) { super(COMMAND_CLASS, SWITCH_MULTILEVEL_REPORT); this.level = level; } public Report(byte[] data) throws DecoderException { super(data, COMMAND_CLASS, SWITCH_MULTILEVEL_REPORT); level = in.read(); } @Override protected void addCommandData(ByteArrayOutputStream result) { super.addCommandData(result); result.write(level); } public static class Processor extends CommandProcessorAdapter<Report> { @Override public CommandCode getCommandCode() { return new CommandCode(COMMAND_CLASS, SWITCH_MULTILEVEL_REPORT); } @Override public Report process(byte[] command, CommandArgument argument) throws DecoderException { return process(new Report(command), argument); } } @Override public String toString() { return String.format("{\"MultiLevelSwitch.Report\":{\"level\": %d}}", level); } } public static class StartLevelChange extends CommandAdapter { private static final int DIRECTION_BIT = 1<<6; private static final int IGNORE_START_POSITION_BIT = 1<<5; public enum Direction {UP, DOWN} public final Direction direction; public final Integer startLevel; public final int duration; public StartLevelChange(int startLevel, Direction direction) { super(COMMAND_CLASS, SWITCH_MULTILEVEL_START_LEVEL_CHANGE); this.direction = direction; this.startLevel = startLevel; duration = 0xFF; } public StartLevelChange(Direction direction) { super(COMMAND_CLASS, SWITCH_MULTILEVEL_START_LEVEL_CHANGE); this.direction = direction; this.startLevel = null; duration = 0xFF; } public StartLevelChange(Direction direction, int duration) { super(COMMAND_CLASS, SWITCH_MULTILEVEL_START_LEVEL_CHANGE); this.direction = direction; this.startLevel = null; this.duration = duration; } public StartLevelChange(byte[] data) throws DecoderException { super(data, COMMAND_CLASS, SWITCH_MULTILEVEL_START_LEVEL_CHANGE); int mode = in.read(); int startLevel = in.read(); direction = ((mode & DIRECTION_BIT) != 0) ? Direction.DOWN : Direction.UP; this.startLevel = ((mode & IGNORE_START_POSITION_BIT) != 0) ? null : startLevel; if (in.available() > 0) { duration = in.read(); } else { duration = 0xFF; } } public static class Processor extends CommandProcessorAdapter<Set> { @Override public CommandCode getCommandCode() { return new CommandCode(COMMAND_CLASS, SWITCH_MULTILEVEL_START_LEVEL_CHANGE); } @Override public Set process(byte[] command, CommandArgument argument) throws DecoderException { return process(new Set(command), argument); } } @Override protected void addCommandData(ByteArrayOutputStream result) { super.addCommandData(result); int mode = (direction == Direction.DOWN) ? DIRECTION_BIT : 0; int tempStartLevel = 0; if (startLevel == null) { mode |= IGNORE_START_POSITION_BIT; } else { tempStartLevel = startLevel; } result.write(mode); result.write(tempStartLevel); result.write(duration); } } public static class StopLevelChange extends CommandAdapter { public StopLevelChange() { super(COMMAND_CLASS, SWITCH_MULTILEVEL_STOP_LEVEL_CHANGE); } public StopLevelChange(byte[] data) throws DecoderException { super(data, COMMAND_CLASS, SWITCH_MULTILEVEL_STOP_LEVEL_CHANGE); } public static class Processor extends CommandProcessorAdapter<Set> { @Override public CommandCode getCommandCode() { return new CommandCode(COMMAND_CLASS, SWITCH_MULTILEVEL_STOP_LEVEL_CHANGE); } @Override public Set process(byte[] command, CommandArgument argument) throws DecoderException { return process(new Set(command), argument); } } @Override protected void addCommandData(ByteArrayOutputStream result) { super.addCommandData(result); } } }
NetHome/ZWave
src/main/java/nu/nethome/zwave/messages/commandclasses/MultiLevelSwitchCommandClass.java
Java
gpl-3.0
7,780
package com.bryanrm.ftptransfer.network; import android.content.Context; import android.os.AsyncTask; import android.widget.Toast; import com.bryanrm.ftptransfer.R; import com.bryanrm.ftptransfer.ftp.WrapFTP; import java.io.InputStream; /** * Created by Bryan R Martinez on 1/3/2017. */ public class Upload extends AsyncTask<Void, Void, Boolean> { private Context context; private String fileName; private InputStream inputStream; public Upload(Context context, String fileName, InputStream inputStream) { this.context = context; this.fileName = fileName; this.inputStream = inputStream; } @Override protected Boolean doInBackground(Void... params) { publishProgress(); return WrapFTP.getInstance().uploadFile(fileName, inputStream); } @Override protected void onProgressUpdate(Void... values) { Toast.makeText(context, context.getString(R.string.message_file_ul_start), Toast.LENGTH_SHORT).show(); } @Override protected void onPostExecute(Boolean result) { if (result) { Toast.makeText(context, context.getString(R.string.message_file_uploaded), Toast.LENGTH_LONG).show(); } else { Toast.makeText(context, context.getString(R.string.message_file_not_uploaded), Toast.LENGTH_LONG).show(); } } }
bryanrm/android-ftp-transfer
app/src/main/java/com/bryanrm/ftptransfer/network/Upload.java
Java
gpl-3.0
1,453
#include <stdio.h> #include <string.h> #include "Stack.h" #define STATE_SPACE 4096 #define TOTAL_CAVITIES 12 int pebbles_left(int state) { state = state - ((state >> 1) & 0x55555555); state = (state & 0x33333333) + ((state >> 2) & 0x33333333); return (((state + (state >> 4)) & 0x0F0F0F0F) * 0x01010101) >> 24; } void set_bit(int* x, int b) { *x |= (1 << b); } void unset_bit(int* x, int b) { *x &= ~(1 << b); } int is_set(int x, int b) { return x & (1 << b); } void add_neighbors(stack* open, char* closed, int state) { for (int i = 0; i < 11; i++) { if (is_set(state, i) && is_set(state, i + 1)) { if (i != 0 && !is_set(state, i - 1)) { int n = state; unset_bit(&n, i); unset_bit(&n, i+1); set_bit(&n, i-1); if (!closed[n]) push(open, n); } if (i != 10 && !is_set(state, i + 2)) { int n = state; unset_bit(&n, i); unset_bit(&n, i+1); set_bit(&n, i+2); if (!closed[n]) push(open, n); } } } } int min(int a, int b) { return a < b ? a : b; } int solve(stack* open, char* closed) { int least = 12; while(!is_empty(open)) { int current = pop(open); if (closed[current]) continue; closed[current] = 1; least = min(least, pebbles_left(current)); if (least == 1) break; add_neighbors(open, closed, current); } return least; } int state_to_number(char* str) { int x = 0; for (int i = 0; i < TOTAL_CAVITIES; i++) { if (str[i] == 'o') x |= (1 << i); } return x; } int main() { int n; scanf("%d",&n); stack open; init(&open, STATE_SPACE << 4); char closed[STATE_SPACE]; while(n--) { char buffer[13]; scanf("%s",buffer); memset(closed, 0, STATE_SPACE * sizeof(char)); clear(&open); push(&open, state_to_number(buffer)); printf("%d\n", solve(&open, closed)); } destroy(&open); return 0; }
JonSteinn/Kattis-Solutions
src/Pebble Solitaire/C/main.c
C
gpl-3.0
2,166
package org.flowerplatform.util.diff_update; import java.io.Serializable; import java.util.Objects; /** * * @author Claudiu Matei * */ public class DiffUpdate implements Serializable { private static final long serialVersionUID = -7517448831349466230L; private long id; private long timestamp = System.currentTimeMillis(); private String type; private String entityUid; /** * Non-conventional getter/setter so that it's not serialized to client */ private Object entity; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getEntityUid() { return entityUid; } public void setEntityUid(String entityUid) { this.entityUid = entityUid; } /** * @see #entity */ public Object entity() { return entity; } /** * @see #entity */ public void entity(Object entity) { this.entity = entity; } @Override public String toString() { return "DiffUpdate[type=" + type + ", id=" + id + ", entityUid=" + entityUid + "]"; } public long getTimestamp() { return timestamp; } @Override public boolean equals(Object obj) { DiffUpdate otherUpdate = (DiffUpdate) obj; return Objects.equals(type, otherUpdate.type) && Objects.equals(entityUid, otherUpdate.entityUid); } @Override public int hashCode() { return type.hashCode() + 3 * entityUid.hashCode(); } }
flower-platform/flower-platform-4
org.flowerplatform.util/src/org/flowerplatform/util/diff_update/DiffUpdate.java
Java
gpl-3.0
1,571
# Load the Rails application. require_relative 'application' # Initialize the Rails application. Rails.application.initialize! if ActiveRecord::Base.connection.pool.connected? then puts "connection size is #{ActiveRecord::Base.connection.pool.size}" puts "new connection size is #{ActiveRecord::Base.connection.pool.size}" if System.table_exists? then System.instance # load system and set new connection pools Rails.application.wakeup_or_start_observer_thread Rails.application.wakeup_or_start_epgdump_thread end else puts "no connection now" end
shinjiro-itagaki/shinjirecs
shinjirecs-rails-server/config/environment.rb
Ruby
gpl-3.0
573
# Makefile.in generated by automake 1.14.1 from Makefile.am. # doc/Makefile. Generated from Makefile.in by configure. # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/pdnsd pkgincludedir = $(includedir)/pdnsd pkglibdir = $(libdir)/pdnsd pkglibexecdir = $(libexecdir)/pdnsd am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/pdnsd.8.in $(srcdir)/pdnsd.conf.5.in \ $(srcdir)/pdnsd.conf.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = pdnsd.8 pdnsd.conf.5 pdnsd.conf CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_$(V)) am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_$(V)) am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man5dir = $(mandir)/man5 am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = aclocal-1.14 ALLOCA = AMTAR = $${TAR-tar} AM_DEFAULT_VERBOSITY = 1 AUTOCONF = autoconf AUTOHEADER = autoheader AUTOMAKE = automake-1.14 AWK = awk CC = gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = gcc -E CPPFLAGS = CYGPATH_W = echo DEFS = -DHAVE_CONFIG_H DEPDIR = .deps ECHO_C = \c ECHO_N = ECHO_T = EGREP = /usr/bin/grep -E EXEEXT = GREP = /usr/bin/grep INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LDFLAGS = LIBOBJS = LIBS = LTLIBOBJS = MAKEINFO = makeinfo MKDIR_P = .././install-sh -c -d OBJEXT = o PACKAGE = pdnsd PACKAGE_BUGREPORT = PACKAGE_NAME = PACKAGE_STRING = PACKAGE_TARNAME = PACKAGE_URL = PACKAGE_VERSION = PATH_SEPARATOR = : RANLIB = ranlib SET_MAKE = SHELL = /bin/sh STRIP = VERSION = 1.2.9b WINDMC = WINDRES = abs_builddir = /Users/d2036a/Documents/pdnsd/doc abs_srcdir = /Users/d2036a/Documents/pdnsd/doc abs_top_builddir = /Users/d2036a/Documents/pdnsd abs_top_srcdir = /Users/d2036a/Documents/pdnsd ac_ct_CC = gcc am__include = include am__leading_dot = . am__quote = am__tar = $${TAR-tar} chof - "$$tardir" am__untar = $${TAR-tar} xf - bindir = ${exec_prefix}/bin build_alias = builddir = . cachedir = /var/cache/pdnsd datadir = ${datarootdir} datarootdir = ${prefix}/share def_id = nobody distribution = Generic docdir = ${datarootdir}/doc/${PACKAGE} dvidir = ${docdir} exec_prefix = ${prefix} fullversion = 1.2.9b-par host_alias = htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = ${SHELL} /Users/d2036a/Documents/pdnsd/install-sh libdir = ${exec_prefix}/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var mandir = ${datarootdir}/man mkdir_p = $(MKDIR_P) oldincludedir = /usr/include packagerelease = par pdfdir = ${docdir} prefix = /usr/local program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin sharedstatedir = ${prefix}/com specbuild = no srcdir = . sysconfdir = ${prefix}/etc target_alias = mingw thread_CFLAGS = threadlib = default top_build_prefix = ../ top_builddir = .. top_srcdir = .. man_MANS = pdnsd.8 pdnsd-ctl.8 pdnsd.conf.5 # Note: pdnsd-ctl.8, pdnsd.conf.5.in, dl.html and the txt docs are handled by dist-hook rule. EXTRA_DIST = pdnsd.conf.in pdnsd.8.in \ html/dl.html.in html/doc.html html/faq.html html/index.html \ doc_makefile html/doc_makefile txt/doc_makefile \ html2confman.pl html/htmlsubst.pl all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): pdnsd.8: $(top_builddir)/config.status $(srcdir)/pdnsd.8.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ pdnsd.conf.5: $(top_builddir)/config.status $(srcdir)/pdnsd.conf.5.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ pdnsd.conf: $(top_builddir)/config.status $(srcdir)/pdnsd.conf.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-man5: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.5[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man5 install-man8 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man5 uninstall-man8 .MAKE: install-am install-data-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am dist-hook distclean distclean-generic distclean-local \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-data-hook \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man5 install-man8 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man5 uninstall-man8 # XXX: Do not insist to set the config file owner to root to avoid breaking RPM # builds install-data-hook: $(mkinstalldirs) "$(DESTDIR)$(sysconfdir)" if test `whoami` = "root"; then \ $(INSTALL) -o 0 -g 0 -m 644 pdnsd.conf "$(DESTDIR)$(sysconfdir)/pdnsd.conf.sample" ; \ else \ $(INSTALL) -m 644 pdnsd.conf "$(DESTDIR)$(sysconfdir)/pdnsd.conf.sample" ; \ fi dist-hook: doc_makefile @$(MAKE) -f doc_makefile doc cp -p --parents pdnsd-ctl.8 pdnsd.conf.5.in \ html/dl.html txt/faq.txt txt/intro.txt txt/manual.txt \ $(distdir) distclean-local: doc_makefile @$(MAKE) -f doc_makefile clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT:
d2036a/pdnsd-mingw
doc/Makefile
Makefile
gpl-3.0
17,379
/** * Balero CMS Project: Proyecto 100% Mexicano de código libre. * Página Oficial: http://www.balerocms.com * * @author Anibal Gomez <anibalgomez@icloud.com> * @copyright Copyright (C) 2015 Neblina Software. Derechos reservados. * @license Licencia BSD; vea LICENSE.txt */ package com.neblina.balero; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; @Configuration @EnableAutoConfiguration @EnableScheduling @ComponentScan @EnableGlobalMethodSecurity(securedEnabled = true, prePostEnabled = true) public class Application { public static void main(String[] args) { SpringApplication.run(Application.class, args); } }
neblina-software/balerocms-v2
src/main/java/com/neblina/balero/Application.java
Java
gpl-3.0
1,024
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head prefix="og: http://ogp.me/ns# dc: http://purl.org/dc/terms/"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --> <!--[if lt IE 9]> <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="//oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> <![endif]--> <title>Fan page: Jim Haney</title> <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> <!-- Optional theme --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous"> <style type="text/css"> #top{ width: 100%; float: left; } #place{ width: 100%; float: left; } #address{ width: 15%; float: left; } #sgvzl{ width: 80%; float: left; } #credits{ width: 100%; float: left; clear: both; } #location-marker{ width: 1em; } #male-glyph{ width: 1em; } </style> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript" id="sgvzlr_script" src="http://mgskjaeveland.github.io/sgvizler/v/0.6/sgvizler.min.js"></script> <script type="text/javascript"> sgvizler .defaultEndpointURL("http://bibfram.es/fuseki/cobra/query"); //// Leave this as is. Ready, steady, go! $(document).ready(sgvizler.containerDrawAll); </script> <!-- Latest compiled and minified JavaScript --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script> <meta name="title" content="Jim Haney"> <meta property="dc:title" content="Jim Haney"> <meta property="og:title" content="Jim Haney"> <meta name="author" content="Jim Haney"> <meta name="dc:creator" content="Jim Haney"> </head> <body prefix="cbo: http://comicmeta.org/cbo/ dc: http://purl.org/dc/elements/1.1/ dcterms: http://purl.org/dc/terms/ foaf: http://xmlns.com/foaf/0.1/ oa: http://www.w3.org/ns/oa# rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# schema: http://schema.org/ skos: http://www.w3.org/2004/02/skos/core# xsd: http://www.w3.org/2001/XMLSchema#"> <div id="wrapper" class="container" about="http://ivmooc-cobra2.github.io/resources/fan/2990" typeof="http://comicmeta.org/cbo/Fan"> <div id="top"> <h1> <span property="http://schema.org/name">Jim Haney</span> <img id="male-glyph" src="/static/resources/img/man.svg" alt="male glyph"> </h1> <dl> <dt> <label for="http://comicmeta.org/cbo/Fan"> <span>type</span> </label> </dt> <dd> <span>http://comicmeta.org/cbo/Fan</span> </dd> </dl> <dl> <dt> <label for="http://schema.org/name"> <span> <a href="http://schema.org/name">name</a> </span> </label> </dt> <dd> <span property="http://schema.org/name">Jim Haney</span> </dd> </dl> </div> <div id="place" rel="http://schema.org/address" resource="http://ivmooc-cobra2.github.io/resources/place/2797" typeof="http://schema.org/Place"> <h2>Location <a href="http://ivmooc-cobra2.github.io/resources/place/2797"> <img id="location-marker" src="/static/resources/img/location.svg" alt="location marker glyph"> </a> </h2> <div id="address" rel="http://schema.org/address" typeof="http://schema.org/PostalAddress" resource="http://ivmooc-cobra2.github.io/resources/place/2797/address"> <dl> <dt> <label for="http://schema.org/streetAddress"> <span> <a href="http://schema.org/streetAddress">Street address</a> </span> </label> </dt> <dd> <span property="http://schema.org/streetAddress">9335 Renton Ave. So.</span> </dd> </dl> <dl> <dt> <label for="http://schema.org/addressLocality"> <span> <a href="http://schema.org/addressLocality">Address locality</a> </span> </label> </dt> <dd> <span property="http://schema.org/addressLocality">Seattle</span> </dd> </dl> <dl> <dt> <label for="http://schema.org/addressRegion"> <span> <a href="http://schema.org/addressRegion">Address region</a> </span> </label> </dt> <dd> <span property="http://schema.org/addressRegion">WA</span> </dd> </dl> <dl> <dt> <label for="http://schema.org/postalCode"> <span> <a href="http://schema.org/postalCode">Postal code</a> </span> </label> </dt> <dd> <span property="http://schema.org/postalCode">98118</span> </dd> </dl> <dl> <dt> <label for="http://schema.org/addressCountry"> <span> <a href="http://schema.org/addressCountry">Address country</a> </span> </label> </dt> <dd> <span property="http://schema.org/addressCountry">US</span> </dd> </dl> </div> <div id="sgvzl" data-sgvizler-endpoint="http://bibfram.es/fuseki/cobra/query" data-sgvizler-query="PREFIX dc: <http://purl.org/dc/elements/1.1/&gt; &#xA;PREFIX cbo: <http://comicmeta.org/cbo/&gt; &#xA;PREFIX foaf: <http://xmlns.com/foaf/0.1/&gt;&#xA;PREFIX schema: <http://schema.org/&gt;&#xA;SELECT ?lat ?long &#xA;WHERE {&#xA; ?fan schema:address ?Place .&#xA; ?Place schema:geo ?Geo .&#xA; ?Geo schema:latitude ?lat .&#xA; ?Geo schema:longitude ?long .&#xA; FILTER(?fan = <http://ivmooc-cobra2.github.io/resources/fan/2990&gt;)&#xA;}" data-sgvizler-chart="google.visualization.GeoChart" data-sgvizler-loglevel="2" style="width:800px; height:400px;"></div> </div> <div id="letter" rel="http://purl.org/dc/elements/1.1/creator" resource="http://ivmooc-cobra2.github.io/resources/letter/3406"> <dl> <dt> <label for="http://schema.org/streetAddress"> <span> <a href="http://schema.org/streetAddress">Street address</a> </span> </label> </dt> <dd> <span property="http://schema.org/streetAddress">9335 Renton Ave. So.</span> </dd> </dl> </div> <div id="credits">Icons made by <a href="http://www.flaticon.com/authors/simpleicon" title="SimpleIcon">SimpleIcon</a> from <a href="http://www.flaticon.com" title="Flaticon">www.flaticon.com</a> is licensed by <a href="http://creativecommons.org/licenses/by/3.0/" title="Creative Commons BY 3.0" target="_blank">CC 3.0 BY</a> </div> </div> </body> </html>
Timathom/timathom.github.io
discovery/resources/fan/2990/index.html
HTML
gpl-3.0
8,290
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>GNU Radio 3.6.1 C++ API: fft.dox File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">GNU Radio 3.6.1 C++ API </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.6.1 --> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('fft_8dox.html',''); </script> <div id="doc-content"> <div class="header"> <div class="headertitle"> <div class="title">fft.dox File Reference</div> </div> </div><!--header--> <div class="contents"> </div><!-- contents --> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="fft_8dox.html">fft.dox</a> </li> <li class="footer">Generated on Wed Jun 13 2012 21:29:00 for GNU Radio 3.6.1 C++ API by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li> </ul> </div> </body> </html>
zitouni/gnuradio-3.6.1
build/docs/doxygen/html/fft_8dox.html
HTML
gpl-3.0
2,065
#!/bin/bash get_tarball_path() { if [ $# -lt 1 ]; then echo "ERROR: Failed to get tarball path. No search path argument given" return 1 fi echo "$(find $1 -name procalc_*.orig.tar.gz)" } get_tarball_name() { if [ $# -lt 1 ]; then echo "ERROR: Failed to get tarball path. No search path argument given" return 1 fi tarball_path="$(get_tarball_path $1)" echo "${tarball_path##*/}" } get_tarball_version() { if [ $# -lt 1 ]; then echo "ERROR: Failed to get tarball path. No search path argument given" return 1 fi tarball_name="$(get_tarball_name $1)" regex="^procalc_(.*)\.orig\.tar\.gz$" if [[ ! "$tarball_name" =~ $regex ]]; then echo "ERROR: Tarball does not exist or has non-conforming file name" return 1 fi echo "${BASH_REMATCH[1]}" }
RobJinman/pro_office_calc
release/functions.sh
Shell
gpl-3.0
807
/* * gVirtuS -- A GPGPU transparent virtualization component. * * Copyright (C) 2009-2010 The University of Napoli Parthenope at Naples. * * This file is part of gVirtuS. * * gVirtuS is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * gVirtuS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU General Public License * along with gVirtuS; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * * Written by: Giuseppe Coviello <giuseppe.coviello@uniparthenope.it>, * Department of Applied Science */ #include "CudaRtHandler.h" CUDA_ROUTINE_HANDLER(DeviceSetCacheConfig) { try { cudaFuncCache cacheConfig = input_buffer->Get<cudaFuncCache>(); cudaError_t exit_code = cudaDeviceSetCacheConfig(cacheConfig); return new Result(exit_code); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); //??? } } CUDA_ROUTINE_HANDLER(DeviceSetLimit) { try { cudaLimit limit = input_buffer->Get<cudaLimit>(); size_t value = input_buffer->Get<size_t>(); cudaError_t exit_code = cudaDeviceSetLimit(limit, value); return new Result(exit_code); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); //??? } } CUDA_ROUTINE_HANDLER(IpcOpenMemHandle) { void *devPtr = NULL; try { cudaIpcMemHandle_t handle = input_buffer->Get<cudaIpcMemHandle_t>(); unsigned int flags = input_buffer->Get<unsigned int>(); cudaError_t exit_code = cudaIpcOpenMemHandle(&devPtr, handle, flags); Buffer *out = new Buffer(); out->AddMarshal(devPtr); return new Result(exit_code, out); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } } CUDA_ROUTINE_HANDLER(DeviceEnablePeerAccess) { int peerDevice = input_buffer->Get<int>(); unsigned int flags = input_buffer->Get<unsigned int>(); cudaError_t exit_code = cudaDeviceEnablePeerAccess(peerDevice, flags); return new Result(exit_code); } CUDA_ROUTINE_HANDLER(DeviceDisablePeerAccess) { int peerDevice = input_buffer->Get<int>(); cudaError_t exit_code = cudaDeviceDisablePeerAccess(peerDevice); return new Result(exit_code); } CUDA_ROUTINE_HANDLER(DeviceCanAccessPeer) { int *canAccessPeer = input_buffer->Assign<int>(); int device = input_buffer->Get<int>(); int peerDevice = input_buffer->Get<int>(); cudaError_t exit_code = cudaDeviceCanAccessPeer(canAccessPeer, device, peerDevice); Buffer *out = new Buffer(); try { out->Add(canAccessPeer); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } return new Result(exit_code, out); } CUDA_ROUTINE_HANDLER(DeviceGetStreamPriorityRange) { int *leastPriority = input_buffer->Assign<int>(); int *greatestPriority = input_buffer->Assign<int>(); cudaError_t exit_code = cudaDeviceGetStreamPriorityRange(leastPriority, greatestPriority); Buffer *out = new Buffer(); try { out->Add(leastPriority); out->Add(greatestPriority); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } return new Result(exit_code, out); } CUDA_ROUTINE_HANDLER(OccupancyMaxActiveBlocksPerMultiprocessor) { int *numBlocks = input_buffer->Assign<int>(); const char *func = (const char*) (input_buffer->Get<pointer_t> ()); int blockSize = input_buffer->Get<int>(); size_t dynamicSMemSize = input_buffer->Get<size_t>(); cudaError_t exit_code = cudaOccupancyMaxActiveBlocksPerMultiprocessor(numBlocks, func, blockSize, dynamicSMemSize); Buffer *out = new Buffer(); try { out->Add(numBlocks); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } return new Result(exit_code, out); } CUDA_ROUTINE_HANDLER(DeviceGetAttribute) { int *value = input_buffer->Assign<int>(); cudaDeviceAttr attr = input_buffer->Get<cudaDeviceAttr>(); int device = input_buffer->Get<int>(); cudaError_t exit_code = cudaDeviceGetAttribute(value, attr, device); Buffer *out = new Buffer(); try { out->Add(value); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } return new Result(exit_code, out); } CUDA_ROUTINE_HANDLER(IpcGetMemHandle) { cudaIpcMemHandle_t *handle = input_buffer->Assign<cudaIpcMemHandle_t>(); void *devPtr = input_buffer->GetFromMarshal<void *>(); cudaError_t exit_code = cudaIpcGetMemHandle(handle, devPtr); Buffer *out = new Buffer(); try { out->Add(handle); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } return new Result(exit_code, out); } CUDA_ROUTINE_HANDLER(IpcGetEventHandle) { cudaIpcEventHandle_t *handle = input_buffer->Assign<cudaIpcEventHandle_t>(); cudaEvent_t event = input_buffer->Get<cudaEvent_t>(); cudaError_t exit_code = cudaIpcGetEventHandle(handle, event); Buffer *out = new Buffer(); try { out->Add(handle); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } return new Result(exit_code, out); } CUDA_ROUTINE_HANDLER(ChooseDevice) { int *device = input_buffer->Assign<int>(); const cudaDeviceProp *prop = input_buffer->Assign<cudaDeviceProp>(); cudaError_t exit_code = cudaChooseDevice(device, prop); Buffer *out = new Buffer(); try { out->Add(device); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } return new Result(exit_code, out); } CUDA_ROUTINE_HANDLER(GetDevice) { try { int *device = input_buffer->Assign<int>(); cudaError_t exit_code = cudaGetDevice(device); Buffer *out = new Buffer(); out->Add(device); return new Result(exit_code, out); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } } CUDA_ROUTINE_HANDLER(DeviceReset) { cudaError_t exit_code = cudaDeviceReset(); Buffer *out = new Buffer(); return new Result(exit_code, out); } CUDA_ROUTINE_HANDLER(DeviceSynchronize) { cudaError_t exit_code = cudaDeviceSynchronize(); try { Buffer *out = new Buffer(); return new Result(exit_code, out); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } } CUDA_ROUTINE_HANDLER(GetDeviceCount) { try { int *count = input_buffer->Assign<int>(); cudaError_t exit_code = cudaGetDeviceCount(count); Buffer *out = new Buffer(); out->Add(count); return new Result(exit_code, out); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } } CUDA_ROUTINE_HANDLER(GetDeviceProperties) { try { struct cudaDeviceProp *prop = input_buffer->Assign<struct cudaDeviceProp>(); int device = input_buffer->Get<int>(); cudaError_t exit_code = cudaGetDeviceProperties(prop, device); #ifndef CUDART_VERSION #error CUDART_VERSION not defined #endif #if CUDART_VERSION >= 2030 prop->canMapHostMemory = 0; #endif Buffer *out = new Buffer(); out->Add(prop, 1); return new Result(exit_code, out); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } } CUDA_ROUTINE_HANDLER(SetDevice) { try { int device = input_buffer->Get<int>(); cudaError_t exit_code = cudaSetDevice(device); return new Result(exit_code); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } } #ifndef CUDART_VERSION #error CUDART_VERSION not defined #endif #if CUDART_VERSION >= 2030 CUDA_ROUTINE_HANDLER(SetDeviceFlags) { try { int flags = input_buffer->Get<int>(); cudaError_t exit_code = cudaSetDeviceFlags(flags); return new Result(exit_code); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } } CUDA_ROUTINE_HANDLER(IpcOpenEventHandle) { Buffer *out = new Buffer(); try { cudaEvent_t *event = input_buffer->Assign<cudaEvent_t>(); cudaIpcEventHandle_t handle = input_buffer->Get<cudaIpcEventHandle_t>(); cudaError_t exit_code = cudaIpcOpenEventHandle(event, handle); out->Add(event); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } } CUDA_ROUTINE_HANDLER(SetValidDevices) { try { int len = input_buffer->BackGet<int>(); int *device_arr = input_buffer->Assign<int>(len); cudaError_t exit_code = cudaSetValidDevices(device_arr, len); Buffer *out = new Buffer(); out->Add(device_arr, len); return new Result(exit_code, out); } catch (string e) { cerr << e << endl; return new Result(cudaErrorMemoryAllocation); } } #endif
Donkey-Sand/gvirtus-multiGPU
gvirtus.cudart/backend/CudaRtHandler_device.cpp
C++
gpl-3.0
9,738
#!/bin/bash # the round function: round() { echo $(printf %.$2f $(echo "scale=$2;(((10^$2)*$1)+0.5)/(10^$2)" | bc)) }; # Checking parameters number if [ $# = 0 ]; then rep="." typ="-s" elif [ $# = 1 ]; then rep=$1 typ="-s" elif [ $# = 2 ]; then if [ $2 != "-s" ] && [ $2 != "-r" ]; then echo "Usage: script [directory] [type]" echo "Usage: type: -s:sort -r:rename" exit 1 fi rep=$1 typ=$2 else echo "Usage: script [directory] [type]" echo "Usage: type: -s:sort -r:rename" exit 1 fi # List of dangerous extention dan=("exe" "pif" "application" "gadget" "msi" "msp" "com" "scr" "hta" "cpl" "msc" "jar" "bat" "cmd" "vb" "vbs" "vbe" "js" "jse" "ws" "wsf" "wsc" "wsh" "ps1" "ps1xml" "ps2" "ps2xml" "psc1" "psc2" "msh" "msh1" "msh1" "mshxml" "msh1xml" "msh2xml" "scf" "lnk" "inf" "reg" "docm" "dotm" "xlsm" "xltm" "xlam" "pptm" "potm" "ppam" "ppsm" "sldm") # Directories creation if [ $typ = "-s" ]; then for (( i=0; i<11; i++ )); do mkdir -p lvl$i; done fi echo "repertoire:$rep" # Creation of files list find $rep/ -type f > tmp.txt # Analyse all files while read line do val=0; sum=0; com=0; # type of file ft=`file -bz --mime-type $line | cut -d'/' -f2` # lvl dangerosity ave=0; cd cve-search # python3.3 search.py -p microsoft -o json | jq -r ".cvss" python3.3 search.py -f microsoft | grep -o "cvss': '[0-9]*.[0-9]" | cut -d"'" -f3 > tmp2.txt while read line2 do sum=`echo "scale=1;($sum+$line2)" | bc` com=$(($com+1)) # fin de boucle done < tmp2.txt ave=`echo "($sum/$com)" | bc` lvl=$(round $ave 0) echo "moyenne:$lvl" cd .. echo "type:$ft" # check entention extention="${line##*.}" for i in ${dan[@]}; do if [ "$i" = "$extention" ]; then val=$(($val+5)) fi done echo "val:$val" lvl=5; if [ $typ = "-s" ]; then # mv of file in the directory # mv $line $lvl echo "move" else # add security lvl before extention filename="${line%.*}" # mv $line $filename.$lvl.$extention fi # fin de boucle done < tmp.txt exit 0
PokerChichi/TidyMyKey
test_files/script.sh
Shell
gpl-3.0
2,113
# -*- coding: utf8 -*- from yanntricks import * def UQZooGFLNEq(): pspict,fig = SinglePicture("UQZooGFLNEq") pspict.dilatation_X(1) pspict.dilatation_Y(1) mx=-5 Mx=5 x=var('x') f=phyFunction( arctan(x) ).graph(mx,Mx) seg1=Segment( Point(mx,pi/2),Point(Mx,pi/2) ) seg2=Segment( Point(mx,-pi/2),Point(Mx,-pi/2) ) seg1.parameters.color="red" seg2.parameters.color="red" seg1.parameters.style="dashed" seg2.parameters.style="dashed" pspict.DrawGraphs(f,seg1,seg2) pspict.axes.single_axeY.axes_unit=AxesUnit(pi/2,'') pspict.DrawDefaultAxes() fig.no_figure() fig.conclude() fig.write_the_file()
LaurentClaessens/mazhe
src_yanntricks/yanntricksUQZooGFLNEq.py
Python
gpl-3.0
671
'use strict'; module.exports = { minVersion: "5.0.0", currentVersion: "5.2.0", activeDelegates: 101, addressLength: 208, blockHeaderLength: 248, confirmationLength: 77, epochTime: new Date(Date.UTC(2016, 4, 24, 17, 0, 0, 0)), fees:{ send: 10000000, vote: 100000000, secondsignature: 500000000, delegate: 6000000000, multisignature: 500000000, dapp: 2500000000 }, feeStart: 1, feeStartVolume: 10000 * 100000000, fixedPoint : Math.pow(10, 8), forgingTimeOut: 500, // 50 blocks maxAddressesLength: 208 * 128, maxAmount: 100000000, maxClientConnections: 100, maxConfirmations : 77 * 100, maxPayloadLength: 1024 * 1024, maxRequests: 10000 * 12, maxSignaturesLength: 196 * 256, maxTxsPerBlock: 25, numberLength: 100000000, requestLength: 104, rewards: { milestones: [ 100000000, // Initial reward 70000000, // Milestone 1 50000000, // Milestone 2 30000000, // Milestone 3 20000000 // Milestone 4 ], offset: 10, // Start rewards at block (n) distance: 3000000, // Distance between each milestone }, signatureLength: 196, totalAmount: 1009000000000000, unconfirmedTransactionTimeOut: 10800 // 1080 blocks };
shiftcurrency/shift
helpers/constants.js
JavaScript
gpl-3.0
1,217
<?php /** * @package GPL Cart core * @author Iurii Makukh <gplcart.software@gmail.com> * @copyright Copyright (c) 2015, Iurii Makukh * @license https://www.gnu.org/licenses/gpl.html GNU/GPLv3 */ namespace gplcart\core\models; use gplcart\core\Hook; use gplcart\core\models\Translation as TranslationModel; /** * Manages basic behaviors and data related to payment methods */ class Payment { /** * Hook class instance * @var \gplcart\core\Hook $hook */ protected $hook; /** * Translation UI model instance * @var \gplcart\core\models\Translation $translation */ protected $translation; /** * @param Hook $hook * @param Translation $translation */ public function __construct(Hook $hook, TranslationModel $translation) { $this->hook = $hook; $this->translation = $translation; } /** * Returns an array of payment methods * @param array $options * @return array */ public function getList(array $options = array()) { $methods = &gplcart_static(gplcart_array_hash(array('payment.methods' => $options))); if (isset($methods)) { return $methods; } $methods = $this->getDefaultList(); $this->hook->attach('payment.methods', $methods, $this); $weights = array(); foreach ($methods as $id => &$method) { $method['id'] = $id; if (!isset($method['weight'])) { $method['weight'] = 0; } if (!empty($options['status']) && empty($method['status'])) { unset($methods[$id]); continue; } if (!empty($options['module']) && (empty($method['module']) || !in_array($method['module'], (array) $options['module']))) { unset($methods[$id]); continue; } $weights[] = $method['weight']; } if (empty($methods)) { return array(); } // Sort by weight then by key array_multisort($weights, SORT_ASC, array_keys($methods), SORT_ASC, $methods); return $methods; } /** * Returns a payment method * @param string $method_id * @return array */ public function get($method_id) { $methods = $this->getList(); return empty($methods[$method_id]) ? array() : $methods[$method_id]; } /** * Returns an array of default payment methods * @return array */ protected function getDefaultList() { return array( 'cod' => array( 'title' => $this->translation->text('Cash on delivery'), 'description' => $this->translation->text('Payment for an order is made at the time of delivery'), 'template' => array('complete' => ''), 'image' => '', 'module' => 'core', 'status' => true, 'weight' => 0 ) ); } }
gplcart/gplcart
system/core/models/Payment.php
PHP
gpl-3.0
3,062
package testutils; import java.util.Random; public class TestHelper { public static byte[] getTestData(int size) { byte[] bytes = new byte[size]; new Random().nextBytes(bytes); return bytes; } public static boolean compareBytes(byte[] x, byte[] y) { if (x.length != y.length) return true; int delta = 0; for(int i = 0; i < x.length; i++) delta |= x[i] ^ y[i]; return delta == 0; } }
dylsmith8/JavaIPC
Windows Implementation/JavaIPC/javawinipc/testprograms/testutils/TestHelper.java
Java
gpl-3.0
533
const path = require('path'); const webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'); var ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin'); var CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { // 页面入口文件配置 entry: { app: [ path.normalize(process.argv[process.argv.length // - 1]) // 默认规则,最后一个参数是entry ] }, 入口文件输出配置 output: { //publicPath: '/dist', path: __dirname + '/www/dist/', filename: '[name].[chunkhash:5].js' }, module: { //加载器配置 rules: [ { test: /\.js|\.jsx$/, // exclude: // /node_modules[\\|\/](?!react-native|@shoutem\\theme|@remobile\\react-native)/, loader: 'babel-loader', options: { //retainLines: true, 'compact':false, 'presets': [ 'react', 'es2015', 'es2017', 'stage-0', 'stage-1', // 'stage-2', 'stage-3' ], 'plugins': [//'transform-runtime', 'transform-decorators-legacy'] }, include: path.resolve(__dirname, (process.cwd() !== path.dirname(__dirname) ? '../../' : '') + "../node_modules") }, { test: /\.ttf$/, loader: "url-loader", // or directly file-loader include: path.resolve(__dirname, (process.cwd() !== path.dirname(__dirname) ? '../../' : '') + "../node_modules/react-native-vector-icons") } ] }, //其它解决方案配置 resolve: { extensions: [ '', '.web.js', '.js' ], alias: { 'react-native': 'react-native-web' } }, plugins: [ new CopyWebpackPlugin([ { from: path.join(__dirname, (process.cwd() !== path.dirname(__dirname) ? '../../' : '') + '../node_modules/babel-polyfill/dist/polyfill.min.js'), to: path.join(__dirname, 'www', 'dist') }, { from: path.join(__dirname, 'viewport.js'), to: path.join(__dirname, 'www', 'dist', 'viewport.min.js') }]), new HtmlWebpackPlugin({ template: __dirname + '/index.temp.html', filename: __dirname + '/www/index.html', minify: { removeComments: true, collapseWhitespace: true, collapseInlineTagWhitespace: true, //conservativeCollapse: true, preserveLineBreaks: true, minifyCSS: true, removeScriptTypeAttributes: true, removeStyleLinkTypeAttributes: true } }), new ScriptExtHtmlWebpackPlugin({defaultAttribute: 'async'}), // new webpack.optimize.DedupePlugin(), new ChunkModuleIDPlugin(), new // webpack.NoErrorsPlugin(), new webpack.DefinePlugin({'__DEV__': false, 'process.env.NODE_ENV': '"production"'}), // new webpack.ProvidePlugin({ '__DEV__': false }), new webpack.SourceMapDevToolPlugin({ test: [ /\.js$/, /\.jsx$/ ], exclude: 'vendor', filename: "[name].[hash:5].js.map", append: "//# sourceMappingURL=[url]", moduleFilenameTemplate: '[resource-path]', fallbackModuleFilenameTemplate: '[resource-path]' }), new webpack.optimize.UglifyJsPlugin({ compress: { //supresses warnings, usually from module minification warnings: false }, //sourceMap: true, mangle: true }) ] };
saas-plat/saas-plat-native
web/webpack.config.js
JavaScript
gpl-3.0
3,434
package org.saintandreas.serket.scpd; import java.io.IOException; import javax.servlet.ServletException; import javax.xml.namespace.QName; import javax.xml.soap.SOAPBodyElement; import javax.xml.soap.SOAPException; import javax.xml.soap.SOAPMessage; import org.saintandreas.serket.service.BaseService; import org.saintandreas.util.SOAPSerializable; import org.saintandreas.util.XmlUtil; import org.w3c.dom.Element; public abstract class ConnectionManager2 extends BaseService { public final static String URI = "urn:schemas-upnp-org:service:ConnectionManager:2"; public ConnectionManager2(String id, String controlURL, String eventURL) { super(id, controlURL, eventURL); } public String getURI() { return URI; } public abstract ConnectionManager2 .GetProtocolInfoResponse getProtocolInfo(ConnectionManager2 .GetProtocolInfoRequest input) throws IOException, ServletException ; public abstract ConnectionManager2 .PrepareForConnectionResponse prepareForConnection(ConnectionManager2 .PrepareForConnectionRequest input) throws IOException, ServletException ; public abstract ConnectionManager2 .ConnectionCompleteResponse connectionComplete(ConnectionManager2 .ConnectionCompleteRequest input) throws IOException, ServletException ; public abstract ConnectionManager2 .GetCurrentConnectionIDsResponse getCurrentConnectionIDs(ConnectionManager2 .GetCurrentConnectionIDsRequest input) throws IOException, ServletException ; public abstract ConnectionManager2 .GetCurrentConnectionInfoResponse getCurrentConnectionInfo(ConnectionManager2 .GetCurrentConnectionInfoRequest input) throws IOException, ServletException ; public static class ConnectionCompleteRequest extends SOAPSerializable { public int connectionID; public void parse(SOAPMessage soapMessage) throws SOAPException { for (Element e: XmlUtil.getChildElements(XmlUtil.getChildElements(soapMessage.getSOAPBody()).get(0))) { String name = e.getNodeName(); if ("ConnectionID".equals(name)) { connectionID = Integer.valueOf(e.getTextContent()); continue; } } } public SOAPMessage format() throws SOAPException { SOAPMessage retVal = ConnectionManager2 .ConnectionCompleteRequest.createMessage(); SOAPBodyElement soapBodyElement = retVal.getSOAPBody().addBodyElement(new QName(URI, "ConnectionCompleteRequest", "u")); soapBodyElement.addChildElement("ConnectionID").setTextContent(Integer.toString(connectionID)); return retVal; } } public static class ConnectionCompleteResponse extends SOAPSerializable { public void parse(SOAPMessage soapMessage) { } public SOAPMessage format() throws SOAPException { SOAPMessage retVal = ConnectionManager2 .ConnectionCompleteResponse.createMessage(); retVal.getSOAPBody().addBodyElement(new QName(URI, "ConnectionCompleteResponse", "u")); return retVal; } } public enum ConnectionStatus { OK, ContentFormatMismatch, InsufficientBandwidth, UnreliableChannel, Unknown; } public enum Direction { Input, Output; } public static class GetCurrentConnectionIDsRequest extends SOAPSerializable { public void parse(SOAPMessage soapMessage) { } public SOAPMessage format() throws SOAPException { SOAPMessage retVal = ConnectionManager2 .GetCurrentConnectionIDsRequest.createMessage(); retVal.getSOAPBody().addBodyElement(new QName(URI, "GetCurrentConnectionIDsRequest", "u")); return retVal; } } public static class GetCurrentConnectionIDsResponse extends SOAPSerializable { public String connectionIDs; public void parse(SOAPMessage soapMessage) throws SOAPException { for (Element e: XmlUtil.getChildElements(XmlUtil.getChildElements(soapMessage.getSOAPBody()).get(0))) { String name = e.getNodeName(); if ("ConnectionIDs".equals(name)) { connectionIDs = e.getTextContent(); continue; } } } public SOAPMessage format() throws SOAPException { SOAPMessage retVal = ConnectionManager2 .GetCurrentConnectionIDsResponse.createMessage(); SOAPBodyElement soapBodyElement = retVal.getSOAPBody().addBodyElement(new QName(URI, "GetCurrentConnectionIDsResponse", "u")); soapBodyElement.addChildElement("ConnectionIDs").setTextContent(connectionIDs.toString()); return retVal; } } public static class GetCurrentConnectionInfoRequest extends SOAPSerializable { public int connectionID; public void parse(SOAPMessage soapMessage) throws SOAPException { for (Element e: XmlUtil.getChildElements(XmlUtil.getChildElements(soapMessage.getSOAPBody()).get(0))) { String name = e.getNodeName(); if ("ConnectionID".equals(name)) { connectionID = Integer.valueOf(e.getTextContent()); continue; } } } public SOAPMessage format() throws SOAPException { SOAPMessage retVal = ConnectionManager2 .GetCurrentConnectionInfoRequest.createMessage(); SOAPBodyElement soapBodyElement = retVal.getSOAPBody().addBodyElement(new QName(URI, "GetCurrentConnectionInfoRequest", "u")); soapBodyElement.addChildElement("ConnectionID").setTextContent(Integer.toString(connectionID)); return retVal; } } public static class GetCurrentConnectionInfoResponse extends SOAPSerializable { public int rcsID; public int aVTransportID; public String protocolInfo; public String peerConnectionManager; public int peerConnectionID; public org.saintandreas.serket.scpd.ConnectionManager2.Direction direction; public ConnectionManager2 .ConnectionStatus status; public void parse(SOAPMessage soapMessage) throws SOAPException { for (Element e: XmlUtil.getChildElements(XmlUtil.getChildElements(soapMessage.getSOAPBody()).get(0))) { String name = e.getNodeName(); if ("RcsID".equals(name)) { rcsID = Integer.valueOf(e.getTextContent()); continue; } if ("AVTransportID".equals(name)) { aVTransportID = Integer.valueOf(e.getTextContent()); continue; } if ("ProtocolInfo".equals(name)) { protocolInfo = e.getTextContent(); continue; } if ("PeerConnectionManager".equals(name)) { peerConnectionManager = e.getTextContent(); continue; } if ("PeerConnectionID".equals(name)) { peerConnectionID = Integer.valueOf(e.getTextContent()); continue; } if ("Direction".equals(name)) { direction = org.saintandreas.serket.scpd.ConnectionManager2.Direction.valueOf(e.getTextContent()); continue; } if ("Status".equals(name)) { status = ConnectionManager2 .ConnectionStatus.valueOf(e.getTextContent()); continue; } } } public SOAPMessage format() throws SOAPException { SOAPMessage retVal = ConnectionManager2 .GetCurrentConnectionInfoResponse.createMessage(); SOAPBodyElement soapBodyElement = retVal.getSOAPBody().addBodyElement(new QName(URI, "GetCurrentConnectionInfoResponse", "u")); soapBodyElement.addChildElement("RcsID").setTextContent(Integer.toString(rcsID)); soapBodyElement.addChildElement("AVTransportID").setTextContent(Integer.toString(aVTransportID)); soapBodyElement.addChildElement("ProtocolInfo").setTextContent(protocolInfo.toString()); soapBodyElement.addChildElement("PeerConnectionManager").setTextContent(peerConnectionManager.toString()); soapBodyElement.addChildElement("PeerConnectionID").setTextContent(Integer.toString(peerConnectionID)); soapBodyElement.addChildElement("Direction").setTextContent(direction.toString()); soapBodyElement.addChildElement("Status").setTextContent(status.toString()); return retVal; } } public static class GetProtocolInfoRequest extends SOAPSerializable { public void parse(SOAPMessage soapMessage) { } public SOAPMessage format() throws SOAPException { SOAPMessage retVal = ConnectionManager2 .GetProtocolInfoRequest.createMessage(); retVal.getSOAPBody().addBodyElement(new QName(URI, "GetProtocolInfoRequest", "u")); return retVal; } } public static class GetProtocolInfoResponse extends SOAPSerializable { public String source; public String sink; public void parse(SOAPMessage soapMessage) throws SOAPException { for (Element e: XmlUtil.getChildElements(XmlUtil.getChildElements(soapMessage.getSOAPBody()).get(0))) { String name = e.getNodeName(); if ("Source".equals(name)) { source = e.getTextContent(); continue; } if ("Sink".equals(name)) { sink = e.getTextContent(); continue; } } } public SOAPMessage format() throws SOAPException { SOAPMessage retVal = ConnectionManager2 .GetProtocolInfoResponse.createMessage(); SOAPBodyElement soapBodyElement = retVal.getSOAPBody().addBodyElement(new QName(URI, "GetProtocolInfoResponse", "u")); soapBodyElement.addChildElement("Source").setTextContent(source.toString()); soapBodyElement.addChildElement("Sink").setTextContent(sink.toString()); return retVal; } } public static class PrepareForConnectionRequest extends SOAPSerializable { public String remoteProtocolInfo; public String peerConnectionManager; public int peerConnectionID; public ConnectionManager2 .Direction direction; public void parse(SOAPMessage soapMessage) throws SOAPException { for (Element e: XmlUtil.getChildElements(XmlUtil.getChildElements(soapMessage.getSOAPBody()).get(0))) { String name = e.getNodeName(); if ("RemoteProtocolInfo".equals(name)) { remoteProtocolInfo = e.getTextContent(); continue; } if ("PeerConnectionManager".equals(name)) { peerConnectionManager = e.getTextContent(); continue; } if ("PeerConnectionID".equals(name)) { peerConnectionID = Integer.valueOf(e.getTextContent()); continue; } if ("Direction".equals(name)) { direction = ConnectionManager2 .Direction.valueOf(e.getTextContent()); continue; } } } public SOAPMessage format() throws SOAPException { SOAPMessage retVal = ConnectionManager2 .PrepareForConnectionRequest.createMessage(); SOAPBodyElement soapBodyElement = retVal.getSOAPBody().addBodyElement(new QName(URI, "PrepareForConnectionRequest", "u")); soapBodyElement.addChildElement("RemoteProtocolInfo").setTextContent(remoteProtocolInfo.toString()); soapBodyElement.addChildElement("PeerConnectionManager").setTextContent(peerConnectionManager.toString()); soapBodyElement.addChildElement("PeerConnectionID").setTextContent(Integer.toString(peerConnectionID)); soapBodyElement.addChildElement("Direction").setTextContent(direction.toString()); return retVal; } } public static class PrepareForConnectionResponse extends SOAPSerializable { public int connectionID; public int aVTransportID; public int rcsID; public void parse(SOAPMessage soapMessage) throws SOAPException { for (Element e: XmlUtil.getChildElements(XmlUtil.getChildElements(soapMessage.getSOAPBody()).get(0))) { String name = e.getNodeName(); if ("ConnectionID".equals(name)) { connectionID = Integer.valueOf(e.getTextContent()); continue; } if ("AVTransportID".equals(name)) { aVTransportID = Integer.valueOf(e.getTextContent()); continue; } if ("RcsID".equals(name)) { rcsID = Integer.valueOf(e.getTextContent()); continue; } } } public SOAPMessage format() throws SOAPException { SOAPMessage retVal = ConnectionManager2 .PrepareForConnectionResponse.createMessage(); SOAPBodyElement soapBodyElement = retVal.getSOAPBody().addBodyElement(new QName(URI, "PrepareForConnectionResponse", "u")); soapBodyElement.addChildElement("ConnectionID").setTextContent(Integer.toString(connectionID)); soapBodyElement.addChildElement("AVTransportID").setTextContent(Integer.toString(aVTransportID)); soapBodyElement.addChildElement("RcsID").setTextContent(Integer.toString(rcsID)); return retVal; } } }
jherico/serket
serket-scpd/src/main/java/org/saintandreas/serket/scpd/ConnectionManager2.java
Java
gpl-3.0
14,975
<?php /** *@package pXP *@file gen-MODGrupoEp.php *@author (admin) *@date 22-04-2013 14:49:40 *@description Clase que envia los parametros requeridos a la Base de datos para la ejecucion de las funciones, y que recibe la respuesta del resultado de la ejecucion de las mismas */ class MODGrupoEp extends MODbase{ function __construct(CTParametro $pParam){ parent::__construct($pParam); } function listarGrupoEp(){ //Definicion de variables para ejecucion del procedimientp $this->procedimiento='param.ft_grupo_ep_sel'; $this->transaccion='PM_GQP_SEL'; $this->tipo_procedimiento='SEL';//tipo de transaccion //Definicion de la lista del resultado del query $this->captura('id_grupo_ep','int4'); $this->captura('estado_reg','varchar'); $this->captura('id_grupo','int4'); $this->captura('id_ep','int4'); $this->captura('fecha_reg','timestamp'); $this->captura('id_usuario_reg','int4'); $this->captura('fecha_mod','timestamp'); $this->captura('id_usuario_mod','int4'); $this->captura('usr_reg','varchar'); $this->captura('usr_mod','varchar'); $this->captura('ep','text'); $this->captura('id_uo','int4'); $this->captura('desc_uo','text'); $this->captura('estado_reg_uo','varchar'); //Ejecuta la instruccion $this->armarConsulta(); $this->ejecutarConsulta(); //Devuelve la respuesta return $this->respuesta; } function insertarGrupoEp(){ //Definicion de variables para ejecucion del procedimiento $this->procedimiento='param.ft_grupo_ep_ime'; $this->transaccion='PM_GQP_INS'; $this->tipo_procedimiento='IME'; //Define los parametros para la funcion $this->setParametro('estado_reg','estado_reg','varchar'); $this->setParametro('id_grupo','id_grupo','int4'); $this->setParametro('id_ep','id_ep','int4'); $this->setParametro('id_uo','id_uo','int4'); //Ejecuta la instruccion $this->armarConsulta(); $this->ejecutarConsulta(); //Devuelve la respuesta return $this->respuesta; } function modificarGrupoEp(){ //Definicion de variables para ejecucion del procedimiento $this->procedimiento='param.ft_grupo_ep_ime'; $this->transaccion='PM_GQP_MOD'; $this->tipo_procedimiento='IME'; //Define los parametros para la funcion $this->setParametro('id_grupo_ep','id_grupo_ep','int4'); $this->setParametro('estado_reg','estado_reg','varchar'); $this->setParametro('id_grupo','id_grupo','int4'); $this->setParametro('id_ep','id_ep','int4'); $this->setParametro('id_uo','id_uo','int4'); //Ejecuta la instruccion $this->armarConsulta(); $this->ejecutarConsulta(); //Devuelve la respuesta return $this->respuesta; } function eliminarGrupoEp(){ //Definicion de variables para ejecucion del procedimiento $this->procedimiento='param.ft_grupo_ep_ime'; $this->transaccion='PM_GQP_ELI'; $this->tipo_procedimiento='IME'; //Define los parametros para la funcion $this->setParametro('id_grupo_ep','id_grupo_ep','int4'); //Ejecuta la instruccion $this->armarConsulta(); $this->ejecutarConsulta(); //Devuelve la respuesta return $this->respuesta; } function sincUoEp(){ //Definicion de variables para ejecucion del procedimiento $this->procedimiento='param.ft_grupo_ep_ime'; $this->transaccion='PM_SINCGREPUO_IME'; $this->tipo_procedimiento='IME'; //Define los parametros para la funcion $this->setParametro('config','config','varchar'); $this->setParametro('id_grupo','id_grupo','int4'); //Ejecuta la instruccion $this->armarConsulta(); $this->ejecutarConsulta(); //Devuelve la respuesta return $this->respuesta; } } ?>
boabo/pxp
sis_parametros/modelo/MODGrupoEp.php
PHP
gpl-3.0
3,739
%%% woptic/doc/woptic_userguide.tex %%% %%% %%% %%% Copyright 2009-2012 Philipp Wissgott %%% %%% 2012-2016 Elias Assmann %%% %%% \input{header.tex} \usepackage{mathtools} \newcommand\TemplateDir{../templates/} \usepackage{tikz, manfnt, pbox} \usetikzlibrary{shapes, arrows, chains, decorations.shapes, fit} \newcommand*\lvir[1][]{% \tikz[overlay] \node[xshift=-6mm, yshift=-1mm, anchor=base, #1] {\footnotesize\textdbend};% } \newcommand*\TOCvir{\lvir[xshift=-11.5mm]} \newcommand*\tocvir[1][]{% \tikz[overlay] \node[xshift=-3.5em, yshift=-.8mm, anchor=base, #1] {\tiny\textdbend};% } \newcommand*\rvir[1][]{% \tikz[overlay] \node[xshift=+6mm, yshift=-1mm, anchor=base, #1] {\footnotesize\textdbend};% } \newcommand\ProgSecVir[2][]{ \def\myarg{#1} \ifx\empty\myarg \def\separator{} \else \def\separator{---} \fi \section[\tocvir\csname#2Hd\endcsname{} \separator{} #1] {\TOCvir\csname#2Hd\endcsname{} \separator{} #1} \label{sec:#2} } \ProgName[woptic\_main] {womain} \ProgName[refine\_tetra]{reftet} \ProgName[obtain\_dist] {obdist} \ProgName[woptic] {woprog} \ProgName {kanalysis} \ProgName {joinham} \ProgName[compute\_vr] {compvr} \ProgName[convert\_vr] {convvr} \ProgName {wopticlean} \ProgName {inwopcheck} \newcommand*\lapwi {\file{lapw1}\xspace} \newcommand*\lapwso {\file{lapwso}\xspace} \newcommand*\optic {\file{optic}\xspace} \newcommand*\prepwiiw{\file{prepare\_w2wdir}\xspace} \newcommand*\wiiw {\file{w2w}\xspace} \newcommand*\wannierx{\file{wannier90.x}\xspace} \newcommand*\convham {\file{convham}\xspace} \newcommand*\wophist {\file{\case.wophist.zip}\xspace} \newcommand*\td{-{}-} \newcommand*\hateq{\mathbin{\widehat=}} \date{for version 1.0.0-$α$} \author{\name{Elias Assmann} \and \name{Philipp Wissgott}} \newcommand*\tit{\Woptic User's Guide} \newcommand*\subtit{Optical conductivity with Wannier functions} \title{\tit\\[1em]\large\mbox{\it \subtit.}} \titlepic{\includegraphics[height=9 cm]{woptic_pic}} \hypersetup{ pdftitle={\tit}, pdfauthor={E. Assmann and P. Wissgott}, pdfsubject={\subtit}, } \begin{document} \raggedbottom \frontmatter \maketitle \newcommand*\cbox[1]{% \pbox{\paperwidth}{\relax\ifvmode\centering\fi% #1% }} \tikz[overlay, remember picture] \node[anchor=center] at (current page.center) { \begin{minipage}{10.7cm} \newcommand*\xL{\color{darkgray}} \newcommand*\xW{\color{green!80!black}} \newcommand*\xF{\bfseries} \newcommand*\xC{\color{brown}} \newcommand*\xA{\color{cyan!90!black}} \newcommand*\xB{\normalfont\ttfamily} \VerbatimInput[commandchars=\!\{\}]{logo.tex} \end{minipage} }; \chapter*{Introduction} \label{chap:intro} To compute the optical conductivity $σ$ in the basis of maximally-localized Wannier orbitals the package \woptic is provided. It uses the Green function formalism, which yields % \begin{equation} \label{eq:optcond} \tag{$*$} σ^{αβ}(Ω) = \tfrac{e^2}{(2π)^2} \int\!\dd^3 k \int\!\dd ω\mathop{} \frac{f(ω)-f(ω+Ω)}{Ω} \tr\left[A(k,ω)\,V^α(k)\,A(k,ω+Ω)\,V^β(k)\right], \end{equation} % where $σ^{αβ}$ is the $(α,β)$ element of the optical conductivity tensor ($α,β \in \{x,y,z\}$), $V_\text{uc}$ the unit cell volume, $f$ the Fermi function, $A= \frac\ii{2 π}(G-G^\dagger)$ the generalized spectral function \cite{Wissgott2012,Tomczak2009a,Jan}, and $V^α$ the group velocity in direction $α$. The numerical bottleneck in evaluating \eqref{eq:optcond} is the k-summation, since usually many k-points are required to obtain converged results. For a speed-up in k-mesh convergence, \woptic therefore employs an adaptively refined tetrahedral tiling of k-space. \Woptic consists of two main programs: \womain, which calculates the optical conductivity, and \reftet, where the k-mesh is refined; as well as several smaller support programs. The individual programs are normally called by means of the driver script \woprog. This guide provides technical documentation for \woptic. For details on the underlying formalism and algorithm, see Refs.~\cite{Philipp, Elias, woptic}. \paragraph{Acknowledgement} Development of this software was supported by Vienna University of Technology, Graz University of Technology, and the European Research Council through grant agreement no. 306447. \paragraph{Caution} Following the many recent changes in \wtow and \woptic, some parts of the older version of \woptic have not yet been adapted. As such, they must be considered experimental. We keep such untested (or even known to be broken) features in the code and in this guide, where they are marked with a ``dangerous bend'' sign, \raisebox{.5\height}{{\footnotesize\dbend}}. \paragraph{Citation} In any scientific publications arising from the use of \woptic, we ask that you cite Ref.~\cite{woptic}, % \begin{quote} \href{http://www.sciencedirect.com/science/article/pii/S0010465515004488}{ \name{E. Assmann, P. Wissgott, J. Kuneš, A. Toschi, P. Blaha}, and \name{K. Held},\\ Comput. Phys. Commun. 202, 1 (2016) } \href{http://arxiv.org/abs/1507.04881}{arXiv:1507.04881}, \end{quote} % to acknowledge your use of our code. This is in addition to the appropriate citations to acknowledge other codes used (such as \wien \cite{wien2k}, \wannier \cite{wien2wannier}, and \wtow \cite{wannier90}). \paragraph{Common options and other resources} This guide attempts to document the features most relevant to the \woptic user; it will not list every option or every file used by every command. Most commands honor the option \code{\td help}, which should provide a definitive list of options for that command. The \woptic distribution also includes a terse instruction sheet as \file{doc/WOPTICHEAT}. \paragraph{Contributing} \Woptic is Free Software. You can contribute to it through \href{https://github.com/woptic/woptic}{GitHub}. Bug reports, feature requests, etc. can be submitted there under \href{https://github.com/woptic/woptic/issues}{Issues}. \MyTOC \mainmatter \chapter{The driver script \woprogHd} \label{sec:woprog} \tikzset{ % <on chain> *and* <on grid> reduce the need for manual relative % positioning of nodes >=latex, %shorten >=1pt, % somehow, I need ‘on grid, on chain’ both globally and in every % node flowchart/.style = { every node/.style = { on chain, on grid }, every join/.style={norm}, % Default linetype for connecting boxes base/.style={ align=center, draw }, prog/.style={ base, rectangle, minimum width=8em, inner sep=2mm, execute at begin node=\ttfamily % ‘font=’ screws up align }, file/.style={ base, ellipse, execute at begin node=\ttfamily % ‘font=’ screws up align }, heading/.style={ base, rounded rectangle, inner sep=10pt, outer sep=0pt }, mycloud/.style={ base, cloud, aspect=2.2, cloud puffs=20, cloud puff arc=135, inner sep=0 }, test/.style={base, diamond, aspect=2, text width=5em}, coord/.style={ }, norm/.style={->}, old/.style ={dashed, overlay}, } } This is the main user-callable program. It runs the other programs as necessary until a set number of iterations is completed (or an error occurs) --- convergence has to be checked manually. If you include an outer window in your \code{interp} calculation, you should check the localization of $W^{αβ}(R,ω)$ and/or the interpolation errors in the optical conductivity. Since the procedure is a little involved, we provide Fig.~\ref{fig:woptic_iter} to give an overview of the files and programs involved in one iteration (but note that not all files that might be involved are shown). The computation of the group velocities $V^α(k)$ for the new k-points varies according to the \hyperref[woprog:matelmode]{option \code{matelmode}}. \Woptic implements two modes using the full momentum matrix elements $V_{ab}^α(k) = \braket{ψ\mathop{} ak | \mathop{\widehat p_α} | ψ\mathop{} bk}$ as group velocities: \paragraph{\code{optic} mode} takes the matrix elements from \wien's \optic module, % \begin{gather*} \tikz[flowchart, baseline, start chain] \node [mycloud] {get new momentum\\matrix elements}; \,=\, \begin{tikzpicture}[ flowchart, baseline, start chain=going right, node distance=4mm, prog/.append style={minimum width=3.8em,text width=, }, ] \node [prog, anchor=base] {\lapwi}; \node [file, join] {vector}; \node [prog, join] {\optic}; \node [file, join] {mommat2}; \end{tikzpicture}\;, \end{gather*} % and transforms them to the Wannier basis using the matrices $U(k)$ which diagonalize the Wannier-interpolated Hamiltonian, $U_{nu}(k) H^\text{w}_{uv}(k) U_{vm}^\dagger(k) = δ_{nm} ε_n(k)$. But the diagonalization fixes the eigenvectors only up to a phase, which leads to a \emph{random-phase problem} in \eqref{eq:optcond} and associated uncertainties in the optical conductivity. The problem is absent whenever the self-energy is orbital-independent (by symmetry, or in a noninteracting model). In such a case, \code{optic} mode should be dependable. Otherwise, the results should be checked for the influence of the random-phase problem. \paragraph{\code{interp} mode} applies Wannier interpolation to the matrix elements directly in order to overcome the random-phase problem. \compvr calculates the Wannier momentum matrix elements in direct space % \begin{gather*} V^{\text{w},α}_{uv}(R) = \frac1{N_k} \sum_k \ee^{-\ii k\cdot R}\, U_{un}^\dagger(k) V^α_{nm}(k) U_{mv}(k) = \braket{w\mathop{} u0 | \mathop{\widehat p_α} | w\mathop{} vR}, \end{gather*} % and \convvr interpolates them to the new k-points,\footnote{In the interest of full disclosure, the diagram is accurate in the case where only Wannier-Wannier transitions are taken into account. With mixed transitions, \file{vr} is supplemented by \file{vvr} and \file{vk$α$} by \file{vvk$αβ$}, and \optic is also called for the mixed [Wannier-Bloch] matrix elements.} % \begin{gather*} \tikz[flowchart, baseline, start chain] \node [mycloud] {get new momentum\\matrix elements}; \,=\, \begin{tikzpicture}[ flowchart, baseline, start chain=going right, node distance=10mm and 4mm, ] \node [prog, anchor=base] (convert_vr) {\convvr}; \node [file, join] {vk$α$}; \node [file, above=of convert_vr, join=with convert_vr by <-] {vr}; \end{tikzpicture}\;. \end{gather*} % The interpolation works well for the Wannier-Wannier transitions ($V^{\text{W},α}$), but interpolation errors may become large for the mixed transitions governed by $W^{αβ}(R,ω)$, where % \begin{gather*} W^{αβ}_{uv}(k, ω) = \sum_i V^α_{ui}(k) A_{ii}(ω) V^β_{iv}(k) \end{gather*} % with the index $i$ running over the non-Wannier states (i.e.~the outer window) and the matrix elements are transformed into the Wannier basis on one side only. Note that the interpolation errors typically only affect the interband optical conductivity; as long as the low-energy degrees of freedom are described by the Wannier functions, the static quantities (dc conductivity and thermopower) should be reliable. \paragraph{\lvir In addition, \code{Peierls}} mode uses the Peierls approximation $V(k) \approx \ii\mathop{\nabla_k} H(k)$ instead of the momentum matrix elements. It is currently unsupported. \paragraph{Further reading.} See \cite{Philipp} for the original description of \woptic in the \code{optic} and \code{Peierls} modes. See \cite{Elias} for a detailed description of \code{interp} mode and a numerical comparison to \code{optic} mode including an analysis of the errors commited in each of them. Ref.~\cite{Wissgott2012} tests the Peierls approximation against the full momentum matrix elements. \paragraph{\lvir Disentanglement} is supported only in \code{interp} mode in the case where only Wannier-Wannier transitions are included. This may be useful when the Wannier model is expected to describe all the salient features of a system, but disentanglement is necessary, e.g., to remove extraneous states at the band edges. %% ------------------------------------------------------------------------ %% Flowcharts inspired by: %% http://www.texample.net/tikz/examples/flexible-flow-chart/ \begin{figure} \centering \newlength\dx \newlength\dy \setlength\dx{22mm} \setlength\dy{18mm} \begin{tikzpicture}[ flowchart, start chain=going below, % General flow is top-to-bottom on chain, on grid, node distance=\dy and \dx, % Global setup of box spacing ] %%% Top \node [coord] (top) {}; % top left \node [file, right=40mm of top, overlay] (kcontribw) {kcontribw}; \node [coord, right=of kcontribw, overlay] () {}; \node [coord, overlay] (start) {}; % top right \node [file, left=40mm of top, overlay] (tetra) {tetra, map, voe}; % top center \node [prog, below=of top, join=with tetra, join=with kcontribw] (refine_tetra) {\reftet}; % top right \node [coord, below=of tetra, overlay] () {}; \node [file, overlay, join=with refine_tetra] (tetra_new) {\ldots\_refined}; %%% Center \node [file, below=of refine_tetra, join=with refine_tetra] (klist_new) {klist\_add}; \node [coord] (m1) {}; \node [coord] () {}; \node [coord] (m2) {}; %%% Right branch \node [mycloud, right=of m1, yshift=-.4\dy, join=with klist_new] (get_mommat) {get new momentum\\matrix elements}; \node [file, yshift=-.6\dy, join] (mommat) {mommat2 \textrm{and/or}\\ vk$α$, vvk$αβ$}; %%% Right branch \node [prog, left=of m1, join=with klist_new](convham) {\convham}; \node [file, left=2\dx of mommat, join] (hk) {hk}; \node [file, left=1.3\dx of hk, overlay] (hk_old) {\ldots\_old}; %%% After re-join \node [prog, below=of m2, join=with mommat, join=with hk, join=with hk_old] (joinham) {\joinham}; \node [file, join] (hk_new) {\ldots\_joined}; \node [file, left=2\dx of hk_new, overlay] (k1w) {K1w\\wdoskcontribw}; \node [prog, below=of hk_new, join, join=with hk_new] (woptic_main) {\womain}; \node [file, join] (kcontribw_new){kcontribw\_new}; \node [file, left=2\dx of kcontribw_new, overlay, join=with woptic_main] (k1w_new) {\ldots\_new}; %%% Bottom \node [coord, below=of kcontribw_new] (bottom) {}; \node [coord, right=of bottom, overlay] (end) {}; %%% ‘old’ and ‘new’ files %%% Arrows not generated by ‘join’ \draw[old] (hk_new) edge[->, bend left=15] (hk_old); \draw[old] (k1w_new) edge[->, bend left] (k1w); \draw[old] (tetra_new) edge[->, bend left] (tetra); \draw[old] (kcontribw_new) edge[->, out=-90,in=180] (end); \draw[old] (kcontribw) edge[<-, out= 0,in= 90] (start); \draw[norm,overlay] (kcontribw) edge[bend left=40] (woptic_main.north east); \end{tikzpicture} \caption{Flow of control and information in the main \woptic loop: programs (rectangles) and selected files (ellipses). Dashed lines indicate a file is taken from the previous iteration.} \label{fig:woptic_iter} \end{figure} \begin{figure} \centering \setlength\dx{25mm} \setlength\dy{17mm} \begin{tikzpicture}[% flowchart, start chain=going below, % general flow is top-to-bottom on chain, on grid, node distance=\dy and \dx,% global setup of box spacing ] \node [base] (wien2k) {\wien run}; \node [prog, join] (prepare) {\prepwiiw, cd}; \node [base, join] (wien2wannier) {\wiiw, \wannierx}; \node [coord, yshift=-.5\dy] (m1) {}; \node [heading, left =of m1] (interp) {momentum matrix\\interpolation}; \node [file, join] {inop\\MME=ON}; \node [prog, join] {\optic}; \node [prog, join] {\compvr}; \node [prog, join] (woptic) {\woprog}; \node [coord, right=of woptic] (m2) {}; \node [heading, right=of m1] (trad) {momentum matrix\\from \optic}; \node [file, join] {inop\\MME=ON}; \node [prog, join, right=of m2] {\woprog}; \draw (wien2wannier.south) -- (trad); \draw (wien2wannier.south) -- (interp); \end{tikzpicture} \caption{Flow of control and information in \woptic initialization.} \label{fig:woptic_init} \end{figure} \FloatBarrier \section{Synopsis} \label{sec:woprog:usage} \newcommand\Ntot{$N_\text{tot}$\xspace} \newcommand\NI{\ensuremath{N_\text{i}}\xspace} \begin{usage} \woprog [-i \Ntot] [\td{}restart $I$] [\codeit{more options}] \end{usage} \section{Options} \begin{options} \item [-i \Ntot] stop after iteration \Ntot{} \rem{(default: 5)} \item [\td{}restart $I$] restart from \wophist at the beginning of iteration $I$ \rem{(default: 1)} \item [\td{}restore $I$] restore iteration $I$ from \wophist without continuing \item [\td{}theta $Θ$] refinement harshness \rem{($Θ=\mathit0$: uniform mesh, $Θ=\mathit1$: most adaptive; default: 0.5)} \item [\td{}inter] focus refinement on larger $Ω$ \item [\td{}init \NI] initial uniform refinement steps \rem{(default: 3)} \label{woprog:init} \item [\lvir\td{}band] compute optical conductivity contributions along \file{\case.klist\_band} to be processed by \kanalysis \item[-p] call the parallelized versions of \lapwi, \lapwso, \optic (\woptic itself is not parallelized) \end{options} % The iterations in \code{-i}, \code{\td{}restart}, and \code{\td{}restore} are ``absolute'' in the sense that iteration $1$ always corresponds to the initial k-mesh. Thus, \code{\woprog{} \td{}restart 3 -i 5} does three iterations: nos. $3$, $4$, and $5$. Iteration no. $1$ starts with a uniform k-mesh whose density is determined by \NI. The starting mesh corresponds to $(2^{\NI+1})^3$ k-points in the full \bz. Let $T$ be a tetrahedron and $ε(T)$ its associated integration error estimate. The precise meaning of the ``harshness'' $Θ\in [0,1]$ is: $T$ will be refined if % \begin{gather} \label{eq:theta} \tag{\code{\td{}theta}} ε(T) \ge Θ \max_{T} ε(T) \end{gather} % (but may also be refined due to other rules) \cite{Philipp, woptic}. The \code{\td{}inter} option scales the contributions to the error estimates by the frequency, % \begin{gather} \label{eq:inter} \tag{\code{\td{}inter}} ε(T; Ω) \gets Ω\cdot ε(T,Ω), \end{gather} % for the purposes of refinement. \section{The input file \file{\case.inwop}} \label{sec:woprog:inwop} The main input file for \woptic is % \Template{inwop} % \listnote \pagebreak \begin{lines} \begin{flin}{mode, matelmode, intrahop}{modes of operation} \label{woprog:matelmode} mode & OPT & compute the optical conductivity\\ & JOINT & compute the joint density of states (noninteracting only)\\ matelmode & 1 | Peierls & use $\dd H^\text{w}/\dd k$ as momentum matrix elements\\ & 2 | interp & Wannier-interpolated momentum matrix elements\\ & 3 | optic & matrix elements computed by \wien's \optic\\ & 4 | Bloch & for testing (noninteracting only)\\ & 5 | LDA & for testing (noninteracting only; should be similar to \optic--\code{joint}--\code{kram})\\ intrahop & \T{logical} & whether to use intra-\uc hopping in \code{Peierls} mode \cite{Tomczak2009a,Jan} (needs \file{\case.intrahop}) \end{flin} \vskip-.9\baselineskip \lvir[anchor=center]{}Only \code{mode}s \code{interp} and \code{optic} are thoroughly tested; \code{Peierls}, \code{Bloch}, and \code{LDA} must be considered experimental. \newcommand*\Emax{\ensuremath{Ω_\text{max}}} \newcommand*\dE {$\upDelta Ω$} \newcommand*\Ndiv{$N_{ω/Ω}$\xspace} \begin{flin}[T]{\Emax, \dE, $δ$, \Ndiv, $ε$}{frequency grids and broadening} \Emax & \U{\eV} & maximum external frequency for which $σ(Ω=\Emax)$ is computed\\ \dE & \U{\eV} & $Ω$ grid spacing\\ $δ$ & \U{\eV} & broadening parameter for noninteracting bands (where $Σ \gets \ii\delta$)\\ \Ndiv & int & internal frequency density (\Ndiv internal $ω$ per external $Ω$)\\ $ε$ & real & tolerance for $ω$-integration limits ($-\Emax \lesssim ω \lesssim 0$) \end{flin} \vskip-.9\baselineskip \textbf{Note:}\hspace{1em} Set $\Emax=0$ to compute only the dc quantities. \begin{flin}[T]{Wlo, Whi, [Blo, Bhi]}{band windows} Wlo, Whi & int & band indices corresponding to \wfs\\ Blo, Bhi & int & the outer (``Bloch'') window \rem{(optional, default: \code{Wlo, Whi})} \end{flin} % We do not use column type [U] here because that way the units are % centered \begin{flin}{$β$, $μ$}{grand-canonical ensemble parameters} $β$ & \U{\eV^{-1}} & the inverse temperature \rem{(To convert to temperature in Kelvin: $T \hateq \maybeit{11604}/β$.)}\\ $μ$ & \U{\eV} & the chemical potential \rem{(applied only to the interacting bands [see \code{iself}], use the DMFT value; for noninteracting calculations, set $μ=\mathit{0}$)} \end{flin} \begin{flin}[T]{Drudesep, orbresolv}{} Drudesep & \U{\eV} & cutoff for Drude sumrule integration\\ \lvir orbresolv & logical & whether to compute observables per-orbital (currently deactivated) \end{flin} \begin{flin}[T]{selfE, Nself}{self-energy specification} selfE & logical & whether to read self-energy $Σ_i(ω)$ from \file{\case.selfE}\\ Nself & int & number of bands with self-energy, or $0$ \rem{(in this case, $\code{Whi}-\code{Wlo}+1$)} \end{flin} \begin{flin}[T]{iself}{interacting bands \rem{(ignored if \code{selfE=.false.} or \code{Nself=0})}} iself & int(Nself) & indices of interacting bands \rem{(if \code{Nself=0}: inner window)} \end{flin} \begin{flin}[T]{wfrot, shift, Eshift, Nshift}{\wf rotation and scissors operator} wfrot & logical & whether to apply unitary matrix from \file{\case.wfrot} to \wf basis\\ shift & logical & whether to apply rigid ``scissors'' shift\\ Eshift & \U{\eV} & shift value\\ Nshift & int & number of bands to shift\\ \end{flin} \begin{flin}[T]{ishift}{scissor bands} ishift & int(Nshift) & indices of bands to shift \end{flin} \end{lines} \section{Environment variable \code{\$SCRATCH}} \label{sec:woprog:scratch} \woprog and the programs it calls support \wien-style \code{\$SCRATCH} for temporary files. This means that \lapwi and \optic will place \file{\case.vector} and \file{\case.mommat2} in the directory \code{\$SCRATCH}; likewise, \womain and \reftet will place certain temporary files in that directory. However, note that a true local \code{\$SCRATCH} on a cluster is not supported. In this case, the individual \file{\case.mommat2\_\textit{i}} would have to be transferred to the “master” node. \section{Output files} \label{sec:woprog:output} Over the course of the iterations, \woprog writes diagnostic information to standard output and lists the executed commands in \file{:log}. In particular, the current values of the quantities \code{thermopower}, \code{dc conductivity}, and \code{sumrules} are extracted from \womain's output file \file{\case.outputwop}, as well as the integration error \code{estimator} from \reftet's \file{case.outputref}. The latter is given in arbitrary units and should decrease over the iterations. The optical conductivity is written to \file{\case.optcondw}. For comparison with \wien's standard \optic module, note that there is a factor $\approx 1112.65$ between \optic's output (given in Gaussian \cgs units of \SI{e15}{\per\second} in \file{\case.sigmak}) and \woptic's (in \siunits units of \si{\siemens\per\cm}). Expressed in the \siunits, the conversion is $\text\optic = \text\woptic \cdot 4π\, ε_0\, \SI{e15}{\hertz\ohm\cm}$. The density of states is written to \file{\case.wdos}. The files \file{\case.optcondw} and \file{\case.wdos} always correspond to the latest iteration. Together with certain other files, they are archived in \wophist with a suffix \file{.$I$} for iteration $I$. \chapter{Support Programs} \label{sec:support} In this section, the sub-programs called by \woprog are documented, roughly in order of decreasing user-callability. %%%%%%%% \ProgSec[remove left-over files from \woptic runs]{wopticlean} %%%% \wopticlean preserves files which serve as input to \woprog and its sub-programs, as well as the archive file \wophist. The number of files considered for deletion is substantial; to check which ones are, use the \code{\td recon} option or the source. \subsection{Synopsis} \begin{usage} \wopticlean [\td recursive] [\td mrproper] [\td recon] [\codeit{directory} \ldots] \end{usage} \subsection{Options and arguments} \begin{options} \item [-r|\td recursive] Operate recursively on \emph{all} directories below \item [-A|\td mrproper] delete also files whose basename does not match the containing directory \item [-n|\td recon] dry-run; print file names that would be deleted \end{options} % The arguments specify \codeit{directories} to operate on \rem{(default: \file{.})}. Before a big cleanup (especially when using \code{-A} or \code{-r}), you are advised to do a dry-run. %%%%%%%% \ProgSec[compute $\maybebmsf{V^\text{w}(R)}$]{compvr} %%%% \compvr computes the dipole matrix elements $V^{\text{W},α}(R)$ and $W^{αβ}(R, ω)$ in direct space by applying the matrices $U(k)$ and a Fourier transform for use with the \code{interp} mode. You should check these matrix elements (especially $W^{αβ}$) for decay in $R$ when using this mode. \subsection{Synopsis} \begin{usage} \compvr [\td text] \case \end{usage} \subsection{Option} \begin{options} \item [\td text] output \file{\case.vvr} in plain text \end{options} \subsection{Files read} \begin{options} \item[\case.inwop] input file \item[\case.chk] \wannier checkpoint file \item[\case{}\_hr.dat] Hamiltonian in direct space \item[\case.mommat2] momentum matrix elements \item[\case.struct] \wien master input file \usgrem{(mixed transitions)} \item[\case.energy] energies from \lapwi \usgrem{(mixed transitions)} \item[\case.fermi] Fermi energy \usgrem{(mixed transitions)} \item[\case.inwf] \wiiw input file \usgrem{(disentanglement)} \end{options} \subsection{Files written} \begin{options} \item[\case.outputvr] log file \item[\case.vr] $V^{\text{W},α}(R)$ \item[\case.vvr] $W^{αβ}(R, ω)$ \usgrem{(mixed transitions)} \end{options} %%%%%%%% \ProgSecVir[$\maybebmsf{σ(k,ω)}$ on a BZ path]{kanalysis} %%%% This program generates files that can be used for analysis of the contributions to the optical conductivity in \woptic. Required is a run of \woprog with the \code{\td{}band} option, such that it computes the contributions to the optical conductivity along \file{\case.klist\_band} and stores them in \file{\case.kcontribw\_band}. \kanalysis reads this file and generates 2\textsc{d} data in $ω$- and k-space readable e.g. by gnuplot. \subsection{Synopsis} \newcommand*\Nfreq{$n_{Ω}^\text{min}$\xspace} \begin{usage} \kanalysis \Nfreq \case [\codeit{mode}] \end{usage} \subsection{Arguments} \begin{options} \item [\Nfreq] minimum frequency index for output \item [\codeit{mode}] \rem{(optional)} by default, the output includes extra newlines for convenient plotting with \gnuplot (\code{splot "\case.optanalysis\_band" with pm3d}); if $\code{mode} = 1$, these newlines are omitted \end{options} %%%%%%%% \ProgSecVir[intra-UC hopping for \code{Peierls}]{obdist} %%%% In \woptic, for the generalized \code{Peierls} approximation \cite{Tomczak2009a}, the distances between the Wannier centers are required. This program reads \file{\case{}\_centres.xyz} which is produced by \wannier and generates \file{\case.intrahop} which can then be used by \woptic. \subsection{Synopsis} \begin{usage} \obdist \case \end{usage} %%%%%%%% \ProgSec[parse \file{inwop} file]{inwopcheck} %%%% A helper program for \woprog. Reads an \file{inwop} file and outputs information suitable for reading in a shell script or for inspection. \subsection{Synopsis} \begin{usage} \inwopcheck \case.inwop \end{usage} %%%%%%%% \ProgSec[k-integration]{womain} %%%% \womain computes the optical conductivity contributions $σ(k,ω)$ on the k-mesh constructed by \reftet and performs the k- and $ω$-integration. It is normally called by \woprog, but it may be useful to call it manually after a \woprog run. \subsection{Synopsis} \begin{usage} \womain [\td{}band] \case \end{usage} \subsection{Option} \begin{options} \item [{\lvir[xshift=-2.65mm]}\td{}band] compute optical conductivity contributions along \file{\case.klist\_band} to be processed by \kanalysis \end{options} \paragraph{} Files used by \womain are listed below. \emph{Updated} files are written with a suffix \file{\_new}. Which files precisely are used depends on the options in effect, this dependence is partially indicated below. \subsection{Files read} \begin{options} \item [\case.inwop] woptic main input file \usgrem{(always)} \item [\case.struct] Wien2k master input file \usgrem{(always)} \item [\case.symop] symmetry operations from optic \usgrem{(always)} \item [\case.klist] symmetrized k-points \usgrem{(always)} \item [\case.tetra] symmetrized tetrahedra \usgrem{(always)} \item [\case.energy] energies from \lapwi \item [\case.fermi] Fermi energy \item [\case.mommat2] matrix elements from \optic \item [\case.chk] \wannier checkpoint file \usgrem{(testing mode)} \item [\case.vk$α$] Wannier-interpolated matrix elements \codeit{(interp)} \item [\case.vvk$αβ$] Wannier-interpolated mixed matrix elements \codeit{(interp)} \item [\case.hk] Wannier Hamiltonian $H^\text{w}(R)$ \item [\case.selfE] self-energy $Σ(ω)$ \codeit{(selfE)} \item [\case.wfrot] Wannier function rotation matrix \codeit{(wfrot)} \item [\case.klist\_full] unsymmetrized k-points \codeit{(Peierls)} \item [\case.tetra\_full] unsymmetrized tetrahedra \codeit{(Peierls)} \item [\case.map] mapping of \file{klist\_full} to \file{klist} \codeit{(Peierls)} \item [\case.intrahop] \wf center distance matrix \codeit{(Peierls \& intrahop)} \end{options} \subsection{Files written} \begin{options} \item[\case.outputwop] diagnostic output \usgrem{(always)} \item[\case.optcondw] optical conductivity \usgrem{(always)} \item[\case.wdos] (joint) density of states \usgrem{(always)} \item[\lvir \case.optcondw\_orb$αβ$] orbitally resolved optical conductivity \codeit{(orbresolv)} (currently deactivated) \end{options} \subsection{Files updated} \begin{options} \item[\case.kcontribw] optical conductivity contributions \item[\case.K1w] thermopower contributions \item[\case.wdoskcontribw] \dos contributions \end{options} %%%%%%%% \ProgSec[k-mesh refinement]{reftet} %%%% \reftet uses the optical conductivity contributions $σ(k, ω)$ to compute integration error estimates and refine the k-mesh. It is normally called by \woprog. \subsection{Synopsis} \begin{usage} \reftet [\codeit{options}] \case \end{usage} \subsection{Options} \begin{options} \item[\td theta $Θ$] $0 \le Θ \le 1$ defines the ``harshness'' of refinement \usgrem{(see \hyperref[eq:theta]{corresponding option} of \woprog)} \item[\td init \NI] initial refinement with \NI steps \usgrem{(see \hyperref[woprog:init]{corresponding option} of \woprog)} \item[\td inter] give larger weight to higher-energy contributions \usgrem{(see \hyperref[eq:inter]{corresponding option} of \woprog)} \end{options} \paragraph{} Files used by \reftet are listed below. \emph{Updated} files are written with a suffix \file{\_refined}. \subsection{Files read} \begin{options} \item[\case.inwop] woptic main input file \item[\case.struct] Wien2k master input file \end{options} \subsection{Files written} \begin{options} \item[\case.kcontribw] function values for estimator on \file{\case.klist} \item[\case.outputref] log file \end{options} \subsection{Files updated} \begin{options} \item[\case.klist] symmetrized k-points \item[\case.klist\_full] unsymmetrized k-points \item[\case.tetra] symmetrized tetrahedra \item[\case.tetra\_full] unsymmetrized tetrahedra \item[\case.voe] list of k-points on tetrahedral edges \item[\case.map] internal mapping of \file{\case.klist\_full} to \file{\case.klist} \end{options} %%%%%%%% \ProgSec[combine \file{hk} / \file{mommat2} / \file{vk$α$} / \file{vvk$αβ$} files]{joinham} %%%% \joinham combines \file{\_old} files from the previous iteration with new files corresponding to added k-points. It is normally called by \woprog. \subsection{Synopsis} \begin{usage} joinham \case |\\ joinham \codeit{hk} \codeit{mommat} |\\ joinham \codeit{hk1} \codeit{hk2} \codeit{hkout} |\\ joinham \codeit{hk1} \codeit{hk2} \codeit{hkout} \codeit{mom1} \codeit{mom2} \codeit{momout} \end{usage} \subsection{Arguments} \begin{options} \item [\itshape hk*] a file of type \file{\case.hk}, \file{\case.vk$α$}, or \file{\case.vvk$αβ$} \item [\itshape mom*] a file of type \file{\case.mommat2} \end{options} % In the first form, \file{\case.hk\_old} is joined with \file{\case.hk}, and, if they exist, \file{\case.mommat2\_old} with \file{\case.mommat}. In the second form, \file{\codeit{hk}\_old} is joined with \fileit{hk} and \fileit{mom\_old} with \fileit{mom}. In both cases, output file names are suffixed with \file{\_joined}. \code{Unformatted} \fileit{mom} files are handled automatically and result in \code{unformatted} output. %%%%%%%% \ProgSec[Fourier-interpolate $\maybebmsf{V^\text{w}(k)}$]{convvr} %%%% \convvr computes \file{\case.vk$α$} and \file{\case.vvk$αβ$} from \file{\case.vr} and \file{\case.vvr} by Fourier transform. The procedure is analogous to \file{convham}, \file{\case.hk}, and \file{\case{}\_hr.dat}. \subsection{Synopsis} \begin{usage} \convvr [\td text] \case \end{usage} \subsection{Option} \begin{options} \item [-t, \td text] write \file{\case.vvk$αβ$} in plain text instead of \code{unformatted} (\file{\case.vk$α$} is always plain text) \end{options} \subsection{Files read} \begin{options} \item[\case.struct] \wien master input file \item[\case.klist] target k-points \item[\case.inwop] \woprog input file \item[\case.vr] direct-space matrix elements $V^{\text{W},α}(R)$ \item[\case.vvr] direct-space mixed matrix elements $W^{αβ}(R, ω)$ \rem{(mixed transitions)} \end{options} \subsection{Files written} \begin{options} \item[\case.outputvk] log file \item[\case.vk\{x,y,z\}] k-space matrix elements $V^{\text{W},α}(k)$ \item[\case.vvk\{xx,xy,xz,yy,yz,zz\}] k-space mixed matrix elements $W^{αβ}(R, ω)$ \rem{(mixed transitions)} \end{options} \backmatter \begin{thebibliography}{88} \bibitem{Wissgott2012} \name{P. Wissgott, J. Kuneš, A. Toschi,} and \name{K. Held.} \textit{Dipole matrix element approach versus Peierls approximation for optical conductivity.} \href{http://prb.aps.org/abstract/PRB/v85/i20/e205133}{ Phys. Rev. B {\bf 85}, 205133 (2012). } \bibitem{Tomczak2009a} \name{J.M. Tomczak} and \name{S. Biermann.} \textit{Optical properties of correlated materials: Generalized Peierls approach and its application to $\text{VO}_{2}$.} \href{http://prb.aps.org/abstract/PRB/v80/i8/e085117}{ Phys. Rev. B {\bf 80}, 085117 (2009). } \bibitem{Jan} \name{J.M. Tomczak.} \textit{Spectral and optical properties of correlated materials.} \href{https://pastel.archives-ouvertes.fr/pastel-00003163}{ PhD Thesis, \'Ecole Polytechnique, Paris (2007). } \bibitem{Philipp} \name{P. Wissgott.} \textit{Transport properties of correlated materials from first principles.} \href{http://katalog.ub.tuwien.ac.at/AC07812647}{ PhD Thesis, TU Wien, Vienna (2012). } \bibitem{Elias} \name{E. Assmann.} \textit{Spectral properties of strongly correlated materials.} \href{http://katalog.ub.tuwien.ac.at/AC12656725}{ PhD Thesis, TU Wien, Vienna (2015). } \bibitem{woptic} \name{E. Assmann, P. Wissgott, J. Kuneš, A. Toschi, P. Blaha,} and \name{K. Held.} \textit{woptic: optical conductivity with Wannier functions and adaptive k-mesh refinement.} \href{http://www.sciencedirect.com/science/article/pii/S0010465515004488}{ Comput. Phys. Commun. \textbf{202}, 1 (2016), } \href{http://arxiv.org/abs/1507.04881}{arXiv:1507.04881}. \bibitem{wien2k} \name{P. Blaha, K. Schwarz, G.K.H. Madsen, D. Kvasnicka,} and \name{J. Luitz.} \textit{Wien2k, An Augmented Plane Wave + Local Orbitals Program for Calculating Crystal Properties.} Techn. Universität Wien, Vienna, (2001). \url{http://www.wien2k.at}. \bibitem{wien2wannier} \name{J. Kuneš, R. Arita, P. Wissgott, A.Toschi, H. Ikeda,} and \name{K. Held.} \textit{Wien2wannier: From linearized augmented plane waves to maximally localized Wannier functions.} \href{http://www.sciencedirect.com/science/article/pii/S0010465510002948}{ Comput. Phys. Commun. \textbf{181}, 1888~(2010), } \href{http://arxiv.org/abs/1004.3934}{arXiv:1004.3934}. \bibitem{wannier90} \name{A.A. Mostofi, J.R. Yates, Y.-S. Lee, I. Souza, D. Vanderbilt,} and \name{N. Marzari.} \textit{Wannier90: A tool for obtaining maximally-localized Wannier functions.} \href{http://www.sciencedirect.com/science/article/pii/S0010465507004936}{% Comput. Phys. Commun. \textbf{178}, 685~(2008). } \href{http://arxiv.org/abs/0708.0650}{arXiv:0708.0650} % Must have empty line to terminate bibitem! \end{thebibliography} \end{document}
woptic/woptic
doc/woptic_userguide.tex
TeX
gpl-3.0
38,651
<?php /** * Translation Manager for Android Apps * * PHP version 7 * * @category PHP * @package TranslationManagerForAndroidApps * @author Andrej Sinicyn <rarogit@gmail.com> * @copyright 2017 Andrej Sinicyn * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License version 3 or later * @link https://github.com/rarog/TranslationManagerForAndroidApps */ /** * List of enabled modules for this application. * * This should be an array of module namespaces used in the application. */ return [ 'Zend\Navigation', 'Zend\Mvc\Plugin\FlashMessenger', 'Zend\Mvc\Plugin\Prg', 'Zend\Serializer', 'Zend\InputFilter', 'Zend\Filter', 'Zend\Hydrator', 'Zend\I18n', 'Zend\Session', 'Zend\Mvc\I18n', 'Zend\Log', 'Zend\Form', 'Zend\Db', 'Zend\Cache', 'Zend\Router', 'Zend\Validator', 'ConfigHelper', 'TwbBundle', 'ZfcUser', 'Setup', 'Common', 'Translations', 'Application', 'ZfcRbac', 'UserRbac', ];
rarog/TranslationManagerForAndroidApps
config/modules.config.php
PHP
gpl-3.0
1,034
# EPROM tool tests Source code of firmware tests to check hardware functions
aelfimow/eprom-tool-1
tests/README.md
Markdown
gpl-3.0
77
/* Test the gnulib dirname module. Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <config.h> #include "dirname.h" #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> struct test { const char *name; /* Name under test. */ const char *dir; /* dir_name (name). */ const char *last; /* last_component (name). */ const char *base; /* base_name (name). */ const char *stripped; /* name after strip_trailing_slashes (name). */ bool modified; /* result of strip_trailing_slashes (name). */ bool absolute; /* IS_ABSOLUTE_FILE_NAME (name). */ }; static struct test tests[] = { {"d/f", "d", "f", "f", "d/f", false, false}, {"/d/f", "/d", "f", "f", "/d/f", false, true}, {"d/f/", "d", "f/", "f/", "d/f", true, false}, {"d/f//", "d", "f//", "f/", "d/f", true, false}, {"f", ".", "f", "f", "f", false, false}, {"/", "/", "", "/", "/", false, true}, #if DOUBLE_SLASH_IS_DISTINCT_ROOT {"//", "//", "", "//", "//", false, true}, {"//d", "//", "d", "d", "//d", false, true}, #else {"//", "/", "", "/", "/", true, true}, {"//d", "/", "d", "d", "//d", false, true}, #endif {"///", "/", "", "/", "/", true, true}, {"///a///", "/", "a///", "a/", "///a", true, true}, /* POSIX requires dirname("") and basename("") to both return ".", but dir_name and base_name are defined differently. */ {"", ".", "", "", "", false, false}, {".", ".", ".", ".", ".", false, false}, {"..", ".", "..", "..", "..", false, false}, #if FILE_SYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR {"a\\", ".", "a\\", "a\\", "a", true, false}, {"a\\b", "a", "b", "b", "a\\b", false, false}, {"\\", "\\", "", "\\", "\\", false, true}, {"\\/\\", "\\", "", "\\", "\\", true, true}, {"\\\\/", "\\", "", "\\", "\\", true, true}, {"\\//", "\\", "", "\\", "\\", true, true}, {"//\\", "/", "", "/", "/", true, true}, #else {"a\\", ".", "a\\", "a\\", "a\\", false, false}, {"a\\b", ".", "a\\b", "a\\b", "a\\b", false, false}, {"\\", ".", "\\", "\\", "\\", false, false}, {"\\/\\", "\\", "\\", "\\", "\\/\\",false, false}, {"\\\\/", ".", "\\\\/","\\\\/","\\\\", true, false}, {"\\//", ".", "\\//", "\\/", "\\", true, false}, # if DOUBLE_SLASH_IS_DISTINCT_ROOT {"//\\", "//", "\\", "\\", "//\\", false, true}, # else {"//\\", "/", "\\", "\\", "//\\", false, true}, # endif #endif #if FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX # if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE {"c:", "c:", "", "c:", "c:", false, false}, {"c:/", "c:/", "", "c:/", "c:/", false, true}, {"c://", "c:/", "", "c:/", "c:/", true, true}, {"c:/d", "c:/", "d", "d", "c:/d", false, true}, {"c://d", "c:/", "d", "d", "c://d",false, true}, {"c:/d/", "c:/", "d/", "d/", "c:/d", true, true}, {"c:/d/f", "c:/d", "f", "f", "c:/d/f",false, true}, {"c:d", "c:.", "d", "d", "c:d", false, false}, {"c:d/", "c:.", "d/", "d/", "c:d", true, false}, {"c:d/f", "c:d", "f", "f", "c:d/f",false, false}, {"a:b:c", "a:.", "b:c", "./b:c","a:b:c",false, false}, {"a/b:c", "a", "b:c", "./b:c","a/b:c",false, false}, {"a/b:c/", "a", "b:c/", "./b:c/","a/b:c",true, false}, # else /* ! FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE */ {"c:", "c:", "", "c:", "c:", false, true}, {"c:/", "c:", "", "c:", "c:", true, true}, {"c://", "c:", "", "c:", "c:", true, true}, {"c:/d", "c:", "d", "d", "c:/d", false, true}, {"c://d", "c:", "d", "d", "c://d",false, true}, {"c:/d/", "c:", "d/", "d/", "c:/d", true, true}, {"c:/d/f", "c:/d", "f", "f", "c:/d/f",false, true}, {"c:d", "c:", "d", "d", "c:d", false, true}, {"c:d/", "c:", "d/", "d/", "c:d", true, true}, {"c:d/f", "c:d", "f", "f", "c:d/f",false, true}, {"a:b:c", "a:", "b:c", "./b:c","a:b:c",false, true}, {"a/b:c", "a", "b:c", "./b:c","a/b:c",false, false}, {"a/b:c/", "a", "b:c/", "./b:c/","a/b:c",true, false}, # endif #else /* ! FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX */ {"c:", ".", "c:", "c:", "c:", false, false}, {"c:/", ".", "c:/", "c:/", "c:", true, false}, {"c://", ".", "c://", "c:/", "c:", true, false}, {"c:/d", "c:", "d", "d", "c:/d", false, false}, {"c://d", "c:", "d", "d", "c://d",false, false}, {"c:/d/", "c:", "d/", "d/", "c:/d", true, false}, {"c:/d/f", "c:/d", "f", "f", "c:/d/f",false, false}, {"c:d", ".", "c:d", "c:d", "c:d", false, false}, {"c:d/", ".", "c:d/", "c:d/", "c:d", true, false}, {"c:d/f", "c:d", "f", "f", "c:d/f",false, false}, {"a:b:c", ".", "a:b:c","a:b:c","a:b:c",false, false}, {"a/b:c", "a", "b:c", "b:c", "a/b:c",false, false}, {"a/b:c/", "a", "b:c/", "b:c/", "a/b:c",true, false}, #endif {"1:", ".", "1:", "1:", "1:", false, false}, {"1:/", ".", "1:/", "1:/", "1:", true, false}, {"/:", "/", ":", ":", "/:", false, true}, {"/:/", "/", ":/", ":/", "/:", true, true}, /* End sentinel. */ {NULL, NULL, NULL, NULL, NULL, false, false} }; int main (void) { struct test *t; bool ok = true; for (t = tests; t->name; t++) { char *dir = dir_name (t->name); int dirlen = dir_len (t->name); char *last = last_component (t->name); char *base = base_name (t->name); int baselen = base_len (base); char *stripped = strdup (t->name); bool modified = strip_trailing_slashes (stripped); bool absolute = IS_ABSOLUTE_FILE_NAME (t->name); if (! (strcmp (dir, t->dir) == 0 && (dirlen == strlen (dir) || (dirlen + 1 == strlen (dir) && dir[dirlen] == '.')))) { ok = false; printf ("dir_name `%s': got `%s' len %d, expected `%s' len %ld\n", t->name, dir, dirlen, t->dir, (unsigned long) strlen (t->dir)); } if (strcmp (last, t->last)) { ok = false; printf ("last_component `%s': got `%s', expected `%s'\n", t->name, last, t->last); } if (! (strcmp (base, t->base) == 0 && (baselen == strlen (base) || (baselen + 1 == strlen (base) && ISSLASH (base[baselen]))))) { ok = false; printf ("base_name `%s': got `%s' len %d, expected `%s' len %ld\n", t->name, base, baselen, t->base, (unsigned long) strlen (t->base)); } if (strcmp (stripped, t->stripped) || modified != t->modified) { ok = false; printf ("strip_trailing_slashes `%s': got %s %s, expected %s %s\n", t->name, stripped, modified ? "changed" : "unchanged", t->stripped, t->modified ? "changed" : "unchanged"); } if (t->absolute != absolute) { ok = false; printf ("`%s': got %s, expected %s\n", t->name, absolute ? "absolute" : "relative", t->absolute ? "absolute" : "relative"); } free (dir); free (base); free (stripped); } return ok ? 0 : 1; }
ystk/debian-m4
tests/test-dirname.c
C
gpl-3.0
8,651
// -*- mode:c++; tab-width:2; indent-tabs-mode:nil; c-basic-offset:2 -*- /* * FinderPatternFinder.cpp * zxing * * Created by Christian Brunschen on 13/05/2008. * Copyright 2008 ZXing authors All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <algorithm> #include <zxing/qrcode/detector/FinderPatternFinder.h> #include <zxing/ReaderException.h> #include <zxing/DecodeHints.h> #include <cstring> using std::sort; using std::max; using std::abs; using std::vector; using zxing::Ref; using zxing::qrcode::FinderPatternFinder; using zxing::qrcode::FinderPattern; using zxing::qrcode::FinderPatternInfo; // VC++ using zxing::BitMatrix; using zxing::ResultPointCallback; using zxing::ResultPoint; using zxing::DecodeHints; namespace { class FurthestFromAverageComparator { private: const float averageModuleSize_; public: FurthestFromAverageComparator(float averageModuleSize) : averageModuleSize_(averageModuleSize) { } bool operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) { float dA = abs(a->getEstimatedModuleSize() - averageModuleSize_); float dB = abs(b->getEstimatedModuleSize() - averageModuleSize_); return dA > dB; } }; class CenterComparator { const float averageModuleSize_; public: CenterComparator(float averageModuleSize) : averageModuleSize_(averageModuleSize) { } bool operator()(Ref<FinderPattern> a, Ref<FinderPattern> b) { // N.B.: we want the result in descending order ... if (a->getCount() != b->getCount()) { return a->getCount() > b->getCount(); } else { float dA = abs(a->getEstimatedModuleSize() - averageModuleSize_); float dB = abs(b->getEstimatedModuleSize() - averageModuleSize_); return dA < dB; } } }; } int FinderPatternFinder::CENTER_QUORUM = 2; int FinderPatternFinder::MIN_SKIP = 3; int FinderPatternFinder::MAX_MODULES = 57; float FinderPatternFinder::centerFromEnd(int* stateCount, int end) { return (float)(end - stateCount[4] - stateCount[3]) - stateCount[2] / 2.0f; } bool FinderPatternFinder::foundPatternCross(int* stateCount) { int totalModuleSize = 0; for (int i = 0; i < 5; i++) { if (stateCount[i] == 0) { return false; } totalModuleSize += stateCount[i]; } if (totalModuleSize < 7) { return false; } float moduleSize = (float)totalModuleSize / 7.0f; float maxVariance = moduleSize / 2.0f; // Allow less than 50% variance from 1-1-3-1-1 proportions return abs(moduleSize - stateCount[0]) < maxVariance && abs(moduleSize - stateCount[1]) < maxVariance && abs(3.0f * moduleSize - stateCount[2]) < 3.0f * maxVariance && abs(moduleSize - stateCount[3]) < maxVariance && abs( moduleSize - stateCount[4]) < maxVariance; } float FinderPatternFinder::crossCheckVertical(size_t startI, size_t centerJ, int maxCount, int originalStateCountTotal) { int maxI = image_->getHeight(); int stateCount[5] = {0}; // for (int i = 0; i < 5; i++) // stateCount[i] = 0; // Start counting up from center int i = startI; while (i >= 0 && image_->get(centerJ, i)) { stateCount[2]++; i--; } if (i < 0) { return nan(); } while (i >= 0 && !image_->get(centerJ, i) && stateCount[1] <= maxCount) { stateCount[1]++; i--; } // If already too many modules in this state or ran off the edge: if (i < 0 || stateCount[1] > maxCount) { return nan(); } while (i >= 0 && image_->get(centerJ, i) && stateCount[0] <= maxCount) { stateCount[0]++; i--; } if (stateCount[0] > maxCount) { return nan(); } // Now also count down from center i = startI + 1; while (i < maxI && image_->get(centerJ, i)) { stateCount[2]++; i++; } if (i == maxI) { return nan(); } while (i < maxI && !image_->get(centerJ, i) && stateCount[3] < maxCount) { stateCount[3]++; i++; } if (i == maxI || stateCount[3] >= maxCount) { return nan(); } while (i < maxI && image_->get(centerJ, i) && stateCount[4] < maxCount) { stateCount[4]++; i++; } if (stateCount[4] >= maxCount) { return nan(); } // If we found a finder-pattern-like section, but its size is more than 40% different than // the original, assume it's a false positive int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4]; if (5 * abs(stateCountTotal - originalStateCountTotal) >= 2 * originalStateCountTotal) { return nan(); } return foundPatternCross(stateCount) ? centerFromEnd(stateCount, i) : nan(); } float FinderPatternFinder::crossCheckHorizontal(size_t startJ, size_t centerI, int maxCount, int originalStateCountTotal) { int maxJ = image_->getWidth(); int stateCount[5] = {0}; // for (int i = 0; i < 5; i++) // stateCount[i] = 0; int j = startJ; while (j >= 0 && image_->get(j, centerI)) { stateCount[2]++; j--; } if (j < 0) { return nan(); } while (j >= 0 && !image_->get(j, centerI) && stateCount[1] <= maxCount) { stateCount[1]++; j--; } if (j < 0 || stateCount[1] > maxCount) { return nan(); } while (j >= 0 && image_->get(j, centerI) && stateCount[0] <= maxCount) { stateCount[0]++; j--; } if (stateCount[0] > maxCount) { return nan(); } j = startJ + 1; while (j < maxJ && image_->get(j, centerI)) { stateCount[2]++; j++; } if (j == maxJ) { return nan(); } while (j < maxJ && !image_->get(j, centerI) && stateCount[3] < maxCount) { stateCount[3]++; j++; } if (j == maxJ || stateCount[3] >= maxCount) { return nan(); } while (j < maxJ && image_->get(j, centerI) && stateCount[4] < maxCount) { stateCount[4]++; j++; } if (stateCount[4] >= maxCount) { return nan(); } // If we found a finder-pattern-like section, but its size is significantly different than // the original, assume it's a false positive int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4]; if (5 * abs(stateCountTotal - originalStateCountTotal) >= originalStateCountTotal) { return nan(); } return foundPatternCross(stateCount) ? centerFromEnd(stateCount, j) : nan(); } bool FinderPatternFinder::handlePossibleCenter(int* stateCount, size_t i, size_t j) { int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4]; float centerJ = centerFromEnd(stateCount, j); float centerI = crossCheckVertical(i, (size_t)centerJ, stateCount[2], stateCountTotal); if (!isnan_z(centerI)) { // Re-cross check centerJ = crossCheckHorizontal((size_t)centerJ, (size_t)centerI, stateCount[2], stateCountTotal); if (!isnan_z(centerJ) && crossCheckDiagonal((int)centerI, (int)centerJ, stateCount[2], stateCountTotal)) { float estimatedModuleSize = (float)stateCountTotal / 7.0f; bool found = false; size_t max = possibleCenters_.size(); for (size_t index = 0; index < max; index++) { Ref<FinderPattern> center = possibleCenters_[index]; // Look for about the same center and module size: if (center->aboutEquals(estimatedModuleSize, centerI, centerJ)) { possibleCenters_[index] = center->combineEstimate(centerI, centerJ, estimatedModuleSize); found = true; break; } } if (!found) { Ref<FinderPattern> newPattern(new FinderPattern(centerJ, centerI, estimatedModuleSize)); possibleCenters_.push_back(newPattern); if (callback_ != 0) { callback_->foundPossibleResultPoint(*newPattern); } } return true; } } return false; } int FinderPatternFinder::findRowSkip() { size_t max = possibleCenters_.size(); if (max <= 1) { return 0; } Ref<FinderPattern> firstConfirmedCenter; for (size_t i = 0; i < max; i++) { Ref<FinderPattern> center = possibleCenters_[i]; if (center->getCount() >= CENTER_QUORUM) { if (firstConfirmedCenter == 0) { firstConfirmedCenter = center; } else { // We have two confirmed centers // How far down can we skip before resuming looking for the next // pattern? In the worst case, only the difference between the // difference in the x / y coordinates of the two centers. // This is the case where you find top left first. Draw it out. hasSkipped_ = true; return (int)(abs(firstConfirmedCenter->getX() - center->getX()) - abs(firstConfirmedCenter->getY() - center->getY()))/2; } } } return 0; } bool FinderPatternFinder::haveMultiplyConfirmedCenters() { int confirmedCount = 0; float totalModuleSize = 0.0f; size_t max = possibleCenters_.size(); for (size_t i = 0; i < max; i++) { Ref<FinderPattern> pattern = possibleCenters_[i]; if (pattern->getCount() >= CENTER_QUORUM) { confirmedCount++; totalModuleSize += pattern->getEstimatedModuleSize(); } } if (confirmedCount < 3) { return false; } // OK, we have at least 3 confirmed centers, but, it's possible that one is a "false positive" // and that we need to keep looking. We detect this by asking if the estimated module sizes // vary too much. We arbitrarily say that when the total deviation from average exceeds // 5% of the total module size estimates, it's too much. float average = totalModuleSize / max; float totalDeviation = 0.0f; for (size_t i = 0; i < max; i++) { Ref<FinderPattern> pattern = possibleCenters_[i]; totalDeviation += abs(pattern->getEstimatedModuleSize() - average); } return totalDeviation <= 0.05f * totalModuleSize; } vector< Ref<FinderPattern> > FinderPatternFinder::selectBestPatterns() { size_t startSize = possibleCenters_.size(); if (startSize < 3) { // Couldn't find enough finder patterns throw zxing::ReaderException("Could not find three finder patterns"); } // Filter outlier possibilities whose module size is too different if (startSize > 3) { // But we can only afford to do so if we have at least 4 possibilities to choose from float totalModuleSize = 0.0f; float square = 0.0f; for (size_t i = 0; i < startSize; i++) { float size = possibleCenters_[i]->getEstimatedModuleSize(); totalModuleSize += size; square += size * size; } float average = totalModuleSize / (float) startSize; float stdDev = (float)sqrt(square / startSize - average * average); sort(possibleCenters_.begin(), possibleCenters_.end(), FurthestFromAverageComparator(average)); float limit = max(0.2f * average, stdDev); for (size_t i = 0; i < possibleCenters_.size() && possibleCenters_.size() > 3; i++) { if (abs(possibleCenters_[i]->getEstimatedModuleSize() - average) > limit) { possibleCenters_.erase(possibleCenters_.begin()+i); i--; } } } if ( possibleCenters_.size() > 3) { // Throw away all but those first size candidate points we found. float totalModuleSize = 0.0f; for (size_t i = 0; i < possibleCenters_.size(); i++) { float size = possibleCenters_[i]->getEstimatedModuleSize(); totalModuleSize += size; } float average = totalModuleSize / (float) possibleCenters_.size(); sort(possibleCenters_.begin(), possibleCenters_.end(), CenterComparator(average)); } vector<Ref<FinderPattern> > result(3); possibleCenters_.erase(possibleCenters_.begin()+3,possibleCenters_.end()); result[0] = possibleCenters_[0]; result[1] = possibleCenters_[1]; result[2] = possibleCenters_[2]; return result; } vector<Ref<FinderPattern> > FinderPatternFinder::orderBestPatterns(vector<Ref<FinderPattern> > patterns) { // Find distances between pattern centers float abDistance = distance(patterns[0], patterns[1]); float bcDistance = distance(patterns[1], patterns[2]); float acDistance = distance(patterns[0], patterns[2]); Ref<FinderPattern> topLeft; Ref<FinderPattern> topRight; Ref<FinderPattern> bottomLeft; // Assume one closest to other two is top left; // topRight and bottomLeft will just be guesses below at first if (bcDistance >= abDistance && bcDistance >= acDistance) { topLeft = patterns[0]; topRight = patterns[1]; bottomLeft = patterns[2]; } else if (acDistance >= bcDistance && acDistance >= abDistance) { topLeft = patterns[1]; topRight = patterns[0]; bottomLeft = patterns[2]; } else { topLeft = patterns[2]; topRight = patterns[0]; bottomLeft = patterns[1]; } // Use cross product to figure out which of other1/2 is the bottom left // pattern. The vector "top-left -> bottom-left" x "top-left -> top-right" // should yield a vector with positive z component if ((bottomLeft->getY() - topLeft->getY()) * (topRight->getX() - topLeft->getX()) < (bottomLeft->getX() - topLeft->getX()) * (topRight->getY() - topLeft->getY())) { Ref<FinderPattern> temp = topRight; topRight = bottomLeft; bottomLeft = temp; } vector<Ref<FinderPattern> > results(3); results[0] = bottomLeft; results[1] = topLeft; results[2] = topRight; return results; } float FinderPatternFinder::distance(Ref<ResultPoint> p1, Ref<ResultPoint> p2) { float dx = p1->getX() - p2->getX(); float dy = p1->getY() - p2->getY(); return (float)sqrt(dx * dx + dy * dy); } FinderPatternFinder::FinderPatternFinder(Ref<BitMatrix> image, Ref<ResultPointCallback>const& callback) : image_(image), possibleCenters_(), hasSkipped_(false), callback_(callback) { } Ref<FinderPatternInfo> FinderPatternFinder::find(DecodeHints const& hints) { bool tryHarder = hints.getTryHarder(); size_t maxI = image_->getHeight(); size_t maxJ = image_->getWidth(); // We are looking for black/white/black/white/black modules in // 1:1:3:1:1 ratio; this tracks the number of such modules seen so far // As this is used often, we use an integer array instead of vector int stateCount[5]; bool done = false; // Let's assume that the maximum version QR Code we support takes up 1/4 // the height of the image, and then account for the center being 3 // modules in size. This gives the smallest number of pixels the center // could be, so skip this often. When trying harder, look for all // QR versions regardless of how dense they are. int iSkip = (3 * maxI) / (4 * MAX_MODULES); if (iSkip < MIN_SKIP || tryHarder) { iSkip = MIN_SKIP; } // This is slightly faster than using the Ref. Efficiency is important here BitMatrix& matrix = *image_; for (size_t i = iSkip - 1; i < maxI && !done; i += iSkip) { // Get a row of black/white values memset(stateCount, 0, sizeof(stateCount)); int currentState = 0; for (size_t j = 0; j < maxJ; j++) { if (matrix.get(j, i)) { // Black pixel if ((currentState & 1) == 1) { // Counting white pixels currentState++; } stateCount[currentState]++; } else { // White pixel if ((currentState & 1) == 0) { // Counting black pixels if (currentState == 4) { // A winner? if (foundPatternCross(stateCount)) { // Yes bool confirmed = handlePossibleCenter(stateCount, i, j); if (confirmed) { // Start examining every other line. Checking each line turned out to be too // expensive and didn't improve performance. iSkip = 2; if (hasSkipped_) { done = haveMultiplyConfirmedCenters(); } else { int rowSkip = findRowSkip(); if (rowSkip > stateCount[2]) { // Skip rows between row of lower confirmed center // and top of presumed third confirmed center // but back up a bit to get a full chance of detecting // it, entire width of center of finder pattern // Skip by rowSkip, but back off by stateCount[2] (size // of last center of pattern we saw) to be conservative, // and also back off by iSkip which is about to be // re-added i += rowSkip - stateCount[2] - iSkip; j = maxJ - 1; } } } else { stateCount[0] = stateCount[2]; stateCount[1] = stateCount[3]; stateCount[2] = stateCount[4]; stateCount[3] = 1; stateCount[4] = 0; currentState = 3; continue; } // Clear state to start looking again currentState = 0; memset(stateCount, 0, sizeof(stateCount)); } else { // No, shift counts back by two stateCount[0] = stateCount[2]; stateCount[1] = stateCount[3]; stateCount[2] = stateCount[4]; stateCount[3] = 1; stateCount[4] = 0; currentState = 3; } } else { stateCount[++currentState]++; } } else { // Counting white pixels stateCount[currentState]++; } } } if (foundPatternCross(stateCount)) { bool confirmed = handlePossibleCenter(stateCount, i, maxJ); if (confirmed) { iSkip = stateCount[0]; if (hasSkipped_) { // Found a third one done = haveMultiplyConfirmedCenters(); } } } } vector<Ref<FinderPattern> > patternInfo = selectBestPatterns(); patternInfo = orderBestPatterns(patternInfo); Ref<FinderPatternInfo> result(new FinderPatternInfo(patternInfo)); return result; } Ref<BitMatrix> FinderPatternFinder::getImage() { return image_; } vector<Ref<FinderPattern> >& FinderPatternFinder::getPossibleCenters() { return possibleCenters_; } bool FinderPatternFinder::crossCheckDiagonal(int startI, int centerJ, int maxCount, int originalStateCountTotal) const { int *stateCount = getCrossCheckStateCount(); // Start counting up, left from center finding black center mass int i = 0; while (startI >= i && centerJ >= i && image_->get(centerJ - i, startI - i)) { stateCount[2]++; i++; } if (startI < i || centerJ < i) { return false; } // Continue up, left finding white space while (startI >= i && centerJ >= i && !image_->get(centerJ - i, startI - i) && stateCount[1] <= maxCount) { stateCount[1]++; i++; } // If already too many modules in this state or ran off the edge: if (startI < i || centerJ < i || stateCount[1] > maxCount) { return false; } // Continue up, left finding black border while (startI >= i && centerJ >= i && image_->get(centerJ - i, startI - i) && stateCount[0] <= maxCount) { stateCount[0]++; i++; } if (stateCount[0] > maxCount) { return false; } int maxI = image_->getHeight(); int maxJ = image_->getWidth(); // Now also count down, right from center i = 1; while (startI + i < maxI && centerJ + i < maxJ && image_->get(centerJ + i, startI + i)) { stateCount[2]++; i++; } // Ran off the edge? if (startI + i >= maxI || centerJ + i >= maxJ) { return false; } while (startI + i < maxI && centerJ + i < maxJ && !image_->get(centerJ + i, startI + i) && stateCount[3] < maxCount) { stateCount[3]++; i++; } if (startI + i >= maxI || centerJ + i >= maxJ || stateCount[3] >= maxCount) { return false; } while (startI + i < maxI && centerJ + i < maxJ && image_->get(centerJ + i, startI + i) && stateCount[4] < maxCount) { stateCount[4]++; i++; } if (stateCount[4] >= maxCount) { return false; } // If we found a finder-pattern-like section, but its size is more than 100% different than // the original, assume it's a false positive int stateCountTotal = stateCount[0] + stateCount[1] + stateCount[2] + stateCount[3] + stateCount[4]; return abs(stateCountTotal - originalStateCountTotal) < 2 * originalStateCountTotal && foundPatternCross(stateCount); } int *FinderPatternFinder::getCrossCheckStateCount() const { memset(crossCheckStateCount, 0, sizeof(crossCheckStateCount)); return crossCheckStateCount; }
fogelton/fraqtive
qzxing/zxing/zxing/qrcode/detector/QRFinderPatternFinder.cpp
C++
gpl-3.0
23,368
int lire_driver (char *nom); int select_driver (void);
DrCoolzic/BIG2
BIG2_DOC/SRCS/BDOC_IMP.H
C++
gpl-3.0
55
<?php /** * General Debugger-Class, implementing a FirePHP-Debugger, * for usage see http://www.firephp.org/HQ/Use.htm * * Usage for Classees implementing Config.php: * if ($this->debugger) $this->debugger->log($data, "Label"); * * @package moosique.net * @author Steffen Becker */ class Debugger { private $fb; // instance of the FirePHP-Class /** * Initializes the Debugger by inlcuding and instanciating FirePHP * * @author Steffen Becker */ function __construct() { require_once('FirePHP.class.php'); $this->fb = FirePHP::getInstance(true); } /** * Logs an Object using FirePHP * * @param mixed $var Any object, array, string etc. to log * @param string $label The label for the object to log * @author Steffen Becker */ public function log($var, $label = '') { $this->fb->log($var, $label); } } ?>
daftano/dl-learner
moosique.net/moosique/classes/Debugger.php
PHP
gpl-3.0
892
<div class="newshead"> <div class="newsheadline"><a class="titlelink" href="index.php?site=news_comments&amp;newsID=$newsID">$headline</a> $isintern</div> <div class="newsdate">$date - $time</div> </div> <div class="newsbegin"> <div class="newspic">$rubricpic</div> <div class="newscontent">$content <br />$adminspacer <div style="text-align:right;">$adminaction</div></div> </div> <div class="clear"></div> <br /><br />
Dwarfex/Hosting-Service
hosting_project/ws_templates/312203/TemplateFiles/templates/news.html
HTML
gpl-3.0
431
#pragma once #include <string> namespace D2K {namespace KEYS { // this represents each value in a Keys Profile array. Example: Profile[KEYS::UP] is defined as KEY_UP by default enum { NAME, DESCRIPTION, Profile, MOUSE, JOY, _START_OF_BUTTONS_, DUP = _START_OF_BUTTONS_, DDOWN, DLEFT, DRIGHT, A, B, X, Y, L, R, START, SELECT, LID, ZL, ZR, BLUE, YELLOW, RED, GREEN, SLIDER_VOLUME, SLIDER_3D, CSTICK_UP, CSTICK_DOWN, CSTICK_LEFT, CSTICK_RIGHT, CPAD_UP, CPAD_DOWN, CPAD_LEFT, CPAD_RIGHT, _END_OF_BUTTONS_ = CPAD_RIGHT, TOUCH_00, TOUCH_01, TOUCH_02, TOUCH_03, TOUCH_04, TOUCH_05, TOUCH_06, TOUCH_07, TOUCH_08, TOUCH_09, TOUCH_10, TOUCH_11, TOUCH_STRING_00, TOUCH_STRING_01, TOUCH_STRING_02, TOUCH_STRING_03, TOUCH_STRING_04, TOUCH_STRING_05, TOUCH_STRING_06, TOUCH_STRING_07, TOUCH_STRING_08, TOUCH_STRING_09, TOUCH_STRING_10, TOUCH_STRING_11, TOUCH_00X, TOUCH_01X, TOUCH_02X, TOUCH_03X, TOUCH_04X, TOUCH_05X, TOUCH_06X, TOUCH_07X, TOUCH_08X, TOUCH_09X, TOUCH_10X, TOUCH_11X, TOUCH_00Y, TOUCH_01Y, TOUCH_02Y, TOUCH_03Y, TOUCH_04Y, TOUCH_05Y, TOUCH_06Y, TOUCH_07Y, TOUCH_08Y, TOUCH_09Y, TOUCH_10Y, TOUCH_11Y, TOUCH_00W, TOUCH_01W, TOUCH_02W, TOUCH_03W, TOUCH_04W, TOUCH_05W, TOUCH_06W, TOUCH_07W, TOUCH_08W, TOUCH_09W, TOUCH_10W, TOUCH_11W, TOUCH_00H, TOUCH_01H, TOUCH_02H, TOUCH_03H, TOUCH_04H, TOUCH_05H, TOUCH_06H, TOUCH_07H, TOUCH_08H, TOUCH_09H, TOUCH_10H, TOUCH_11H, END, }; const static int KEYS_BUTTON_COUNT = KEYS::_END_OF_BUTTONS_ - KEYS::_START_OF_BUTTONS_ + 1; std::string GetKeyName(int key); }} // namespace D2K::Keys
sypherce/ds2key
common/enum_keys.h
C
gpl-3.0
1,557
<div class="a-main"> <div class="a-breadcrumb container-fluid mat-elevation-z4"> <div class="row"> <div class="col"> <a *ngIf="good" (click)="navigation.list(m.Good)">Products</a> <a *ngIf="part" (click)="navigation.list(m.Part)">Parts</a> <span *ngIf="add"> / Add ISBN</span> <span *ngIf="edit && good"> / <a (click)="navigation.overview(good)">{{good?.Name}}</a> / Edit ISBN</span> <span *ngIf="edit && part"> / <a (click)="navigation.overview(part)">{{part?.Name}}</a> / Edit ISBN</span> </div> </div> </div> <form *ngIf="iGoodIdentification" class="a-edit" #form="ngForm" (submit)="save()" novalidate> <mat-card> <mat-card-content class="container-fluid"> <div class="row"> <a-mat-static class="col-md" [object]="iGoodIdentification" [roleType]="m.IGoodIdentification.GoodIdentificationType" display="Name" ></a-mat-static> <a-mat-input class="col-md" [object]="iGoodIdentification" [roleType]="m.IGoodIdentification.Identification" class="col-md"></a-mat-input> </div> </mat-card-content> </mat-card> <a-mat-footer> <button mat-raised-button (click)="navigation.back()" type="button">CANCEL</button> <button mat-raised-button class="ml-2" color="primary" type="submit" [disabled]="!form.form.valid || !allors.context.hasChanges">SAVE</button> </a-mat-footer> </form> </div>
Allors/apps
Domains/Apps/Workspace/Typescript/Intranet/src/allors/material/apps/objects/isbnidentification/edit/isbnidentification-edit.component.html
HTML
gpl-3.0
1,430
<?php require_once(dirname($_SERVER['SCRIPT_FILENAME'])."/../src/Common/all.php"); $from = $argv[1]; if ($argc>2) { $to = $argv[2]; } else { $to = "."; } list($stdout, $stderr) = exec2("ln -fs ".get_path("test_data_folder")."{$from} {$to}"); ?>
imgag/megSAP
test/link_test_data.php
PHP
gpl-3.0
250
## import argparse from plotWheels.helical_wheel import helical_wheel if __name__ == "__main__": parser = argparse.ArgumentParser(description="Generate Helical Wheel") parser.add_argument("--sequence",dest="sequence",type=str) parser.add_argument("--seqRange",dest="seqRange",type=int,default=1) parser.add_argument("--t_size",dest="t_size",type=int,default=32) parser.add_argument("--rotation",dest="rotation",type=int,default=90) parser.add_argument("--numbering",action="store_true",help="numbering for helical wheel") parser.add_argument("--output",dest="output",type=argparse.FileType("wb"), default="_helicalwheel.png")#dest="output",default="_helicalwheel.png") #### circle colors parser.add_argument("--f_A",dest="f_A", default="#ffcc33") parser.add_argument("--f_C",dest="f_C",default="#b5b5b5") parser.add_argument("--f_D",dest="f_D",default="#db270f") parser.add_argument("--f_E",dest="f_E",default="#db270f") parser.add_argument("--f_F",dest="f_F",default="#ffcc33") parser.add_argument("--f_G",dest="f_G",default="#b5b5b5") parser.add_argument("--f_H",dest="f_H",default="#12d5fc") parser.add_argument("--f_I",dest="f_I",default="#ffcc33") parser.add_argument("--f_K",dest="f_K",default="#12d5fc") parser.add_argument("--f_L",dest="f_L",default="#ffcc33") parser.add_argument("--f_M",dest="f_M",default="#ffcc33") parser.add_argument("--f_N",dest="f_N",default="#b5b5b5") parser.add_argument("--f_P",dest="f_P",default="#ffcc33") parser.add_argument("--f_Q",dest="f_Q",default="#b5b5b5") parser.add_argument("--f_R",dest="f_R",default="#12d5fc") parser.add_argument("--f_S",dest="f_S",default="#b5b5b5") parser.add_argument("--f_T",dest="f_T",default="#b5b5b5") parser.add_argument("--f_V",dest="f_V",default="#ffcc33") parser.add_argument("--f_W",dest="f_W",default="#ffcc33") parser.add_argument("--f_Y",dest="f_Y",default="#b5b5b5") ### text colors parser.add_argument("--t_A",dest="t_A",default="k") parser.add_argument("--t_C",dest="t_C",default="k") parser.add_argument("--t_D",dest="t_D",default="w") parser.add_argument("--t_E",dest="t_E",default="w") parser.add_argument("--t_F",dest="t_F",default="k") parser.add_argument("--t_G",dest="t_G",default="k") parser.add_argument("--t_H",dest="t_H",default="k") parser.add_argument("--t_I",dest="t_I",default="k") parser.add_argument("--t_K",dest="t_K",default="k") parser.add_argument("--t_L",dest="t_L",default="k") parser.add_argument("--t_M",dest="t_M",default="k") parser.add_argument("--t_N",dest="t_N",default="k") parser.add_argument("--t_P",dest="t_P",default="k") parser.add_argument("--t_Q",dest="t_Q",default="k") parser.add_argument("--t_R",dest="t_R",default="k") parser.add_argument("--t_S",dest="t_S",default="k") parser.add_argument("--t_T",dest="t_T",default="k") parser.add_argument("--t_V",dest="t_V",default="k") parser.add_argument("--t_W",dest="t_W",default="k") parser.add_argument("--t_Y",dest="t_Y",default="k") args = parser.parse_args() #print(type(args.output)) f_colors = [args.f_A,args.f_C,args.f_D,args.f_E,args.f_F,args.f_G,args.f_H,args.f_I,args.f_K, args.f_L,args.f_M,args.f_N,args.f_P,args.f_Q,args.f_R,args.f_S,args.f_T,args.f_V, args.f_W,args.f_Y] t_colors = [args.t_A,args.t_C,args.t_D,args.t_E,args.t_F,args.t_G,args.t_H,args.t_I,args.t_K, args.t_L,args.t_M,args.t_N,args.t_P,args.t_Q,args.t_R,args.t_S,args.t_T,args.t_V, args.t_W,args.t_Y] colors = [f_colors, t_colors] tmp_file = "./tmp.png" helical_wheel(sequence=args.sequence, colorcoding=colors[0], text_color=colors[1], seqRange=args.seqRange, t_size=args.t_size, rot=args.rotation, numbering=args.numbering, filename=tmp_file ) with open("tmp.png", "rb") as f: for line in f: args.output.write(line)
TAMU-CPT/galaxy-tools
tools/helicalWheel/generateHelicalWheel.py
Python
gpl-3.0
4,144
g++ -Wall -Wl,-rpath=libevent/libevent-2.0.21-stable/lib/:cppfastdevelop/cppfoundation/bin/ \ -g server.cpp io_cb.cpp thread_worker.cpp -O0 -o server \ -Llibevent/libevent-2.0.21-stable/lib -Lcppfastdevelop/cppfoundation/bin \ -Ilibevent/libevent-2.0.21-stable/include -Icppfastdevelop/cppfoundation/include \ -levent -lcfclass_d -lcfstub_d
dungeonsnd/test-code
dev_examples/libevent_multithreads/build.sh
Shell
gpl-3.0
345
/* Copyright 2016 Sebastian Gniazdowski This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef MYQTABWIDGET_H #define MYQTABWIDGET_H #include <QObject> #include <QWidget> #include <QTabWidget> #include <QColor> #include <QTimer> class MyQTabWidget : public QTabWidget { Q_OBJECT public: MyQTabWidget(QWidget *parent = 0); void saveTheColor(); public slots: void markThirdTab(bool highlight); void toggleThirdTabMark(); signals: void thirdTabMarkingEnough(); private: QColor default_color_; bool current_third_tab_mark_; int mark_count_; QTimer timer_; }; #endif // MYQTABWIDGET_H
psprint/QtZekyllManager
manager/myqtabwidget.h
C
gpl-3.0
1,208
# SKIP(Social Knowledge & Innovation Platform) # Copyright (C) 2008-2010 TIS Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. require File.dirname(__FILE__) + '/../spec_helper' describe User, '#groups' do before do @user = create_user @group = create_group group_participation = GroupParticipation.create!(:user_id => @user.id, :group_id => @group.id) end it '一件のグループが取得できること' do @user.groups.size.should == 1 end describe 'グループを論理削除された場合' do before do @group.logical_destroy end it 'グループが取得できないこと' do @user.groups.size.should == 0 end end end describe User," is a_user" do fixtures :users, :user_accesses, :user_uids before(:each) do @user = users(:a_user) end it "get uid and name by to_s" do @user.to_s.should == "uid:#{@user.uid}, name:#{@user.name}" end it "get symbol_id" do @user.symbol_id.should == "a_user" end it "get symbol" do @user.symbol.should == "uid:a_user" end it "get before_access" do @user.before_access.should == "Within 1 day" end it "set mark_track" do lambda { @user.mark_track(users(:a_group_joined_user).id) }.should change(Track, :count).by(1) end end describe User, 'validation' do describe 'email' do before do @user = new_user(:email => 'skip@example.org') @user.save! end it 'ユニークであること' do new_user(:email => 'skip@example.org').valid?.should be_false # 大文字小文字が異なる場合もNG new_user(:email => 'Skip@example.org').valid?.should be_false end it 'ドメイン名に大文字を含むアドレスを許容すること' do new_user(:email => 'foo@Example.org').valid?.should be_true end it 'アカウント名とドメイン名に大文字を含むアドレスを許容すること' do new_user(:email => 'Foo@Example.org').valid?.should be_true end end describe 'pssword' do before do @user = create_user @user.stub!(:password_required?).and_return(true) end it '必須であること' do @user.password = '' @user.valid?.should be_false @user.errors['password'].include?('Password can\'t be blank').should be_true end it '確認用パスワードと一致すること' do @user.password = 'valid_password' @user.password_confirmation = 'invalid_password' @user.valid?.should be_false @user.errors['password'].include?('Password doesn\'t match confirmation').should be_true end it '6文字以上であること' do @user.password = 'abcd' @user.valid?.should be_false @user.errors['password'].include?('Password is too short (minimum is 6 characters)').should be_true end it '40文字以内であること' do @user.password = SkipFaker.rand_char(41) @user.valid?.should be_false @user.errors['password'].include?('Password is too long (maximum is 40 characters)').should be_true end it 'ログインIDと異なること' do @user.stub!(:uid).and_return('yamada') @user.password = 'yamada' @user.valid?.should be_false @user.errors['password'].should be_include('shall not be the same with login ID.') end it '現在のパスワードと異なること' do @user.password = 'Password2' @user.password_confirmation = 'Password2' @user.save! @user.password = 'Password2' @user.valid?.should be_false @user.errors['password'].should be_include('shall not be the same with the previous one.') end describe 'パスワード強度が弱の場合' do before do Admin::Setting.stub!(:password_strength).and_return('low') end it '6文字以上の英数字記号であること' do @user.password = 'abcde' @user.password_confirmation = 'abcde' @user.valid? [@user.errors['password']].flatten.size.should == 2 @user.password = 'abcdef' @user.password_confirmation = 'abcdef' @user.valid? @user.errors['password'].should be_nil end end describe 'パスワード強度が中の場合' do before do Admin::Setting.stub!(:password_strength).and_return('middle') end it '7文字の場合エラー' do @user.password = 'abcdeF0' @user.valid? [@user.errors['password']].flatten.size.should == 1 end describe '8文字以上の場合' do it '小文字のみの場合エラー' do @user.password = 'abcdefgh' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '大文字のみの場合エラー' do @user.password = 'ABCDEFGH' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '数字のみの場合エラー' do @user.password = '12345678' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '記号のみの場合エラー' do @user.password = '####&&&&' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '小文字、大文字のみの場合エラー' do @user.password = 'abcdEFGH' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '小文字、大文字、数字の場合エラーにならないこと' do @user.password = 'abcdEF012' @user.password_confirmation = 'abcdEF012' @user.valid? @user.errors['password'].should be_nil end end end describe 'パスワード強度が強の場合' do before do Admin::Setting.stub!(:password_strength).and_return('high') end it '7文字の場合エラー' do @user.password = 'abcdeF0' @user.valid? [@user.errors['password']].flatten.size.should == 1 end describe '8文字以上の場合' do it '小文字のみの場合エラー' do @user.password = 'abcdefgh' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '大文字のみの場合エラー' do @user.password = 'ABCDEFGH' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '数字のみの場合エラー' do @user.password = '12345678' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '記号のみの場合エラー' do @user.password = '####&&&&' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '小文字、大文字のみの場合エラー' do @user.password = 'abcdEFGH' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '小文字、大文字、数字の場合エラー' do @user.password = 'abcdEF01' @user.valid? [@user.errors['password']].flatten.size.should == 1 end it '小文字、大文字、数字, 記号の場合エラーとならないこと' do @user.password = 'abcdeF0@#' @user.password_confirmation = 'abcdeF0@#' @user.errors['password'].should be_nil end end end end end describe User, "#before_save" do before do SkipEmbedded::InitialSettings['login_mode'] = 'password' SkipEmbedded::InitialSettings['sha1_digest_key'] = "digest_key" end describe '新規の場合' do before do @user = new_user Admin::Setting.password_change_interval = 90 end it 'パスワードが保存されること' do lambda do @user.save end.should change(@user, :crypted_password).from(nil) end it 'パスワード有効期限が設定されること' do time = Time.now Time.stub!(:now).and_return(time) lambda do @user.save end.should change(@user, :password_expires_at).to(Time.now.since(90.day)) end end describe '更新の場合' do before do @user = new_user @user.save @user.reset_auth_token = 'reset_auth_token' @user.reset_auth_token_expires_at = Time.now @user.locked = true @user.trial_num = 1 @user.save Admin::Setting.password_change_interval = 90 end describe 'パスワードの変更の場合' do before do @user.password = 'Password99' @user.password_confirmation = 'Password99' end it 'パスワードが保存される' do lambda do @user.save end.should change(@user, :crypted_password).from(nil) end it 'パスワード有効期限が設定される' do time = Time.now Time.stub!(:now).and_return(time) lambda do @user.save end.should change(@user, :password_expires_at).to(Time.now.since(90.day)) end it 'reset_auth_tokenがクリアされること' do lambda do @user.save end.should change(@user, :reset_auth_token).to(nil) end it 'reset_auth_token_expires_atがクリアされること' do lambda do @user.save end.should change(@user, :reset_auth_token_expires_at).to(nil) end it 'lockedがクリアされること' do lambda do @user.save end.should change(@user, :locked).to(false) end it 'trial_numがクリアされること' do lambda do @user.save end.should change(@user, :trial_num).to(0) end end describe 'パスワード以外の変更の場合' do before do @user.name = 'fuga' end it 'パスワードは変更されないこと' do lambda do @user.save end.should_not change(@user, :crypted_password) end it 'パスワード有効期限は設定されないこと' do lambda do @user.save end.should_not change(@user, :password_expires_at) end it 'reset_auth_tokenが変わらないこと' do lambda do @user.save end.should_not change(@user, :reset_auth_token) end it 'reset_auth_token_expires_atが変わらないこと' do lambda do @user.save end.should_not change(@user, :reset_auth_token_expires_at) end it 'lockedが変わらないこと' do lambda do @user.save end.should_not change(@user, :locked) end it 'trial_numが変わらないこと' do lambda do @user.save end.should_not change(@user, :trial_num) end end end describe 'ロックする場合' do before do @user = create_user(:user_options => { :auth_session_token => 'auth_session_token', :remember_token => 'remember_token', :remember_token_expires_at => Time.now }) @user.locked = true end it 'セッション認証用のtokenが破棄されること' do lambda do @user.save end.should change(@user, :auth_session_token).to(nil) end it 'クッキー認証用のtokenが破棄されること' do lambda do @user.save end.should change(@user, :remember_token).to(nil) end it 'クッキー認証用のtokenの有効期限が破棄されること' do lambda do @user.save end.should change(@user, :remember_token_expires_at).to(nil) end end describe 'ロック状態が変化しない場合' do before do @user = create_user(:user_options => { :auth_session_token => 'auth_session_token', :remember_token => 'remember_token', :remember_token_expires_at => Time.now }) end it 'セッション認証用のtokenが破棄されないこと' do lambda do @user.save end.should_not change(@user, :auth_session_token) end it 'クッキー認証用のtokenが破棄されないこと' do lambda do @user.save end.should_not change(@user, :remember_token) end it 'クッキー認証用のtokenの有効期限が破棄されないこと' do lambda do @user.save end.should_not change(@user, :remember_token_expires_at) end end end describe User, '#before_create' do before do @user = new_user end it '新規作成の際にはissued_atに現在日時が設定される' do time = Time.now Time.stub!(:now).and_return(time) lambda do @user.save end.should change(@user, :issued_at).to(nil) end end describe User, '#after_save' do describe '退職になったユーザの場合' do before do @user = create_user do |u| u.user_oauth_accesses.create(:app_name => 'wiki', :token => 'token', :secret => 'secret') end end it '対象ユーザのOAuthアクセストークンが削除されること' do lambda do @user.status = 'RETIRED' @user.save end.should change(@user.user_oauth_accesses, :size).by(-1) end end describe '利用中のユーザの場合' do before do @user = create_user do |u| u.user_oauth_accesses.create(:app_name => 'wiki', :token => 'token', :secret => 'secret') end end it '対象ユーザのOAuthアクセストークンが変化しないこと' do lambda do @user.name = 'new_name' @user.save end.should_not change(@user.user_oauth_accesses, :size) end end end describe User, '#change_password' do before do SkipEmbedded::InitialSettings['login_mode'] = 'password' SkipEmbedded::InitialSettings['sha1_digest_key'] = 'digest_key' @user = create_user(:user_options => {:password => 'Password1'}) @old_password = 'Password1' @new_password = 'Hogehoge1' @params = { :old_password => @old_password, :password => @new_password, :password_confirmation => @new_password } end describe "前のパスワードが正しい場合" do describe '新しいパスワードが入力されている場合' do it 'パスワードが変更されること' do lambda do @user.change_password @params end.should change(@user, :crypted_password) end end describe '新しいパスワードが入力されていない場合' do before do @params[:password] = '' @user.change_password @params end it { @user.errors.full_messages.size.should == 1 } end end describe "前のパスワードが間違っている場合" do before do @params[:old_password] = 'fugafuga' @user.change_password @params end it { @user.errors.full_messages.size.should == 1 } end end describe User, ".new_with_identity_url" do before do @identity_url = "http://test.com/identity" @params = { :code => 'hoge', :name => "ほげ ふが", :email => 'hoge@hoge.com' } @user = User.new_with_identity_url(@identity_url, @params) @user.stub!(:password_required?).and_return(false) end describe "正しく保存される場合" do it { @user.should be_valid } it { @user.should be_is_a(User) } it { @user.openid_identifiers.should_not be_nil } it { @user.openid_identifiers.map{|i| i.url}.should be_include(@identity_url) } end describe "バリデーションエラーの場合" do before do @user.name = '' @user.email = '' end it { @user.should_not be_valid } it "userにエラーが設定されていること" do @user.valid? @user.errors.full_messages.size.should == 3 end end end describe User, ".create_with_identity_url" do before do @identity_url = "http://test.com/identity" @params = { :code => 'hoge', :name => "ほげ ふが", :email => 'hoge@hoge.com' } @user = mock_model(User) User.should_receive(:new_with_identity_url).and_return(@user) @user.should_receive(:save) end it { User.create_with_identity_url(@identity_url, @params).should be_is_a(User) } end describe User, ".auth" do subject { User.auth('code_or_email', "valid_password") { |result, user| @result = result; @authed_user = user } } describe "指定したログインID又はメールアドレスに対応するユーザが存在する場合" do before do @user = create_user @user.stub!(:crypted_password).and_return(User.encrypt("valid_password")) User.stub!(:find_by_code_or_email_with_key_phrase).and_return(@user) end describe "未使用ユーザの場合" do before do @user.stub!(:unused?).and_return(true) end it { should be_false } end describe "使用中ユーザの場合" do before do @user.stub!(:unused?).and_return(false) User.stub(:auth_successed).and_return(@user) User.stub(:auth_failed) end describe "パスワードが正しい場合" do it '認証成功処理が行われること' do User.should_receive(:auth_successed).with(@user) User.auth('code_or_email', "valid_password") end it "ユーザが返ること" do should be_true @authed_user.should == @user end end describe "パスワードは正しくない場合" do it '認証失敗処理が行われること' do User.should_receive(:auth_failed).with(@user) User.auth('code_or_email', 'invalid_password') end it "エラーメッセージが返ること" do User.auth('code_or_email', 'invalid_password').should be_false end end describe "パスワードの有効期限が切れている場合" do before do @user.stub!(:within_time_limit_of_password?).and_return(false) end it "エラーメッセージが返ること" do should be_false @authed_user.should == @user end end describe "アカウントがロックされている場合" do before do @user.stub!(:locked?).and_return(true) end it "エラーメッセージが返ること" do should be_false @authed_user.should == @user end end end end describe "指定したログインID又はメールアドレスに対応するユーザが存在しない場合" do before do User.should_receive(:find_by_code_or_email_with_key_phrase).at_least(:once).and_return(nil) end it { should be_false } end end describe User, "#delete_auth_tokens" do before do @user = create_user @user.remember_token = "remember_token" @user.remember_token_expires_at = Time.now @user.auth_session_token = "auth_session_token" @user.save @user.delete_auth_tokens! end it "すべてのトークンが削除されていること" do @user.remember_token.should be_nil @user.remember_token_expires_at.should be_nil @user.auth_session_token.should be_nil end end describe User, "#update_auth_session_token" do before do @user = create_user @auth_session_token = User.make_token User.stub!(:make_token).and_return(@auth_session_token) end describe 'シングルセッション機能が有効な場合' do before do Admin::Setting.should_receive(:enable_single_session).and_return(true) end it "トークンが保存されること" do @user.update_auth_session_token! @user.auth_session_token.should == @auth_session_token end it "トークンが返されること" do @user.update_auth_session_token!.should == @auth_session_token end end describe 'シングルセッション機能が無効な場合' do before do Admin::Setting.should_receive(:enable_single_session).and_return(false) end describe '新規ログインの場合(auth_session_tokenに値が入っていない)' do before do @user.auth_session_token = nil end it "トークンが保存されること" do @user.update_auth_session_token! @user.auth_session_token.should == @auth_session_token end it "トークンが返されること" do @user.update_auth_session_token!.should == @auth_session_token end end describe 'ログイン済みの場合(auth_session_tokenに値が入っている)' do before do @user.auth_session_token = 'auth_session_token' end it 'トークンが変化しないこと' do lambda do @user.update_auth_session_token! end.should_not change(@user, :auth_session_token) end it 'トークンが返されること' do @user.update_auth_session_token!.should == 'auth_session_token' end end end end describe User, '#issue_reset_auth_token' do before do @user = create_user @now = Time.local(2008, 11, 1) Time.stub!(:now).and_return(@now) end it 'reset_auth_tokenに値が入ること' do lambda do @user.issue_reset_auth_token end.should change(@user, :reset_auth_token) end it 'reset_auth_token_expires_atが24時間後となること' do lambda do @user.issue_reset_auth_token end.should change(@user, :reset_auth_token_expires_at).from(nil).to(@now.since(24.hour)) end end describe User, '#determination_reset_auth_token' do before do @user = create_user end it 'reset_auth_tokenの値が更新されること' do prc = '6df711a1a42d110261cfe759838213143ca3c2ad' @user.reset_auth_token = prc lambda do @user.determination_reset_auth_token end.should change(@user, :reset_auth_token).from(prc).to(nil) end it 'reset_auth_token_expires_atの値が更新されること' do time = Time.now @user.reset_auth_token_expires_at = time lambda do @user.determination_reset_auth_token end.should change(@user, :reset_auth_token_expires_at).from(time).to(nil) end end describe User, '#issue_activation_code' do before do @user = create_user @now = Time.local(2008, 11, 1) User.stub!(:activation_lifetime).and_return(2) Time.stub!(:now).and_return(@now) end it 'activation_tokenに値が入ること' do lambda do @user.issue_activation_code end.should change(@user, :activation_token) end it 'activation_token_expires_atが48時間後となること' do lambda do @user.issue_activation_code end.should change(@user, :activation_token_expires_at).from(nil).to(@now.since(48.hour)) end end describe User, '.issue_activation_codes' do before do @now = Time.local(2008, 11, 1) User.stub!(:activation_lifetime).and_return(2) Time.stub!(:now).and_return(@now) end describe '指定したIDのユーザが存在する場合' do before do @user = create_user(:status => 'UNUSED') end it '未使用ユーザのactivation_tokenに値が入ること' do unused_users, active_users = User.issue_activation_codes([@user.id]) unused_users.first.activation_token.should_not be_nil end it '未使用ユーザのactivation_token_expires_atが48時間後となること' do unused_users, active_users = User.issue_activation_codes([@user.id]) unused_users.first.activation_token_expires_at.should == @now.since(48.hour) end end end describe User, '#activate!' do it 'activation_tokenの値が更新されること' do activation_token = '6df711a1a42d110261cfe759838213143ca3c2ad' u = create_user(:user_options => {:activation_token=> activation_token}, :status => 'UNUSED') u.password = '' lambda do u.activate! end.should change(u, :activation_token).from(activation_token).to(nil) end it 'activation_token_expires_atの値が更新されること' do time = Time.now u = create_user(:user_options => {:activation_token_expires_at => time}, :status => 'UNUSED') u.password = '' lambda do u.activate! end.should change(u, :activation_token_expires_at).from(time).to(nil) end end describe User, '.activation_lifetime' do describe 'activation_lifetimeの設定が3(日)の場合' do before do Admin::Setting.stub!(:activation_lifetime).and_return(3) end it { User.activation_lifetime.should == 3 } end end describe User, '#within_time_limit_of_activation_token' do before do @activation_token_expires_at = Time.local(2008, 11, 1, 0, 0, 0) @activation_token = 'activation_token' end describe 'activation_token_expires_atが期限切れの場合' do before do @user = create_user(:user_options => {:activation_token => @activation_token, :activation_token_expires_at => @activation_token_expires_at }) now = @activation_token_expires_at.since(1.second) Time.stub!(:now).and_return(now) end it 'falseが返ること' do @user.within_time_limit_of_activation_token?.should be_false end end describe 'activation_token_expires_atが期限切れではない場合' do before do @user = create_user(:user_options => {:activation_token => @activation_token, :activation_token_expires_at => @activation_token_expires_at }) now = @activation_token_expires_at.ago(1.second) Time.stub!(:now).and_return(now) end it 'trueが返ること' do @user.within_time_limit_of_activation_token?.should be_true end end end describe User, '.grouped_sections' do before do User.delete_all create_user :user_options => {:email => SkipFaker.email, :section => 'Programmer'}, :user_uid_options => {:uid => SkipFaker.rand_num(6)} create_user :user_options => {:email => SkipFaker.email, :section => 'Programmer'}, :user_uid_options => {:uid => SkipFaker.rand_num(6)} create_user :user_options => {:email => SkipFaker.email, :section => 'Tester'}, :user_uid_options => {:uid => SkipFaker.rand_num(6)} end it {User.grouped_sections.size.should == 2} end describe User, "#find_or_initialize_profiles" do before do @user = new_user @user.save! @masters = (1..3).map{|i| create_user_profile_master(:name => "master#{i}")} @master_1_id = @masters[0].id @master_2_id = @masters[1].id end describe "設定されていないプロフィールがわたってきた場合" do it "新規に作成される" do @user.find_or_initialize_profiles(@master_1_id.to_s => "ほげ").should_not be_empty end it "新規の値が設定される" do @user.find_or_initialize_profiles(@master_1_id.to_s => "ほげ") @user.user_profile_values.each do |values| values.value.should == "ほげ" if values.user_profile_master_id == @master_1_id end end it "保存されていないprofile_valueが返される" do profiles = @user.find_or_initialize_profiles(@master_1_id.to_s => "ほげ") profiles.first.should be_is_a(UserProfileValue) profiles.first.value.should == "ほげ" profiles.first.should be_new_record end end describe "既に存在するプロフィールがわたってきた場合" do before do @user.user_profile_values.create(:user_profile_master_id => @master_1_id, :value => "ふが") end it "上書きされたものが返される" do profiles = @user.find_or_initialize_profiles(@master_1_id.to_s => "ほげ") profiles.first.should be_is_a(UserProfileValue) profiles.first.value.should == "ほげ" profiles.first.should be_changed end end describe "新規の値と保存された値が渡された場合" do before do @user.user_profile_values.create(:user_profile_master_id => @master_1_id, :value => "ふが") @profiles = @user.find_or_initialize_profiles(@master_1_id.to_s => "ほげ", @master_2_id.to_s => "ほげほげ") end it "保存されていたmaster_idが1のvalueは上書きされていること" do @profiles.each do |profile| if profile.user_profile_master_id == @master_1_id profile.value.should == "ほげ" end end end it "新規のmaster_idが2のvalueは新しく作られていること" do @profiles.each do |profile| if profile.user_profile_master_id == @master_2_id profile.value.should == "ほげほげ" end end end end describe "マスタに存在する値がパラメータで送られてこない場合" do before do @user.user_profile_values.create(:user_profile_master_id => @master_1_id, :value => "ほげ") @profiles = @user.find_or_initialize_profiles({}) @profile_hash = @profiles.index_by(&:user_profile_master_id) end it "空が登録されること" do @profile_hash[@master_1_id].value.should == "" end it "マスタの数だけprofile_valuesが返ってくること" do @profiles.size.should == @masters.size end end end describe User, '#group_symbols' do before do @user = create_user @group = create_group(:gid => 'skip_dev') do |g| g.group_participations.build(:user_id => @user.id, :owned => true) end @group_symbols = ['gid:skip_dev'] end describe '1度だけ呼ぶ場合' do it 'ユーザの所属するグループのシンボル配列を返すこと' do @user.group_symbols.should == @group_symbols end end describe '2度呼ぶ場合' do it 'ユーザの所属するグループのシンボル配列を返すこと(2回目はキャッシュされた結果になること)' do @user.group_symbols @user.group_symbols.should == @group_symbols end end end describe User, '#belong_symbols' do before do @user = stub_model(User, :symbol => 'uid:skipuser') @user.should_receive(:group_symbols).once.and_return(['gid:skip_dev']) end describe '1度だけ呼ぶ場合' do it 'ユーザ自身のシンボルとユーザの所属するグループのシンボルを配列で返すこと' do @user.belong_symbols.should == ['uid:skipuser', 'gid:skip_dev'] end end describe '2度呼ぶ場合' do it 'ユーザ自身のシンボルとユーザの所属するグループのシンボルを配列で返すこと(2回目はキャッシュされた結果になること' do @user.belong_symbols @user.belong_symbols.should == ['uid:skipuser', 'gid:skip_dev'] end end end describe User, "#belong_symbols_with_collaboration_apps" do before do SkipEmbedded::InitialSettings['host_and_port'] = 'test.host' SkipEmbedded::InitialSettings['protocol'] = 'http://' @user = stub_model(User, :belong_symbols => ["uid:a_user", "gid:a_group"], :code => "a_user") end describe "SkipEmbedded::InitialSettingsが設定されている場合" do before do SkipEmbedded::InitialSettings["belong_info_apps"] = { 'app' => { "url" => "http://localhost:3100/notes.js", "ca_file" => "hoge/fuga" } } end describe "情報が返ってくる場合" do before do SkipEmbedded::WebServiceUtil.stub!(:open_service_with_url).and_return([{"publication_symbols" => "note:1"}, { "publication_symbols" => "note:4"}]) end it "SKIP内の所属情報を返すこと" do ["uid:a_user", "gid:a_group", Symbol::SYSTEM_ALL_USER].each do |symbol| @user.belong_symbols_with_collaboration_apps.should be_include(symbol) end end it "SkipEmbedded::WebServiceUtilから他のアプリにアクセスすること" do SkipEmbedded::WebServiceUtil.should_receive(:open_service_with_url).with("http://localhost:3100/notes.js", { :user => "http://test.host/id/a_user" }, "hoge/fuga") @user.belong_symbols_with_collaboration_apps end it "連携アプリ内の所属情報を返すこと" do ["note:1"].each do |symbol| @user.belong_symbols_with_collaboration_apps.should be_include(symbol) end end end describe "情報が取得できない場合" do before do SkipEmbedded::WebServiceUtil.stub!(:open_service_with_url) end it "publicが追加されること" do ["uid:a_user", "gid:a_group", Symbol::SYSTEM_ALL_USER, "public"].each do |symbol| @user.belong_symbols_with_collaboration_apps.should be_include(symbol) end end end end describe "SkipEmbedded::InitialSettingsが設定されていない場合" do before do SkipEmbedded::InitialSettings["belong_info_apps"] = {} end it "SKIP内の所属情報を返すこと" do ["uid:a_user", "gid:a_group", Symbol::SYSTEM_ALL_USER, "public"].each do |symbol| @user.belong_symbols_with_collaboration_apps.should be_include(symbol) end end end end describe User, "#openid_identifier" do before do SkipEmbedded::InitialSettings['host_and_port'] = 'test.host' SkipEmbedded::InitialSettings['protocol'] = 'http://' @user = stub_model(User, :code => "a_user") end it "OPとして発行する OpenID identifier を返すこと" do @user.openid_identifier.should == "http://test.host/id/a_user" end it "relative_url_rootが設定されている場合 反映されること" do ActionController::Base.relative_url_root = "/skip" @user.openid_identifier.should == "http://test.host/skip/id/a_user" end after do ActionController::Base.relative_url_root = nil end end describe User, '#to_s_log' do before do @user = stub_model(User, :id => "99", :uid => '999999') end it 'ログに出力する形式に整えられた文字列を返すこと' do @user.to_s_log('message').should == "message: {\"user_id\" => \"#{@user.id}\", \"uid\" => \"#{@user.uid}\"}" end end describe User, '#locked?' do before do @user = stub_model(User) end describe 'ユーザロック機能が有効な場合' do before do Admin::Setting.enable_user_lock = 'true' end describe 'ユーザがロックされている場合' do before do @user.locked = true end it 'ロックされていると判定されること' do @user.locked?.should be_true end end describe 'ユーザがロックされていない場合' do before do @user.locked = false end it 'ロックされていないと判定されること' do @user.locked?.should be_false end end end describe 'ユーザロック機能が無効な場合' do before do Admin::Setting.enable_user_lock = 'false' end describe 'ユーザがロックされている場合' do before do @user.locked = true end it 'ロックされていると判定されること' do @user.locked?.should be_true end end describe 'ユーザがロックされていない場合' do before do @user.locked = false end it 'ロックされていないと判定されること' do @user.locked?.should be_false end end end end describe User, '#within_time_limit_of_password?' do before do @user = stub_model(User) end describe 'パスワード変更強制機能が有効な場合' do before do Admin::Setting.enable_password_periodic_change = 'true' end describe 'パスワードの有効期限切れ日が設定されている場合' do before do @user.password_expires_at = Time.local(2009, 3, 1, 0, 0, 0) end describe 'パスワード有効期限切れの場合' do before do now = Time.local(2009, 3, 1, 0, 0, 1) Time.stub!(:now).and_return(now) end it 'パスワード有効期限切れと判定されること' do @user.within_time_limit_of_password?.should be_false end end describe 'パスワード有効期限内の場合' do before do now = Time.local(2009, 3, 1, 0, 0, 0) Time.stub!(:now).and_return(now) end it 'パスワード有効期限内と判定されること' do @user.within_time_limit_of_password?.should be_true end end end describe 'パスワードの有効期限切れ日が設定されていない場合' do before do @user.password_expires_at = nil end it 'パスワード有効期限切れと判定されること' do @user.within_time_limit_of_password?.should be_nil end end end describe 'パスワード変更強制機能が無効な場合' do before do Admin::Setting.enable_password_periodic_change = 'false' end it 'パスワード有効期限内と判定されること' do @user.within_time_limit_of_password?.should be_true end end end describe User, '.synchronize_users' do describe '二人の利用中のユーザと一人の退職ユーザと一人の未使用ユーザが存在する場合' do before do User.delete_all SkipEmbedded::InitialSettings['host_and_port'] = 'localhost:3000' SkipEmbedded::InitialSettings['protocol'] = 'http://' @bob = create_user :user_options => {:name => 'ボブ', :admin => false}, :user_uid_options => {:uid => 'boob'} @alice = create_user :user_options => {:name => 'アリス', :admin => true}, :user_uid_options => {:uid => 'alice'} @carol = create_user :user_options => {:name => 'キャロル', :admin => false}, :user_uid_options => {:uid => 'carol'}, :status => 'RETIRED' @michael = create_user :user_options => { :name => "マイケル", :admin => false }, :user_uid_options => { :uid => 'michael' }, :status => "UNUSED" @users = User.synchronize_users @bob_attr, @alice_attr, @carol_attr, @michael_attr = @users end it '4件のユーザ同期情報を取得できること' do @users.size.should == 4 end it 'ボブの情報が正しく設定されていること' do @bob_attr.should == ['http://localhost:3000/id/boob', 'boob', 'ボブ', false, false] end it 'アリスの情報が正しく設定されていること' do @alice_attr.should == ['http://localhost:3000/id/alice', 'alice', 'アリス', true, false] end it 'キャロルの情報が正しく設定されていること' do @carol_attr.should == ['http://localhost:3000/id/carol', 'carol', 'キャロル', false, true] end it "マイケルの情報が正しく設定されていること" do @michael_attr.should == ["http://localhost:3000/id/michael", 'michael', "マイケル", false, false] end describe 'ボブが4分59秒前に更新、アリスが5分前に更新、キャロル, マイケルが5分1秒前に更新されており、5分以内に更新があったユーザのみ取得する場合' do before do Time.stub!(:now).and_return(Time.local(2009, 6, 2, 0, 0, 0)) User.record_timestamps = false @bob.update_attribute(:updated_on, Time.local(2009, 6, 1, 23, 54, 59)) @alice.update_attribute(:updated_on, Time.local(2009, 6, 1, 23, 55, 0)) @carol.update_attribute(:updated_on, Time.local(2009, 6, 1, 23, 55, 1)) @michael.update_attribute(:updated_on, Time.local(2009, 6, 1, 23, 55, 1)) @users = User.synchronize_users 5 @alice_attr, @carol_attr, @michael_attr = @users end it '3件のユーザ同期情報を取得できること' do @users.size.should == 3 end it 'アリスの情報が正しく設定されていること' do @alice_attr.should == ['http://localhost:3000/id/alice', 'alice', 'アリス', true, false] end it 'キャロルの情報が正しく設定されていること' do @carol_attr.should == ['http://localhost:3000/id/carol', 'carol', 'キャロル', false, true] end it "マイケルの情報が正しく設定されていること" do @michael_attr.should == ["http://localhost:3000/id/michael", 'michael', "マイケル", false, false] end after do User.record_timestamps = true end end end end describe User, "#custom" do it "関連するuser_customが存在するユーザの場合、そのuser_customが返る" do user = create_user custom = user.create_user_custom(:theme => "green", :editor_mode => "hiki") user.custom.should == custom end it "関連するuser_customが存在しないユーザの場合、新規のuser_customが取得返る" do user = create_user user.custom.should be_is_a(UserCustom) user.custom.should be_new_record end end describe User, '#participating_groups?' do before do @user = stub_model(User, :id => 99) @group = create_group end describe '指定したユーザがグループ参加者(参加済み)の場合' do before do group_participation = create_group_participation(:user_id => @user.id, :group_id => @group.id) end it 'trueが返ること' do @user.participating_group?(@group).should be_true end end describe '指定したユーザがグループ参加者(参加待ち)の場合' do before do group_participation = create_group_participation(:user_id => @user.id, :group_id => @group.id, :waiting => true) end it 'falseが返ること' do @user.participating_group?(@group).should be_false end end describe '指定したユーザがグループ管理者(参加済み)の場合' do before do group_participation = create_group_participation(:user_id => @user.id, :group_id => @group.id, :waiting => false, :owned => true) end it 'trueが返ること' do @user.participating_group?(@group).should be_true end end describe '指定したユーザがグループ管理者(参加待ち)の場合' do before do group_participation = create_group_participation(:user_id => @user.id, :group_id => @group.id, :waiting => true, :owned => true) end it 'falseが返ること' do @user.participating_group?(@group).should be_false end end describe '指定したユーザがグループ未参加者の場合' do before do group_participation = create_group_participation(:user_id => @user.id + 1, :group_id => @group.id) end it 'falseが返ること' do @user.participating_group?(@group).should be_false end end describe 'Group以外の場合' do it 'ArgumentErrorとなること' do lambda { @user.participating_group?(nil) }.should raise_error(ArgumentError) end end end describe User, 'password_required?' do before do @user = new_user end describe 'パスワードモードの場合' do before do SkipEmbedded::InitialSettings['login_mode'] = 'password' end describe 'パスワードが空の場合' do before do @user.password = '' end describe 'ユーザが利用中の場合' do before do @user.status = 'ACTIVE' end describe 'crypted_passwordが空の場合' do before do @user.crypted_password = '' end it '必要(true)と判定されること' do @user.send(:password_required?).should be_true end end describe 'crypted_passwordが空ではない場合' do before do @user.crypted_password = 'password' end it '必要ではない(false)と判定されること' do @user.send(:password_required?).should be_false end end end describe 'ユーザが利用中ではない場合' do before do @user.status = 'UNUSED' end it '必要ではない(false)と判定されること' do @user.send(:password_required?).should be_false end end end describe 'パスワードが空ではない場合' do before do @user.password = 'Password1' end it '必要(true)と判定されること' do @user.send(:password_required?).should be_true end end end describe 'パスワードモード以外の場合' do before do SkipEmbedded::InitialSettings['login_mode'] = 'rp' end it '必要ではない(false)と判定されること' do @user.send(:password_required?).should be_false end end end describe User, '.find_by_code_or_email_with_key_phrase' do before do @user = stub_model(User) User.stub!(:find_by_code_or_email).and_return(@user) end describe 'ログインキーフレーズが有効な場合' do before do Admin::Setting.should_receive(:enable_login_keyphrase).and_return(true) Admin::Setting.should_receive(:login_keyphrase).and_return('key_phrase') end describe 'ログインキーフレーズが設定値と一致する場合' do before do @key_phrase = 'key_phrase' end it 'ログインIDまたはemailで検索した結果が返ること' do User.send(:find_by_code_or_email_with_key_phrase, 'code_or_email', @key_phrase).should == @user end end describe 'ログインキーフレーズが設定値と一致しない場合' do before do @key_phrase = 'invalid_key_phrase' end it 'nilが返ること' do User.send(:find_by_code_or_email_with_key_phrase, 'code_or_email', @key_phrase).should be_nil end end end describe 'ログインキーフレーズが無効な場合' do before do Admin::Setting.should_receive(:enable_login_keyphrase).and_return(false) end it 'ログインIDまたはemailで検索した結果が返ること' do User.send(:find_by_code_or_email_with_key_phrase, 'code_or_email', @key_phrase).should == @user end end end describe User, '.find_by_code_or_email' do describe 'ログインIDに一致するユーザが見つかる場合' do before do @user = mock_model(User) User.should_receive(:find_by_code).and_return(@user) end it '見つかったユーザが返ること' do User.send(:find_by_code_or_email, 'login_id').should == @user end end describe 'ログインIDに一致するユーザが見つからない場合' do before do @user = mock_model(User) User.should_receive(:find_by_code).and_return(nil) end describe 'メールアドレスに一致するユーザが見つかる場合' do before do User.should_receive(:find_by_email).and_return(@user) end it '見つかったユーザが返ること' do User.send(:find_by_code_or_email, 'skip@example.org').should == @user end end describe 'メールアドレスに一致するユーザが見つからない場合' do before do User.should_receive(:find_by_email).and_return(nil) end it 'nilが返ること' do User.send(:find_by_code_or_email, 'skip@example.org').should be_nil end end end end describe User, '.auth_successed' do before do @user = create_user end it "検索されたユーザが返ること" do User.send(:auth_successed, @user).should == @user end describe 'ユーザがロックされている場合' do before do @user.should_receive(:locked?).and_return(true) end it 'last_authenticated_atが変化しないこと' do lambda do User.send(:auth_successed, @user) end.should_not change(@user, :last_authenticated_at) end it 'ログイン試行回数が変化しないこと' do lambda do User.send(:auth_successed, @user) end.should_not change(@user, :trial_num) end end describe 'ユーザがロックされていない場合' do before do @user.trial_num = 2 end it "last_authenticated_atが現在時刻に設定されること" do time = Time.now Time.stub!(:now).and_return(time) lambda do User.send(:auth_successed, @user) end.should change(@user, :last_authenticated_at).to(time) end it 'ログイン試行回数が0になること' do lambda do User.send(:auth_successed, @user) end.should change(@user, :trial_num).to(0) end end end describe User, '.auth_failed' do before do @user = create_user end it 'nilが返ること' do User.send(:auth_failed, @user).should be_nil end describe 'ユーザがロックされていない場合' do before do @user.should_receive(:locked?).and_return(false) end describe 'ログイン試行回数が最大値未満の場合' do before do @user.trial_num = 2 Admin::Setting.user_lock_trial_limit = 3 end describe 'ユーザロック機能が有効な場合' do before do Admin::Setting.enable_user_lock = 'true' end it 'ログイン試行回数が1増加すること' do lambda do User.send(:auth_failed, @user) end.should change(@user, :trial_num).to(3) end end describe 'ユーザロック機能が無効な場合' do before do Admin::Setting.enable_user_lock = 'false' end it 'ログイン試行回数が変化しないこと' do lambda do User.send(:auth_failed, @user) end.should_not change(@user, :trial_num) end end end describe 'ログイン試行回数が最大値以上の場合' do before do @user.trial_num = 3 Admin::Setting.user_lock_trial_limit = 3 end describe 'ユーザロック機能が有効な場合' do before do Admin::Setting.enable_user_lock = 'true' end it 'ロックされること' do lambda do User.send(:auth_failed, @user) end.should change(@user, :locked).to(true) end it 'ロックした旨のログが出力されること' do @user.should_receive(:to_s_log).with('[User Locked]').and_return('user locked log') @user.logger.should_receive(:info).with('user locked log') User.send(:auth_failed, @user) end end describe 'ユーザロック機能が無効な場合' do before do Admin::Setting.enable_user_lock = 'false' end it 'ロック状態が変化しないこと' do lambda do User.send(:auth_failed, @user) end.should_not change(@user, :locked) end it 'ロックした旨のログが出力されないこと' do @user.stub!(:to_s_log).with('[User Locked]').and_return('user locked log') @user.logger.should_not_receive(:info).with('user locked log') User.send(:auth_failed, @user) end end end end describe 'ユーザがロックされている場合' do before do @user.should_receive(:locked?).and_return(true) end it 'ログイン試行回数が変化しないこと' do lambda do User.send(:auth_failed, @user) end.should_not change(@user, :trial_num) end it 'ロック状態が変化しないこと' do lambda do User.send(:auth_failed, @user) end.should_not change(@user, :locked) end it 'ロックした旨のログが出力されないこと' do @user.stub!(:to_s_log).with('[User Locked]').and_return('user locked log') @user.logger.should_not_receive(:info).with('user locked log') User.send(:auth_failed, @user) end end end def new_user options = {} User.new({ :name => 'ほげ ほげ', :password => 'Password1', :password_confirmation => 'Password1', :email => SkipFaker.email, :section => 'Tester',}.merge(options)) end
openskip/skip
spec/models/user_spec.rb
Ruby
gpl-3.0
52,460
angular.module('starter.controllers') .controller('HistoryCtrl', function($scope) { $scope.history = [ { label: "Today, 10am-11am", min: 60, max: 87}, { label: "Today, 9am-10am", min: 62, max: 76}, { label: "Today, 8am-9am", min: 55, max: 79}, { label: "Yesterday, 10pm-11pm", min: 66, max: 83}, { label: "Yesterday, 6pm-7pm", min: 62, max: 91}, { label: "Yesterday, 5m-6pm", min: 54, max: 82}, { label: "Yesterday, 10am-11pm", min: 62, max: 97}, { label: "Yesterday, 9am-10pm", min: 64, max: 79}, ]; $scope.history.forEach(function(entry) { if (entry.max > 95) { entry.bgCol = "red"; entry.fgCol = "white"; entry.weight = "bold"; } else if( entry.max > 85) { entry.bgCol = "orange"; entry.fgCol = "white"; entry.weight = "bold"; } else { entry.bgCol = "white"; entry.fgCol = "black"; entry.weight = "normal"; } }); });
JBeaudaux/JBeaudaux.github.io
OpenHeart/js/history.js
JavaScript
gpl-3.0
987
const editor = require('./form-editor/form-editor.js') const fields = require('./form-editor/fields.js') const settings = require('./settings') const notices = {} function show (id, text) { notices[id] = text render() } function hide (id) { delete notices[id] render() } function render () { let html = '' for (const key in notices) { html += '<div class="notice notice-warning inline"><p>' + notices[key] + '</p></div>' } let container = document.querySelector('.mc4wp-notices') if (!container) { container = document.createElement('div') container.className = 'mc4wp-notices' const heading = document.querySelector('h1, h2') heading.parentNode.insertBefore(container, heading.nextSibling) } container.innerHTML = html } const groupingsNotice = function () { const text = 'Your form contains deprecated <code>GROUPINGS</code> fields. <br /><br />Please remove these fields from your form and then re-add them through the available field buttons to make sure your data is getting through to Mailchimp correctly.' const formCode = editor.getValue().toLowerCase(); (formCode.indexOf('name="groupings') > -1) ? show('deprecated_groupings', text) : hide('deprecated_groupings') } const requiredFieldsNotice = function () { const requiredFields = fields.getAllWhere('forceRequired', true) const missingFields = requiredFields.filter(function (f) { return !editor.containsField(f.name.toUpperCase()) }) let text = '<strong>Heads up!</strong> Your form is missing list fields that are required in Mailchimp. Either add these fields to your form or mark them as optional in Mailchimp.' text += '<br /><ul class="ul-square" style="margin-bottom: 0;"><li>' + missingFields.map(function (f) { return f.title }).join('</li><li>') + '</li></ul>'; (missingFields.length > 0) ? show('required_fields_missing', text) : hide('required_fields_missing') } const mailchimpListsNotice = function () { const text = '<strong>Heads up!</strong> You have not yet selected a Mailchimp list to subscribe people to. Please select at least one list from the <a href="javascript:void(0)" data-tab="settings" class="tab-link">settings tab</a>.' if (settings.getSelectedLists().length > 0) { hide('no_lists_selected') } else { show('no_lists_selected', text) } } // old groupings groupingsNotice() editor.on('focus', groupingsNotice) editor.on('blur', groupingsNotice) // missing required fields requiredFieldsNotice() editor.on('blur', requiredFieldsNotice) editor.on('focus', requiredFieldsNotice) document.body.addEventListener('change', mailchimpListsNotice)
ibericode/mailchimp-for-wordpress
assets/src/js/admin/notices.js
JavaScript
gpl-3.0
2,625
package hu.rgai.yako.beens; import java.util.*; import android.os.Parcel; import android.os.Parcelable; /** * * @author Tamas Kojedzinszky */ public class MainServiceExtraParams implements Parcelable { public static final Parcelable.Creator<MainServiceExtraParams> CREATOR = new Parcelable.Creator<MainServiceExtraParams>() { public MainServiceExtraParams createFromParcel(Parcel in) { return new MainServiceExtraParams(in); } public MainServiceExtraParams[] newArray(int size) { return new MainServiceExtraParams[size]; } }; private boolean mFromNotifier = false; private int mQueryLimit = -1; private int mQueryOffset = -1; private boolean mLoadMore = false; private List<Account> mAccounts = new LinkedList<>(); private boolean mForceQuery = false; private int mResult = -1; private boolean mMessagesRemovedAtServer = false; private boolean mSplittedMessageSecondPart = false; private boolean mNewMessageArrivedRequest = false; private TreeMap<String, MessageListElement> mSplittedMessages = new TreeMap<>(); public MainServiceExtraParams() {} public MainServiceExtraParams(Parcel in) { mFromNotifier = in.readByte() == 1; mQueryLimit = in.readInt(); mQueryOffset = in.readInt(); mLoadMore = in.readByte() == 1; in.readList(mAccounts,Account.class.getClassLoader()); mForceQuery = in.readByte() == 1; mResult = in.readInt(); mMessagesRemovedAtServer = in.readByte() == 1; mSplittedMessageSecondPart = in.readByte() == 1; mNewMessageArrivedRequest = in.readByte() == 1; int splittedLength = in.readInt(); for (int i = 0; i < splittedLength; i++) { mSplittedMessages.put(in.readString(), (MessageListElement)in.readParcelable(MessageListElement.class.getClassLoader())); } } public int describeContents() { return 0; } public void writeToParcel(Parcel dest, int flags) { dest.writeByte((byte)(mFromNotifier ? 1 : 0)); dest.writeInt(mQueryLimit); dest.writeInt(mQueryOffset); dest.writeByte((byte) (mLoadMore ? 1 : 0)); dest.writeList(mAccounts); dest.writeByte((byte) (mForceQuery ? 1 : 0)); dest.writeInt(mResult); dest.writeByte((byte) (mMessagesRemovedAtServer ? 1 : 0)); dest.writeByte((byte) (mSplittedMessageSecondPart ? 1 : 0)); dest.writeByte((byte) (mNewMessageArrivedRequest ? 1 : 0)); dest.writeInt(mSplittedMessages.size()); for (Map.Entry<String, MessageListElement> e : mSplittedMessages.entrySet()) { dest.writeString(e.getKey()); dest.writeParcelable(e.getValue(), flags); } } public boolean isFromNotifier() { return mFromNotifier; } public void setFromNotifier(boolean mFromNotifier) { this.mFromNotifier = mFromNotifier; } public int getQueryLimit() { return mQueryLimit; } public void setQueryLimit(int mQueryLimit) { this.mQueryLimit = mQueryLimit; } public int getQueryOffset() { return mQueryOffset; } public void setQueryOffset(int mQueryOffset) { this.mQueryOffset = mQueryOffset; } public boolean isLoadMore() { return mLoadMore; } public void setLoadMore(boolean mLoadMore) { this.mLoadMore = mLoadMore; } public boolean isAccountsEmpty() { return mAccounts.isEmpty(); } public boolean accountsContains(Account acc) { return mAccounts.contains(acc); } public List<Account> getAccounts() { return Collections.unmodifiableList(mAccounts) ; } public void addAccount(Account acc) { this.mAccounts.add(acc); } public void setOnNewMessageArrived(boolean newMessageArrivedRequest) { mNewMessageArrivedRequest = newMessageArrivedRequest; } public boolean isNewMessageArrivedRequest() { return mNewMessageArrivedRequest; } public void setAccount(Account account) { mAccounts.clear(); mAccounts.add(account); } public void setAccounts(List<Account> accounts) { this.mAccounts = accounts; } public boolean isForceQuery() { return mForceQuery; } public void setForceQuery(boolean mForceQuery) { this.mForceQuery = mForceQuery; } public int getResult() { return mResult; } public void setResult(int mResult) { this.mResult = mResult; } public boolean isMessagesRemovedAtServer() { return mMessagesRemovedAtServer; } public void setMessagesRemovedAtServer(boolean mMessagesRemovedAtServer) { this.mMessagesRemovedAtServer = mMessagesRemovedAtServer; } public void setSplittedMessageSecondPart(boolean splittedMessageSecondPart) { mSplittedMessageSecondPart = splittedMessageSecondPart; } public void setSplittedMessages(TreeMap<String, MessageListElement> splittedMessages) { mSplittedMessages = splittedMessages; } public TreeMap<String, MessageListElement> getSplittedMessages() { return mSplittedMessages; } public boolean isSplittedMessageSecondPart() { return mSplittedMessageSecondPart; } @Override public String toString() { String ToString = "MainServiceExtraParams{" + "mFromNotifier=" + mFromNotifier + ", mQueryLimit=" + mQueryLimit + ", mQueryOffset=" + mQueryOffset + ", mLoadMore=" + mLoadMore + ", mAccounts="; for (int i = 0; i < mAccounts.size(); i++) { ToString += mAccounts.get(i) + ", "; } ToString += "mForceQuery=" + mForceQuery + ", mResult=" + mResult + '}'; return ToString; } }
k-kojak/yako
src/hu/rgai/yako/beens/MainServiceExtraParams.java
Java
gpl-3.0
5,416
<? // // TorrentTrader v2.x // This file was last updated: 06/03/2009 by TorrentialStorm // // http://www.torrenttrader.org // // require_once("backend/functions.php"); dbconn(); //check permissions if ($site_config["MEMBERSONLY"]){ loggedinonly(); if($CURUSER["view_torrents"]=="no") show_error_msg("Error","You do not have permission to view torrents",1); } function sqlwildcardesc($x){ return str_replace(array("%","_"), array("\\%","\\_"), mysql_real_escape_string($x)); } //GET SEARCH STRING $searchstr = trim(unesc($_GET["search"])); $cleansearchstr = searchfield($searchstr); if (empty($cleansearchstr)) unset($cleansearchstr); $thisurl = "torrents-search.php?"; $addparam = ""; $wherea = array(); $wherecatina = array(); $wherea[] = "banned = 'no'"; $wherecatina = array(); $wherecatin = ""; $res = mysql_query("SELECT id FROM categories"); while($row = mysql_fetch_assoc($res)){ if ($_GET["c$row[id]"]) { $wherecatina[] = $row[id]; $addparam .= "c$row[id]=1&amp;"; $addparam .= "c$row[id]=1&amp;"; $thisurl .= "c$row[id]=1&amp;"; } $wherecatin = implode(", ", $wherecatina); } if ($wherecatin) $wherea[] = "category IN ($wherecatin)"; //include dead if ($_GET["incldead"] == 1) { $addparam .= "incldead=1&amp;"; $thisurl .= "incldead=1&"; }elseif ($_GET["incldead"] == 2){ $wherea[] = "visible = 'no'"; $addparam .= "incldead=2&amp;"; $thisurl .= "incldead=2&"; }else $wherea[] = "visible = 'yes'"; // Include freeleech if ($_GET["freeleech"] == 1) { $addparam .= "freeleech=1&amp;"; $thisurl .= "freeleech=1&amp;"; $wherea[] = "freeleech = '0'"; } elseif ($_GET["freeleech"] == 2) { $addparam .= "freeleech=2&amp;"; $thisurl .= "freeleech=2&amp;"; $wherea[] = "freeleech = '1'"; } //include external if ($_GET["inclexternal"] == 1) { $addparam .= "inclexternal=1&amp;"; $wherea[] = "external = 'no'"; } if ($_GET["inclexternal"] == 2) { $addparam .= "inclexternal=2&amp;"; $wherea[] = "external = 'yes'"; } //cat if ($_GET["cat"]) { $wherea[] = "category = " . sqlesc($_GET["cat"]); $wherecatina[] = sqlesc($_GET["cat"]); $addparam .= "cat=" . urlencode($_GET["cat"]) . "&amp;"; $thisurl .= "cat=".urlencode($_GET["cat"])."&"; } //language if ($_GET["lang"]) { $wherea[] = "torrentlang = " . sqlesc($_GET["lang"]); $addparam .= "lang=" . urlencode($_GET["lang"]) . "&amp;"; $thisurl .= "lang=".urlencode($_GET["lang"])."&"; } //parent cat if ($_GET["parent_cat"]) { $addparam .= "parent_cat=" . urlencode($_GET["parent_cat"]) . "&amp;"; $thisurl .= "parent_cat=".urlencode($_GET["parent_cat"])."&"; } $parent_cat = $_GET["parent_cat"]; $wherebase = $wherea; if (isset($cleansearchstr)) { $wherea[] = "MATCH (torrents.name) AGAINST ('".mysql_real_escape_string($searchstr)."' IN BOOLEAN MODE)"; $addparam .= "search=" . urlencode($searchstr) . "&amp;"; $thisurl .= "search=".urlencode($searchstr)."&"; } //order by if ($_GET['sort'] && $_GET['order']) { $column = ''; $ascdesc = ''; switch($_GET['sort']) { case 'id': $column = "id"; break; case 'name': $column = "name"; break; case 'comments': $column = "comments"; break; case 'size': $column = "size"; break; case 'times_completed': $column = "times_completed"; break; case 'seeders': $column = "seeders"; break; case 'leechers': $column = "leechers"; break; case 'category': $column = "category"; break; default: $column = "id"; break; } switch($_GET['order']) { case 'asc': $ascdesc = "ASC"; break; case 'desc': $ascdesc = "DESC"; break; default: $ascdesc = "DESC"; break; } } else { $_GET["sort"] = "id"; $_GET["order"] = "desc"; $column = "id"; $ascdesc = "DESC"; } $orderby = "ORDER BY torrents." . $column . " " . $ascdesc; $pagerlink = "sort=" . $_GET['sort'] . "&order=" . $_GET['order'] . "&"; if (is_valid_id($_GET["page"])) $thisurl .= "page=$_GET[page]&"; $where = implode(" AND ", $wherea); if ($where != "") $where = "WHERE $where"; if ($parent_cat){ $parent_check = " AND categories.parent_cat='$parent_cat'"; } //GET NUMBER FOUND FOR PAGER $res = mysql_query("SELECT COUNT(*) FROM torrents $where $parent_check") or die(mysql_error()); $row = mysql_fetch_array($res); $count = $row[0]; if (!$count && isset($cleansearchstr)) { $wherea = $wherebase; $searcha = explode(" ", $cleansearchstr); $sc = 0; foreach ($searcha as $searchss) { if (strlen($searchss) <= 1) continue; $sc++; if ($sc > 5) break; $ssa = array(); foreach (array("torrents.name") as $sss) $ssa[] = "$sss LIKE '%" . sqlwildcardesc($searchss) . "%'"; $wherea[] = "(" . implode(" OR ", $ssa) . ")"; } if ($sc) { $where = implode(" AND ", $wherea); if ($where != "") $where = "WHERE $where"; $res = mysql_query("SELECT COUNT(*) FROM torrents $where $parent_check"); $row = mysql_fetch_array($res); $count = $row[0]; } } //Sort by if ($addparam != "") { if ($pagerlink != "") { if ($addparam{strlen($addparam)-1} != ";") { // & = &amp; $addparam = $addparam . "&" . $pagerlink; } else { $addparam = $addparam . $pagerlink; } } } else { $addparam = $pagerlink; } if ($count) { //SEARCH QUERIES! list($pagertop, $pagerbottom, $limit) = pager(20, $count, "torrents-search.php?" . $addparam); $query = "SELECT torrents.id, torrents.anon, torrents.announce, torrents.category, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.parent_cat AS cat_parent, categories.image AS cat_pic, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id $where $parent_check $orderby $limit"; $res = mysql_query($query) or die(mysql_error()); }else{ unset($res); } if (isset($cleansearchstr)) stdhead("Search results for \"$searchstr\""); else stdhead("Browse Torrents"); begin_frame("" . SEARCH_TITLE . ""); // get all parent cats echo "<CENTER><B>".CATEGORIES.":</B> "; $catsquery = mysql_query("SELECT distinct parent_cat FROM categories ORDER BY parent_cat")or die(mysql_error()); echo " - <a href=torrents.php>".SHOWALL."</a>"; while($catsrow = MYSQL_FETCH_ARRAY($catsquery)){ echo " - <a href=torrents.php?parent_cat=".urlencode($catsrow['parent_cat']).">$catsrow[parent_cat]</a>"; } ?> <BR><BR> <form method="get" action="torrents-search.php"> <table class=bottom align="center"> <tr align='right'> <? $i = 0; $cats = mysql_query("SELECT * FROM categories ORDER BY parent_cat, name"); while ($cat = mysql_fetch_assoc($cats)) { $catsperrow = 5; print(($i && $i % $catsperrow == 0) ? "</tr><tr align='right'>" : ""); print("<td style=\"padding-bottom: 2px;padding-left: 2px\"><a class=catlink href=torrents.php?cat={$cat["id"]}>".htmlspecialchars($cat["parent_cat"])." - " . htmlspecialchars($cat["name"]) . "</a><input name=c{$cat["id"]} type=\"checkbox\" " . (in_array($cat["id"], $wherecatina) ? "checked " : "") . "value=1></td>\n"); $i++; } echo "</tr></table>"; //if we are browsing, display all subcats that are in same cat if ($parent_cat){ echo "<BR><BR><b>You are in:</b> <a href=torrents.php?parent_cat=$parent_cat>$parent_cat</a><BR><B>Sub Categories:</B> "; $subcatsquery = mysql_query("SELECT id, name, parent_cat FROM categories WHERE parent_cat='$parent_cat' ORDER BY name")or die(mysql_error()); while($subcatsrow = MYSQL_FETCH_ARRAY($subcatsquery)){ $name = $subcatsrow['name']; echo " - <a href=torrents.php?cat=$subcatsrow[id]>$name</a>"; } } echo "</CENTER><BR><BR>";//some spacing ?> <CENTER> <? print("" . SEARCH . "\n"); ?> <input type="text" name="search" size="40" value="<?= stripslashes(htmlspecialchars($searchstr)) ?>" /> <? print("" . IN . "\n"); ?> <select name="cat"> <option value="0"><? echo "(".ALL." ".TYPES.")";?></option> <? $cats = genrelist(); $catdropdown = ""; foreach ($cats as $cat) { $catdropdown .= "<option value=\"" . $cat["id"] . "\""; if ($cat["id"] == $_GET["cat"]) $catdropdown .= " selected=\"selected\""; $catdropdown .= ">" . htmlspecialchars($cat["parent_cat"]) . ": " . htmlspecialchars($cat["name"]) . "</option>\n"; } ?> <?= $catdropdown ?> </select> <BR><BR> <select name="incldead"> <option value="0"><?php echo "".ACTIVE_TRANSFERS."";?></option> <option value="1" <?php if ($_GET["incldead"] == 1) echo "selected"; ?>><?php echo "".INC_DEAD."";?></option> <option value="2" <?php if ($_GET["incldead"] == 2) echo "selected"; ?>><?php echo "".ONLY_DEAD."";?></option> </select> <select name="freeleech"> <option value="0">Any</option> <option value="1" <?php if ($_GET["freeleech"] == 1) echo "selected"; ?>>Not freeleech</option> <option value="2" <?php if ($_GET["freeleech"] == 2) echo "selected"; ?>>Only freeleech</option> </select> <?if ($site_config["ALLOWEXTERNAL"]){?> <select name="inclexternal"> <option value="0">Local/External</option> <option value="1" <?php if ($_GET["inclexternal"] == 1) echo "selected"; ?>>Local Only</option> <option value="2" <?php if ($_GET["inclexternal"] == 2) echo "selected"; ?>>External Only</option> </select> <? } ?> <select name="lang"> <option value="0"><? echo "(".ALL.")";?></option> <? $lang = langlist(); $langdropdown = ""; foreach ($lang as $lang) { $langdropdown .= "<option value=\"" . $lang["id"] . "\""; if ($lang["id"] == $_GET["lang"]) $langdropdown .= " selected=\"selected\""; $langdropdown .= ">" . htmlspecialchars($lang["name"]) . "</option>\n"; } ?> <?= $langdropdown ?> </select> <input type="submit" value="<? print("" . SEARCH . "\n"); ?>" /> <br> </form> </CENTER><CENTER><? print("" . SEARCH_RULES . "\n"); ?></CENTER><BR> <? //sort /* echo "<div align=right><form action='' name='jump' method='GET'>"; echo "Sort By: <select name='sort' onChange='document.jump.submit();' style=\"font-family: Verdana; font-size: 8pt; border: 1px solid #000000; background-color: #CCCCCC\" size=\"1\">"; echo "<option value='id'" . ($_GET["sort"] == "id" ? "selected" : "") . ">Added</option>"; echo "<option value='name'" . ($_GET["sort"] == "name" ? "selected" : "") . ">Name</option>"; echo "<option value='comments'" . ($_GET["sort"] == "comments" ? "selected" : "") . ">Comments</option>"; echo "<option value='size'" . ($_GET["sort"] == "size" ? "selected" : "") . ">Size</option>"; echo "<option value='times_completed'" . ($_GET["sort"] == "times_completed" ? "selected" : "") . ">Completed</option>"; echo "<option value='seeders'" . ($_GET["sort"] == "seeders" ? "selected" : "") . ">Seeders</option>"; echo "<option value='leechers'" . ($_GET["sort"] == "leechers" ? "selected" : "") . ">Leechers</option>"; echo "</select>&nbsp;"; echo "<select name='order' onChange='document.jump.submit();' style=\"font-family: Verdana; font-size: 8pt; border: 1px solid #000000; background-color: #CCCCCC\" size=\"1\">"; echo "<option selected value='asc'" . ($_GET["order"] == "asc" ? "selected" : "") . ">Ascend</option>"; echo "<option value='desc'" . ($_GET["order"] == "desc" ? "selected" : "") . ">Descend</option>"; echo "</select>"; echo "</form>"; echo "</div>"; ********** OLD CODE *************/ if ($count) { // New code (TorrentialStorm) echo "<div align=right><form id='sort'>".SORT_BY.": <select name='sort' onChange='window.location=\"{$thisurl}sort=\"+this.options[this.selectedIndex].value+\"&order=\"+document.forms[\"sort\"].order.options[document.forms[\"sort\"].order.selectedIndex].value' style=\"font-family: Verdana; font-size: 8pt; border: 1px solid #000000; background-color: #CCCCCC\" size=\"1\">"; echo "<option value='id'" . ($_GET["sort"] == "id" ? "selected" : "") . ">".ADDED."</option>"; echo "<option value='name'" . ($_GET["sort"] == "name" ? "selected" : "") . ">".NAME."</option>"; echo "<option value='comments'" . ($_GET["sort"] == "comments" ? "selected" : "") . ">".COMMENTS."</option>"; echo "<option value='size'" . ($_GET["sort"] == "size" ? "selected" : "") . ">".SIZE."</option>"; echo "<option value='times_completed'" . ($_GET["sort"] == "times_completed" ? "selected" : "") . ">".COMPLETED."</option>"; echo "<option value='seeders'" . ($_GET["sort"] == "seeders" ? "selected" : "") . ">".SEEDS."</option>"; echo "<option value='leechers'" . ($_GET["sort"] == "leechers" ? "selected" : "") . ">".LEECH."</option>"; echo "</select>&nbsp;"; echo "<select name='order' onChange='window.location=\"{$thisurl}order=\"+this.options[this.selectedIndex].value+\"&sort=\"+document.forms[\"sort\"].sort.options[document.forms[\"sort\"].sort.selectedIndex].value' style=\"font-family: Verdana; font-size: 8pt; border: 1px solid #000000; background-color: #CCCCCC\" size=\"1\">"; echo "<option selected value='asc'" . ($_GET["order"] == "asc" ? "selected" : "") . ">".ASCEND."</option>"; echo "<option value='desc'" . ($_GET["order"] == "desc" ? "selected" : "") . ">".DESCEND."</option>"; echo "</select>"; echo "</form></div>"; // End torrenttable($res); print($pagerbottom); }else { show_error_msg("" . NOTHING_FOUND . "", "" . NO_RESULTS . "",0); } if ($CURUSER) mysql_query("UPDATE users SET last_browse=".gmtime()." WHERE id=$CURUSER[id]"); end_frame(); stdfoot(); ?>
BamBam0077/TorrentTrader-2.06
torrents-search.php
PHP
gpl-3.0
13,485
# -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from redsolutioncms.models import CMSSettings, BaseSettings, BaseSettingsManager FIELD_TYPES = ( ('BooleanField', _('Checkbox')), ('CharField', _('Character field')), ('Text', _('Text area')), ('EmailField', _('Email field')), ) class FeedbackSettingsManager(BaseSettingsManager): def get_settings(self): if self.get_query_set().count(): return self.get_query_set()[0] else: feedback_settings = self.get_query_set().create() # cms_settings = CMSSettings.objects.get_settings() return feedback_settings class FeedbackSettings(BaseSettings): # use_direct_view = models.BooleanField( # verbose_name=_('Use dedicated view to render feedback page'), # default=True # ) # Temporary hadrcoded use_direct_view = True use_custom_form = models.BooleanField(verbose_name=_('Use custom feedback form'), default=False) objects = FeedbackSettingsManager() class FormField(models.Model): feedback_settings = models.ForeignKey('FeedbackSettings') field_type = models.CharField(verbose_name=_('Type of field'), choices=FIELD_TYPES, max_length=255) field_name = models.CharField(verbose_name=_('Verbose name of field'), max_length=255)
redsolution/django-simple-feedback
feedback/redsolution_setup/models.py
Python
gpl-3.0
1,391
/*============================================================================== * File $Id$ * Project: ProWim * * $LastChangedDate: 2010-07-19 17:01:15 +0200 (Mon, 19 Jul 2010) $ * $LastChangedBy: wardi $ * $HeadURL: https://repository.ebcot.info/wivu/trunk/prowim-server/src/de/ebcot/prowim/datamodel/prowim/ProcessElement.java $ * $LastChangedRevision: 4323 $ *------------------------------------------------------------------------------ * (c) 06.08.2009 Ebcot Business Solutions GmbH. More info: http://www.ebcot.de * All rights reserved. Use is subject to license terms. *============================================================================== * *This file is part of ProWim. ProWim is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ProWim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with ProWim. If not, see <http://www.gnu.org/licenses/>. Diese Datei ist Teil von ProWim. ProWim ist Freie Software: Sie können es unter den Bedingungen der GNU General Public License, wie von der Free Software Foundation, Version 3 der Lizenz oder (nach Ihrer Option) jeder späteren veröffentlichten Version, weiterverbreiten und/oder modifizieren. ProWim wird in der Hoffnung, dass es nützlich sein wird, aber OHNE JEDE GEWÄHELEISTUNG, bereitgestellt; sogar ohne die implizite Gewährleistung der MARKTFÄHIGKEIT oder EIGNUNG FÜR EINEN BESTIMMTEN ZWECK. Siehe die GNU General Public License für weitere Details. Sie sollten eine Kopie der GNU General Public License zusammen mit diesem Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>. */ package org.prowim.datamodel.prowim; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType; import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.Validate; import org.prowim.datamodel.collections.StringArray; import org.prowim.utils.JSONConvertible; /** * This is a data object as parent for all process element objects.<br> * A process element is an element of a {@link Process process} * * @author Saad Wardi * @version $Revision: 4323 $ */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ProcessElement", propOrder = { "id", "name", "createTime", "description", "className", "keyWords" }) public class ProcessElement implements JSONConvertible { private String id; private String name; private String createTime; private String description; private String className; private StringArray keyWords = new StringArray(); /** * Creates a ProcessElement. * * @param id {@link ProcessElement#setID(String)} * @param name {@link ProcessElement#setName(String)} * @param createTime {@link ProcessElement#setCreateTime(String)} */ protected ProcessElement(String id, String name, String createTime) { setID(id); setName(name); setCreateTime(createTime); } /** * This non-arg constructor is needed to bind this DataObject in EJB-Context. See the J2EE specification. */ protected ProcessElement() { } /** * ProcessElementement#setID(String)} * * @return the id . not null */ public String getID() { return id; } /** * Sets the ID of the template to a ProcessElement instance. * * @param id the not null ID to set */ private void setID(String id) { Validate.notNull(id); this.id = id; } /** * {@link ProcessElement#setName(String)} * * @return the name . not null */ public String getName() { return name; } /** * Sets the name of the template to a ProcessElement instance. * * @param name the not null name to set */ public void setName(String name) { Validate.notNull(name); this.name = name; } /** * {@link ProcessElement#setCreateTime(String)} * * @return the createTime */ public String getCreateTime() { return createTime; } /** * Sets the name of the template to a ProcessElement instance. * * @param createTime the not null createTime to set. */ private void setCreateTime(String createTime) { Validate.notNull(createTime); this.createTime = createTime; } /** * Gets the value of the description property. * * @return possible object is {@link String}. cann be null if no description is specified. * */ public String getDescription() { return description; } /** * Sets the value of the description property. * * @param value allowed object is {@link String}. null is possible. * */ public void setDescription(String value) { this.description = value; } /** * {@inheritDoc} * * @see java.lang.Object#toString() */ @Override public String toString() { return this.getName(); } /** * * {@inheritDoc} * * @see org.prowim.utils.JSONConvertible#toJSON() */ public String toJSON() { StringBuilder builder = new StringBuilder(); builder.append("{"); builder.append("className:\""); builder.append(StringEscapeUtils.escapeJavaScript(this.getClassName())); builder.append("\","); builder.append("name:\""); builder.append(StringEscapeUtils.escapeJavaScript(this.getName())); builder.append("\","); builder.append("description:\""); builder.append(StringEscapeUtils.escapeJavaScript(this.getDescription())); builder.append("\","); builder.append("id:\""); builder.append(StringEscapeUtils.escapeJavaScript(this.getID())); builder.append("\"}"); return builder.toString(); } /** * Sets the class name of the concrete instance * * @param className the className to set */ public void setClassName(String className) { this.className = className; } /** * Gets the class name of the concrete instance * * @return the className, can be <code>NULL</code> */ public String getClassName() { return className; } /** * Sets a list of key words for element * * @param keyWords the keyWords to set */ public void setKeyWords(StringArray keyWords) { this.keyWords = keyWords; } /** * Get all key words of this element * * @return the keyWords */ public StringArray getKeyWords() { return keyWords; } /** * * Add the given key word to the list of key words. It can not be null. * * @param keyWord a key word for given element. Not null. */ public void addKeyWord(String keyWord) { Validate.notNull(keyWord, "Key word can not be null."); this.keyWords.add(keyWord); } }
prowim/prowim
prowim-data/src/org/prowim/datamodel/prowim/ProcessElement.java
Java
gpl-3.0
7,775
/************************************************************************** * Meerkat Browser: Web browser controlled by the user, not vice-versa. * Copyright (C) 2013 - 2016 Michal Dutkiewicz aka Emdek <michal@emdek.pl> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * **************************************************************************/ #ifndef MEERKAT_NETWORKCACHE_H #define MEERKAT_NETWORKCACHE_H #include <QtNetwork/QNetworkDiskCache> namespace Meerkat { class NetworkCache : public QNetworkDiskCache { Q_OBJECT public: explicit NetworkCache(QObject *parent = nullptr); void clearCache(int period = 0); void insert(QIODevice *device); QIODevice* prepare(const QNetworkCacheMetaData &metaData); QString getPathForUrl(const QUrl &url); QList<QUrl> getEntries() const; bool remove(const QUrl &url); protected slots: void optionChanged(int identifier, const QVariant &value); private: QHash<QIODevice*, QUrl> m_devices; signals: void cleared(); void entryAdded(QUrl url); void entryRemoved(QUrl url); }; } #endif
MeerkatBrowser/meerkat-browser
src/core/NetworkCache.h
C
gpl-3.0
1,634
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals """ oauthlib.oauth1.rfc5849 ~~~~~~~~~~~~~~ This module is an implementation of various logic needed for signing and checking OAuth 1.0 RFC 5849 requests. """ import logging log = logging.getLogger("oauthlib") import sys import time try: import urlparse except ImportError: import urllib.parse as urlparse if sys.version_info[0] == 3: bytes_type = bytes else: bytes_type = str from ...common import Request, urlencode, generate_nonce from ...common import generate_timestamp, to_unicode from . import parameters, signature, utils SIGNATURE_HMAC = "HMAC-SHA1" SIGNATURE_RSA = "RSA-SHA1" SIGNATURE_PLAINTEXT = "PLAINTEXT" SIGNATURE_METHODS = (SIGNATURE_HMAC, SIGNATURE_RSA, SIGNATURE_PLAINTEXT) SIGNATURE_TYPE_AUTH_HEADER = 'AUTH_HEADER' SIGNATURE_TYPE_QUERY = 'QUERY' SIGNATURE_TYPE_BODY = 'BODY' CONTENT_TYPE_FORM_URLENCODED = 'application/x-www-form-urlencoded' class Client(object): """A client used to sign OAuth 1.0 RFC 5849 requests""" def __init__(self, client_key, client_secret=None, resource_owner_key=None, resource_owner_secret=None, callback_uri=None, signature_method=SIGNATURE_HMAC, signature_type=SIGNATURE_TYPE_AUTH_HEADER, rsa_key=None, verifier=None, realm=None, encoding='utf-8', decoding=None, nonce=None, timestamp=None): """Create an OAuth 1 client. :param client_key: Client key (consumer key), mandatory. :param resource_owner_key: Resource owner key (oauth token). :param resource_owner_secret: Resource owner secret (oauth token secret). :param callback_uri: Callback used when obtaining request token. :param signature_method: SIGNATURE_HMAC, SIGNATURE_RSA or SIGNATURE_PLAINTEXT. :param signature_type: SIGNATURE_TYPE_AUTH_HEADER (default), SIGNATURE_TYPE_QUERY or SIGNATURE_TYPE_BODY depending on where you want to embed the oauth credentials. :param rsa_key: RSA key used with SIGNATURE_RSA. :param verifier: Verifier used when obtaining an access token. :param realm: Realm (scope) to which access is being requested. :param encoding: If you provide non-unicode input you may use this to have oauthlib automatically convert. :param decoding: If you wish that the returned uri, headers and body from sign be encoded back from unicode, then set decoding to your preferred encoding, i.e. utf-8. :param nonce: Use this nonce instead of generating one. (Mainly for testing) :param timestamp: Use this timestamp instead of using current. (Mainly for testing) """ # Convert to unicode using encoding if given, else assume unicode encode = lambda x: to_unicode(x, encoding) if encoding else x self.client_key = encode(client_key) self.client_secret = encode(client_secret) self.resource_owner_key = encode(resource_owner_key) self.resource_owner_secret = encode(resource_owner_secret) self.signature_method = encode(signature_method) self.signature_type = encode(signature_type) self.callback_uri = encode(callback_uri) self.rsa_key = encode(rsa_key) self.verifier = encode(verifier) self.realm = encode(realm) self.encoding = encode(encoding) self.decoding = encode(decoding) self.nonce = encode(nonce) self.timestamp = encode(timestamp) if self.signature_method == SIGNATURE_RSA and self.rsa_key is None: raise ValueError('rsa_key is required when using RSA signature method.') def get_oauth_signature(self, request): """Get an OAuth signature to be used in signing a request """ if self.signature_method == SIGNATURE_PLAINTEXT: # fast-path return signature.sign_plaintext(self.client_secret, self.resource_owner_secret) uri, headers, body = self._render(request) collected_params = signature.collect_parameters( uri_query=urlparse.urlparse(uri).query, body=body, headers=headers) log.debug("Collected params: {0}".format(collected_params)) normalized_params = signature.normalize_parameters(collected_params) normalized_uri = signature.normalize_base_string_uri(request.uri) log.debug("Normalized params: {0}".format(normalized_params)) log.debug("Normalized URI: {0}".format(normalized_uri)) base_string = signature.construct_base_string(request.http_method, normalized_uri, normalized_params) log.debug("Base signing string: {0}".format(base_string)) if self.signature_method == SIGNATURE_HMAC: sig = signature.sign_hmac_sha1(base_string, self.client_secret, self.resource_owner_secret) elif self.signature_method == SIGNATURE_RSA: sig = signature.sign_rsa_sha1(base_string, self.rsa_key) else: sig = signature.sign_plaintext(self.client_secret, self.resource_owner_secret) log.debug("Signature: {0}".format(sig)) return sig def get_oauth_params(self): """Get the basic OAuth parameters to be used in generating a signature. """ nonce = (generate_nonce() if self.nonce is None else self.nonce) timestamp = (generate_timestamp() if self.timestamp is None else self.timestamp) params = [ ('oauth_nonce', nonce), ('oauth_timestamp', timestamp), ('oauth_version', '1.0'), ('oauth_signature_method', self.signature_method), ('oauth_consumer_key', self.client_key), ] if self.resource_owner_key: params.append(('oauth_token', self.resource_owner_key)) if self.callback_uri: params.append(('oauth_callback', self.callback_uri)) if self.verifier: params.append(('oauth_verifier', self.verifier)) return params def _render(self, request, formencode=False, realm=None): """Render a signed request according to signature type Returns a 3-tuple containing the request URI, headers, and body. If the formencode argument is True and the body contains parameters, it is escaped and returned as a valid formencoded string. """ # TODO what if there are body params on a header-type auth? # TODO what if there are query params on a body-type auth? uri, headers, body = request.uri, request.headers, request.body # TODO: right now these prepare_* methods are very narrow in scope--they # only affect their little thing. In some cases (for example, with # header auth) it might be advantageous to allow these methods to touch # other parts of the request, like the headers—so the prepare_headers # method could also set the Content-Type header to x-www-form-urlencoded # like the spec requires. This would be a fundamental change though, and # I'm not sure how I feel about it. if self.signature_type == SIGNATURE_TYPE_AUTH_HEADER: headers = parameters.prepare_headers(request.oauth_params, request.headers, realm=realm) elif self.signature_type == SIGNATURE_TYPE_BODY and request.decoded_body is not None: body = parameters.prepare_form_encoded_body(request.oauth_params, request.decoded_body) if formencode: body = urlencode(body) headers['Content-Type'] = 'application/x-www-form-urlencoded' elif self.signature_type == SIGNATURE_TYPE_QUERY: uri = parameters.prepare_request_uri_query(request.oauth_params, request.uri) else: raise ValueError('Unknown signature type specified.') return uri, headers, body def sign(self, uri, http_method='GET', body=None, headers=None, realm=None): """Sign a request Signs an HTTP request with the specified parts. Returns a 3-tuple of the signed request's URI, headers, and body. Note that http_method is not returned as it is unaffected by the OAuth signing process. Also worth noting is that duplicate parameters will be included in the signature, regardless of where they are specified (query, body). The body argument may be a dict, a list of 2-tuples, or a formencoded string. The Content-Type header must be 'application/x-www-form-urlencoded' if it is present. If the body argument is not one of the above, it will be returned verbatim as it is unaffected by the OAuth signing process. Attempting to sign a request with non-formencoded data using the OAuth body signature type is invalid and will raise an exception. If the body does contain parameters, it will be returned as a properly- formatted formencoded string. Body may not be included if the http_method is either GET or HEAD as this changes the semantic meaning of the request. All string data MUST be unicode or be encoded with the same encoding scheme supplied to the Client constructor, default utf-8. This includes strings inside body dicts, for example. """ # normalize request data request = Request(uri, http_method, body, headers, encoding=self.encoding) # sanity check content_type = request.headers.get('Content-Type', None) multipart = content_type and content_type.startswith('multipart/') should_have_params = content_type == CONTENT_TYPE_FORM_URLENCODED has_params = request.decoded_body is not None # 3.4.1.3.1. Parameter Sources # [Parameters are collected from the HTTP request entity-body, but only # if [...]: # * The entity-body is single-part. if multipart and has_params: raise ValueError("Headers indicate a multipart body but body contains parameters.") # * The entity-body follows the encoding requirements of the # "application/x-www-form-urlencoded" content-type as defined by # [W3C.REC-html40-19980424]. elif should_have_params and not has_params: raise ValueError("Headers indicate a formencoded body but body was not decodable.") # * The HTTP request entity-header includes the "Content-Type" # header field set to "application/x-www-form-urlencoded". elif not should_have_params and has_params: raise ValueError("Body contains parameters but Content-Type header was not set.") # 3.5.2. Form-Encoded Body # Protocol parameters can be transmitted in the HTTP request entity- # body, but only if the following REQUIRED conditions are met: # o The entity-body is single-part. # o The entity-body follows the encoding requirements of the # "application/x-www-form-urlencoded" content-type as defined by # [W3C.REC-html40-19980424]. # o The HTTP request entity-header includes the "Content-Type" header # field set to "application/x-www-form-urlencoded". elif self.signature_type == SIGNATURE_TYPE_BODY and not ( should_have_params and has_params and not multipart): raise ValueError('Body signatures may only be used with form-urlencoded content') # We amend http://tools.ietf.org/html/rfc5849#section-3.4.1.3.1 # with the clause that parameters from body should only be included # in non GET or HEAD requests. Extracting the request body parameters # and including them in the signature base string would give semantic # meaning to the body, which it should not have according to the # HTTP 1.1 spec. elif http_method.upper() in ('GET', 'HEAD') and has_params: raise ValueError('GET/HEAD requests should not include body.') # generate the basic OAuth parameters request.oauth_params = self.get_oauth_params() # generate the signature request.oauth_params.append(('oauth_signature', self.get_oauth_signature(request))) # render the signed request and return it uri, headers, body = self._render(request, formencode=True, realm=(realm or self.realm)) if self.decoding: log.debug('Encoding URI, headers and body to %s.', self.decoding) uri = uri.encode(self.decoding) body = body.encode(self.decoding) if body else body new_headers = {} for k, v in headers.items(): new_headers[k.encode(self.decoding)] = v.encode(self.decoding) headers = new_headers return uri, headers, body class Server(object): """A server base class used to verify OAuth 1.0 RFC 5849 requests OAuth providers should inherit from Server and implement the methods and properties outlined below. Further details are provided in the documentation for each method and property. Methods used to check the format of input parameters. Common tests include length, character set, membership, range or pattern. These tests are referred to as `whitelisting or blacklisting`_. Whitelisting is better but blacklisting can be usefull to spot malicious activity. The following have methods a default implementation: - check_client_key - check_request_token - check_access_token - check_nonce - check_verifier - check_realm The methods above default to whitelist input parameters, checking that they are alphanumerical and between a minimum and maximum length. Rather than overloading the methods a few properties can be used to configure these methods. * @safe_characters -> (character set) * @client_key_length -> (min, max) * @request_token_length -> (min, max) * @access_token_length -> (min, max) * @nonce_length -> (min, max) * @verifier_length -> (min, max) * @realms -> [list, of, realms] Methods used to validate input parameters. These checks usually hit either persistent or temporary storage such as databases or the filesystem. See each methods documentation for detailed usage. The following methods must be implemented: - validate_client_key - validate_request_token - validate_access_token - validate_timestamp_and_nonce - validate_redirect_uri - validate_requested_realm - validate_realm - validate_verifier Method used to retrieve sensitive information from storage. The following methods must be implemented: - get_client_secret - get_request_token_secret - get_access_token_secret - get_rsa_key To prevent timing attacks it is necessary to not exit early even if the client key or resource owner key is invalid. Instead dummy values should be used during the remaining verification process. It is very important that the dummy client and token are valid input parameters to the methods get_client_secret, get_rsa_key and get_(access/request)_token_secret and that the running time of those methods when given a dummy value remain equivalent to the running time when given a valid client/resource owner. The following properties must be implemented: * @dummy_client * @dummy_request_token * @dummy_access_token Example implementations have been provided, note that the database used is a simple dictionary and serves only an illustrative purpose. Use whichever database suits your project and how to access it is entirely up to you. The methods are introduced in an order which should make understanding their use more straightforward and as such it could be worth reading what follows in chronological order. .. _`whitelisting or blacklisting`: http://www.schneier.com/blog/archives/2011/01/whitelisting_vs.html """ def __init__(self): pass @property def allowed_signature_methods(self): return SIGNATURE_METHODS @property def safe_characters(self): return set(utils.UNICODE_ASCII_CHARACTER_SET) @property def client_key_length(self): return 20, 30 @property def request_token_length(self): return 20, 30 @property def access_token_length(self): return 20, 30 @property def timestamp_lifetime(self): return 600 @property def nonce_length(self): return 20, 30 @property def verifier_length(self): return 20, 30 @property def realms(self): return [] @property def enforce_ssl(self): return True def check_client_key(self, client_key): """Check that the client key only contains safe characters and is no shorter than lower and no longer than upper. """ lower, upper = self.client_key_length return (set(client_key) <= self.safe_characters and lower <= len(client_key) <= upper) def check_request_token(self, request_token): """Checks that the request token contains only safe characters and is no shorter than lower and no longer than upper. """ lower, upper = self.request_token_length return (set(request_token) <= self.safe_characters and lower <= len(request_token) <= upper) def check_access_token(self, request_token): """Checks that the token contains only safe characters and is no shorter than lower and no longer than upper. """ lower, upper = self.access_token_length return (set(request_token) <= self.safe_characters and lower <= len(request_token) <= upper) def check_nonce(self, nonce): """Checks that the nonce only contains only safe characters and is no shorter than lower and no longer than upper. """ lower, upper = self.nonce_length return (set(nonce) <= self.safe_characters and lower <= len(nonce) <= upper) def check_verifier(self, verifier): """Checks that the verifier contains only safe characters and is no shorter than lower and no longer than upper. """ lower, upper = self.verifier_length return (set(verifier) <= self.safe_characters and lower <= len(verifier) <= upper) def check_realm(self, realm): """Check that the realm is one of a set allowed realms. """ return realm in self.realms def get_client_secret(self, client_key): """Retrieves the client secret associated with the client key. This method must allow the use of a dummy client_key value. Fetching the secret using the dummy key must take the same amount of time as fetching a secret for a valid client:: # Unlikely to be near constant time as it uses two database # lookups for a valid client, and only one for an invalid. from your_datastore import ClientSecret if ClientSecret.has(client_key): return ClientSecret.get(client_key) else: return 'dummy' # Aim to mimic number of latency inducing operations no matter # whether the client is valid or not. from your_datastore import ClientSecret return ClientSecret.get(client_key, 'dummy') Note that the returned key must be in plaintext. """ raise NotImplementedError("Subclasses must implement this function.") @property def dummy_client(self): """Dummy client used when an invalid client key is supplied. The dummy client should be associated with either a client secret, a rsa key or both depending on which signature methods are supported. Providers should make sure that get_client_secret(dummy_client) get_rsa_key(dummy_client) return a valid secret or key for the dummy client. """ raise NotImplementedError("Subclasses must implement this function.") def get_request_token_secret(self, client_key, request_token): """Retrieves the shared secret associated with the request token. This method must allow the use of a dummy values and the running time must be roughly equivalent to that of the running time of valid values:: # Unlikely to be near constant time as it uses two database # lookups for a valid client, and only one for an invalid. from your_datastore import RequestTokenSecret if RequestTokenSecret.has(client_key): return RequestTokenSecret.get((client_key, request_token)) else: return 'dummy' # Aim to mimic number of latency inducing operations no matter # whether the client is valid or not. from your_datastore import RequestTokenSecret return ClientSecret.get((client_key, request_token), 'dummy') Note that the returned key must be in plaintext. """ raise NotImplementedError("Subclasses must implement this function.") def get_access_token_secret(self, client_key, access_token): """Retrieves the shared secret associated with the access token. This method must allow the use of a dummy values and the running time must be roughly equivalent to that of the running time of valid values:: # Unlikely to be near constant time as it uses two database # lookups for a valid client, and only one for an invalid. from your_datastore import AccessTokenSecret if AccessTokenSecret.has(client_key): return AccessTokenSecret.get((client_key, request_token)) else: return 'dummy' # Aim to mimic number of latency inducing operations no matter # whether the client is valid or not. from your_datastore import AccessTokenSecret return ClientSecret.get((client_key, request_token), 'dummy') Note that the returned key must be in plaintext. """ raise NotImplementedError("Subclasses must implement this function.") @property def dummy_request_token(self): """Dummy request token used when an invalid token was supplied. The dummy request token should be associated with a request token secret such that get_request_token_secret(.., dummy_request_token) returns a valid secret. """ raise NotImplementedError("Subclasses must implement this function.") @property def dummy_access_token(self): """Dummy access token used when an invalid token was supplied. The dummy access token should be associated with an access token secret such that get_access_token_secret(.., dummy_access_token) returns a valid secret. """ raise NotImplementedError("Subclasses must implement this function.") def get_rsa_key(self, client_key): """Retrieves a previously stored client provided RSA key. This method must allow the use of a dummy client_key value. Fetching the rsa key using the dummy key must take the same amount of time as fetching a key for a valid client. The dummy key must also be of the same bit length as client keys. Note that the key must be returned in plaintext. """ raise NotImplementedError("Subclasses must implement this function.") def _get_signature_type_and_params(self, request): """Extracts parameters from query, headers and body. Signature type is set to the source in which parameters were found. """ # Per RFC5849, only the Authorization header may contain the 'realm' optional parameter. header_params = signature.collect_parameters(headers=request.headers, exclude_oauth_signature=False, with_realm=True) body_params = signature.collect_parameters(body=request.body, exclude_oauth_signature=False) query_params = signature.collect_parameters(uri_query=request.uri_query, exclude_oauth_signature=False) params = [] params.extend(header_params) params.extend(body_params) params.extend(query_params) signature_types_with_oauth_params = list(filter(lambda s: s[2], ( (SIGNATURE_TYPE_AUTH_HEADER, params, utils.filter_oauth_params(header_params)), (SIGNATURE_TYPE_BODY, params, utils.filter_oauth_params(body_params)), (SIGNATURE_TYPE_QUERY, params, utils.filter_oauth_params(query_params)) ))) if len(signature_types_with_oauth_params) > 1: raise ValueError('oauth_ params must come from only 1 signature type but were found in %s' % ', '.join( [s[0] for s in signature_types_with_oauth_params])) try: signature_type, params, oauth_params = signature_types_with_oauth_params[0] except IndexError: raise ValueError('oauth_ params are missing. Could not determine signature type.') return signature_type, params, oauth_params def validate_client_key(self, client_key): """Validates that supplied client key is a registered and valid client. Note that if the dummy client is supplied it should validate in same or nearly the same amount of time as a valid one. Ensure latency inducing tasks are mimiced even for dummy clients. For example, use:: from your_datastore import Client try: return Client.exists(client_key, access_token) except DoesNotExist: return False Rather than:: from your_datastore import Client if access_token == self.dummy_access_token: return False else: return Client.exists(client_key, access_token) """ raise NotImplementedError("Subclasses must implement this function.") def validate_request_token(self, client_key, request_token): """Validates that supplied request token is registered and valid. Note that if the dummy request_token is supplied it should validate in the same nearly the same amount of time as a valid one. Ensure latency inducing tasks are mimiced even for dummy clients. For example, use:: from your_datastore import RequestToken try: return RequestToken.exists(client_key, access_token) except DoesNotExist: return False Rather than:: from your_datastore import RequestToken if access_token == self.dummy_access_token: return False else: return RequestToken.exists(client_key, access_token) """ raise NotImplementedError("Subclasses must implement this function.") def validate_access_token(self, client_key, access_token): """Validates that supplied access token is registered and valid. Note that if the dummy access token is supplied it should validate in the same or nearly the same amount of time as a valid one. Ensure latency inducing tasks are mimiced even for dummy clients. For example, use:: from your_datastore import AccessToken try: return AccessToken.exists(client_key, access_token) except DoesNotExist: return False Rather than:: from your_datastore import AccessToken if access_token == self.dummy_access_token: return False else: return AccessToken.exists(client_key, access_token) """ raise NotImplementedError("Subclasses must implement this function.") def validate_timestamp_and_nonce(self, client_key, timestamp, nonce, request_token=None, access_token=None): """Validates that the nonce has not been used before. Per `Section 3.3`_ of the spec. "A nonce is a random string, uniquely generated by the client to allow the server to verify that a request has never been made before and helps prevent replay attacks when requests are made over a non-secure channel. The nonce value MUST be unique across all requests with the same timestamp, client credentials, and token combinations." .. _`Section 3.3`: http://tools.ietf.org/html/rfc5849#section-3.3 One of the first validation checks that will be made is for the validity of the nonce and timestamp, which are associated with a client key and possibly a token. If invalid then immediately fail the request by returning False. If the nonce/timestamp pair has been used before and you may just have detected a replay attack. Therefore it is an essential part of OAuth security that you not allow nonce/timestamp reuse. Note that this validation check is done before checking the validity of the client and token.:: nonces_and_timestamps_database = [ (u'foo', 1234567890, u'rannoMstrInghere', u'bar') ] def validate_timestamp_and_nonce(self, client_key, timestamp, nonce, request_token=None, access_token=None): return ((client_key, timestamp, nonce, request_token or access_token) in self.nonces_and_timestamps_database) """ raise NotImplementedError("Subclasses must implement this function.") def validate_redirect_uri(self, client_key, redirect_uri): """Validates the client supplied redirection URI. It is highly recommended that OAuth providers require their clients to register all redirection URIs prior to using them in requests and register them as absolute URIs. See `CWE-601`_ for more information about open redirection attacks. By requiring registration of all redirection URIs it should be straightforward for the provider to verify whether the supplied redirect_uri is valid or not. Alternatively per `Section 2.1`_ of the spec: "If the client is unable to receive callbacks or a callback URI has been established via other means, the parameter value MUST be set to "oob" (case sensitive), to indicate an out-of-band configuration." .. _`CWE-601`: http://cwe.mitre.org/top25/index.html#CWE-601 .. _`Section 2.1`: https://tools.ietf.org/html/rfc5849#section-2.1 """ raise NotImplementedError("Subclasses must implement this function.") def validate_requested_realm(self, client_key, realm): """Validates that the client may request access to the realm. This method is invoked when obtaining a request token and should tie a realm to the request token and after user authorization this realm restriction should transfer to the access token. """ raise NotImplementedError("Subclasses must implement this function.") def validate_realm(self, client_key, access_token, uri=None, required_realm=None): """Validates access to the request realm. How providers choose to use the realm parameter is outside the OAuth specification but it is commonly used to restrict access to a subset of protected resources such as "photos". required_realm is a convenience parameter which can be used to provide a per view method pre-defined list of allowed realms. """ raise NotImplementedError("Subclasses must implement this function.") def validate_verifier(self, client_key, request_token, verifier): """Validates a verification code. OAuth providers issue a verification code to clients after the resource owner authorizes access. This code is used by the client to obtain token credentials and the provider must verify that the verifier is valid and associated with the client as well as the resource owner. Verifier validation should be done in near constant time (to avoid verifier enumeration). To achieve this we need a constant time string comparison which is provided by OAuthLib in ``oauthlib.common.safe_string_equals``:: from your_datastore import Verifier correct_verifier = Verifier.get(client_key, request_token) from oauthlib.common import safe_string_equals return safe_string_equals(verifier, correct_verifier) """ raise NotImplementedError("Subclasses must implement this function.") def verify_request_token_request(self, uri, http_method='GET', body=None, headers=None): """Verify the initial request in the OAuth workflow. During this step the client obtains a request token for use during resource owner authorization (which is outside the scope of oauthlib). """ return self.verify_request(uri, http_method=http_method, body=body, headers=headers, require_resource_owner=False, require_realm=True, require_callback=True) def verify_access_token_request(self, uri, http_method='GET', body=None, headers=None): """Verify the second request in the OAuth workflow. During this step the client obtains the access token for use when accessing protected resources. """ return self.verify_request(uri, http_method=http_method, body=body, headers=headers, require_verifier=True) def verify_request(self, uri, http_method='GET', body=None, headers=None, require_resource_owner=True, require_verifier=False, require_realm=False, required_realm=None, require_callback=False): """Verifies a request ensuring that the following is true: Per `section 3.2`_ of the spec. - all mandated OAuth parameters are supplied - parameters are only supplied in one source which may be the URI query, the Authorization header or the body - all parameters are checked and validated, see comments and the methods and properties of this class for further details. - the supplied signature is verified against a recalculated one A ValueError will be raised if any parameter is missing, supplied twice or invalid. A HTTP 400 Response should be returned upon catching an exception. A HTTP 401 Response should be returned if verify_request returns False. `Timing attacks`_ are prevented through the use of dummy credentials to create near constant time verification even if an invalid credential is used. Early exit on invalid credentials would enable attackers to perform `enumeration attacks`_. Near constant time string comparison is used to prevent secret key guessing. Note that timing attacks can only be prevented through near constant time execution, not by adding a random delay which would only require more samples to be gathered. .. _`section 3.2`: http://tools.ietf.org/html/rfc5849#section-3.2 .. _`Timing attacks`: http://rdist.root.org/2010/07/19/exploiting-remote-timing-attacks/ .. _`enumeration attacks`: http://www.sans.edu/research/security-laboratory/article/attacks-browsing """ # Only include body data from x-www-form-urlencoded requests headers = headers or {} if ("Content-Type" in headers and headers["Content-Type"] == CONTENT_TYPE_FORM_URLENCODED): request = Request(uri, http_method, body, headers) else: request = Request(uri, http_method, '', headers) if self.enforce_ssl and not request.uri.lower().startswith("https://"): raise ValueError("Insecure transport, only HTTPS is allowed.") signature_type, params, oauth_params = self._get_signature_type_and_params(request) # The server SHOULD return a 400 (Bad Request) status code when # receiving a request with duplicated protocol parameters. if len(dict(oauth_params)) != len(oauth_params): raise ValueError("Duplicate OAuth entries.") oauth_params = dict(oauth_params) request.signature = oauth_params.get('oauth_signature') request.client_key = oauth_params.get('oauth_consumer_key') request.resource_owner_key = oauth_params.get('oauth_token') request.nonce = oauth_params.get('oauth_nonce') request.timestamp = oauth_params.get('oauth_timestamp') request.callback_uri = oauth_params.get('oauth_callback') request.verifier = oauth_params.get('oauth_verifier') request.signature_method = oauth_params.get('oauth_signature_method') request.realm = dict(params).get('realm') # The server SHOULD return a 400 (Bad Request) status code when # receiving a request with missing parameters. if not all((request.signature, request.client_key, request.nonce, request.timestamp, request.signature_method)): raise ValueError("Missing OAuth parameters.") # OAuth does not mandate a particular signature method, as each # implementation can have its own unique requirements. Servers are # free to implement and document their own custom methods. # Recommending any particular method is beyond the scope of this # specification. Implementers should review the Security # Considerations section (`Section 4`_) before deciding on which # method to support. # .. _`Section 4`: http://tools.ietf.org/html/rfc5849#section-4 if not request.signature_method in self.allowed_signature_methods: raise ValueError("Invalid signature method.") # Servers receiving an authenticated request MUST validate it by: # If the "oauth_version" parameter is present, ensuring its value is # "1.0". if ('oauth_version' in request.oauth_params and request.oauth_params['oauth_version'] != '1.0'): raise ValueError("Invalid OAuth version.") # The timestamp value MUST be a positive integer. Unless otherwise # specified by the server's documentation, the timestamp is expressed # in the number of seconds since January 1, 1970 00:00:00 GMT. if len(request.timestamp) != 10: raise ValueError("Invalid timestamp size") try: ts = int(request.timestamp) except ValueError: raise ValueError("Timestamp must be an integer") else: # To avoid the need to retain an infinite number of nonce values for # future checks, servers MAY choose to restrict the time period after # which a request with an old timestamp is rejected. if time.time() - ts > self.timestamp_lifetime: raise ValueError("Request too old, over 10 minutes.") # Provider specific validation of parameters, used to enforce # restrictions such as character set and length. if not self.check_client_key(request.client_key): raise ValueError("Invalid client key.") if not request.resource_owner_key and require_resource_owner: raise ValueError("Missing resource owner.") if (require_resource_owner and not require_verifier and not self.check_access_token(request.resource_owner_key)): raise ValueError("Invalid resource owner key.") if (require_resource_owner and require_verifier and not self.check_request_token(request.resource_owner_key)): raise ValueError("Invalid resource owner key.") if not self.check_nonce(request.nonce): raise ValueError("Invalid nonce.") if request.realm and not self.check_realm(request.realm): raise ValueError("Invalid realm. Allowed are %s" % self.realms) if not request.verifier and require_verifier: raise ValueError("Missing verifier.") if require_verifier and not self.check_verifier(request.verifier): raise ValueError("Invalid verifier.") if require_callback and not request.callback_uri: raise ValueError("Missing callback URI.") # Servers receiving an authenticated request MUST validate it by: # If using the "HMAC-SHA1" or "RSA-SHA1" signature methods, ensuring # that the combination of nonce/timestamp/token (if present) # received from the client has not been used before in a previous # request (the server MAY reject requests with stale timestamps as # described in `Section 3.3`_). # .._`Section 3.3`: http://tools.ietf.org/html/rfc5849#section-3.3 # # We check this before validating client and resource owner for # increased security and performance, both gained by doing less work. if require_verifier: token = {"request_token": request.resource_owner_key} else: token = {"access_token": request.resource_owner_key} if not self.validate_timestamp_and_nonce(request.client_key, request.timestamp, request.nonce, **token): return False, request # The server SHOULD return a 401 (Unauthorized) status code when # receiving a request with invalid client credentials. # Note: This is postponed in order to avoid timing attacks, instead # a dummy client is assigned and used to maintain near constant # time request verification. # # Note that early exit would enable client enumeration valid_client = self.validate_client_key(request.client_key) if not valid_client: request.client_key = self.dummy_client # Callback is normally never required, except for requests for # a Temporary Credential as described in `Section 2.1`_ # .._`Section 2.1`: http://tools.ietf.org/html/rfc5849#section-2.1 if require_callback: valid_redirect = self.validate_redirect_uri(request.client_key, request.callback_uri) else: valid_redirect = True # The server SHOULD return a 401 (Unauthorized) status code when # receiving a request with invalid or expired token. # Note: This is postponed in order to avoid timing attacks, instead # a dummy token is assigned and used to maintain near constant # time request verification. # # Note that early exit would enable resource owner enumeration if request.resource_owner_key: if require_verifier: valid_resource_owner = self.validate_request_token( request.client_key, request.resource_owner_key) if not valid_resource_owner: request.resource_owner_key = self.dummy_request_token else: valid_resource_owner = self.validate_access_token( request.client_key, request.resource_owner_key) if not valid_resource_owner: request.resource_owner_key = self.dummy_access_token else: valid_resource_owner = True # Note that `realm`_ is only used in authorization headers and how # it should be interepreted is not included in the OAuth spec. # However they could be seen as a scope or realm to which the # client has access and as such every client should be checked # to ensure it is authorized access to that scope or realm. # .. _`realm`: http://tools.ietf.org/html/rfc2617#section-1.2 # # Note that early exit would enable client realm access enumeration. # # The require_realm indicates this is the first step in the OAuth # workflow where a client requests access to a specific realm. # This first step (obtaining request token) need not require a realm # and can then be identified by checking the require_resource_owner # flag and abscence of realm. # # Clients obtaining an access token will not supply a realm and it will # not be checked. Instead the previously requested realm should be # transferred from the request token to the access token. # # Access to protected resources will always validate the realm but note # that the realm is now tied to the access token and not provided by # the client. if ((require_realm and not request.resource_owner_key) or (not require_resource_owner and not request.realm)): valid_realm = self.validate_requested_realm(request.client_key, request.realm) elif require_verifier: valid_realm = True else: valid_realm = self.validate_realm(request.client_key, request.resource_owner_key, uri=request.uri, required_realm=required_realm) # The server MUST verify (Section 3.2) the validity of the request, # ensure that the resource owner has authorized the provisioning of # token credentials to the client, and ensure that the temporary # credentials have not expired or been used before. The server MUST # also verify the verification code received from the client. # .. _`Section 3.2`: http://tools.ietf.org/html/rfc5849#section-3.2 # # Note that early exit would enable resource owner authorization # verifier enumertion. if request.verifier: valid_verifier = self.validate_verifier(request.client_key, request.resource_owner_key, request.verifier) else: valid_verifier = True # Parameters to Client depend on signature method which may vary # for each request. Note that HMAC-SHA1 and PLAINTEXT share parameters request.params = filter(lambda x: x[0] not in ("oauth_signature", "realm"), params) # ---- RSA Signature verification ---- if request.signature_method == SIGNATURE_RSA: # The server verifies the signature per `[RFC3447] section 8.2.2`_ # .. _`[RFC3447] section 8.2.2`: http://tools.ietf.org/html/rfc3447#section-8.2.1 rsa_key = self.get_rsa_key(request.client_key) valid_signature = signature.verify_rsa_sha1(request, rsa_key) # ---- HMAC or Plaintext Signature verification ---- else: # Servers receiving an authenticated request MUST validate it by: # Recalculating the request signature independently as described in # `Section 3.4`_ and comparing it to the value received from the # client via the "oauth_signature" parameter. # .. _`Section 3.4`: http://tools.ietf.org/html/rfc5849#section-3.4 client_secret = self.get_client_secret(request.client_key) resource_owner_secret = None if require_resource_owner: if require_verifier: resource_owner_secret = self.get_request_token_secret( request.client_key, request.resource_owner_key) else: resource_owner_secret = self.get_access_token_secret( request.client_key, request.resource_owner_key) if request.signature_method == SIGNATURE_HMAC: valid_signature = signature.verify_hmac_sha1(request, client_secret, resource_owner_secret) else: valid_signature = signature.verify_plaintext(request, client_secret, resource_owner_secret) # We delay checking validity until the very end, using dummy values for # calculations and fetching secrets/keys to ensure the flow of every # request remains almost identical regardless of whether valid values # have been supplied. This ensures near constant time execution and # prevents malicious users from guessing sensitive information v = all((valid_client, valid_resource_owner, valid_realm, valid_redirect, valid_verifier, valid_signature)) if not v: log.info("[Failure] OAuthLib request verification failed.") log.info("Valid client:\t%s" % valid_client) log.info("Valid token:\t%s\t(Required: %s" % (valid_resource_owner, require_resource_owner)) log.info("Valid realm:\t%s\t(Required: %s)" % (valid_realm, require_realm)) log.info("Valid callback:\t%s" % valid_redirect) log.info("Valid verifier:\t%s\t(Required: %s)" % (valid_verifier, require_verifier)) log.info("Valid signature:\t%s" % valid_signature) return v, request
raqqun/tweetcommander
packages/oauthlib/oauth1/rfc5849/__init__.py
Python
gpl-3.0
49,724
/* * Copyright 2008 Michal Turek * * This file is part of Graphal library. * http://graphal.sourceforge.net/ * * Graphal library is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, version 3 of the License. * * Graphal library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Graphal library. If not, see <http://www.gnu.org/licenses/>. */ /**************************************************************************** * * * This file was generated by gen_operators.pl script. * * Don't update it manually! * * * ****************************************************************************/ #include "generated/nodebinarydiv.h" #include "value.h" ///////////////////////////////////////////////////////////////////////////// //// NodeBinaryDiv::NodeBinaryDiv(Node* left, Node* right) : NodeBinary(left, right) { } NodeBinaryDiv::~NodeBinaryDiv(void) { } ///////////////////////////////////////////////////////////////////////////// //// CountPtr<Value> NodeBinaryDiv::execute(void) { return m_left->execute()->div(*(m_right->execute())); } void NodeBinaryDiv::dump(ostream& os, uint indent) const { dumpIndent(os, indent); os << "<NodeBinaryDiv>" << endl; m_left->dump(os, indent+1); m_right->dump(os, indent+1); dumpIndent(os, indent); os << "</NodeBinaryDiv>" << endl; } ostream& operator<<(ostream& os, const NodeBinaryDiv& node) { node.dump(os, 0); return os; }
mixalturek/graphal
libgraphal/generated/nodebinarydiv.cpp
C++
gpl-3.0
2,018
// Copyright (c) 2015 Contributors as noted in the AUTHORS file. // This file is part of form_factors. // // form_factors is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // form_factors is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with form_factors. If not, see <http://www.gnu.org/licenses/>. #include "TaskParser.h" TaskParser::TaskParser(onEndCb onEnd, onEndFrameCb onFrameEnd) : newFrame_re("^\\s{0,}newfrm\\s{1,}frame_(\\d+)$", regex_constants::icase), step_re("^\\s{0,}step\\s{1,}([\\d\\.]+)$"), tmp_re("^\\s{0,}tmprt\\s{1,}([\\d\\.]+)$", regex_constants::icase), comment_re("^\\s{0,}#.{0,}$", regex_constants::icase), curState(RUNNING) { assert(onEnd); assert(onFrameEnd); this->onEnd = onEnd; this->onFrameEnd = onFrameEnd; reset(); } void TaskParser::reset() { curFrame = 0; curState = RUNNING; curStep = 0; totalFrames = 0; } int TaskParser::onLine(string line) { // Check for comments first if (curState != ERROR && !line.empty() && regex_match(line, comment_re)) { return 0; } smatch match; switch (curState) { case (ERROR) : return -1; case (FINISHED) : return 0; case(RUNNING): if (line.empty()) { return 0; } else { if (regex_search(line, match, newFrame_re) && match.size() > 1) { curFrame = stoi(match.str(1), NULL); curState = FRAME; curStep = 0.0f; faceTemps.clear(); return 0; } else { return 0; } } case (FRAME): if (line.empty()) { curState = RUNNING; ++totalFrames; onFrameEnd(curFrame, totalFrames, curStep, faceTemps); return 0; } else if (regex_search(line, match, tmp_re) && match.size() > 1) { faceTemps.push_back(stof(match.str(1), NULL)); return 0; } else if (regex_search(line, match, step_re) && match.size() > 1) { curStep = stof(match.str(1), NULL); return 0; } default: return -1; } return -1; }
kroburg/form_factors
runner/TaskParser.cpp
C++
gpl-3.0
2,648
/* pMMF is an open source software library for efficiently computing the MMF factorization of large matrices. Copyright (C) 2015 Risi Kondor, Nedelina Teneva, Pramod Mudrakarta This file is part of pMMF. pMMF is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef _DenseMatrixFileASCII #define _DenseMatrixFileASCII #include "DenseMatrixFile.hpp" class DenseMatrixFile::ASCII: public DenseMatrixFile { public: ASCII(const char* filename) { ifs.open(filename); if (ifs.fail()) { cout << "Failed to open " << filename << "." << endl; return; } char buffer[1024]; int linelength = 0; do { ifs.get(buffer, 1024); linelength += strlen(buffer); } while (strlen(buffer) > 0); cout << "Line length=" << linelength << endl; ifs.close(); ifs.open(filename); // why does ifs.seekg(0) not work? float b; ncols = 0; while (ifs.good() && ifs.tellg() < linelength) { ifs >> b; ncols++; } nrows = 0; while (ifs.good()) { for (int i = 0; i < ncols; i++) ifs >> b; nrows++; } cout << nrows << " " << ncols << endl; ifs.close(); ifs.open(filename); } DenseMatrixFile::iterator begin() { ifs.seekg(0); return DenseMatrixFile::iterator(*this); } void get(DenseMatrixFile::iterator& it) { if (!ifs.good()) { it.endflag = true; return; } it.endflag = false; ifs >> it.value; } DenseMatrixFile& operator>>(FIELD& dest) { if (ifs.good()) ifs >> dest; return *this; } }; // note: there is a potential problem when the file marker moves to eof, because seekg cannot reset it to beginning #endif
risi-kondor/pMMF
filetypes/DenseMatrixFileASCII.hpp
C++
gpl-3.0
2,198
#!/bin/bash echo '===> Running pre-commit checks for amd' | doppler yellow mk sniff-amd
nbloomf/nbloomf.md
hooks/pre-commit.sh
Shell
gpl-3.0
90
/* * Copyright (C) 2008 J?lio Vilmar Gesser. * * This file is part of Java 1.5 parser and Abstract Syntax Tree. * * Java 1.5 parser and Abstract Syntax Tree is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Java 1.5 parser and Abstract Syntax Tree is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Java 1.5 parser and Abstract Syntax Tree. If not, see <http://www.gnu.org/licenses/>. */ /* * Created on 05/10/2006 */ package japa.parser; import japa.parser.ast.CompilationUnit; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; /** * <p>This class was generated automatically by javacc, do not edit.</p> * <p>Parse Java 1.5 source code and creates Abstract Syntax Tree classes.</p> * <p><b>Note:</b> To use this parser asynchronously, disable de parser cache * by calling the method {@link setCacheParser} with <code>false</code> * as argument.</p> * * @author J?lio Vilmar Gesser */ public final class JavaParser { private static ASTParser parser; private static boolean cacheParser = true; private JavaParser() { // hide the constructor } /** * Changes the way that the parser acts when starts to parse. If the * parser cache is enabled, only one insance of this object will be * used in every call to parse methods. * If this parser is intend to be used asynchonously, the cache must * be disabled setting this flag to <code>false</code>. * By default, the cache is enabled. * @param value <code>false</code> to disable the parser instance cache. */ public static void setCacheParser(boolean value) { cacheParser = value; if (!value) { parser = null; } } /** * Parses the Java code contained in the {@link InputStream} and returns * a {@link CompilationUnit} that represents it. * @param in {@link InputStream} containing Java source code * @param encoding encoding of the source code * @return CompilationUnit representing the Java source code * @throws ParseException if the source code has parser errors */ public static CompilationUnit parse(InputStream in, String encoding) throws ParseException { if (cacheParser) { if (parser == null) { parser = new ASTParser(in, encoding); } else { parser.reset(in, encoding); } return parser.CompilationUnit(); } return new ASTParser(in, encoding).CompilationUnit(); } /** * Parses the Java code contained in the {@link InputStream} and returns * a {@link CompilationUnit} that represents it. * @param in {@link InputStream} containing Java source code * @return CompilationUnit representing the Java source code * @throws ParseException if the source code has parser errors */ public static CompilationUnit parse(InputStream in) throws ParseException { return parse(in, null); } /** * Parses the Java code contained in a {@link File} and returns * a {@link CompilationUnit} that represents it. * @param file {@link File} containing Java source code * @param encoding encoding of the source code * @return CompilationUnit representing the Java source code * @throws ParseException if the source code has parser errors * @throws IOException */ public static CompilationUnit parse(File file, String encoding) throws ParseException, IOException { FileInputStream in = new FileInputStream(file); try { return parse(in, encoding); } finally { in.close(); } } /** * Parses the Java code contained in a {@link File} and returns * a {@link CompilationUnit} that represents it. * @param file {@link File} containing Java source code * @return CompilationUnit representing the Java source code * @throws ParseException if the source code has parser errors * @throws IOException */ public static CompilationUnit parse(File file) throws ParseException, IOException { return parse(file, null); } }
codesearch-github/codesearch
src/custom-libs/Codesearch-JavaParser/src/main/java/japa/parser/JavaParser.java
Java
gpl-3.0
4,813
/*------------------------------------------------------------------------ * * copyright : (C) 2008 by Benjamin Mueller * email : news@fork.ch * website : http://sourceforge.net/projects/adhocrailway * version : $Id: MemoryRoutePersistence.java 154 2008-03-28 14:30:54Z fork_ch $ * *----------------------------------------------------------------------*/ /*------------------------------------------------------------------------ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * *----------------------------------------------------------------------*/ package ch.fork.adhocrailway.persistence.xml.impl; import java.util.SortedSet; import java.util.TreeSet; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import ch.fork.adhocrailway.model.turnouts.Route; import ch.fork.adhocrailway.model.turnouts.RouteGroup; import ch.fork.adhocrailway.model.turnouts.RouteItem; import ch.fork.adhocrailway.services.RouteService; import ch.fork.adhocrailway.services.RouteServiceListener; public class XMLRouteService implements RouteService { private static final Logger LOGGER = LoggerFactory.getLogger(XMLRouteService.class); private final SortedSet<Route> routes = new TreeSet<Route>(); private final SortedSet<RouteGroup> routeGroups = new TreeSet<RouteGroup>(); private RouteServiceListener listener; public XMLRouteService() { LOGGER.info("XMLRoutePersistence loaded"); } @Override public void addRoute(final Route route) { routes.add(route); listener.routeAdded(route); } @Override public void removeRoute(final Route route) { routes.remove(route); listener.routeRemoved(route); } @Override public void updateRoute(final Route route) { routes.remove(route); routes.add(route); listener.routeUpdated(route); } @Override public SortedSet<RouteGroup> getAllRouteGroups() { return routeGroups; } @Override public void addRouteGroup(final RouteGroup routeGroup) { routeGroups.add(routeGroup); listener.routeGroupAdded(routeGroup); } @Override public void removeRouteGroup(final RouteGroup routeGroup) { routeGroups.remove(routeGroup); listener.routeGroupRemoved(routeGroup); } @Override public void updateRouteGroup(final RouteGroup routeGroup) { routeGroups.remove(routeGroup); routeGroups.add(routeGroup); listener.routeGroupUpdated(routeGroup); } @Override public void addRouteItem(final RouteItem item) { } @Override public void removeRouteItem(final RouteItem item) { } @Override public void updateRouteItem(final RouteItem item) { } @Override public void clear() { routes.clear(); routeGroups.clear(); } @Override public void init(final RouteServiceListener listener) { this.listener = listener; } @Override public void disconnect() { } public void loadRouteGroupsFromXML(final SortedSet<RouteGroup> groups) { routeGroups.clear(); routes.clear(); if (groups != null) { for (final RouteGroup routeGroup : groups) { routeGroup.init(); routeGroups.add(routeGroup); if (routeGroup.getRoutes() == null || routeGroup.getRoutes().isEmpty()) { routeGroup.setRoutes(new TreeSet<Route>()); } for (final Route route : routeGroup.getRoutes()) { route.init(); routes.add(route); route.setRouteGroup(routeGroup); } } } listener.routesUpdated(routeGroups); } }
forkch/adhoc-railway
ch.fork.adhocrailway.persistence.xml/src/main/java/ch/fork/adhocrailway/persistence/xml/impl/XMLRouteService.java
Java
gpl-3.0
4,013
This package implements a discretization of poro-mechanics by cell centered finite volume methods. The package provides discretization of three different equations: 1. Scalar elliptic equations (Darcy flow), using Multipoint flux approximations. 2. Linear elasticity, using Multipoint stress approximations 3. Poro-mechanics, e.g. coupling terms for the combined system of 1. and 2. Examples of usage for the three options can be found in mpfa_ex, mpsa_ex and biot_ex, respectively. Further information on the methods implemented herein, in particular the discretization of elasticity and poro-mechanics, can be found in the following papers (all open access): J. M. Nordbotten: Stable cell-center finite volume disrcetizaiton for Biot equations - SIAM J. Numer. Anal. 54(2) 942-968. J. M. Nordbotten: Convergence of a cell-centered finite volume discretization for linear elasticity - SIAM J. Numer. Anal. 53(2) 2605-2625. E. Keilegavlen, J. M. Nordbotten: Finite volume methods for elasticity with weak symmetry - Int. J. Num. Meth. Eng, 2017, doi: 10.1002/nme.5538. The implementation of elasticity is based on the forumlation described in the latter. For information on the MPFA discretizations for the flow equation, see I. Aavatsmark: An introduction to multipoint flux approximations for quadrilateral grids, Comput. Geosci. 6(3-4) 405-432. The is compatible with the (freely available) Matlab Reservoir Simulation Toolbox (MRST) provided by SINTEF ICT, see http://www.sintef.no/projectweb/mrst/ In particular, the grid data structure is that of MRST, and it is assumed that MRST is in the matlab path. The code has been tested with Matlab R2015b, and mrst-2016a.
rojolocco/MRST2017a
modules/fvbiot/README.md
Markdown
gpl-3.0
1,712
/* Gerador de nomes @author Maickon Rangel @copyright Help RPG - 2016 */ function download_para_pdf(){ var doc = new jsPDF(); var specialElementHandlers = { '#editor': function (element, renderer) { return true; } }; doc.fromHTML($('#content').html(), 15, 15, { 'width': 170, 'elementHandlers': specialElementHandlers }); doc.save('sample-file.pdf'); } function rand_nomes(){ var selecionado = $("#select").val(); if(!$('#disable_mode_draw').is(':checked')) { var intervalo = window.setInterval(function(){ var raca = $.ajax({ type: 'post', dataType: 'html', url: JS_SERVICE_NAME_PATH + '/' + selecionado + '/9', data: {select: selecionado}, success: function(result){ var json = (eval("(" + result + ")")); var attr = [ 'nome-1', 'nome-2', 'nome-3', 'nome-4', 'nome-5', 'nome-6', 'nome-7', 'nome-8', 'nome-9' ]; for(var i=0; i<attr.length; i++){ $( "#"+attr[i] ).empty(); $( "#"+attr[i] ).append(json[i]); } } }); }, speed); window.setTimeout(function() { clearInterval(intervalo); }, time); } else if ($('#disable_mode_draw').is(':checked')){ var raca = $.ajax({ type: 'post', dataType: 'html', url: JS_SERVICE_NAME_PATH + '/' + selecionado + '/9', data: {select: selecionado}, success: function(result){ var json = (eval("(" + result + ")")); var attr = [ 'nome-1', 'nome-2', 'nome-3', 'nome-4', 'nome-5', 'nome-6', 'nome-7', 'nome-8', 'nome-9' ]; for(var i=0; i<attr.length; i++){ $( "#"+attr[i] ).empty(); $( "#"+attr[i] ).append(json[i]); } } }); } }
maickon/Help-RPG-4.0
app/assets/js/nomes/nomes.js
JavaScript
gpl-3.0
2,470
/*! \file \brief The definition of bobura::view::timetable::item. Copyright (C) 2007-2019 kaoru $Id$ */ #if !defined(BOBURA_VIEW_TIMETABLE_ITEM_H) #define BOBURA_VIEW_TIMETABLE_ITEM_H #include <memory> #include <boost/core/noncopyable.hpp> namespace bobura::view::timetable { /*! \brief The class template for the timetable view item. \tparam Traits A traits type. */ template <typename Traits> class item : private boost::noncopyable { public: // types //! The traits type. using traits_type = Traits; //! The canvas type. using canvas_type = typename traits_type::canvas_type; //! The position type. using position_type = typename canvas_type::position_type; //! The dimension type. using dimension_type = typename canvas_type::dimension_type; // constructors and destructor /*! \brief Creates an item. */ item(); /*! \brief Destroys the item. */ virtual ~item() noexcept; // functions /*! \brief Assigns an item. \param another Another item. \return This item. */ item& operator=(item&& another); /*! \brief Returns the position. \return The position. */ const position_type& position() const; /*! \brief Returns the position. \return The position. */ position_type& position(); /*! \brief Returns the dimension. \return The dimension. */ const dimension_type& dimension() const; /*! \brief Returns the dimension. \return The dimension. */ dimension_type& dimension(); /*! \brief Draws this item on the canvas. \param canvas A canvas. */ void draw_on(canvas_type& canvas) const; protected: // functions /*! \brief Sets a position. \param position A position. */ void set_position(position_type position); /*! \brief Sets a dimension. \param dimension A dimension. */ void set_dimension(dimension_type dimension); private: // types class impl; // variables std::unique_ptr<impl> m_p_impl; // virtual functions virtual void draw_on_impl(canvas_type& canvas) const; }; } #endif
kaorut/bobura
bobura_core/include/bobura/view/timetable/item.h
C
gpl-3.0
2,737
#ifndef XTRAS_TYPEMATH_HPP_ #define XTRAS_TYPEMATH_HPP_ #include <type_traits> #include <functional> namespace xtras { namespace typemath { template<auto V> using make_integral_constant = std::integral_constant<decltype(V), V>; template<typename Op, typename T1, typename T2> using binary_op = make_integral_constant<Op{}(T1::value, T2::value)>; template<typename Op, typename T1> using unary_op = make_integral_constant<Op{}(T1::value)>; template<typename T1, typename T2> using plus = binary_op<std::plus<>, T1, T2>; template<typename T1, typename T2> using minus = binary_op<std::minus<>, T1, T2>; template<typename T1, typename T2> using multiplies = binary_op<std::multiplies<>, T1, T2>; template<typename T1, typename T2> using divides = binary_op<std::divides<>, T1, T2>; template<typename T1, typename T2> using modulus = binary_op<std::modulus<>, T1, T2>; template<typename T1> using negate = unary_op<std::negate<>, T1>; template<typename T1, typename T2> using equal_to = binary_op<std::equal_to<>, T1, T2>; template<typename T1, typename T2> using not_equal_to = binary_op<std::not_equal_to<>, T1, T2>; template<typename T1, typename T2> using greater = binary_op<std::greater<>, T1, T2>; template<typename T1, typename T2> using greater_equal = binary_op<std::greater_equal<>, T1, T2>; template<typename T1, typename T2> using less = binary_op<std::less<>, T1, T2>; template<typename T1, typename T2> using less_equal = binary_op<std::less_equal<>, T1, T2>; template<typename T> using logical_not = unary_op<std::logical_not<>, T>; template<typename T1, typename T2> using logical_or = binary_op<std::logical_or<>, T1, T2>; template<typename T1, typename T2> using logical_and = binary_op<std::logical_and<>, T1, T2>; template<typename T> using bit_not = unary_op<std::bit_not<>, T>; template<typename T1, typename T2> using bit_or = binary_op<std::bit_or<>, T1, T2>; template<typename T1, typename T2> using bit_and = binary_op<std::bit_and<>, T1, T2>; template<typename T1, typename T2> using bit_xor = binary_op<std::bit_xor<>, T1, T2>; } // namespace typemath } // namespace xtras #endif // XTRAS_TYPEMATH_HPP_
witosx/rafalw
src/xtras/typemath.hpp
C++
gpl-3.0
2,158
/* ppddl-planner - client for IPPC'08 Copyright (C) 2008 Florent Teichteil-Koenigsbuch and Guillaume Infantes and Ugur Kuter This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "symbolic_lao.h" SymbolicLAO::SymbolicLAO(const Problem& pb, double epsilon, double discount_factor, unsigned int plan_length, heuristic_t heuristic_type, determinization_t determinization_type, deterministic_planner_t deterministic_planner_type) try : BaseAlgorithm(pb, epsilon, discount_factor), SymbolicHeuristicAlgorithm(pb, epsilon, discount_factor, plan_length, heuristic_type, determinization_type, deterministic_planner_type) { policy_deterministic_transitions_ = dd_node_ptr(Cudd_ReadLogicZero(dd_node_ptr::get_cudd_manager())); forward_reachable_states_ = dd_node_ptr(Cudd_ReadLogicZero(dd_node_ptr::get_cudd_manager())); backward_reachable_states_ = dd_node_ptr(Cudd_ReadLogicZero(dd_node_ptr::get_cudd_manager())); states_frontier_ = dd_node_ptr(Cudd_ReadLogicZero(dd_node_ptr::get_cudd_manager())); mdp_->connect_bdd(policy_deterministic_transitions_); mdp_->connect_bdd(forward_reachable_states_); mdp_->connect_bdd(backward_reachable_states_); mdp_->connect_bdd(states_frontier_); } catch (BaseException& error) { error.push_function_backtrace("SymbolicLAO::SymbolicLAO"); throw; } SymbolicLAO::~SymbolicLAO() { mdp_->disconnect_bdd(policy_deterministic_transitions_); mdp_->disconnect_bdd(forward_reachable_states_); mdp_->disconnect_bdd(backward_reachable_states_); mdp_->disconnect_bdd(states_frontier_); } void SymbolicLAO::solve_initialize(const PddlState& st) { SymbolicHeuristicAlgorithm::solve_initialize(st); forward_reachable_states_.copy(initial_state_); states_frontier_.copy(initial_state_); policy_deterministic_transitions_ = dd_node_ptr(Cudd_ReadLogicZero(dd_node_ptr::get_cudd_manager())); } void SymbolicLAO::solve_progress() { compute_backward_reachability(); optimize(backward_reachable_states_); compute_forward_reachability(); } bool SymbolicLAO::has_converged() { return (states_frontier_.get() == Cudd_ReadLogicZero(dd_node_ptr::get_cudd_manager())); } void SymbolicLAO::compute_backward_reachability() { backward_reachable_states_.copy(states_frontier_); dd_node_ptr backward_frontier; backward_frontier.copy(states_frontier_); while (backward_frontier.get() != Cudd_ReadLogicZero(dd_node_ptr::get_cudd_manager())) { dd_node_ptr previous_states(Cudd_bddPermute(dd_node_ptr::get_cudd_manager(), backward_frontier.get(), mdp_->get_unprimed_to_primed_permutation())); previous_states = dd_node_ptr(Cudd_bddAnd(dd_node_ptr::get_cudd_manager(), policy_deterministic_transitions_.get(), previous_states.get())); previous_states = dd_node_ptr(Cudd_bddExistAbstract(dd_node_ptr::get_cudd_manager(), previous_states.get(), mdp_->get_primed_variables_bdd_cube().get())); backward_frontier = dd_node_ptr(Cudd_bddAnd(dd_node_ptr::get_cudd_manager(), backward_reachable_states_.get(), previous_states.get())); backward_frontier = dd_node_ptr(Cudd_bddXor(dd_node_ptr::get_cudd_manager(), backward_frontier.get(), previous_states.get())); backward_reachable_states_ = dd_node_ptr(Cudd_bddOr(dd_node_ptr::get_cudd_manager(), backward_reachable_states_.get(), backward_frontier.get())); } } void SymbolicLAO::compute_forward_reachability() { forward_reachable_states_.copy(initial_state_); dd_node_ptr forward_frontier; forward_frontier.copy(initial_state_); states_frontier_ = dd_node_ptr(Cudd_ReadLogicZero(dd_node_ptr::get_cudd_manager())); policy_deterministic_transitions_ = compute_policy_deterministic_transitions(explored_states_); while (forward_frontier.get() != Cudd_ReadLogicZero(dd_node_ptr::get_cudd_manager())) { dd_node_ptr next_states(Cudd_bddAnd(dd_node_ptr::get_cudd_manager(), forward_frontier.get(), policy_deterministic_transitions_.get())); next_states = dd_node_ptr(Cudd_bddExistAbstract(dd_node_ptr::get_cudd_manager(), next_states.get(), mdp_->get_unprimed_variables_bdd_cube().get())); next_states = dd_node_ptr(Cudd_bddPermute(dd_node_ptr::get_cudd_manager(), next_states.get(), mdp_->get_primed_to_unprimed_permutation())); forward_frontier = dd_node_ptr(Cudd_bddAnd(dd_node_ptr::get_cudd_manager(), next_states.get(), forward_reachable_states_.get())); forward_frontier = dd_node_ptr(Cudd_bddXor(dd_node_ptr::get_cudd_manager(), next_states.get(), forward_frontier.get())); dd_node_ptr new_states_frontier = forward_frontier; forward_reachable_states_ = dd_node_ptr(Cudd_bddOr(dd_node_ptr::get_cudd_manager(), forward_reachable_states_.get(), new_states_frontier.get())); forward_frontier = dd_node_ptr(Cudd_bddAnd(dd_node_ptr::get_cudd_manager(), new_states_frontier.get(), tip_states_.get())); states_frontier_ = dd_node_ptr(Cudd_bddOr(dd_node_ptr::get_cudd_manager(), states_frontier_.get(), forward_frontier.get())); forward_frontier = dd_node_ptr(Cudd_bddXor(dd_node_ptr::get_cudd_manager(), new_states_frontier.get(), forward_frontier.get())); } initialize(states_frontier_); }
fteicht/ppddl-planner
src/algorithms/symbolic_lao.cc
C++
gpl-3.0
5,674
define(['forum/accountheader'], function(header) { var AccountSettings = {}; AccountSettings.init = function() { header.init(); $('#submitBtn').on('click', function() { var settings = { showemail: $('#showemailCheckBox').is(':checked') ? 1 : 0 }; socket.emit('user.saveSettings', settings, function(err) { if (err) { return app.alertError('There was an error saving settings!'); } app.alertSuccess('Settings saved!'); }); return false; }); }; return AccountSettings; });
changyou/NadBB
public/src/forum/accountsettings.js
JavaScript
gpl-3.0
522
<?php /** * @version $Id$ * @copyright Center for History and New Media, 2007-2010 * @license http://www.gnu.org/licenses/gpl-3.0.txt * @package Omeka **/ /** * * * @package Omeka * @copyright Center for History and New Media, 2007-2010 **/ class Omeka_File_Derivative_Image_Creator_CreatorTest extends PHPUnit_Framework_TestCase { public function setUp() { try { $this->convertDir = Zend_Registry::get('test_config')->paths->imagemagick; } catch (Zend_Exception $e) { $this->convertDir = dirname(`which convert`); } $this->invalidFile = '/foo/bar/baz.html'; $this->validFilePath = dirname(__FILE__) . '/_files/valid-image.jpg'; $this->validMimeType = 'image/jpeg'; $this->fullsizeImgType = 'fullsize'; $this->derivativeFilename = 'valid-image_deriv.jpg'; // If we set up a test log, then log the ImageMagick commands instead // of executing via the commandline. $this->logWriter = new Zend_Log_Writer_Mock; $this->testLog = new Zend_Log($this->logWriter); } public function testConstructor() { $creator = new Omeka_File_Derivative_Image_Creator($this->convertDir); $this->assertEquals("{$this->convertDir}/convert", $creator->getConvertPath()); } public function testCreateWithoutProvidingDerivativeFilename() { try { $creator = new Omeka_File_Derivative_Image_Creator($this->convertDir); $creator->create($this->validFilePath, '', $this->validMimeType); } catch (InvalidArgumentException $e) { $this->assertContains("Invalid derivative filename", $e->getMessage()); return; } $this->fail("create() should have failed when a derivative filename was not provided."); } public function testCreateWithInvalidConvertPath() { try { $creator = new Omeka_File_Derivative_Image_Creator('/foo/bar'); } catch (Omeka_File_Derivative_Exception $e) { $this->assertContains("invalid directory", $e->getMessage()); return; } $this->fail("Instantiating with a valid convert path failed to throw an exception."); } public function testCreate() { $creator = new Omeka_File_Derivative_Image_Creator($this->convertDir); // Should do nothing. $creator->create($this->validFilePath, $this->derivativeFilename, $this->validMimeType); } public function testCreateWithInvalidOriginalFile() { $creator = new Omeka_File_Derivative_Image_Creator($this->convertDir); try { $creator->create($this->invalidFile, $this->derivativeFilename, $this->validMimeType); } catch (Exception $e) { $this->assertContains("does not exist", $e->getMessage()); return; } $this->fail("Failed to throw an exception when given an invalid original file."); } public function testAddDerivativeWithInvalidDerivativeType() { $creator = new Omeka_File_Derivative_Image_Creator($this->convertDir); try { $creator->addDerivative("/foo/bar/baz", 20); } catch (Exception $e) { $this->assertContains("Invalid derivative type", $e->getMessage()); return; } $this->fail("Failed to throw exception when given invalid type name for image derivatives."); } public function testCreateWithDerivativeImgSize() { $creator = new Omeka_File_Derivative_Image_Creator($this->convertDir); $creator->addDerivative($this->fullsizeImgType, 10); $creator->create($this->validFilePath, $this->derivativeFilename, $this->validMimeType); $newFilePath = dirname($this->validFilePath) . '/' . $this->fullsizeImgType . '_' . $this->derivativeFilename; $this->assertTrue(file_exists($newFilePath)); unlink($newFilePath); } public function testCreateWithDerivativeCommandArgs() { $creator = new Omeka_File_Derivative_Image_Creator($this->convertDir); } }
sipes23/Omeka
application/tests/unit/libraries/Omeka/File/Derivative/Image/CreatorTest.php
PHP
gpl-3.0
4,163
/* Template Name: Creative Bootstrap 3 Responsive Admin Template Template Version: 1.0 Author: GeeksLabs Website: http://geekslabs.com/ */ /* Import fonts */ @import url(http://fonts.googleapis.com/css?family=Lato:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic); @import url(line-icons.css); body { color: #797979; background: #eeeeee; font-family: sans-serif; padding: 0px !important; margin: 0px !important; font-size:14px !important; } h1,h2,h3,h4,h5{ font-weight: 300; } label{ font-weight: 300; } ul li { list-style: none; } a, a:hover, a:focus { text-decoration: none; outline: none; outline: 0; } input:focus, textarea:focus { outline: none; } table tr th { color: #688a7e;} *:focus {outline: none;} ::selection { background: #688a7e; color: #fff; } ::-moz-selection { background: #688a7e; color: #fff; } #container { width: 100%; height: 100%; } .Creative-pro, .Creative-pro h3{ display: block; position: fixed; bottom:0; z-index: 100000; width: 100%; overflow: hidden; height: 50px; margin:0px; } .Creative-pro h3{ padding-bottom: 10px; padding-top: 10px; } .lite{ color: #00a0df !important; } /*login page*/ .login-body { background-color: #f1f2f7; } .login-img-body{ background: url('../img/bg-1.jpg') no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } .login-img2-body{ background: url('../img/bg-1.jpg') no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } .login-img3-body{ background: url('../img/bg-1.jpg') no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } .login-form { max-width: 350px; margin: 200px auto 0; background: #d5d7de; } .login-img-body .login-form{ max-width: 350px; margin: 200px auto 0; background: rgba(213,215,222,0.4); border: 1px solid #B0B6BE; } .login-img2-body .login-form{ border: 1px solid #B0B6BE; background: rgba(213,215,222,0.7); } .login-img3-body .login-form{ border: 1px solid #B0B6BE; background: rgba(213,215,222,0.9); } .login-form a{ color: #688a7e !important; } .login-form h2.login-form-heading { margin: 0; padding:20px 15px; text-align: center; background: #34aadc; border-radius: 5px 5px 0 0; -webkit-border-radius: 5px 5px 0 0; color: #fff; font-size: 18px; text-transform: uppercase; font-weight: 300; font-family: 'Lato', sans-serif; } .login-form .checkbox { margin-bottom: 14px; } .login-form .checkbox { font-weight: normal; font-weight: 300; font-family: 'Lato', sans-serif; } .login-form .form-control { position: relative; font-size: 16px; height: auto; padding: 10px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .login-form .form-control:focus { z-index: 2; } .login-form .login-img{ font-size: 50px; font-weight: 300; } .login-form .input-group{ padding-bottom: 15px; } .login-form .input-group-addon{ padding: 6px 12px; font-size: 16px; color: #8b9199; font-weight: normal; line-height: 1; text-align: center; background-color: #ffffff; border: none; border-radius: 0; } .login-form input[type="text"], .login-form input[type="password"] { border: none; box-shadow: none; font-size: 16px; border-radius: 0; } .login-form .btn{ border-radius: 0; } .login-form .btn-login { background: #f67a6e; color: #fff; text-transform: uppercase; font-weight: 300; font-family: 'Lato', sans-serif; box-shadow: 0 4px #e56b60; margin-bottom: 20px; } .login-form p { text-align: center; color: #b6b6b6; font-size: 16px; font-weight: 300; } .login-img3-body .login-form p,.login-img2-body .login-form p { color: #34aadc; } .login-form a { color: #b6b6b6; } .login-form a:hover { color: #34aadc; } .form .required{ font-size: 16px; color: #00a0df; } .login-wrap { padding: 20px; } .login-social-link { display: inline-block; margin-top: 20px; margin-bottom: 15px; } .login-social-link a { color: #fff; padding: 15px 28px; border-radius: 4px; } .login-social-link a:hover { color: #fff; } .login-social-link a i { font-size: 20px; padding-right: 10px; } .login-social-link a.facebook { background: #5193ea; margin-right: 22px; box-shadow: 0 4px #2775e2; float:left; } .login-social-link a.twitter { background: #44ccfe; box-shadow: 0 4px #2bb4e8; float:left; } /*Modal Content*/ .modal-content{ border-radius:0px; background:rgba(255,255,255,0.9); } .modal-header .close{ font-weight: 300; font-size: 30px; } /*sidebar navigation*/ #sidebar { width: 180px; height: 100%; position: fixed; background: #394a59; } .nav-collapse.collapse { display: inline; } ul.sidebar-menu , ul.sidebar-menu li ul.sub{ margin: -2px 0 0; padding: 0; } ul.sidebar-menu { margin-top: 60px; } #sidebar > ul > li > ul.sub { display: none; } #sidebar > ul > li.active > ul.sub, #sidebar > ul > li > ul.sub > li > a { display: block; } ul.sidebar-menu li ul.sub li{ background: #394a59; margin-bottom: 0; margin-left: 0; margin-right: 0; } ul.sidebar-menu li ul.sub li:last-child{ border-radius: 0 0 4px 4px; -webkit-border-radius: 0 0 4px 4px; } ul.sidebar-menu li ul.sub li a { font-size: 12px; padding: 0 0 0 32px; line-height: 35px; height: 35px; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; -ms-transition: all 0.3s ease; transition: all 0.3s ease; color: #d0d8df; font-size: 14px; } ul.sidebar-menu li ul.sub li a:hover, ul.sidebar-menu li ul.sub li.active a { color: #fff; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; -ms-transition: all 0.3s ease; transition: all 0.3s ease; display: block; } ul.sidebar-menu li{ line-height: 20px !important; /*margin-bottom: 5px; margin-left:10px; margin-right:10px;*/ } /*ul.sidebar-menu li:hover{ border-bottom: 1px solid #688a7e; }*/ ul.sidebar-menu li.sub-menu{ line-height: 15px; font-size: 16px; } ul.sidebar-menu li a span{ display: inline-block; } ul.sidebar-menu li a{ color: #d0d8df; text-decoration: none; display: block; padding: 15px 0 15px 10px; font-size: 16px; font-weight: 300; outline: none; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; -ms-transition: all 0.3s ease; transition: all 0.3s ease; border-right: 1px solid #D7D7D7; border-bottom: 1px solid #D7D7D7; } /*ul.sidebar-menu li a i{ position: relative; top: 2px; }*/ ul.sidebar-menu li.active a, ul.sidebar-menu li a:hover, ul.sidebar-menu li a:focus { background: #2e3b46; color: #fff; display: block; /*border-radius: 4px; -webkit-border-radius: 4px;*/ -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; -ms-transition: all 0.3s ease; transition: all 0.3s ease; } ul.sidebar-menu li a:hover, ul.sidebar-menu li a:focus { border-bottom: 1px solid #d0d8df; } /*ul.sidebar-menu li.active a,*/ ul.sidebar-menu .sub-menu li.active a{ border-bottom: 1px solid #d0d8df; } ul.sidebar-menu li a i { font-size: 18px; padding-right: 6px; /*color: #688a7e;*/ } ul.sidebar-menu li a:hover i, ul.sidebar-menu li a:focus i { color: #fff; } ul.sidebar-menu li.active a i { color: #fff; } #sidebar ul > li > a .arrow { border-bottom: 4px solid transparent; border-left: 4px solid #A0A0A0; border-top: 4px solid transparent; float: right; height: 0; margin-right: 10px; margin-top: 6px; width: 0; } #sidebar ul > li > a .menu-arrow { float: right; margin-right: 8px; margin-top: 6px; } #sidebar > ul > li > a .arrow.open { border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid #A0A0A0; float: right; height: 0; margin-right: 10px; margin-top: 8px; width: 0; } #sidebar ul > li.active > a .arrow, #sidebar ul > li > a:hover .arrow, #sidebar ul > li > a:focus .arrow { float: right; margin-top: 6px; margin-right: 10px; width: 0; height: 0; border-left: 4px solid #d0d8df; border-top: 4px solid transparent; border-bottom: 4px solid transparent; } #sidebar > ul > li.active > a .arrow.open, #sidebar > ul > li > a:hover .arrow.open, #sidebar > ul > li > a:focus .arrow.open { float: right; margin-top: 8px; margin-right: 10px; width: 0; height: 0; border-top: 5px solid #d0d8df; border-left: 4px solid transparent; border-right: 4px solid transparent; } .mail-info, .mail-info:hover { margin: 3px 6px 0 0; font-size: 11px; } /*profile status bubbly*/ .online-profile li a i { position: relative; left: -12px; top: -10px; } .online-profile li a span i { position: relative; top: 10px; } /*chat-*/ .chat-online-profile li a i { position: relative; left: -12px; top: -10px; } .chat-online-profile li a span i { position: relative; top: 10px; } .chat-online-profile li a{ border-bottom: 1px solid #D7D7D7; } .chat-online-profile li a:hover, .chat-online-profile li a:focus, .chat-online-profile li a:active{ background: #eeeeee !important; border-bottom: 1px solid #688a7e !important; } .chat-online-profile li a:hover span i,.chat-online-profile li a:focus span i,.chat-online-profile li a:active span i{ color: #688a7e; } .right-chat-panel{ max-height: 600px; } .compose-mail{ width: 95%; font-size: 16px; border-radius: 0; } /*main content*/ #main-content { margin-left: 180px; } .header, .footer { min-height: 60px; padding: 0 15px; } .box1 { font-size: 16px; display: inline-block; width: 25%; padding: .25em .5em; margin: 20px 10px 0 0; } .header { position: fixed; left: 0; right: 0; z-index: 1002; } .white-bg { background: rgba(255,255,255,0.9); border-bottom: 1px solid #f1f2f7; } .dark-bg { background: rgba(54,66,74,1); border-bottom: 1px solid #f1f2f7; } .panel-content{ padding: 10px; } .wrapper { display: inline-block; margin-top: 60px; padding: 15px; width: 100%; } a.logo { font-size: 22px; font-weight: 300; color: #fed189; float: left; margin-top: 15px; text-transform: uppercase; } a.logo:hover, a.logo:focus { text-decoration: none; outline: none; } a.logo span { color: #688a7e; } /*notification*/ #top_menu .nav > li, ul.top-menu > li { float: left; } .search-row { float: left; margin-top: 15px; margin-left: 16px; } .notification-row { float: right; margin-top: 15px; margin-left: 65px; } #task_notificatoin_bar, #mail_notificatoin_bar, #alert_notificatoin_bar{ margin-top: 7px; } ul.top-menu > li > a { color: #fed189; font-size: 18px; padding: 2px 6px; margin-right: 15px; } ul.top-menu > li > a:hover, ul.top-menu > li > a:focus { background: transparent !important; color: #D7D7D7 !important; } .notification-row .badge { position: absolute; right: -4px; top: 0px; z-index: 100; border-radius: 9px; min-width: 18px; height: 18px; text-align: center; padding: 3px 5px; background: #00a0df; font-weight: 400; } .badge { border-radius: 9px; min-width: 18px; height: 18px; text-align: center; padding: 3px 5px; background: #00a0df; } .dropdown-menu.extended { max-width: 300px !important; min-width: 160px !important; top: 42px; width: 235px !important; padding: 0; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.176) !important; border: none !important; border-radius: 4px; -webkit-border-radius: 4px; } .navbar-form{ padding: 0px; margin: 0 0 0 10px; } .navbar-form .form-control{ width: 200px; height: 30px; background: white url('../img/icons/search-line-icon.png') no-repeat 3px; padding-left: 24px; margin-top: 1px; } @media screen and (-webkit-min-device-pixel-ratio:0) { /* Safari and Chrome */ .dropdown-menu.extended { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.176) !important; }; } /* bootstrape editor*/ #editor { max-height: 250px; height: 250px; background-color: white; border-collapse: separate; border: 1px solid rgb(204, 204, 204); padding: 4px; box-sizing: content-box; -webkit-box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px 0px inset; box-shadow: rgba(0, 0, 0, 0.0745098) 0px 1px 1px 0px inset; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border-top-left-radius: 3px; overflow: scroll; outline: none; } #voiceBtn { width: 20px; color: transparent; background-color: transparent; transform: scale(2.0, 2.0); -webkit-transform: scale(2.0, 2.0); -moz-transform: scale(2.0, 2.0); border: transparent; cursor: pointer; box-shadow: none; -webkit-box-shadow: none; } div[data-role="editor-toolbar"] { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .dropdown-menu.extended li p { background-color: #F1F2F7; color: #666666; margin: 0; padding: 10px; } .dropdown-menu.extended li p.green { background-color: #4cd964; color: #fff; } .dropdown-menu.extended li p.red { background-color: #00a0df; color: #fff; } .dropdown-menu.extended li p.blue { background-color: #688a7e; color: #fff; } .dropdown-menu.extended li p.yellow { background-color: #fcb322; color: #fff; } .dropdown-menu.extended li a { border-bottom: 1px solid #EBEBEB !important; font-size: 12px; list-style: none; } .dropdown-menu.extended li a { padding: 15px 10px !important; width: 100%; display: inline-block; } .dropdown-menu.extended li a:hover { background-color: #F7F8F9 !important; color: #2E2E2E; border-bottom: 1px solid #688a7e !important; } .dropdown-menu.tasks-bar .task-info .desc { font-size: 13px; font-weight: normal; } .dropdown-menu.tasks-bar .task-info .percent { display: inline-block; float: right; font-size: 13px; font-weight: 600; padding-left: 10px; margin-top: -4px; } .dropdown-menu.extended .progress { margin-bottom: 0 !important; height: 10px; } .dropdown-menu.inbox li a .photo img { border-radius: 2px 2px 2px 2px; float: left; height: 40px; margin-right: 4px; width: 40px; } .dropdown-menu.inbox li a .subject { display: block; } .dropdown-menu.inbox li a .subject .from { font-size: 12px; font-weight: 600; } .dropdown-menu.inbox li a .subject .time { font-size: 11px; font-style: italic; font-weight: bold; position: absolute; right: 5px; } .dropdown-menu.inbox li a .message { display: block !important; font-size: 11px; } .top-nav { margin-top: 7px; } .top-nav ul.top-menu > li .dropdown-menu.logout { width: 200px !important; } .top-nav li.dropdown .dropdown-menu { float: right; right: 0; left: auto; } .dropdown-menu.extended.logout > li { float: left; text-align: left; width: 100%; } .dropdown-menu.extended.logout > li.eborder-top { border-top: 2px solid #688a7e !important; } .dropdown-menu.extended.logout > li:last-child { float: left; text-align: left; width: 100%; background: #688a7e; } .dropdown-menu.extended.logout > li:last-child > a, .dropdown-menu.extended.logout > li:last-child > a:hover { color: #fff; border-bottom: none !important; text-transform: uppercase; background-color:#688a7e !important; } .dropdown-menu.extended.logout > li:last-child > a:hover > i{ color: #fff; } .dropdown-menu > li > a{ color: #797979; } .dropdown-menu.extended.logout > li > a { border-bottom: 1px solid #EBEBEB !important; font-size: 14px; list-style: none; padding: 15px 10px !important; width: 100%; display: inline-block; } .dropdown-menu.extended.logout > li > a:hover { background-color: #F7F8F9 !important; color: #2E2E2E; border-bottom: 1px solid #688a7e !important; } .dropdown-menu.extended.logout > li > a:hover i { color: #688a7e; } .dropdown-menu.extended.logout > li > a i { font-size: 17px; } .dropdown-menu.extended.logout > li > a > i { display: inline-block; padding-right: 10px } .top-nav .username { font-size: 13px; color: #bdbdbd; } .top-nav ul.top-menu > li > a { padding: 8px; background: none; margin-right: 0; } .top-nav ul.top-menu > li { margin-left: 10px; } .top-nav ul.top-menu > li > a:hover, .top-nav ul.top-menu > li > a:focus { background: #F1F2F7; } .top-nav .dropdown-menu.extended.logout { top: 50px; } .top-nav .nav .caret { border-bottom-color: #A4AABA; border-top-color: #A4AABA; } .top-nav ul.top-menu > li > a:hover .caret { border-bottom-color: #7498f1; border-top-color: #7498f1; } .log-arrow-up { background: url("../img/arrow-up.png") no-repeat; width: 20px; height: 11px; position: absolute; right: 20px; top: -10px; } /*----*/ .page-header { margin: 12px 0 20px; border-bottom: none; opacity: 0.7; text-transform: uppercase; } .page-header i { color: #acb1b8; margin-right: 10px; float: left; font-size: 30px; line-height: 22px; opacity: 0.8; } .breadcrumb { -webkit-border-radius: 0px; -moz-border-radius: 0px; border-radius: 0px; height: 34px; position: relative; margin: 0 0 19px 0; overflow: hidden; } .breadcrumb li { position: relative; margin-right: 0; } .breadcrumb li i { Font-size: 15px; margin-right: 5px; } .breadcrumb > .active { color: #d4d4d4; } /* .info-box =================================================================== */ .info-box { min-height: 140px; margin-bottom: 30px; padding: 20px; color: white; -webkit-box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.35), 0 3px 1px -1px rgba(0, 0, 0, 0.1); -moz-box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.35), 0 3px 1px -1px rgba(0, 0, 0, 0.1); box-shadow: inset 0 0 1px 1px rgba(255, 255, 255, 0.35), 0 3px 1px -1px rgba(0, 0, 0, 0.1); } .info-box i { display: block; height: 100px; font-size: 60px; line-height: 100px; width: 100px; float: left; text-align: center; margin-right: 20px; padding-right: 20px; color: rgba(255, 255, 255, 0.75); } .info-box .count { margin-top: 20px; font-size: 34px; font-weight: 700; } .info-box .title { font-size: 12px; text-transform: uppercase; font-weight: 600; } .info-box .desc { margin-top: 10px; font-size: 12px; } .info-box.danger { background: #ff5454; border: 1px solid #ff2121; } .info-box.warning { background: #fabb3d; border: 1px solid #f9aa0b; } .info-box.primary { background: #20a8d8; border: 1px solid #1985ac; } .info-box.info { background: #67c2ef; border: 1px solid #39afea; } .info-box.success { background: #79c447; border: 1px solid #61a434; } /*---------------- color------------------------*/ .dark-heading-bg { background: #4c4f53; border: 1px solid #4c4f53; } .main-bg { background: #e6e8ea; } .white-bg { color : #768399; background : #fff; background-color : #fff; } .red-bg { color : #fff; background : #d95043; background-color : #d95043; } .blue-bg { color : #fff; background : #57889c; background-color : #57889c; } .green-bg { color : #fff; background : #26c281; background-color : #26c281; } .greenLight-bg { color: #71843f; background: #71843f; background-color: #71843f; } .yellow-bg { color : #fff; background : #fc6; background-color : #fc6; } .orange-bg { color : #fff; background : #f4b162; background-color : #f4b162; } .purple-bg { color : #fff; background : #af91e1; background-color : #af91e1; } .pink-bg { color : #fff; background : #f78db8; background-color : #f78db8; } .lime-bg { color : #fff; background : #a8db43; background-color : #a8db43; } .magenta-bg { color : #fff; background : #e65097; background-color : #e65097; } .teal-bg { color : #fff; background : #97d3c5; background-color : #97d3c5; } .brown-bg { color : #fff; background : #d1b993; background-color : #d1b993; } .gray-bg { color : #768399; background : #e4e9eb; background-color : #e4e9eb; } .dark-bg { color : #fff; background : #1a2732; background-color : #1a2732; } .facebook-bg { color: #fff; background: #3b5998; background-color : #3b5998; } .twitter-bg { color: #fff; background: #00aced; background-color : #00aced; } .linkedin-bg { color: #fff; background: #4875b4; background-color : #4875b4; } /*---------------------- panel-----------------*/ .panel { border:none; -webkit-border-radius: 0px; -moz-border-radius: 0px; border-radius: 0px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; margin-bottom: 30px; } .panel .panel-heading { line-height: 34px; padding: 0 15px; min-height: 34px; border-left: 1px solid #ccc; border-right: 1px solid #ccc; -webkit-border-radius: 0px; -moz-border-radius: 0px; border-radius: 0px; position: relative; box-shadow: inset 0 -2px 0 rgba(0,0,0,.05); -moz-box-shadow: inset 0 -2px 0 rgba(0,0,0,.05); -webkit-box-shadow: inset 0 -2px 0 rgba(0,0,0,.05); } .panel .panel-heading .panel-title { line-height: 40px; } .panel .panel-heading i { width: 30px; display: inline-block; font-size: 14px; border-right:1px solid #e6e6e6 ; } .panel .panel-heading ul li { border-top:1px solid #e6e6e6 ; border-left:1px solid #e6e6e6 ; border-right:1px solid #e6e6e6 ; } .panel .panel-heading h2 { height: 100%; width: auto; display: inline-block; font-size: 14px; position: relative; margin: 0; line-height: 34px; font-weight: 400; letter-spacing: 0; } .panel .panel-heading .panel-actions { float: right; margin-right: -15px; height: 40px; font-size: 0; } .panel .panel-heading .panel-actions i { display: inline-block; text-align: center; width: 34px; -webkit-transition: all 0.1s ease-in-out; -moz-transition: all 0.1s ease-in-out; -ms-transition: all 0.1s ease-in-out; -o-transition: all 0.1s ease-in-out; transition: all 0.1s ease-in-out; text-decoration: none; font-size: 14px; } .panel .panel-heading .panel-actions a { text-decoration: none; font-size: 14px; text-align: center; display: inline-block; line-height: 32px; padding: 0; margin: 0; color: #333; border-left: 1px solid rgba(0,0,0,.09); } .panel-actions .btn-setting:hover, .panel-actions .btn-minimize:hover, .panel-actions .btn-close:hover { background-color: rgba(0,0,0,.05); } .panel .panel-heading .switch { margin: 10px; } .panel .panel-body { border-width: 1px 1px 2px; border-style: solid; border-top: none; border-right-color: #ccc!important; border-bottom-color: #ccc!important; border-left-color: #ccc!important; } .panel .panel-body-map { border-width: 1px 1px 2px; border-style: solid; background:#eef3f7; height:380px; border-top: none; border-right-color: #ccc!important; border-bottom-color: #ccc!important; border-left-color: #ccc!important; } .panel .panel-body.no-padding { padding: 0; } .panel .panel-body.padding-horizontal { padding: 0 15px; } .panel .panel-body.no-padding-bottom { padding-bottom: 0; } .panel-footer { padding: 10px 15px; background-color: #f5f5f5; border-top: 1px solid #ddd; border-bottom-right-radius: 0; border-bottom-left-radius: 0; } .panel .panel-footer { border-width: 0 1px 2px 1px; border-style: solid; border-top: none; border-right-color: #ccc!important; border-bottom-color: #ccc!important; border-left-color: #ccc!important; position: relative; } .panel.panel-default { border-radius: 0px; border-top: 1px solid #d4d4d4; -webkit-box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.1); -moz-box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.1); box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.1); } } .panel.panel-default.panel-heading { background: #97d3c5; } .panel.panel-default .panel-footer { background: #f5f5f5; } .panel.panel-primary { border-color: #20a8d8; } .panel.panel-primary .panel-heading, .panel.panel-primary .panel-footer { background: #5dc3e7; color: #092f3d; border-color: #20a8d8; } .panel.panel-success { border-color: #79c447; } .panel.panel-success .panel-heading, .panel.panel-success .panel-footer { background: #a3d781; color: #284315; border-color: #79c447; } .panel.panel-info { border-color: #67c2ef; } .panel.panel-info .panel-heading, .panel.panel-info .panel-footer { background: #acdef6; color: #106894; border-color: #67c2ef; } .panel.panel-warning { border-color: #fabb3d; } .panel.panel-warning .panel-heading, .panel.panel-warning .panel-footer { background: #fcd588; color: #815703; border-color: #fabb3d; } .panel.panel-danger { border-color: #ff5454; } .panel.panel-danger .panel-heading, .panel.panel-danger .panel-footer { background: #ffa1a1; color: #a10000; border-color: #ff5454; } /* Chat Widget starts */ .chats{ list-style-type: none; margin: 0px; } .chats li{ margin-bottom: 8px; padding-bottom: 8px; } .chats .by-me img{ margin-top: 5px; margin-right:10px; padding: 1px; background:#fff; border: 1px solid #ccc; } .chats .by-me .chat-meta{ font-size: 11px; color: #999; } .chats .by-me .chat-content{ margin-left: 60px; position: relative; background: #fff; border: 1px solid #ddd; padding: 7px 10px; border-radius: 5px; font-size: 13px; } .chats .by-me .chat-content:after, .chats .by-me .chat-content:before { right: 100%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; } .chats .by-me .chat-content:after { border-color: rgba(255, 255, 255, 0); border-right-color: #fff; border-width: 10px; top: 30%; margin-top: -10px; } .chats .by-me .chat-content:before { border-color: rgba(238, 238, 238, 0); border-right-color: #ccc; border-width: 11px; top: 30%; margin-top: -11px; } .chats .by-other img{ margin-top: 5px; margin-left:10px; padding: 1px; background:#fff; border: 1px solid #ccc; } .chats .by-other .chat-meta{ font-size: 11px; color: #999; } .chats .by-other .chat-content{ margin-right: 60px; position: relative; background: #fff; border: 1px solid #ddd; padding: 7px 10px; border-radius: 5px; font-size: 13px; } .chats .by-other .chat-content:after, .chats .by-other .chat-content:before { left: 100%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; } .chats .by-other .chat-content:after { border-color: rgba(255, 255, 255, 0); border-left-color: #fff; border-width: 10px; top: 30%; margin-top: -10px; } .chats .by-other .chat-content:before { border-color: rgba(238, 238, 238, 0); border-left-color: #ccc; border-width: 11px; top: 30%; margin-top: -11px; } /* Chat widget ends */ .portlets{ min-height:50px; } .portlets .widget-head{ cursor:move; } /* Just Gage - Demo Charts =================================================================== */ .sz1 { width: 200px; height: 160px; } .sz0 { margin: 2em 0 0 0; } .sz0 { width: 100px; height: 80px; } /** * Nestable */ .dd { position: relative; display: block; margin: 0; padding: 0; list-style: none; font-size: 13px; line-height: 20px; } .dd-list { display: block; position: relative; margin: 0; padding: 0; list-style: none; } .dd-list .dd-list { padding-left: 30px; } .dd-collapsed .dd-list { display: none; } .dd-item, .dd-empty, .dd-placeholder { display: block; position: relative; margin: 0; padding: 0; min-height: 20px; font-size: 13px; line-height: 20px; } .dd-handle { display: block; height: 30px; margin: 5px 0; padding: 4px 10px; text-decoration: none; border: 1px solid #d4d4d4; background: #eeeeee; -webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .dd-handle:hover { color: #20a8d8; background: white; } .dd-handle .icon { float: right; font-size: 16px; margin-left: 10px; } .dd-handle .icon:hover { text-decoration: none; } .dd-item > button { display: block; position: relative; cursor: pointer; float: left; width: 25px; height: 20px; margin: 5px 0; padding: 0; text-indent: 100%; white-space: nowrap; overflow: hidden; border: 0; background: transparent; font-size: 12px; line-height: 1; text-align: center; font-weight: bold; } .dd-item > button:before { content: '+'; display: block; position: absolute; width: 100%; text-align: center; text-indent: 0; } .dd-item > button[data-action="collapse"]:before { content: '-'; } .dd-placeholder, .dd-empty { margin: 5px 0; padding: 0; min-height: 30px; background: #f2fbff; border: 1px dashed #b6bcbf; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } .dd-empty { border: 1px dashed #bbb; min-height: 100px; background-color: #e5e5e5; background-size: 60px 60px; background-position: 0 0, 30px 30px; } .dd-dragel { position: absolute; pointer-events: none; z-index: 9999; } .dd-dragel > .dd-item .dd-handle { margin-top: 0; } .dd-dragel .dd-handle { -webkit-box-shadow: 2px 4px 6px 0 rgba(0, 0, 0, 0.1); -moz-box-shadow: 2px 4px 6px 0 rgba(0, 0, 0, 0.1); box-shadow: 2px 4px 6px 0 rgba(0, 0, 0, 0.1); } * /Widget-Content */ .widget-content .error .form-inline button{ margin-left:-2px; padding:8px 12px; } .chats{ padding-left:0px; margin-left:0px; } .recent{ padding-left:0px; margin-left:0px; } .widget-foot .form-inline button { margin-left: -3px; padding:7px 12px; } .widget-content .form-inline button { margin-left: 0px; padding:7px 12px; } .buttons button{ margin-top:10px; } .widget-content ol#slist{ padding:0px; } .widget .widget-head,.modal-header{ background-color: #f8f8f8; background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f2f2f2)); background: -webkit-linear-gradient(top, #f8f8f8, #f2f2f2); background: -moz-linear-gradient(top, #f8f8f8, #f2f2f2); background: -ms-linear-gradient(top, #f8f8f8, #f2f2f2); background: -o-linear-gradient(top, #f8f8f8, #f2f2f2); background: linear-gradient(top, #f8f8f8, #f2f2f2); border-top-right-radius: 3px; border-top-left-radius: 3px; text-shadow:0px 1px #fff; border-bottom: 1px solid #ccc; border-top: 1px solid #fff; color: #666; font-size: 14px; font-weight: bold; padding: 8px 15px; } .widget.wblack .widget-head{ background-color: #e8ece9; background: -webkit-gradient(linear, left top, left bottom, from(#e8ece9), to(#111)); background: -webkit-linear-gradient(top, #e8ece9, #111); background: -moz-linear-gradient(top, #e8ece9, #111); background: -ms-linear-gradient(top, #e8ece9, #111); background: -o-linear-gradient(top, #e8ece9, #111); background: linear-gradient(top, #e8ece9, #111); text-shadow:0px 1px #000; border-bottom: 1px solid #555; border-top: 1px solid #666; box-shadow: inset 0px 1px 1px #444; color: #ccc; } .widget .widget-head .widget-icons i{ font-size: 14px; margin: 0px 4px; } .widget .widget-head .widget-icons a{ color: #aaa; } .widget .widget-head .widget-icons a:hover{ color: #999; } .widget.wblack .widget-head .widget-icons i{ font-size: 14px; margin: 0px 4px; } .widget .widget-foot, .modal-footer{ background-color: #f8f8f8; background: -webkit-gradient(linear, left top, left bottom, from(#f8f8f8), to(#f2f2f2)); background: -webkit-linear-gradient(top, #f8f8f8, #f2f2f2); background: -moz-linear-gradient(top, #f8f8f8, #f2f2f2); background: -ms-linear-gradient(top, #f8f8f8, #f2f2f2); background: -o-linear-gradient(top, #f8f8f8, #f2f2f2); background: linear-gradient(top, #f8f8f8, #f2f2f2); border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; text-shadow:0px 1px #fff; border-bottom: 1px solid #fff; border-top: 1px solid #ccc; padding: 8px 15px; font-size: 12px; color: #555; box-shadow: inset 0px 1px 1px #fff; } .widget-content .error .form-inline button{ margin-left:-2px; padding:8px 12px; } .chats{ padding-left:0px; margin-left:0px; } .recent{ padding-left:0px; margin-left:0px; } .widget-foot .form-inline button { margin-left: -3px; padding:7px 12px; } .widget-content .form-inline button { margin-left: 0px; padding:7px 12px; } .widget .padd .modal-body{ padding: 13px 15px; } .buttons button{ margin-top:10px; } .widget-content ol#slist{ padding:0px; } .task i { display:inline-block; width: 30px; height: 17px; background: #ccc; text-align: center; border-radius: 50px; font-size: 10px; line-height: 17px; } .pagination li a{ color:#777; } /* Widget white extras */ .widget .nav-tabs > li a { } .widget .nav-tabs { margin-bottom: 5px; } .widget .tab-content{ margin-bottom: 10px; } .widget .padd, .modal-body{ padding: 13px 15px; } .portlets{ min-height:50px; } .portlets .widget-head{ cursor:move; } /*----- map-----*/ * Google maps */ .gmap iframe{ width: 100%; margin: 0px; padding: 0px; } /* Google maps ends */ /* Today datas */ .today-datas{ list-style-type: none; padding: 0px; margin: 10px 0px; } .today-datas li{ display: inline-block; margin-bottom: 5px; margin-right: 10px; padding: 10px 10px; text-shadow:0px 1px 0px #fff; max-width: 100%; text-align: center; } .today-datas li .datas-text{ font-size: 13px; padding: 7px 0px 0px 0px; font-weight: normal; } /*----*/ .notify-arrow { border-style: solid; border-width: 0 9px 9px; height: 0; margin-top: 0; opacity: 0; position: absolute; right: 7px; top: -18px; transition: all 0.25s ease 0s; width: 0; z-index: 10; margin-top: 10px; opacity: 1; } .notify-arrow-blue{ border-color: transparent transparent #688a7e; border-bottom-color: #688a7e !important; border-top-color: #688a7e !important; } .notify-arrow-yellow { border-color: transparent transparent #FCB322; border-bottom-color: #FCB322 !important; border-top-color: #FCB322 !important; } .notify-arrow-red { border-color: transparent transparent #00a0df; border-bottom-color: #00a0df !important; border-top-color: #00a0df !important; } .notify-arrow-green { border-color: transparent transparent #4cd964; border-bottom-color: #4cd964 !important; border-top-color: #4cd964 !important; } /*search*/ .search { margin-top: 6px ; width: 20px; -webkit-transition: all .3s ease; -moz-transition: all .3s ease; -ms-transition: all .3s ease; -o-transition: all .3s ease; transition: all .3s ease; border: 1px solid #fff; box-shadow: none; background: url("../img/search-icon.jpg") no-repeat 10px 8px; padding:0 5px 0 35px; color: #fff; } .search:focus { margin-top: 5px ; width: 180px; border: 1px solid #eaeaea; box-shadow: none; -webkit-transition: all .3s ease; -moz-transition: all .3s ease; -ms-transition: all .3s ease; -o-transition: all .3s ease; transition: all .3s ease; color: #c8c8c8; font-weight: 300; } /*--sidebar toggle---*/ .toggle-nav { float: left; padding-right: 15px; margin-top: 20px; } .toggle-nav .icon-reorder { cursor: pointer; display: inline-block; font-size: 20px; } .sidebar-closed > #sidebar > ul { display: none; } .sidebar-closed #main-content { margin-left: 0px; } .sidebar-closed #sidebar { margin-left: -180px; } /*state overview*/ .state-overview .symbol, .state-overview .value { display: inline-block; text-align: center; } .state-overview .value { float: right; } .state-overview .value h1{ margin: 0; padding: 0; color: #688a7e; } .state-overview .value p { margin: 0; padding: 0; color: #fed189; } .state-overview .value h1 { font-weight: 300; font-weight: 30px; } .state-overview .symbol i { color: #688a7e; font-size: 30px; } .state-overview .symbol { width: 30%; padding: 25px 15px; } .state-overview .value { width: 68%; padding-top: 21px; } .state-overview .terques { background: #34AADC; } .state-overview .red { background: #00a0df; } .state-overview .yellow { background: #FCB322; } .state-overview .blue { background: #688a7e; } /**/ .state .panel-body{ padding: 0px; } .panel-body.chart-texture { background: url("../img/chart-texture.jpg"); -webkit-border-radius: 4px 4px 0px 0px; border-radius: 4px 4px 0px 0px; padding: 0px; } /*personal task*/ .task-thumb { width: 90px; float: left; } .task-thumb img { border-radius: 4px; -webkit-border-radius: 4px; } .task-thumb-details { display: inline-block; margin: 25px 0 0 10px; } .task-progress { float: left; } .task-thumb-details h1, .task-thumb-details h1 a, .task-progress h1, .task-progress h1 a { color: #688a7e; font-size: 18px; margin: 0; padding: 0; font-weight: 300; } .task-thumb-details p, .task-progress p { padding-top: 5px; color: #fed189; } .personal-task tbody tr td{ padding: 11px 15px; border-color: #eeeff1; } .personal-task tbody tr td i { font-size: 16px; color: #c7cbd4; position: relative; right: 6px; top: 6px; } .personal-task.table-hover > tbody > tr:hover > td, .table-hover > tbody > tr:hover > th { background-color: #f7f8fc; } .personal-task.table-hover > tbody > tr:hover > td i{ color: #688a7e; } .personal-task > tbody > tr > td:last-child { text-align: right; } .task-option { float: right; } .task-option select{ height: 35px; border: 1px solid #eaeaea; border-radius: 4px; -webkit-border-radius: 4px; padding: 8px; color: #a4abbb; } .progress-panel { padding-bottom: 5px; } /*badge*/ .badge.bg-primary { background: #688a7e; } .badge.bg-success { background: #4cd964; } .badge.bg-warning { background: #FCB322; } .badge.bg-important { background: #00a0df; font-family: 'Lato', sans-serif; font-size: 11px; } .badge.bg-info { background: #34aadc; } .badge.bg-inverse { background: #797979; } /*---revenue----*/ .revenue-head { background: #688a7e; color: #fff; line-height: 50px; text-align: center; } .revenue-head span { /*background: rgba(0,0,0,0.1);*/ text-align: left; line-height: normal; padding: 16px; font-weight: 300; } .revenue-head span i { font-size: 18px; } .revenue-head h3 { display: inline; padding: 0 10px; font-size: 16px; font-weight: 400; } .revenue-head span.rev-combo { /*background: rgba(0,0,0,0.1);*/ text-align: right; padding: 16px; line-height: normal; font-weight: 300; } /*easy pie chart*/ .easy-pie-chart { display: inline-block; padding: 30px 0; } .chart-info, .chart-info .increase, .chart-info .decrease { display: inline-block; } .chart-info { width: 100%; margin-bottom:5px; } .chart-position { margin-top: 70px; } .chart-info span { margin: 0 3px; } .chart-info .increase { background: #688a7e; width: 10px; height: 10px; } .chart-info .decrease { background: #f2f2f2; width: 10px; height: 10px; } .panel-footer.revenue-foot { background-color: #e6e7ec; -webkit-border-radius: 0px 0px 4px 4px; border-radius: 0px 0px 4px 4px; border: none; padding: 0; width: 100%; display: inline-block; } @media screen and (-webkit-min-device-pixel-ratio:0) { /* Safari and Chrome */ .panel-footer.revenue-foot { margin-bottom: -4px; }; } .panel-footer.revenue-foot ul { margin: 0; padding: 0; width: 100%; display: inline-flex; } .panel-footer.revenue-foot ul li { float: left; width: 33.33%; } .panel-footer.revenue-foot ul li.first a:hover, .panel-footer.revenue-foot ul li.first a { -webkit-border-radius: 0px 0px 0px 4px; border-radius: 0px 0px 0px 4px; } .panel-footer.revenue-foot ul li.last a:hover, .panel-footer.revenue-foot ul li.last a { -webkit-border-radius: 0px 0px 4px 0px; border-radius: 0px 0px 4px 0px; border-right: none; } .panel-footer.revenue-foot ul li a{ display: inline-block; width: 100%; padding: 14px 15px; text-align: center; border-right: 1px solid #d5d8df; color: #797979; } .panel-footer.revenue-foot ul li a:hover, .panel-footer.revenue-foot ul li.active a { background: #fff; position: relative; } .panel-footer.revenue-foot ul li a i { color: #c6cad5; display: block; font-size: 16px; } .panel-footer.revenue-foot ul li a:hover i, .panel-footer.revenue-foot ul li.active a i { color: #688a7e; display: block; font-size: 16px; } /*Creative carousel model*/ .flat-carousal { background: #00a0df; padding: 10px; color: #fff; position: relative; } .flat-carousal h1 { text-align: center; font-size: 16px; margin: 30px 20px; line-height: 20px; font-weight: 300; font-style: italic; } a.view-all { color: #fff; background: rgba(0,0,0,0.1); padding: 8px 15px; text-align: center; border-radius: 25px; -webkit-border-radius: 25px; margin-bottom: 18px; display: inline-block; text-transform: uppercase; font-size: 12px; } ul.ft-link { margin: 0; padding: 0; } ul.ft-link li { border-right: 1px solid #E6E7EC; display: inline-block; line-height: 30px; margin: 8px 0; text-align: center; width: 24%; } ul.ft-link li a { color: #74829c; text-transform: uppercase; font-size: 12px; } ul.ft-link li a:hover, ul.ft-link li.active a { color: #00a0df; } ul.ft-link li:last-child { border-right: none; } ul.ft-link li a i { display: block; } #owl-slider .item img{ display: block; width: 100%; height: auto; } .owl-buttons { position: absolute; top: 70px; width: 100%; } .owl-prev, .owl-next { position: absolute; } .owl-next { right: 0; } .owl-buttons .owl-prev { text-indent: -9999px; background: url("../img/left-arrow.png") no-repeat; width: 6px; height: 10px; display: inline-block; } .owl-buttons .owl-next { text-indent: -9999px; background: url("../img/right-arrow.png") no-repeat; width: 6px; height: 10px; display: inline-block; } /*product post*/ .post-wrap aside { display: table-cell; float: none; height: 100%; padding: 0; vertical-align: top; } .pro-box { border-collapse: collapse; border-spacing: 0; display: table; table-layout: fixed; width: 100%; } .post-info { position: relative; } .arrow-pro.right:after { border-left-color: #FFFFFF; border-right-width: 0; top: 85px; content: " "; } .arrow-pro.left:after { border-right-color: #FFFFFF; border-left-width: 0; top: 80px; content: " "; } .arrow-pro.left { left: -8px; } .arrow-pro:after { border-width: 7px; content: ""; } .arrow-pro, .arrow-pro:after { border-color: rgba(0, 0, 0, 0); border-style: solid; display: block; height: 0; position: absolute; width: 0; right: -5px; } .post-highlight.yellow { background: #FCB322; } .post-highlight.terques { background: #688a7e; } .post-info h1 { margin: 0; font-size: 18px; color: #a19899; font-weight: 300; } .post-highlight.terques h2 { font-size: 16px; color: #fff; font-style: italic; padding: 0 20px; line-height: 22px; margin: 0; font-weight: 300; } .post-highlight.terques h2 span, .post-highlight.terques h2 a { color: #92faf3; } .post-info h1 strong { text-transform: uppercase; color: #937b7b; } .post-info .desk { display: inline-block; } .post-info .desk h3{ font-size: 16px; } .post-info .desk.yellow h3 { color:#FCB322 ; } .post-btn { } .post-btn a { float: left; margin-right: 8px; font-size: 18px; color: #9a9a9a; } .post-btn a:hover { color: #727272; } .pro-thumb { text-align: center; display: inline-block; border-radius: 50%; -webkit-border-radius: 50%; border: 10px solid rgba(256,256,256,0.4); } .pro-thumb img{ text-align: center; width: 112px; height: 112px; border-radius: 50%; -webkit-border-radius: 50%; } .v-align { vertical-align: middle !important; } .twite h1 { margin: 50px 0; } .social-footer { display: inline; text-align: center; } .social-footer ul { text-align: center; margin: 0; padding: 0; } .social-footer ul li { display: inline-block; margin: 0 20px; } .social-footer ul li a { font-size: 25px; color: #ceced0; } .social-footer ul li a:hover i.icon-facebook, .social-footer ul li.active a i.icon-facebook { color: #486eac; } .social-footer ul li a:hover i.icon-twitter, .social-footer ul li.active a i.icon-twitter { color: #00a0df; } .social-footer ul li a:hover i.icon-google-plus, .social-footer ul li.active a i.icon-google-plus { color: #4a4a4a; } .social-footer ul li a:hover i.icon-pinterest, .social-footer ul li.active a i.icon-pinterest { color: #d1282d; } /*pie chart */ .pie-foot { background: #6b6b6b; padding: 18px 15px; color: #fff; border-radius: 0 0 4px 4px; -webkit-border-radius: 0 0 4px 4px; text-align: center; font-size: 16px; font-weight: 300; } /*profile-widget*/ .profile-widget { color: #fff; text-align: center; } /*profile-widget image bg*/ .profile-widget-img{ background: url('../img/backgrounds/bg-11-small.jpg') no-repeat !important; } .profile-nav .profile-widget-img .bg-layer { background: rgba(0,0,0,0.5) !important; } .profile-widget-img .panel-body{ background: rgba(0,0,0,0.5) !important; } .profile-widget-img .profile-widget-foot{ background: rgba(0,0,0,0.8); } .profile-widget p{ font-weight: 300; /*margin-bottom: 15px;*/ } .profile-widget{ /*padding-left: 20px 15px 30px 15px;*/ } .profile-widget .twt-category{ display: inline-block; margin-bottom: 0px; margin-top: 10px; width: 100%; padding: 0px; } .profile-widget .twt-category ul li{ color: #ffffff; } .knob-charts{ margin-top: 10px; } .follow-task{ padding: 5px; } .follow-task a{ color: #ffffff; width: 15%; display: inline-block; } .follow-task a span.badge{ top: -12px; position: relative; left: -8px; background: #FFFFFF; color: #34AADC; } .follow-task i{ font-size: 20px; } .profile-widget-foot { padding: 8px 5px 5px 5px; background: rgba(0,0,0,0.1); color: #757575; font-weight: 300; } .profile-foot { padding: 8px 5px 5px 5px; background: rgba(0,0,0,0.1); color: #ffffff; font-weight: 300; overflow: hidden; } .profile-foot .active{ } .profile-foot a{ color: #ffffff; } .profile-widget-foot ul { padding: 0; margin: 0; } .profile-widget-foot ul li{ display: inline-block; text-align: center; width: 48%; line-height: normal; } .profile-widget-foot ul li h5{ margin: 5px 0 0 0; } .follow-info{ text-align: left; padding-top: 20px; padding-bottom: 10px; } .profile-widget h4 { margin: 5px; font-size: 18px; font-weight: 300; } .profile-widget h6 { margin: 0px; font-size: 12px; color: rgba(255,255,255,0.9); font-weight: 300; } .profile-widget h6 span i{ padding-right: 4px; } .profile-widget h6 span{ padding-right: 8px; } .project-team, .panel-title,.progress-panel{ background: #F7F7F7; } .profile-ava img{ border-radius: 50%; -webkit-border-radius: 50%; border: 2px solid #688a7e; display: inline-block; } .profile-ava img.simple{ border-radius: 50%; -webkit-border-radius: 50%; border: 2px solid rgba(0,112,255,0.4); display: inline-block; } .profile-name{ margin: 0px; font-size: 16px; } .profile-occupation{ margin: 0px; font-size: 12px; } .follow-ava { border-radius: 50%; -webkit-border-radius: 50%; border: 5px solid rgba(0,0,0,0.1); display: inline-block; } .timeline-ava { border-radius: 50%; -webkit-border-radius: 50%; border: 5px solid #688a7e; display: inline-block; } .timeline-ava img{ border-radius: 50%; -webkit-border-radius: 50%; width: 50px; height: 50px; } .profile-widget img { border-radius: 50%; -webkit-border-radius: 50%; width: 62px; height: 62px; /*display: inline-block;*/ } /* .social-box =================================================================== */ .social-box { min-height: 158px; background: white; margin-bottom: 30px; text-align: center; } .social-box i { display: block; font-size: 40px; line-height: 90px; background: #f5f5f5; } .social-box ul { list-style: none; padding: 10px 0; } .social-box ul li { display: block; width: 50%; float: left; } .social-box ul li:first-child { border-right: 1px solid #f5f5f5; } .social-box ul li strong { display: block; font-size: 20px; } .social-box ul li span { color: #d4d4d4; font-weight: 500; text-transform: uppercase; font-size: 10px; } .social-box.facebook i { background: #3b5998; color: white; margin: -1px -1px 1px -1px; } .social-box.twitter i { background: #00aced; color: white; margin: -1px -1px 1px -1px; } .social-box.linkedin i { background: #4875b4; color: white; margin: -1px -1px 1px -1px; } .social-box.google-plus i { background: #d34836; color: white; margin: -1px -1px 1px -1px; } /*weather*/ .weather-bg { background: #34AADC; color: #fff; text-align: center; font-size: 16px; font-weight: 300; } .weather-bg i { font-size: 60px; display: block; } .weather-bg h3{ font-weight: 300; font-size: 28px; } .weather-bg .degree { padding-top: 10px; font-size: 60px; } .weather-category { padding: 15px 0; color: #ffffff; } .weather-info{ background: #34AADC; } .weather-category ul { padding:0; margin: 0; display: inline-block; width: 100%; } .weather-category ul { display: inline-block; width: 100%; padding-bottom: 10px; text-align: center; border-top:1px solid #e6e6e6 ; border-left:1px solid #e6e6e6 ; border-right:1px solid #e6e6e6 ; border-bottom:1px solid #e6e6e6 ; display: inline-block; } .weather-category ul li { display: inline-block; width: 70%; padding-top: 10px; padding-bottom: 10px; text-align: center; display: inline-block; } .weather-category ul li i { margin-bottom:10px; } .weather-category ul li h4 { margin: 10px 0 0 0 ; text-transform: uppercase; font-weight: 300; } .weather-days{ color: #ffffff; background: #34AADC; } .weather-days ul { padding:0; margin: 0; display: inline-block; width: 100%; } .weather-days ul li { display: inline-block; width: 16.6%; text-align: center; display: inline-block; margin-right: -2.9px; padding: 5px 0px; } .weather-days ul li.day1{ background: rgba(0,0,0,0.05); } .weather-days ul li.day2{ background: rgba(0,0,0,0.1); } .weather-days ul li.day3{ background: rgba(0,0,0,0.15); } .weather-days ul li.day4{ background: rgba(0,0,0,0.2); } .weather-days ul li.day5{ background: rgba(0,0,0,0.25); } .weather-days ul li.day6{ background: rgba(0,0,0,0.3); } .weather-days ul li h5 { margin: 0 0 5px 0; text-transform: uppercase; font-weight: 300; } .weather-category ul li a { } .weather-category ul li:last-child,.weather-days ul li:last-child { border-right:none ; } /*weather widget 2*/ .weather-bg-img { background: url(../img/backgrounds/bg-14-small.jpg) no-repeat center center; color: #fff; text-shadow: 0px 1px 5px #fed189; text-align: center; font-size: 16px; font-weight: 300; } .weather-bg-img i { font-size: 60px; text-shadow: 0px 1px 5px #fed189; display: block; } .weather-bg-img h3{ font-weight: 300; font-size: 28px; } .weather-bg-img .degree { padding-top: 10px; font-size: 60px; } .weather-bg-img .weather-category { padding: 15px 0; color: #ffffff; text-shadow: 0px 1px 5px #fed189; background: transparent; } .weather-bg-img .weather-category ul { padding:0; margin: 0; display: inline-block; width: 100%; } .weather-bg-img .weather-category ul li { display: inline-block; width: 32%; text-align: center; border-right:1px solid #e6e6e6 ; display: inline-block; } .weather-bg-img .weather-category ul li h5 { margin: 0 0 5px 0; text-transform: uppercase; font-weight: 300; text-shadow: 0px 1px 5px #fed189; } .weather-bg-img .panel-body, footer.weather-bg-img ul{ background: rgba(0,0,0,0.5); } .weather-days-img{ color: #ffffff; text-shadow: 0px 1px 5px #fed189; } .weather-days-img{ background: transparent !important; } /*fontawesome*/ .fontawesome-icon-list h2 { margin-top: 0; font-size: 20px; font-weight: 300; } .fontawesome-icon-list .col-sm-3 { margin-bottom: 10px; } .fontawesome-icon-list .page-header { border-bottom: 1px solid #C9CDD7; } .fontawesome-icon-list i { font-size: 16px; padding-right: 10px; } #web-application, #text-editor, #directional, #video-player, #brand, #medical, #currency { margin-top: 10px; } /*mail inbox*/ .inbox-wrapper { border-collapse: collapse; border-spacing: 0; display: table; table-layout: fixed; width: 100%; } .inbox-wrapper aside { display: table-cell; float: none; height: 100%; padding: 0; vertical-align: top; } .inbox-wrapper .inbox-left { width: 20%; background: #e5e8ef; } .inbox-wrapper .inbox-middle { width: 25%; background: #fff; } .inbox-wrapper .inbox-right { width: 65%; background: #f5f5f5; } .inbox-wrapper .inbox-left .inbox-left-menu { background: #688a7e; } .table-inbox .icon_star_alt:hover, .starred{ color: #FCB322; } .inbox-wrapper .inbox-left .user-head { background: rgba(0,0,0,0.2); padding: 10px; color: #fff; min-height: 80px; } .inbox-wrapper .inbox-middle .inbox-mail { background: #688a7e; padding: 10px; color: #fff; min-height: 80px; } .user-head .inbox-avatar { width: 65px; float: left; } .user-head .inbox-avatar img { border-radius: 4px; -webkit-border-radius: 4px; } .user-head .user-name { display: inline-block; margin:0 0 0 10px; } .user-head .user-name h5 { font-size: 14px; margin-top: -15px; margin-bottom: 0; font-weight: 300; } .user-head .user-name h5 a { color: #fff; } .user-head .user-name span a { font-size: 12px; color: rgba(255,255,255,0.9); } a.mail-dropdown { background: #80d3d9; padding:3px 5px; font-size: 10px; color: #01a7b3; border-radius: 2px; margin-top: 20px; } .inbox-body { padding: 20px; } .btn-compose { background: #00a0df; padding: 12px 0; text-align: center; width: 100%; color: #fff; } .btn-compose:hover { background: #f5675c; color: #fff; } ul.mail-nav { display: inline-block; width: 100%; margin: 0; padding: 0; } .mail-divider { border-bottom: 1px solid #d5d8df; } ul.mail-nav li { display: inline-block; line-height: 20px; padding: 10px; width: 100%; border-right: 1px solid #D7D7D7; border-bottom: 1px solid #D7D7D7; } ul.mail-nav li a { color: #6a6a6a; width: 100%; display: inline-block; padding: 0 20px; } ul.mail-nav .mail-info{ padding: 5px; font-size: 14px; } ul.mail-nav p{ font-size: 12px; } ul.mail-nav li:hover, ul.mail-nav li.active, ul.mail-nav li:focus { color: #6a6a6a; background: #f5f5f5; border-bottom: 1px solid #688a7e; border-right: none; } ul.mail-nav li a i { padding-right: 10px; font-size: 16px; color: #6a6a6a; } ul.mail-nav li a span.label { margin-top: 13px; } ul.inbox-nav { display: inline-block; width: 100%; margin: 0; padding: 0; } .inbox-divider { border-bottom: 1px solid #d5d8df; } ul.inbox-nav li { display: inline-block; line-height: 45px; width: 100%; } ul.inbox-nav li a { color: #6a6a6a; line-height: 45px; width: 100%; display: inline-block; padding: 0 20px; } ul.inbox-nav li a:hover, ul.inbox-nav li.active a, ul.inbox-nav li a:focus { color: #6a6a6a; background: #d5d7de; } ul.inbox-nav li a i { padding-right: 10px; font-size: 16px; color: #6a6a6a; } ul.inbox-nav li a span.label { margin-top: 13px; } ul.labels-info li h4 { padding-left:15px; padding-right:15px; padding-top: 5px; color: #5c5c5e; font-size: 13px; text-transform: uppercase; } ul.labels-info li { margin: 0; } ul.labels-info li a { color: #6a6a6a; border-radius: 0; } ul.labels-info li a:hover, ul.labels-info li a:focus { color: #6a6a6a; background: #d5d7de; } ul.labels-info li a i { padding-right: 10px; } .nav.nav-pills.nav-stacked.labels-info p { margin-bottom: 0; padding: 0 22px; color: #9d9f9e; font-size: 11px; } .inbox-head { padding:10px; background: #688a7e; color: #fff; border-bottom: 1px solid #D7D7D7; min-height: 80px; } .inbox-head h3 { margin: 0; display: inline-block; padding-top: 6px; font-weight: 300; } .inbox-head .sr-input { height: 40px; border: none; box-shadow: none; padding: 0 10px; float: left; border-radius: 4px 0 0 4px; color: #8a8a8a; } .inbox-head .sr-btn { height: 40px; border: none; background: #00a6b2; color: #fff; padding: 0 20px; border-radius: 0 4px 4px 0; -webkit-border-radius: 0 4px 4px 0; } .table-inbox { border: 1px solid #d3d3d3; margin-bottom: 0; } .table-inbox tr td{ padding: 12px !important; } .table-inbox tr td:hover{ cursor: pointer; } .table-inbox tr td .icon-star.inbox-started ,.table-inbox tr td .icon-star:hover{ color: #f78a09; } .table-inbox tr td .icon-star{ color: #d5d5d5; } .table-inbox tr.unread td { font-weight: 600; background: #f7f7f7; } ul.inbox-pagination { float: right; } ul.inbox-pagination li { float: left; } .mail-option { display: inline-block; margin-bottom: 0px; width: 100%; margin-top: 18px; } .open-mail-action i{ padding-right: 5px; font-size: 14px; } .inbox-mail .navbar-form{ margin-top: 15px; } .mail-option .chk-all, .mail-option .btn-group { margin-right: 5px; } .mail-option .chk-all, .mail-option .btn-group a.btn { border: 1px solid #e7e7e7; padding: 5px 10px; display: inline-block; background: #ffffff; color: #688a7e; border-radius: 0px !important; -webkit-border-radius: 0px !important; } .inbox-pagination a.np-btn { border: 1px solid #e7e7e7; padding: 5px 15px; display: inline-block; background: #fcfcfc; color: #afafaf; border-radius: 0px !important; -webkit-border-radius: 0px !important; } .mail-option .chk-all input[type=checkbox] { margin-top: 0; } .mail-option .btn-group a.all { padding: 0; border: none; } .inbox-pagination a.np-btn { margin-left: 5px; } .inbox-pagination li span { display: inline-block; margin-top: 7px; margin-right: 5px; } .fileinput-button { border: 1px solid #e6e6e6; background: #eeeeee; } .inbox-body .modal .modal-body input, .inbox-body .modal .modal-body textarea{ border: 1px solid #e6e6e6; box-shadow: none; } .btn-send, .btn-send:hover { background: #00A8B3; color: #fff; } .btn-send:hover { background: #009da7; } .modal-header h4.modal-title { font-weight: 300; font-family: 'Lato', sans-serif; } .modal-body label { font-weight: 400; font-family: 'Lato', sans-serif; } /*404 page*/ .page-404{ position:relative; width:350px; height:200px; margin:100px auto; text-align: center; } .text-404{ font-size:138px; background:#e9e3dd; background-image: url('https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcQTdWeWNteABnbzguiXSBxmfc8Z8nh_HHoWoK35QL81x4HnpVmgvQ'); background-repeat: no-repeat; background-size: 200% 200%; background-position: 100% 100%; -webkit-animation: square 3s linear infinite; -ms-animation: square 3s linear infinite; animation: square 3s linear infinite; -webkit-background-clip: text; color:transparent; text-align:center; line-height:200px; position:relative; } .text-404:nth-of-type(2){ text-shadow:none; z-index:2; position:absolute; top:-139px; left:-1px; } @-webkit-keyframes square { 0% { background-position: 0 0; } 25% { background-position: 100% 0; } 50% { background-position: 100% 100%; } 75% { background-position: 0 100%; } 100% { background-position: 0 0; } } @-ms-keyframes square { 0% { background-position: 0 0; } 25% { background-position: 100% 0; } 50% { background-position: 100% 100%; } 75% { background-position: 0 100%; } 100% { background-position: 0 0; } } @keyframes square { 0% { background-position: 0 0; } 25% { background-position: 100% 0; } 50% { background-position: 100% 100%; } 75% { background-position: 0 100%; } 100% { background-position: 0 0; } } /*profile*/ .profile-nav .user-heading { background: #688a7e; color: #fff; padding: 30px; text-align: center; } .profile-nav .user-heading.round a { border-radius: 50%; -webkit-border-radius: 50%; border: 10px solid rgba(256,256,256,0.3); display: inline-block; } .profile-nav .user-heading a img { width: 112px; height: 112px; border-radius: 50%; -webkit-border-radius: 50%; } .profile-nav .user-heading h1 { font-size: 22px; font-weight: 300; margin-bottom: 5px; } .profile-nav .user-heading p { font-size: 12px; } .profile-nav ul { margin-top: 1px; } .profile-nav ul > li { border-bottom: 1px solid #ebeae6; margin-top: 0; line-height: 30px; } .profile-nav ul > li:last-child { border-bottom: none; } .profile-nav ul > li > a { border-radius: 0; -webkit-border-radius: 0; color: #89817f; border-left: 5px solid #fff; } .profile-nav ul > li > a:hover, .profile-nav ul > li > a:focus, .profile-nav ul li.active a { background: #f8f7f5 !important; border-left: 5px solid #688a7e; color: #89817f !important; } .profile-nav ul > li:last-child > a:last-child { border-radius: 0 0 4px 4px; -webkit-border-radius: 0 0 4px 4px; } .profile-nav ul > li > a > i{ font-size: 16px; padding-right: 10px; color: #bcb3aa; } .r-activity { margin: 6px 0 0; font-size: 12px; } /*profile-widget color bg*/ .profile-widget-info{ background: #324c57 !important; } .profile-widget-success{ background: #4cd964 !important; } .profile-widget-primary{ background: #688a7e !important; } .profile-widget-warning{ background: #ffcc00 !important; } .profile-widget-danger{ background: #00a0df !important; } .profile-widget-name{ padding: 0px; } .p-text-area, .p-text-area:focus { border: none; font-weight: 300; box-shadow: none; color: #c3c3c3; font-size: 16px; } .profile-info .panel-footer { background-color:#f8f7f5 ; border-top: 1px solid #e7ebee; } .profile-info .panel-footer ul li a { color: #7a7a7a; } .bio-graph-heading { background: #263a4f; color: #fff; text-align: center; font-style: italic; padding: 40px 110px; font-size: 16px; font-weight: 300; } .bio-graph-info { color: #89817e; } .bio-graph-info h1 { font-size: 22px; font-weight: 300; margin: 0 0 20px; } .bio-row { width: 50%; float: left; margin-bottom: 10px; padding:0 15px; } .bio-row p span { width: 100px; display: inline-block; } .bio-chart, .bio-desk { float: left; } .bio-chart { width: 40%; } .bio-desk { width: 60%; } .bio-desk h4 { font-size: 15px; font-weight:400; } .bio-desk h4.terques { color: #34aadc; } .bio-desk h4.red { color: #e26b7f; } .bio-desk h4.green { color: #97be4b; } .bio-desk h4.purple { color: #caa3da; } .file-pos { margin: 6px 0 10px 0; } .profile-activity h5 { font-weight: 300; margin-top: 0; color: #c3c3c3; } .summary-head { background: #ee7272; color: #fff; text-align: center; border-bottom: 1px solid #ee7272; } .summary-head h4 { font-weight: 300; text-transform: uppercase; margin-bottom: 5px; } .summary-head p { color: rgba(256,256,256,0.6); } ul.summary-list { display: inline-block; padding-left:0 ; width: 100%; margin-bottom: 0; } ul.summary-list > li { display: inline-block; width: 19.5%; text-align: center; } ul.summary-list > li > a > i { display:block; font-size: 18px; padding-bottom: 5px; } ul.summary-list > li > a { padding: 10px 0; display: inline-block; color: #818181; } ul.summary-list > li { border-right: 1px solid #eaeaea; } ul.summary-list > li:last-child { border-right: none; } .activity { width: 100%; float: left; margin-bottom: 10px; } .activity.alt { width: 100%; float: right; margin-bottom: 10px; } .activity span { float: left; } .activity.alt span { float: right; } /*.activity span, .activity.alt span { width: 45px; height: 45px; line-height: 45px; border-radius: 50%; -webkit-border-radius: 50%; background: #eee; text-align: center; color: #fff; font-size: 16px; }*/ .activity.terques span { background: #8dd7d6; } .activity.terques h4 { color: #8dd7d6; } .activity.purple span { background: #b984dc; } .activity.purple h4 { color: #b984dc; } .activity.blue span { background: #90b4e6; } .activity.blue h4 { color: #90b4e6; } .activity.green span { background: #4cd964; } .activity.green h4 { color: #4cd964; } .activity h4 { margin-top:0 ; font-size: 16px; } .activity p { margin-bottom: 0; font-size: 13px; } .activity .activity-desk i, .activity.alt .activity-desk i { float: left; font-size: 18px; margin-right: 10px; color: #bebebe; } .activity .activity-desk { margin-left: 70px; position: relative; } .activity.alt .activity-desk { margin-right: 70px; position: relative; } .activity.alt .activity-desk .panel { float: right; position: relative; border-radius: 10px; -webkit-border-radius: 10px; } .activity .activity-desk .panel { background: #F4F4F4 ; display: inline-block; } .activity.alt .activity-desk .panel { background: #688a7e ; color: #ffffff; display: inline-block; } .activity .activity-desk .arrow { border-right: 8px solid #F4F4F4 !important; } .activity .activity-desk .arrow { border-bottom: 8px solid transparent; border-top: 8px solid transparent; display: block; height: 0; left: -7px; position: absolute; top: 13px; width: 0; } .activity-desk .arrow-alt { border-left: 8px solid #688a7e !important; } .activity-desk .arrow-alt { border-bottom: 8px solid transparent; border-top: 8px solid transparent; display: block; height: 0; right: -7px; position: absolute; top: 13px; width: 0; } .activity-desk .album { display: inline-block; margin-top: 10px; } .activity-desk .album a{ margin-right: 10px; } .activity-desk .album a:last-child{ margin-right: 0px; } /*invoice*/ .invoice-list { margin-bottom: 30px; } .invoice-list h4 { font-weight: 300; font-size: 16px; } .invoice-block { text-align: right; } .invoice-paid{ color: #4cd964; } ul.amounts li { background: #f5f5f5; margin-bottom: 5px; padding: 10px; border-radius: 4px; -webkit-border-radius: 4px; font-weight: 300; } .invoice-btn a{ font-weight: 300; margin: 0 5px; font-size: 16px; } .company-logo { margin: 30px; } /*panel heading color*/ .panel-heading,.modal-header{ background: #F7F7F7; color: #688a7e; } .panel-heading h3{ margin: 0px !important; } .panel-primary > .panel-heading.navyblue { background-color: #2A3542; border-color: #2A3542; color: #FFFFFF; } /*table*/ .table-advance tr td { vertical-align: middle !important; } .no-border { border-bottom: none; } .dataTables_length , .dataTables_filter{ padding:15px; } .dataTables_info{ padding:0 15px; } .dataTables_filter { float: right; } .dataTables_length select { width: 65px; padding:5px 8px; } .dataTables_length label, .dataTables_filter label { font-weight: 300; } .dataTables_filter label { width: 100%; } .dataTables_filter label input { width: 78%; } .border-top { border-top: 1px solid #ddd; } .dataTables_paginate.paging_bootstrap.pagination li { float: left; margin: 0 1px; border: 1px solid #ddd; border-radius: 3px; -webkit-border-radius: 3px; } .dataTables_paginate.paging_bootstrap.pagination li.disabled a{ color: #c7c7c7; } .dataTables_paginate.paging_bootstrap.pagination li a{ color: #797979; padding: 5px 10px; display: inline-block; } .dataTables_paginate.paging_bootstrap.pagination li:hover a, .dataTables_paginate.paging_bootstrap.pagination li.active a{ color: #797979; background: #eee; border-radius: 3px; -webkit-border-radius: 3px; } .dataTables_paginate.paging_bootstrap.pagination { float: right; margin-right: 15px; margin-top: -5px; margin-bottom: 15px; } .dataTable tr:last-child { border-bottom: 1px solid #ddd; } /*button*/ .btn-row { margin-bottom: 10px; } /*tabs*/ .tab-head { background: #688a7e; display: inline-block; width: 100%; margin-top: 60px; } .tab-container { margin-top: 10px; } .tab-head .nav-tabs > li > a { border-radius: 0; margin-right: 1px; color: #fff; } .tab-head .nav-tabs > li.active > a, .tab-head .nav-tabs > li > a:hover, .tab-head .nav-tabs > li.active > a:hover, .tab-head .nav-tabs > li.active > a:focus { background-color: #f1f2f7; border-color: #f1f2f7; color: #797979; } /*general page*/ .progress-xs { height: 8px; } .progress-sm { height: 12px; } .panel-heading .nav { border: medium none; font-size: 13px; margin: -10px -15px -11px; } .tab-bg-primary { background: #688a7e; border-bottom: none; } .tab-bg-info { background: #324c57; border-bottom: none; } .tab-bg-info.panel-heading .nav > li.active > a, .tab-bg-info.panel-heading .nav > li > a:hover{ color: #36464d; } .tab-bg-info.panel-heading .nav{ margin: -10px 15px -11px; } .panel-heading .nav > li > a, .panel-heading .nav > li.active > a, .panel-heading .nav > li.active > a:hover, .panel-heading .nav > li.active > a:focus { border-width: 0; border-radius: 0; } .panel-heading .nav > li > a { color: #fff; } .panel-heading .nav > li.active > a, .panel-heading .nav > li > a:hover { color: #688a7e; background: #fff; } .tab-right { height: 38px; } .panel-heading.tab-right .nav > li:first-child.active > a, .tab-right.panel-heading .nav > li:first-child > a:hover { border-radius: 0 ; -webkit-border-radius: 0 ; } .panel-heading.tab-right .nav > li:last-child.active > a, .tab-right.panel-heading .nav > li:last-child > a:hover { border-radius: 0 4px 0 0; -webkit-border-radius: 0 4px 0 0; } .panel-heading.tab-right .nav-tabs > li > a { margin-left: 1px; margin-right: 0px; } .m-bot20 { margin-bottom: 20px; } .m-bot-none { margin-bottom: 0; } .wht-color { color: #fff; } .close-sm { font-size: 14px; } /*carousel*/ .carousel-indicators li { background: rgba(0, 0, 0, 0.2) ; border: none; transition:background-color 0.25s ease 0s; -moz-transition:background-color 0.25s ease 0s; -webkit-transition:background-color 0.25s ease 0s; } .carousel-indicators .active { background:#00a0df; height: 10px; margin: 1px; width: 10px; } .carousel-indicators.out { bottom: -5px; } .carousel-indicators.out { bottom: -5px; } .carousel-control { color: #999999; text-shadow: none; width: 45px; } .carousel-control i { display: inline-block; height: 25px; left: 50%; margin-left: -10px; margin-top: -10px; position: absolute; top: 50%; width: 20px; z-index: 5; } .carousel-control.left, .carousel-control.right { background: none; filter:none; } .carousel-control:hover, .carousel-control:focus { color: #CCCCCC; opacity: 0.9; text-decoration: none; } .carousel-inner h3 { font-weight: 300; font-size: 16px; margin: 0; } .carousel-inner { margin-bottom: 15px; } /*gritter*/ .gritter-close { left: auto !important; right: 3px !important; } /*form*/ .sm-input { width: 175px; } .form-horizontal .form-group { border-bottom: 1px solid #eff2f7; padding-bottom: 15px; margin-bottom: 15px; } .form-horizontal .form-group:last-child { border-bottom: none; padding-bottom: 0px; margin-bottom: 0px; } .form-horizontal .form-group .help-block { margin-bottom: 0; } .round-input { border-radius: 500px; -webkit-border-radius: 500px; } .m-bot15 { margin-bottom: 15px; } .form-horizontal .checkbox-inline > input { margin-top: 1px; border:none; } /*form validation*/ .form-validate .form-group label.error { display: inline; margin: 5px 0; color: #00a0df; font-weight: 400; } input:focus:invalid:focus, textarea:focus:invalid:focus, select:focus:invalid:focus, .form-validate .form-group input.error , .form-validate .form-group textarea.error{ border-color: #00a0df !important; } #register_form label.error { display: inline; margin:5px 0px; width: auto; color: #00a0df; } .checkbox, .checkbox:hover, .checkbox:focus { border:none; } /*slider*/ table.sliders tr td { padding: 30px 0; border:none; } .slider { margin-top: 3px; } .slider-info { padding-top: 10px; } .sliders .ui-widget-header { background: #688a7e !important; border-radius: 15px !important; -webkit-border-radius: 15px !important; } .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { border-bottom-right-radius: 0 !important; } .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { border-bottom-left-radius: 0 !important; } .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { border-top-right-radius: 0 !important; } .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { border-top-left-radius: 0 !important; } #eq span { height:120px; float:left; margin:15px } .ui-widget-content { background: #f0f2f7 !important; border: none !important; border-radius: 15px !important; -webkit-border-radius: 15px !important; } .ui-slider-horizontal { height: 8px !important; } .ui-slider-horizontal .ui-slider-handle { top: -0.57em !important; } .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { background: #fff !important; /*border: 3px solid #22bacf !important;*/ box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); border-radius: 50% !important; -webkit-border-radius: 50% !important; } .ui-slider-vertical { width: 8px !important; } .ui-slider-vertical .ui-slider-handle { left: -0.5em !important; } .ui-slider .ui-slider-handle { cursor: default; height: 1.6em; position: absolute; width: 1.6em; z-index: 2; } .bound-s { width: 90px; margin-bottom: 15px; } /*----switch ----*/ .has-switch { border-radius: 30px; -webkit-border-radius: 30px; display: inline-block; cursor: pointer; line-height: 1.231; overflow: hidden; position: relative; text-align: left; width: 80px; -webkit-mask: url('../img/mask.png') 0 0 no-repeat; mask: url('../img/mask.png') 0 0 no-repeat; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; } .has-switch.deactivate { opacity: 0.5; filter: alpha(opacity=50); cursor: default !important; } .has-switch.deactivate label, .has-switch.deactivate span { cursor: default !important; } .has-switch > div { width: 162%; position: relative; top: 0; } .has-switch > div.switch-animate { -webkit-transition: left 0.25s ease-out; -moz-transition: left 0.25s ease-out; -o-transition: left 0.25s ease-out; transition: left 0.25s ease-out; -webkit-backface-visibility: hidden; } .has-switch > div.switch-off { left: -63%; } .has-switch > div.switch-off label { background-color: #7f8c9a; border-color: #bdc3c7; -webkit-box-shadow: -1px 0 0 rgba(255, 255, 255, 0.5); -moz-box-shadow: -1px 0 0 rgba(255, 255, 255, 0.5); box-shadow: -1px 0 0 rgba(255, 255, 255, 0.5); } .has-switch > div.switch-on { left: 0%; } .has-switch > div.switch-on label { background-color: #34aadc; } .has-switch input[type=checkbox] { display: none; } .has-switch span { cursor: pointer; font-size: 14.994px; font-weight: 700; float: left; height: 29px; line-height: 19px; margin: 0; padding-bottom: 6px; padding-top: 5px; position: relative; text-align: center; width: 50%; z-index: 1; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; -webkit-transition: 0.25s ease-out; -moz-transition: 0.25s ease-out; -o-transition: 0.25s ease-out; transition: 0.25s ease-out; -webkit-backface-visibility: hidden; } .has-switch span.switch-left { border-radius: 30px 0 0 30px; background-color: #2A3542; color: #34aadc; border-left: 1px solid transparent; } .has-switch span.switch-right { border-radius: 0 30px 30px 0; background-color: #bdc3c7; color: #ffffff; text-indent: 7px; } .has-switch span.switch-right [class*="fui-"] { text-indent: 0; } .has-switch label { border: 4px solid #2A3542; border-radius: 50%; -webkit-border-radius: 50%; float: left; height: 29px; margin: 0 -21px 0 -14px; padding: 0; position: relative; vertical-align: middle; width: 29px; z-index: 100; -webkit-transition: 0.25s ease-out; -moz-transition: 0.25s ease-out; -o-transition: 0.25s ease-out; transition: 0.25s ease-out; -webkit-backface-visibility: hidden; } .switch-square { border-radius: 6px; -webkit-border-radius: 6px; -webkit-mask: url('../img/mask.png') 0 0 no-repeat; mask: url('../img/mask.png') 0 0 no-repeat; } .switch-square > div.switch-off label { border-color: #7f8c9a; border-radius: 6px 0 0 6px; } .switch-square span.switch-left { border-radius: 6px 0 0 6px; } .switch-square span.switch-left [class*="fui-"] { text-indent: -10px; } .switch-square span.switch-right { border-radius: 0 6px 6px 0; } .switch-square span.switch-right [class*="fui-"] { text-indent: 5px; } .switch-square label { border-radius: 0 6px 6px 0; border-color: #34aadc; } /*tag input*/ .tagsinput { border: 1px solid #e3e6ed; border-radius: 6px; height: 100px; padding: 6px 1px 1px 6px; overflow-y: auto; text-align: left; } .tagsinput .tag { border-radius: 4px; background-color: #688a7e; color: #ffffff; cursor: pointer; margin-right: 5px; margin-bottom: 5px; overflow: hidden; line-height: 15px; padding: 6px 13px 8px 19px; position: relative; vertical-align: middle; display: inline-block; zoom: 1; *display: inline; -webkit-transition: 0.14s linear; -moz-transition: 0.14s linear; -o-transition: 0.14s linear; transition: 0.14s linear; -webkit-backface-visibility: hidden; } .tagsinput .tag:hover { background-color: rgba(0,122,255,0.7); color: #ffffff; padding-left: 12px; padding-right: 20px; } .tagsinput .tag:hover .tagsinput-remove-link { color: #ffffff; opacity: 1; display: block\9; } .tagsinput input { background: transparent; border: none; color: #34495e; font-family: "Lato", sans-serif; font-size: 14px; margin: 0px; padding: 0 0 0 5px; outline: 0; margin-right: 5px; margin-bottom: 5px; width: 12px; } .tagsinput-remove-link { bottom: 0; color: #ffffff; cursor: pointer; font-size: 12px; opacity: 0; padding: 7px 7px 5px 0; position: absolute; right: 0; text-align: right; text-decoration: none; top: 0; width: 100%; z-index: 2; display: none\9; } .tagsinput-remove-link:before { color: #ffffff; content: "\f00d"; font-family: "FontAwesome"; } .tagsinput-add-container { vertical-align: middle; display: inline-block; zoom: 1; *display: inline; } .tagsinput-add { background-color: #d6dbdf; border-radius: 3px; color: #ffffff; cursor: pointer; margin-bottom: 5px; padding: 6px 9px; display: inline-block; zoom: 1; *display: inline; -webkit-transition: 0.25s; -moz-transition: 0.25s; -o-transition: 0.25s; transition: 0.25s; -webkit-backface-visibility: hidden; } .tagsinput-add:hover { background-color: #688a7e; } .tagsinput-add:before { content: "\f067"; font-family: "FontAwesome"; } .tags_clear { clear: both; width: 100%; height: 0px; } /*checkbox & radio style*/ .checkboxes label, .radios label { display: block; cursor: pointer; line-height: 20px; padding-bottom: 7px; font-weight: 300; } .radios { padding-top: 18px; } .label_check input, .label_radio input { margin-right: 5px; } .has-js .label_check, .has-js .label_radio { padding-left: 34px; } .has-js .label_radio { background: url(../img/checkbox/radio-off.png) no-repeat; } .has-js .label_check { background: url(../img/checkbox/check-off.png) no-repeat; } .has-js label.c_on { background: url(../img/checkbox/check-on.png) no-repeat; } .has-js label.r_on { background: url(../img/checkbox/radio-on.png) no-repeat; } .has-js .label_check input, .has-js .label_radio input { position: absolute; left: -9999px; } /*date picker*/ .add-on { border: 1px solid #E2E2E4; border-radius: 4px; -webkit-border-radius: 4px; float: right; margin-right: -37px; margin-top: -34px; padding: 8px; text-align: center; background: #EEEEEE; } .daterangepicker .ranges .range_inputs > div:nth-child(2) { margin-bottom: 10px; padding-left: 0px; } .daterangepicker .ranges label { padding-bottom: 0; padding-top: 8px; } .daterangepicker td.active, .daterangepicker td.active:hover, .datepicker td.active:hover, .datepicker td.active:hover:hover, .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active.active:hover, .datepicker td.active.disabled, .datepicker td.active.disabled:hover, .datepicker td.active[disabled], .datepicker td.active[disabled]:hover, .datepicker td span.active:hover, .datepicker td span.active:active, .datepicker td span.active.active, .datepicker td span.active.disabled, .datepicker td span.active[disabled]{ background: #688a7e; } .daterangepicker .calendar th, .daterangepicker .calendar td { font-family: 'Lato', sans-serif; font-weight: 300; text-align: center; white-space: nowrap; } .daterangepicker td.active, .daterangepicker td.active:hover, .datepicker td.active, .datepicker td.active:hover, .datepicker td span.active { text-shadow: none; } .datepicker th.switch { width: 125px; } .datepicker td span { height: 40px; line-height: 40px; } /*ck editor*/ .cke_top, .cke_bottom { background: #F5F5F5 !important; background: -moz-linear-gradient(center top , #F5F5F5, #F5F5F5) repeat scroll 0 0 #F5F5F5 !important; background: -webkit-linear-gradient(center top , #F5F5F5, #F5F5F5) repeat scroll 0 0 #F5F5F5 !important; background: -o-linear-gradient(center top , #F5F5F5, #F5F5F5) repeat scroll 0 0 #F5F5F5 !important; box-shadow: none; padding: 6px 8px 2px; } .cke_top { border-bottom: 1px solid #cccccc !important; } .cke_chrome { border: 1px solid #cccccc !important; box-shadow: none !important; display: block; padding: 0; } /*form wizard*/ .stepy-tab { text-align: center; } .stepy-tab ul{ display: inline-block; } .stepy-tab ul li { float: left; } .step legend { border: none; } .button-back { float: left; } .button-next, .finish { float: right; } .button-back, .button-next, .finish { cursor: pointer; text-decoration: none; } .step { clear: left; } .step label { display: block; } .stepy-titles li { color: #757575; cursor: pointer; float: left; margin: 10px 15px; } .stepy-titles li span { display: block; } .stepy-titles li.current-step div { color: #fff; cursor: auto; background: #688a7e; border-radius: 50%; -webkit-border-radius: 50%; width: 80px; height: 80px; line-height: 80px; } .stepy-titles li div{ font-size:16px; font-weight: 300; background: #eee; border-radius: 50%; -webkit-border-radius: 50%; width: 80px; height: 80px; line-height: 80px; } /*widget*/ .user-heading.alt { display: inline-block; width: 100%; text-align: left; } .alt.green-bg { background: #4cd964; } .profile-nav.alt.green-border ul > li > a:hover, .profile-nav.alt.green-border ul > li > a:focus, .profile-nav.alt.green-border ul li.active a { border-left: 5px solid #4cd964; } .user-heading.alt a { float: left; margin-right: 15px; margin-left: -10px; display: inline-block; border: 5px solid rgba(255, 255, 255, 0.3); border-radius: 50%; -webkit-border-radius: 50%; } .user-heading.alt a img{ width: 100px; height: 100px; border-radius: 50%; -webkit-border-radius: 50%; } .twt-feed { border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; color: #FFFFFF; padding: 10px; position: relative; text-align: center; } .twt-feed.blue-bg { background: #00a0df; } .twt-feed h1 { font-size: 22px; font-weight: 300; margin-bottom: 5px; } .twt-feed a { border: 8px solid #fff; border-radius: 50%; -webit-border-radius: 50%; display: inline-block; margin-bottom: -55px; } .twt-feed a img { height: 112px; width: 112px; border-radius: 50%; -webit-border-radius: 50%; } .twt-category { display: inline-block; margin-bottom: 11px; margin-top: 55px; width: 100%; } .profile-widget-data{ display: inline-block; margin-bottom: 10px; margin-top: 15px; width: 100%; } .twt-category ul li, .profile-widget-data ul li,.profile-nav ul > li{ color: #89817f; font-size: 13px; border-bottom: none; } .twt-category h5 { font-size: 20px; font-weight: 300; } .twt-write .t-text-area { border: 1px solid #eeeeee; border-radius: 0; } .twt-footer { padding: 10px 15px; } .btn-space { padding-left: 11.6%; padding-right: 11%; } .p-head { color: #f77b6f; font-weight: 400; font-size: 14px; } .cmt-head { font-weight: 400; font-size: 13px; } .p-thumb img { width: 50px; border-radius: 3px; -webkit-border-radius: 3px; } .tasi-tab .media-body p { /*color: #b8bac6;*/ } /*Timeline chat*/ .chat-form { margin-top: 25px; clear: both; } .chat-form .input-cont { margin-bottom: 10px; } .chat-form .input-cont input { margin-bottom: 0px; } .chat-form .input-cont input{ border: 1px solid #d3d3d3 !important; margin-top:0; min-height: 45px; } .chat-form .input-cont input { background-color: #fff !important; } .chat-features a { margin-left: 10px; } .chat-features a i{ color: #d0d0d0; } .profile-activity:before { background: rgba(0, 0, 0, 0.1); bottom: 0; top: 0; width: 2px; } /*.profile-activity:before, .act-time:before, .act-time .text:before { content: ""; left: 60px; position: absolute; top: -2px; }*/ .profile-activity, .act-time , .profile-activity .act-in, .profile-activity .act-out { position: relative; } .profile-activity .act-in .arrow { /*border-right: 8px solid #F4F4F4 !important;*/ } .profile-activity .act-in .arrow { border-bottom: 8px solid transparent; border-top: 8px solid transparent; display: block; height: 0; left: -8px; position: absolute; top: 13px; width: 0; } .profile-activity .act-out .arrow { /*border-right: 8px solid #34aadc !important;*/ } .profile-activity .act-out .arrow { border-bottom: 8px solid transparent; border-top: 8px solid transparent; display: block; height: 0; left: -8px; position: absolute; top: 13px; width: 0; } .act-time:first-child:before { margin-top: 16px; } .act-time:before { background:#CCCCCC; border: 2px solid #FAFAFA; border-radius: 100px; -moz-border-radius: 100px; -webkit-border-radius: 100px; height: 14px; margin: 23px 0 0 -6px; width: 14px; } .act-time:hover:before { background: #34aadc; } .act-time:first-child { padding-top: 0; } .activity-img { float: left; margin-right: 30px; overflow: hidden; } .activity-img img { display: block; height: 44px; width: 44px; } .activity-body { /*margin-left: 80px;*/ } .act-time .act-in .text { border: 1px solid #e3e6ed; padding: 10px; border-radius: 4px; -webkit-border-radius: 4px; } .act-time .act-out .text { border: 1px solid #e3e6ed; padding: 10px; border-radius: 4px; -webkit-border-radius: 4px; } .act-time p { margin: 0; } .act-time .attribution { font-size: 11px; margin: 0px 0 5px; } .act-time { overflow: hidden; padding:8px 0; } .act-in a, .act-in a:hover{ color: #b64c4c; text-decoration: none; border-radius: 50%; -webkit-border-radius: 50%; margin-right: 10px; font-weight: 400; font-size: 13px; } .act-out a, .act-out a:hover{ color: #288f98; text-decoration: none; border-radius: 4px; -webkit-border-radius: 4px; margin-right: 10px; font-weight: 400; font-size: 13px; } .messages-wrapper { position: relative; } .message { border-radius: 20px 20px 20px 20px; margin: 0 15px 10px; padding: 5px 20px; position: relative; } .message.to { background-color: #2095FE; color: #fff; margin-left: 80px; } .message.from { background-color: #E5E4E9; color: #363636; margin-right: 80px; } .message.to + .message.to, .message.from + .message.from { margin-top: -7px; } .message:before { border-color: #2095FE; border-radius: 50% 50% 50% 50%; border-style: solid; border-width: 0 20px; bottom: 0; clip: rect(20px, 35px, 42px, 0px); content: " "; height: 40px; position: absolute; right: -50px; width: 30px; z-index: -1; } .message.from:before { border-color: #E5E4E9; left: -50px; -webkit-transform: rotateY(180deg); -moz-transform: rotateY(180deg); transform: rotateY(180deg); } /*custom select*/ span.customSelect { font-size:12px; background-color: #ffffff; padding:10px; border:1px solid #EAEAEA; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; color: #A4AABA; } span.customSelect.changed { background-color: #fff; } .customSelectInner { background:url(../img/customSelect-arrow.gif) no-repeat center right; }
vibollmc/5aa2ed571501055565936ff4f5887882
HMS.Web.Main/css/style.css
CSS
gpl-3.0
93,201
/* TP Checker * Main Program * gcc main.c glutils.c glmath.c -o code004 -lGL -lGLEW -lglut -lm * or simply use make ;) */ #ifndef STDLIB_INCLUDED #define STDLIB_INCLUDED #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #endif #ifndef GL_INCLUDED #define GL_INCLUDED #include <GL/glew.h> #include <GL/freeglut.h> #include "glutils.h" #include "glmath.h" #endif #ifndef CHECKER_INCLUDED #define CHECKER_INCLUDED #include "checker.h" #endif /** Structure de donnees regroupant toutes les valeurs importantes. */ struct Application { // etat de l'application enum { INIT=0, RUN, FINISH } state; // identificateur de la fenetre de dessin int window_id; // identificateur du groupe de shaders GLuint program_id; // modele GLuint vertex_array_id; // buffer de points GLuint vertex_buffer_id; // buffer d'indices GLuint element_buffer_id; GLuint element_buffer_count; // position de la camera vec3 mvp_camera, mvp_lookat, mvp_vertical; // matrice de visualisation mat4 mvp_matrix; // matrice de transformation mat4 mvp_model; // connexion avec le vertex shader (point de vue) GLuint mvp_matrix_id, tint_id; } app = { 0 }; void set_mvp( void ) { mat4 projection_matrix = mat4_perspective( 45., 1000. / 1000., .1, 100. ); mat4 view_matrix = mat4_lookAt(app.mvp_camera, app.mvp_lookat, app.mvp_vertical ); app.mvp_matrix = mat4_product( mat4_product(projection_matrix, view_matrix), app.mvp_model ); } /** Rafraichissement de la fenetre * * Lorsqu'il faut regenerer le contenu de la fenetre : * - evenement externe (par ex., une autre fenetre qui masquait * une partie de la fenetre vient de disparaitre) * - evenement interne (par ex., le point de vue a change) */ void my_refresh( void ) { glEnable( GL_DEPTH_TEST); glDepthFunc(GL_LESS); //on efface la fenêtre glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); // on (re)met en place les bons shaders glUseProgram( app.program_id ); // on pousse la matrice de point de vue sur la carte glUniformMatrix4fv( app.mvp_matrix_id, 1, GL_FALSE, &app.mvp_matrix.matrix[0][0] ); // on se branche sur la bonne source... glEnableVertexAttribArray( 0 ); glBindBuffer( GL_ARRAY_BUFFER, app.vertex_buffer_id ); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, (void*)0); //dessiner les objets glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, app.element_buffer_id); glUniform3f(app.tint_id, 1, 0, 0); glDrawElements(GL_TRIANGLES, 12 * 3, GL_UNSIGNED_INT, (void*)(6 * sizeof(GLuint))); glUniform3f(app.tint_id, 0, 1, 0); glDrawElements(GL_LINES, 3 * 2, GL_UNSIGNED_INT, (void*)0); // on débranche ... glDisableVertexAttribArray(0); //on valide l'affichage glutSwapBuffers(); } /** gestion des événements clavier * * @param key code (caractere) de la touche * @param x coordonnee du pointeur au moment de l'action * @param y coordonnee du pointeur au moment de l'action * @param action 1 pour enfonce, 0 pour relache */ void my_keyboard( unsigned char key, int x, int y, int action ) { switch (key) { case 27: // <Escape> glutLeaveMainLoop(); // freeglut break; case 'q': if (action) { app.mvp_camera = vec3_transform(mat4_rotate(-.1, app.mvp_vertical), app.mvp_camera ); set_mvp(); glutPostRedisplay(); } ; break; case 'a': if (action) { app.mvp_camera = vec3_transform(mat4_rotate(.1, app.mvp_vertical), app.mvp_camera ); set_mvp(); glutPostRedisplay(); } break; } } /** touche clavier appuyee * * @param key code (caractere) de la touche * @param x coordonnee du pointeur au moment de l'action * @param y coordonnee du pointeur au moment de l'action */ void my_keyboard_press( unsigned char key, int x, int y ) { my_keyboard( key, x, y, 1 ); } /** touche clavier relachee * * @param key code (caractere) de la touche * @param x coordonnee du pointeur au moment de l'action * @param y coordonnee du pointeur au moment de l'action */ void my_keyboard_release( unsigned char key, int x, int y ) { my_keyboard( key, x, y, 0 ); } /** boucle principale */ void mainloop( void ) { app.state = RUN; glClearColor( 0.0f, 0.0f, 0.4f, 0.0f ); glutSetOption( GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS ); glutMainLoop(); app.state = FINISH; } /** fin de programme * * Appele quand l'application se termine *normalement*, * c'est-a-dire s'il n'y a pas eu plantage grave ou appel a * la fonction abort(). */ void bye( void ) { printf( "that's all folks! (state=%d)\n", app.state ); } /** initialisation de l'application * * @param argc argument count (transmis par l'interface de main) * @param argv argument vector * @return 0 si tout est ok, 1 en cas de probleme * * glutInit peut egalement provoquer l'arret du programme en cas * de probleme : pas de retour dans main(), mais le callback bye * sera appele (cf. atexit en debut de main). */ int init_resources( int *argc, char **argv ) { // 1) Connexion au système graphique natif & initialisation glutInit( argc, argv ); // 2) creation d'une fenetre glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA ); glutInitWindowPosition( 0, 0 ); glutInitWindowSize( 1600, 900 ); app.window_id = glutCreateWindow( "This is not a Test" ); printf("Stop 0"); glutKeyboardFunc( my_keyboard_press ); glutKeyboardUpFunc( my_keyboard_release ); glutDisplayFunc( my_refresh ); printf("Stop A"); // 3) exposition de l'API (*apres* la creation d'une fenetre) glutInitContextVersion(3, 3); // a rajouter pour fonctionner sous iGP intel (besoin de spécifier la version OpenGL et de GLSL) glewExperimental = GL_TRUE; if ( glewInit() != GLEW_OK ) return 1; // 4) les shaders printf("Stop B"); char vertex_shader[] = "#version 330 core\n" "layout(location = 0) in vec3 vertexPosition_modelspace; \n" "layout(location = 1) in vec3 vertexColor;" "uniform mat4 MVP; \n" "out vec3 fragmentColor; \n" "void main() \n" "{ \n" " gl_Position = MVP * vec4(vertexPosition_modelspace,1); \n" " fragmentColor = vertexColor; \n" "} \n"; char fragment_shader[] = "#version 330 core\n" "in vec3 fragmentColor; \n" "out vec3 color; \n" "void main() \n" "{ \n" " color = fragmentColor; \n" "} \n"; printf("Stop C"); app.program_id = load_shaders( vertex_shader, fragment_shader ); if ( app.program_id == 0 ) return 1; // 5) le point de vue initial app.mvp_model = mat4_identity(); app.mvp_matrix_id = glGetUniformLocation( app.program_id, "MVP" ); app.mvp_camera = vec3_init( 4, 3, 3 ); app.mvp_lookat = vec3_init( 0, 0, 0 ); app.mvp_vertical = vec3_init( 0, 1, 0 ); set_mvp(); //modele geometrique glGenVertexArrays( 1, &app.vertex_array_id ); glBindVertexArray( app.vertex_array_id ); GLfloat *g_vertex_buffer_data = NULL; GLuint *indices = NULL; // The Checker generator. int test = Gen_checker(3, 3, g_vertex_buffer_data, indices); if (test == 1) return 1; glGenBuffers( 1, &app.vertex_buffer_id ); glBindBuffer( GL_ARRAY_BUFFER, app.vertex_buffer_id ); glBufferData( GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), g_vertex_buffer_data, GL_STATIC_DRAW ); //needs to know whats in the buffers : for (unsigned int A = 0; A < ((4 * 4 * sizeof(GLfloat)) + (sizeof(GLfloat) * 4)); A++) { for (int B = 0; B < 3; B++) printf("%.1f ", g_vertex_buffer_data[A * B]); printf("\n"); } // got rid of the actual buffer for the cube ;) #if 0 //modele couleur glGenVertexArrays( 1, &app.vertex_array_id ); glBindVertexArray( app.vertex_array_id ); static const GLfloat g_vertex_buffer_data[] = { 0.0, 0.0, 0.0, // 0 10., 0.0, 0.0, // 1 0.0, 10., 0.0, // 2 0.0, 0.0, 10., // 3 -1.0, -1.0, -1.0, // 4 cube floor 1.0, -1.0, -1.0, 1.0, 1.0, -1.0, -1.0, 1.0, -1.0, -1.0, -1.0, 1.0, // 8 cube ceiling 1.0, -1.0, 1.0, 1.0, 1.0, 1.0, -1.0, 1.0, 1.0 }; glGenBuffers( 1, &app.vertex_buffer_id ); glBindBuffer( GL_ARRAY_BUFFER, app.vertex_buffer_id ); glBufferData( GL_ARRAY_BUFFER, sizeof(g_vertex_buffer_data), g_vertex_buffer_data, GL_STATIC_DRAW ); static const GLuint indices[] = { // 0..5: axis 0, 1, //x 0, 2, //y 0, 3, //z // 6..41 : triangles. 4, 7, 6, 4, 6, 5, 11, 8, 9, 11, 9, 10, //etc... }; #endif glGenBuffers(1, &app.element_buffer_id); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, app.element_buffer_id); app.element_buffer_count = sizeof(indices) / sizeof(*indices); glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof indices, indices, GL_STATIC_DRAW); //freeing the VBOs (Am I supposed to do so ?) free(g_vertex_buffer_data); free(indices); return 0; } void free_resources( void ) { glDeleteBuffers(1, &app.vertex_buffer_id); glDeleteProgram(app.program_id); glDeleteVertexArrays(1, &app.vertex_array_id); } /** programme principal */ int main( int argc, char **argv ) { atexit(bye); int sizeX; int sizeY; if (argc == 3){ sizeX = atoi(argv[1]); sizeY = atoi(argv[2]); }else{ sizeX = 3; sizeY = 3; } int Vsize = Pre_Checker(sizeX,sizeY); GLfloat g_vertex_buffer_data[Vsize]; GLuint indices[(sizeX+1) * (sizeY+1) * 2 * 3]; int test = Gen_checker(sizeX, sizeY, g_vertex_buffer_data, indices); if (test == 1) return 1; printf("\n test : \n"); for (int i = 0; i < (sizeX+1) * (sizeY+1) * 3; i=i+3){ printf("%0.1f, %0.1f, %0.1f \n", g_vertex_buffer_data[i], g_vertex_buffer_data[i+1], g_vertex_buffer_data[i+2]); } printf("\n it worked !"); #if 0 if ( init_resources( &argc, argv ) != 0 ) { fprintf(stderr, "erreur lors de l'initialisation de l'application\n"); return 1; } mainloop(); free_resources(); #endif // that's all folks! return 0; }
MadMcCrow/OpenGL_courses
TP-damier/main.c
C
gpl-3.0
9,821
/** * Copyright (C) 2001-2016 by RapidMiner and the contributors * * Complete list of developers available at our web site: * * http://rapidminer.com * * This program is free software: you can redistribute it and/or modify it under the terms of the * GNU Affero General Public License as published by the Free Software Foundation, either version 3 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License along with this program. * If not, see http://www.gnu.org/licenses/. */ package com.rapidminer.example.test; import java.util.Arrays; import java.util.LinkedList; import java.util.List; import java.util.Random; import com.rapidminer.example.Attribute; import com.rapidminer.example.Attributes; import com.rapidminer.example.ExampleSet; import com.rapidminer.example.table.AttributeFactory; import com.rapidminer.example.table.DataRow; import com.rapidminer.example.table.DataRowFactory; import com.rapidminer.example.table.DataRowReader; import com.rapidminer.example.table.DoubleArrayDataRow; import com.rapidminer.example.table.ListDataRowReader; import com.rapidminer.example.table.MemoryExampleTable; import com.rapidminer.tools.Ontology; /** * Provides factory methods for text fixtures. * * @author Simon Fischer, Ingo Mierswa */ public class ExampleTestTools { /** Returns a DataRowReader returning the given values. */ public static DataRowReader createDataRowReader(DataRowFactory factory, Attribute[] attributes, String[][] values) { List<DataRow> dataRows = new LinkedList<DataRow>(); for (int i = 0; i < values.length; i++) { dataRows.add(factory.create(values[i], attributes)); } return new ListDataRowReader(dataRows.iterator()); } /** Returns a DataRowReader returning the given values. */ public static DataRowReader createDataRowReader(double[][] values) { List<DataRow> dataRows = new LinkedList<DataRow>(); for (int i = 0; i < values.length; i++) { dataRows.add(new DoubleArrayDataRow(values[i])); } return new ListDataRowReader(dataRows.iterator()); } /** * Returns a DataRowReader returning random values (generated with fixed * random seed). */ public static DataRowReader createDataRowReader(int size, Attribute[] attributes) { Random random = new Random(0); List<DataRow> dataRows = new LinkedList<DataRow>(); for (int i = 0; i < size; i++) { double[] data = new double[attributes.length]; for (int j = 0; j < data.length; j++) { if (attributes[j].isNominal()) { data[j] = random.nextInt(attributes[j].getMapping().getValues().size()); } if (attributes[j].getValueType() == Ontology.INTEGER) { data[j] = random.nextInt(200) - 100; } else { data[j] = 20.0 * random.nextDouble() - 10.0; } } dataRows.add(new DoubleArrayDataRow(data)); } return new ListDataRowReader(dataRows.iterator()); } public static MemoryExampleTable createMemoryExampleTable(int size) { Attribute[] attributes = createFourAttributes(); return new MemoryExampleTable(Arrays.asList(attributes), createDataRowReader(size, attributes)); } public static Attribute attributeDogCatMouse() { Attribute a = AttributeFactory.createAttribute("animal", Ontology.NOMINAL); a.getMapping().mapString("dog"); a.getMapping().mapString("cat"); a.getMapping().mapString("mouse"); return a; } public static Attribute attributeYesNo() { Attribute a = AttributeFactory.createAttribute("decision", Ontology.NOMINAL); a.getMapping().mapString("no"); a.getMapping().mapString("yes"); return a; } public static Attribute attributeInt() { Attribute a = AttributeFactory.createAttribute("integer", Ontology.INTEGER); return a; } public static Attribute attributeReal() { Attribute a = AttributeFactory.createAttribute("real", Ontology.REAL); return a; } public static Attribute attributeReal(int index) { Attribute a = AttributeFactory.createAttribute("real" + index, Ontology.REAL); return a; } /** * Creates four attributes: "animal" (dog/cat/mouse), "decision" (yes/no), * "int", and "real". */ public static Attribute[] createFourAttributes() { Attribute[] attributes = new Attribute[4]; attributes[0] = ExampleTestTools.attributeDogCatMouse(); attributes[1] = ExampleTestTools.attributeYesNo(); attributes[2] = ExampleTestTools.attributeInt(); attributes[3] = ExampleTestTools.attributeReal(); for (int i = 0; i < attributes.length; i++) attributes[i].setTableIndex(i); return attributes; } public static Attribute createPredictedLabel(ExampleSet exampleSet) { Attribute predictedLabel = AttributeFactory.createAttribute(exampleSet.getAttributes().getLabel(), Attributes.PREDICTION_NAME); exampleSet.getExampleTable().addAttribute(predictedLabel); exampleSet.getAttributes().setPredictedLabel(predictedLabel); return predictedLabel; } }
transwarpio/rapidminer
rapidMiner/rapidminer-studio-core/src/test/java/com/rapidminer/example/test/ExampleTestTools.java
Java
gpl-3.0
5,152
// Decompiled with JetBrains decompiler // Type: System.CodeDom.Compiler.CodeParser // Assembly: System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 // MVID: 5ABD58FD-DF31-44FD-A492-63F2B47CC9AF // Assembly location: C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.dll using System.CodeDom; using System.IO; using System.Runtime; using System.Security.Permissions; namespace System.CodeDom.Compiler { /// <summary> /// Provides an empty implementation of the <see cref="T:System.CodeDom.Compiler.ICodeParser"/> interface. /// </summary> [PermissionSet(SecurityAction.InheritanceDemand, Name = "FullTrust")] [PermissionSet(SecurityAction.LinkDemand, Name = "FullTrust")] public abstract class CodeParser : ICodeParser { /// <summary> /// Initializes a new instance of the <see cref="T:System.CodeDom.Compiler.CodeParser"/> class. /// </summary> [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")] protected CodeParser() { } /// <summary> /// Compiles the specified text stream into a <see cref="T:System.CodeDom.CodeCompileUnit"/>. /// </summary> /// /// <returns> /// A <see cref="T:System.CodeDom.CodeCompileUnit"/> containing the code model produced from parsing the code. /// </returns> /// <param name="codeStream">A <see cref="T:System.IO.TextReader"/> that is used to read the code to be parsed. </param> public abstract CodeCompileUnit Parse(TextReader codeStream); } }
mater06/LEGOChimaOnlineReloaded
LoCO Client Files/Decompressed Client/Extracted DLL/System/System/CodeDom/Compiler/CodeParser.cs
C#
gpl-3.0
1,547
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="cs"> <head> <!-- Generated by javadoc (version 1.7.0_71) on Mon May 25 21:19:38 CEST 2015 --> <title>Uses of Class cz.utb.fai.cudaonlineide.shared.dto.COIFolder</title> <meta name="date" content="2015-05-25"> <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="Uses of Class cz.utb.fai.cudaonlineide.shared.dto.COIFolder"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <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><a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">Class</a></li> <li class="navBarCell1Rev">Use</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>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?cz/utb/fai/cudaonlineide/shared/dto/class-use/COIFolder.html" target="_top">Frames</a></li> <li><a href="COIFolder.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class cz.utb.fai.cudaonlineide.shared.dto.COIFolder" class="title">Uses of Class<br>cz.utb.fai.cudaonlineide.shared.dto.COIFolder</h2> </div> <div class="classUseContainer"> <ul class="blockList"> <li class="blockList"> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation"> <caption><span>Packages that use <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Package</th> <th class="colLast" scope="col">Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><a href="#cz.utb.fai.cudaonlineide.client.context">cz.utb.fai.cudaonlineide.client.context</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#cz.utb.fai.cudaonlineide.client.popup">cz.utb.fai.cudaonlineide.client.popup</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#cz.utb.fai.cudaonlineide.client.service.coi">cz.utb.fai.cudaonlineide.client.service.coi</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#cz.utb.fai.cudaonlineide.server.service.coi">cz.utb.fai.cudaonlineide.server.service.coi</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="altColor"> <td class="colFirst"><a href="#cz.utb.fai.cudaonlineide.server.verifier">cz.utb.fai.cudaonlineide.server.verifier</a></td> <td class="colLast">&nbsp;</td> </tr> <tr class="rowColor"> <td class="colFirst"><a href="#cz.utb.fai.cudaonlineide.shared.dto">cz.utb.fai.cudaonlineide.shared.dto</a></td> <td class="colLast">&nbsp;</td> </tr> </tbody> </table> </li> <li class="blockList"> <ul class="blockList"> <li class="blockList"><a name="cz.utb.fai.cudaonlineide.client.context"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a> in <a href="../../../../../../../cz/utb/fai/cudaonlineide/client/context/package-summary.html">cz.utb.fai.cudaonlineide.client.context</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../cz/utb/fai/cudaonlineide/client/context/package-summary.html">cz.utb.fai.cudaonlineide.client.context</a> with parameters of type <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a></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> <tbody> <tr class="altColor"> <td class="colFirst"><code>private static void</code></td> <td class="colLast"><span class="strong">TreeContextMenu.</span><code><strong><a href="../../../../../../../cz/utb/fai/cudaonlineide/client/context/TreeContextMenu.html#createFileOfSampleProject(cz.utb.fai.cudaonlineide.shared.dto.COIProject,%20cz.utb.fai.cudaonlineide.shared.dto.COIFolder,%20cz.utb.fai.cudaonlineide.client.dto.COIData)">createFileOfSampleProject</a></strong>(<a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIProject.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIProject</a>&nbsp;sampleProject, <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a>&nbsp;sampleFolder, <a href="../../../../../../../cz/utb/fai/cudaonlineide/client/dto/COIData.html" title="class in cz.utb.fai.cudaonlineide.client.dto">COIData</a>&nbsp;coiData)</code> <div class="block">Method creates source file of sample project.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="cz.utb.fai.cudaonlineide.client.popup"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a> in <a href="../../../../../../../cz/utb/fai/cudaonlineide/client/popup/package-summary.html">cz.utb.fai.cudaonlineide.client.popup</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../cz/utb/fai/cudaonlineide/client/popup/package-summary.html">cz.utb.fai.cudaonlineide.client.popup</a> with parameters of type <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a></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> <tbody> <tr class="altColor"> <td class="colFirst"><code>static com.sencha.gxt.widget.core.client.Window</code></td> <td class="colLast"><span class="strong">PopUpWindow.</span><code><strong><a href="../../../../../../../cz/utb/fai/cudaonlineide/client/popup/PopUpWindow.html#fileUploadPanel(cz.utb.fai.cudaonlineide.shared.dto.COIFolder)">fileUploadPanel</a></strong>(<a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a>&nbsp;coiFolder)</code> <div class="block">File upload pop up window.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static com.sencha.gxt.widget.core.client.Window</code></td> <td class="colLast"><span class="strong">PopUpWindow.</span><code><strong><a href="../../../../../../../cz/utb/fai/cudaonlineide/client/popup/PopUpWindow.html#newFilePanel(cz.utb.fai.cudaonlineide.shared.dto.COIFolder)">newFilePanel</a></strong>(<a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a>&nbsp;coiFolder)</code> <div class="block">Creating of new file pop up window.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="cz.utb.fai.cudaonlineide.client.service.coi"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a> in <a href="../../../../../../../cz/utb/fai/cudaonlineide/client/service/coi/package-summary.html">cz.utb.fai.cudaonlineide.client.service.coi</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../cz/utb/fai/cudaonlineide/client/service/coi/package-summary.html">cz.utb.fai.cudaonlineide.client.service.coi</a> with parameters of type <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a></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> <tbody> <tr class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><span class="strong">COIService.</span><code><strong><a href="../../../../../../../cz/utb/fai/cudaonlineide/client/service/coi/COIService.html#createNewFolder(cz.utb.fai.cudaonlineide.shared.dto.COIWorkspace,%20cz.utb.fai.cudaonlineide.shared.dto.COIFolder)">createNewFolder</a></strong>(<a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIWorkspace.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIWorkspace</a>&nbsp;coiWorkspace, <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a>&nbsp;coiFolder)</code> <div class="block">Method creating new folder.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">COIServiceAsync.</span><code><strong><a href="../../../../../../../cz/utb/fai/cudaonlineide/client/service/coi/COIServiceAsync.html#createNewFolder(cz.utb.fai.cudaonlineide.shared.dto.COIWorkspace,%20cz.utb.fai.cudaonlineide.shared.dto.COIFolder,%20com.google.gwt.user.client.rpc.AsyncCallback)">createNewFolder</a></strong>(<a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIWorkspace.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIWorkspace</a>&nbsp;coiWorkspace, <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a>&nbsp;coiFolder, com.google.gwt.user.client.rpc.AsyncCallback&lt;java.lang.Boolean&gt;&nbsp;callback)</code> <div class="block">Method creating new folder.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="cz.utb.fai.cudaonlineide.server.service.coi"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a> in <a href="../../../../../../../cz/utb/fai/cudaonlineide/server/service/coi/package-summary.html">cz.utb.fai.cudaonlineide.server.service.coi</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../cz/utb/fai/cudaonlineide/server/service/coi/package-summary.html">cz.utb.fai.cudaonlineide.server.service.coi</a> with parameters of type <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a></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> <tbody> <tr class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><span class="strong">COIServiceImpl.</span><code><strong><a href="../../../../../../../cz/utb/fai/cudaonlineide/server/service/coi/COIServiceImpl.html#createNewFolder(cz.utb.fai.cudaonlineide.shared.dto.COIWorkspace,%20cz.utb.fai.cudaonlineide.shared.dto.COIFolder)">createNewFolder</a></strong>(<a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIWorkspace.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIWorkspace</a>&nbsp;coiWorkspace, <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a>&nbsp;coiFolder)</code> <div class="block">Method creating new folder.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="cz.utb.fai.cudaonlineide.server.verifier"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a> in <a href="../../../../../../../cz/utb/fai/cudaonlineide/server/verifier/package-summary.html">cz.utb.fai.cudaonlineide.server.verifier</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../cz/utb/fai/cudaonlineide/server/verifier/package-summary.html">cz.utb.fai.cudaonlineide.server.verifier</a> with parameters of type <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a></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> <tbody> <tr class="altColor"> <td class="colFirst"><code>static boolean</code></td> <td class="colLast"><span class="strong">RPCVerifier.</span><code><strong><a href="../../../../../../../cz/utb/fai/cudaonlineide/server/verifier/RPCVerifier.html#isCOIFolderCorrect(cz.utb.fai.cudaonlineide.shared.dto.COIFolder)">isCOIFolderCorrect</a></strong>(<a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a>&nbsp;coiFolder)</code> <div class="block">Method test if new folder has correct parameters.</div> </td> </tr> </tbody> </table> </li> <li class="blockList"><a name="cz.utb.fai.cudaonlineide.shared.dto"> <!-- --> </a> <h3>Uses of <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a> in <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/package-summary.html">cz.utb.fai.cudaonlineide.shared.dto</a></h3> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing fields, and an explanation"> <caption><span>Fields in <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/package-summary.html">cz.utb.fai.cudaonlineide.shared.dto</a> with type parameters of type <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a></span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tbody> <tr class="altColor"> <td class="colFirst"><code>private java.util.List&lt;<a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a>&gt;</code></td> <td class="colLast"><span class="strong">COIProject.</span><code><strong><a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIProject.html#items">items</a></strong></code> <div class="block">List of CudaOnlineIDE folders.</div> </td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Methods in <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/package-summary.html">cz.utb.fai.cudaonlineide.shared.dto</a> that return types with arguments of type <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a></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> <tbody> <tr class="altColor"> <td class="colFirst"><code>java.util.List&lt;<a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a>&gt;</code></td> <td class="colLast"><span class="strong">COIProject.</span><code><strong><a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIProject.html#getItems()">getItems</a></strong>()</code>&nbsp;</td> </tr> </tbody> </table> <table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation"> <caption><span>Method parameters in <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/package-summary.html">cz.utb.fai.cudaonlineide.shared.dto</a> with type arguments of type <a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a></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> <tbody> <tr class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><span class="strong">COIProject.</span><code><strong><a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIProject.html#setItems(java.util.List)">setItems</a></strong>(java.util.List&lt;<a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">COIFolder</a>&gt;&nbsp;items)</code>&nbsp;</td> </tr> </tbody> </table> </li> </ul> </li> </ul> </div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar_bottom"> <!-- --> </a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_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><a href="../../../../../../../cz/utb/fai/cudaonlineide/shared/dto/COIFolder.html" title="class in cz.utb.fai.cudaonlineide.shared.dto">Class</a></li> <li class="navBarCell1Rev">Use</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>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../index.html?cz/utb/fai/cudaonlineide/shared/dto/class-use/COIFolder.html" target="_top">Frames</a></li> <li><a href="COIFolder.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
rough23/cudaonlineide
doc/cz/utb/fai/cudaonlineide/shared/dto/class-use/COIFolder.html
HTML
gpl-3.0
20,447
<!DOCTYPE html> <html xml:lang="en-GB" lang="en-GB" xmlns="http://www.w3.org/1999/xhtml"> <head lang="en-GB"> <title>Ross Gammon’s Family Tree - WILSON, Irene Alice</title> <meta charset="UTF-8" /> <meta name ="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1" /> <meta name ="apple-mobile-web-app-capable" content="yes" /> <meta name="generator" content="Gramps 4.2.8 http://gramps-project.org/" /> <meta name="author" content="" /> <link href="../../../images/favicon2.ico" rel="shortcut icon" type="image/x-icon" /> <link href="../../../css/narrative-screen.css" media="screen" rel="stylesheet" type="text/css" /> <link href="../../../css/narrative-print.css" media="print" rel="stylesheet" type="text/css" /> <link href="../../../css/ancestortree.css" media="screen" rel="stylesheet" type="text/css" /> </head> <body> <div id="header"> <h1 id="SiteTitle">Ross Gammon’s Family Tree</h1> </div> <div class="wrapper" id="nav" role="navigation"> <div class="container"> <ul class="menu" id="dropmenu"> <li class = "CurrentSection"><a href="../../../individuals.html" title="Individuals">Individuals</a></li> <li><a href="../../../index.html" title="Surnames">Surnames</a></li> <li><a href="../../../families.html" title="Families">Families</a></li> <li><a href="../../../events.html" title="Events">Events</a></li> <li><a href="../../../places.html" title="Places">Places</a></li> <li><a href="../../../sources.html" title="Sources">Sources</a></li> <li><a href="../../../repositories.html" title="Repositories">Repositories</a></li> <li><a href="../../../media.html" title="Media">Media</a></li> <li><a href="../../../thumbnails.html" title="Thumbnails">Thumbnails</a></li> </ul> </div> </div> <div class="content" id="IndividualDetail"> <h3>WILSON, Irene Alice<sup><small></small></sup></h3> <div id="summaryarea"> <table class="infolist"> <tr> <td class="ColumnAttribute">Birth Name</td> <td class="ColumnValue"> WILSON, Irene Alice <a href="#sref1a">1a</a> </td> </tr> <tr> <td class="ColumnAttribute">Gramps&nbsp;ID</td> <td class="ColumnValue">I12252</td> </tr> <tr> <td class="ColumnAttribute">Gender</td> <td class="ColumnValue">female</td> </tr> <tr> <td class="ColumnAttribute">Age at Death</td> <td class="ColumnValue">7 months, 29 days</td> </tr> </table> </div> <div class="subsection" id="events"> <h4>Events</h4> <table class="infolist eventlist"> <thead> <tr> <th class="ColumnEvent">Event</th> <th class="ColumnDate">Date</th> <th class="ColumnPlace">Place</th> <th class="ColumnDescription">Description</th> <th class="ColumnNotes">Notes</th> <th class="ColumnSources">Sources</th> </tr> </thead> <tbody> <tr> <td class="ColumnEvent"> <a href="../../../evt/1/7/d15f605acd4535da7d254d37471.html" title="Birth"> Birth <span class="grampsid"> [E14549]</span> </a> </td> <td class="ColumnDate">1887-04-21</td> <td class="ColumnPlace"> <a href="../../../plc/c/9/d15f602f1736034930f14c99e9c.html" title=""> </a> </td> <td class="ColumnDescription">&nbsp;</td> <td class="ColumnNotes"> <div> </div> </td> <td class="ColumnSources"> &nbsp; </td> </tr> <tr> <td class="ColumnEvent"> <a href="../../../evt/2/1/d15f605ace07e1e131314af7412.html" title="Death"> Death <span class="grampsid"> [E14550]</span> </a> </td> <td class="ColumnDate">1887-12-20</td> <td class="ColumnPlace"> <a href="../../../plc/c/9/d15f602f1736034930f14c99e9c.html" title=""> </a> </td> <td class="ColumnDescription">&nbsp;</td> <td class="ColumnNotes"> <div> </div> </td> <td class="ColumnSources"> &nbsp; </td> </tr> </tbody> </table> </div> <div class="subsection" id="parents"> <h4>Parents</h4> <table class="infolist"> <thead> <tr> <th class="ColumnAttribute">Relation to main person</th> <th class="ColumnValue">Name</th> <th class="ColumnValue">Relation within this family (if not by birth)</th> </tr> </thead> <tbody> </tbody> <tr> <td class="ColumnAttribute">Father</td> <td class="ColumnValue"> <a href="../../../ppl/6/f/d15f60592d05c6292b1741659f6.html">WILSON, Henry James<span class="grampsid"> [I12152]</span></a> </td> </tr> <tr> <td class="ColumnAttribute">Mother</td> <td class="ColumnValue"> <a href="../../../ppl/6/c/d15f60592822bcd30993fa711c6.html">LUCAS, Amelia<span class="grampsid"> [I12151]</span></a> </td> </tr> <tr> <td class="ColumnAttribute">&nbsp;&nbsp;&nbsp;&nbsp;Brother</td> <td class="ColumnValue">&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../../ppl/a/a/d15f605930c15585d317889cfaa.html">WILSON, Albert Henry<span class="grampsid"> [I12153]</span></a></td> <td class="ColumnValue"></td> </tr> <tr> <td class="ColumnAttribute">&nbsp;&nbsp;&nbsp;&nbsp;Sister</td> <td class="ColumnValue">&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../../ppl/a/d/d15f6059a38278dc5d9534776da.html">WILSON, Florence Mary Ann<span class="grampsid"> [I12192]</span></a></td> <td class="ColumnValue"></td> </tr> <tr> <td class="ColumnAttribute">&nbsp;&nbsp;&nbsp;&nbsp;Brother</td> <td class="ColumnValue">&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../../ppl/b/0/d15f605a17a248c54037e4ef80b.html">WILSON, Henry James Norman Bruce<span class="grampsid"> [I12196]</span></a></td> <td class="ColumnValue"></td> </tr> <tr> <td class="ColumnAttribute">&nbsp;&nbsp;&nbsp;&nbsp;Sister</td> <td class="ColumnValue">&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../../ppl/f/0/d15f605ac67f76ff99fdb27c0f.html">WILSON, Elsie Constance<span class="grampsid"> [I12250]</span></a></td> <td class="ColumnValue"></td> </tr> <tr> <td class="ColumnAttribute">&nbsp;&nbsp;&nbsp;&nbsp;</td> <td class="ColumnValue">&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../../ppl/a/9/d15f605acca1e2103166051e69a.html">WILSON, Irene Alice<span class="grampsid"> [I12252]</span></a></td> <td class="ColumnValue"></td> </tr> <tr> <td class="ColumnAttribute">&nbsp;&nbsp;&nbsp;&nbsp;Brother</td> <td class="ColumnValue">&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../../ppl/9/1/d15f605ad082d8a6abb74ea3619.html">WILSON, John Phillip<span class="grampsid"> [I12253]</span></a></td> <td class="ColumnValue"></td> </tr> </table> </div> <div class="subsection" id="attributes"> <h4>Attributes</h4> <table class="infolist attrlist"> <thead> <tr> <th class="ColumnType">Type</th> <th class="ColumnValue">Value</th> <th class="ColumnNotes">Notes</th> <th class="ColumnSources">Sources</th> </tr> </thead> <tbody> <tr> <td class="ColumnType">_UID</td> <td class="ColumnValue">3D506647D1CF77428E2546A21B3F3E8C52CA</td> <td class="ColumnNotes"><div></div></td> <td class="ColumnSources">&nbsp;</td> </tr> </tbody> </table> </div> <div class="subsection" id="pedigree"> <h4>Pedigree</h4> <ol class="pedigreegen"> <li> <a href="../../../ppl/6/f/d15f60592d05c6292b1741659f6.html">WILSON, Henry James<span class="grampsid"> [I12152]</span></a> <ol> <li class="spouse"> <a href="../../../ppl/6/c/d15f60592822bcd30993fa711c6.html">LUCAS, Amelia<span class="grampsid"> [I12151]</span></a> <ol> <li> <a href="../../../ppl/a/a/d15f605930c15585d317889cfaa.html">WILSON, Albert Henry<span class="grampsid"> [I12153]</span></a> </li> <li> <a href="../../../ppl/a/d/d15f6059a38278dc5d9534776da.html">WILSON, Florence Mary Ann<span class="grampsid"> [I12192]</span></a> </li> <li> <a href="../../../ppl/b/0/d15f605a17a248c54037e4ef80b.html">WILSON, Henry James Norman Bruce<span class="grampsid"> [I12196]</span></a> </li> <li> <a href="../../../ppl/f/0/d15f605ac67f76ff99fdb27c0f.html">WILSON, Elsie Constance<span class="grampsid"> [I12250]</span></a> </li> <li class="thisperson"> WILSON, Irene Alice </li> <li> <a href="../../../ppl/9/1/d15f605ad082d8a6abb74ea3619.html">WILSON, John Phillip<span class="grampsid"> [I12253]</span></a> </li> </ol> </li> </ol> </li> </ol> </div> <div class="subsection" id="tree"> <h4>Ancestors</h4> <div id="treeContainer" style="width:735px; height:602px;"> <div class="boxbg female AncCol0" style="top: 269px; left: 6px;"> <a class="noThumb" href="../../../ppl/a/9/d15f605acca1e2103166051e69a.html"> WILSON, Irene Alice </a> </div> <div class="shadow" style="top: 274px; left: 10px;"></div> <div class="bvline" style="top: 301px; left: 165px; width: 15px"></div> <div class="gvline" style="top: 306px; left: 165px; width: 20px"></div> <div class="boxbg male AncCol1" style="top: 119px; left: 196px;"> <a class="noThumb" href="../../../ppl/6/f/d15f60592d05c6292b1741659f6.html"> WILSON, Henry James </a> </div> <div class="shadow" style="top: 124px; left: 200px;"></div> <div class="bvline" style="top: 151px; left: 180px; width: 15px;"></div> <div class="gvline" style="top: 156px; left: 185px; width: 20px;"></div> <div class="bhline" style="top: 151px; left: 180px; height: 150px;"></div> <div class="gvline" style="top: 156px; left: 185px; height: 150px;"></div> <div class="boxbg female AncCol1" style="top: 419px; left: 196px;"> <a class="noThumb" href="../../../ppl/6/c/d15f60592822bcd30993fa711c6.html"> LUCAS, Amelia </a> </div> <div class="shadow" style="top: 424px; left: 200px;"></div> <div class="bvline" style="top: 451px; left: 180px; width: 15px;"></div> <div class="gvline" style="top: 456px; left: 185px; width: 20px;"></div> <div class="bhline" style="top: 301px; left: 180px; height: 150px;"></div> <div class="gvline" style="top: 306px; left: 185px; height: 150px;"></div> <div class="bvline" style="top: 451px; left: 355px; width: 15px"></div> <div class="gvline" style="top: 456px; left: 355px; width: 20px"></div> <div class="boxbg male AncCol2" style="top: 344px; left: 386px;"> <a class="noThumb" href="../../../ppl/4/a/d15f60115312fd2f4af186abfa4.html"> LUCAS, Thomas </a> </div> <div class="shadow" style="top: 349px; left: 390px;"></div> <div class="bvline" style="top: 376px; left: 370px; width: 15px;"></div> <div class="gvline" style="top: 381px; left: 375px; width: 20px;"></div> <div class="bhline" style="top: 376px; left: 370px; height: 75px;"></div> <div class="gvline" style="top: 381px; left: 375px; height: 75px;"></div> <div class="bvline" style="top: 376px; left: 545px; width: 15px"></div> <div class="gvline" style="top: 381px; left: 545px; width: 20px"></div> <div class="boxbg male AncCol3" style="top: 307px; left: 576px;"> <a class="noThumb" href="../../../ppl/a/3/d15f5fb962f11f46775d411d23a.html"> LUCAS, Nathaniel </a> </div> <div class="shadow" style="top: 312px; left: 580px;"></div> <div class="bvline" style="top: 339px; left: 560px; width: 15px;"></div> <div class="gvline" style="top: 344px; left: 565px; width: 20px;"></div> <div class="bhline" style="top: 339px; left: 560px; height: 37px;"></div> <div class="gvline" style="top: 344px; left: 565px; height: 37px;"></div> <div class="boxbg female AncCol3" style="top: 381px; left: 576px;"> <a class="noThumb" href="../../../ppl/6/8/d15f5fb965a7bfcfae4d7c1e486.html"> GASCOYNE, Olivia </a> </div> <div class="shadow" style="top: 386px; left: 580px;"></div> <div class="bvline" style="top: 413px; left: 560px; width: 15px;"></div> <div class="gvline" style="top: 418px; left: 565px; width: 20px;"></div> <div class="bhline" style="top: 376px; left: 560px; height: 37px;"></div> <div class="gvline" style="top: 381px; left: 565px; height: 37px;"></div> <div class="boxbg female AncCol2" style="top: 494px; left: 386px;"> <a class="noThumb" href="../../../ppl/7/5/d15f604ffbf2561736d127fd157.html"> SYDES, Margaret </a> </div> <div class="shadow" style="top: 499px; left: 390px;"></div> <div class="bvline" style="top: 526px; left: 370px; width: 15px;"></div> <div class="gvline" style="top: 531px; left: 375px; width: 20px;"></div> <div class="bhline" style="top: 451px; left: 370px; height: 75px;"></div> <div class="gvline" style="top: 456px; left: 375px; height: 75px;"></div> </div> </div> <div class="subsection" id="sourcerefs"> <h4>Source References</h4> <ol> <li> <a href="../../../src/a/6/d15f60115341c7ebf941727f26a.html" title="Frank Lee: GEDCOM File : ThomasLUCAS.ged" name ="sref1"> Frank Lee: GEDCOM File : ThomasLUCAS.ged <span class="grampsid"> [S0307]</span> </a> <ol> <li id="sref1a"> <ul> <li> Confidence: Low </li> </ul> </li> </ol> </li> </ol> </div> </div> <div class="fullclear"></div> <div id="footer"> <p id="createdate"> Generated by <a href="http://gramps-project.org/">Gramps</a> 4.2.8<br />Last change was the 2015-08-05 19:55:04<br />Created for <a href="../../../ppl/9/e/d15f5fb48902c4fc1b421d249e9.html">GAMMON, Francis</a> </p> <p id="copyright"> </p> </div> </body> </html>
RossGammon/the-gammons.net
RossFamilyTree/ppl/a/9/d15f605acca1e2103166051e69a.html
HTML
gpl-3.0
13,810
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2012 The Bitcoin developers // Distributed under the MIT/X11 software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "protocol.h" #include "util.h" #include "netbase.h" #ifndef WIN32 # include <arpa/inet.h> #endif // The message start string is designed to be unlikely to occur in normal data. // The characters are rarely used upper ascii, not valid as UTF-8, and produce // a large 4-byte int at any alignment. // Public testnet message start // unsigned char pchMessageStartTestBitcoin[4] = { 0xfa, 0xbf, 0xb5, 0xda }; static unsigned char pchMessageStartTestOld[4] = { 0xdb, 0xe1, 0xf2, 0xf6 }; static unsigned char pchMessageStartTestNew[4] = { 0xcb, 0xf2, 0xc0, 0xef }; static unsigned int nMessageStartTestSwitchTime = 1346200000; // PPCoin message start (switch from Bitcoin's in v0.2) static unsigned char pchMessageStartBitcoin[4] = { 0xf9, 0xbe, 0xb4, 0xd9 }; static unsigned char pchMessageStartPPCoin[4] = { 0xe6, 0xe8, 0xe9, 0x02 }; static unsigned int nMessageStartSwitchTime = 1347300000; void GetMessageStart(unsigned char pchMessageStart[], bool fPersistent) { if (fTestNet) memcpy(pchMessageStart, (fPersistent || GetAdjustedTime() > nMessageStartTestSwitchTime)? pchMessageStartTestNew : pchMessageStartTestOld, sizeof(pchMessageStartTestNew)); else memcpy(pchMessageStart, (fPersistent || GetAdjustedTime() > nMessageStartSwitchTime)? pchMessageStartPPCoin : pchMessageStartBitcoin, sizeof(pchMessageStartPPCoin)); } static const char* ppszTypeName[] = { "ERROR", "tx", "block", }; CMessageHeader::CMessageHeader() { GetMessageStart(pchMessageStart); memset(pchCommand, 0, sizeof(pchCommand)); pchCommand[1] = 1; nMessageSize = -1; nChecksum = 0; } CMessageHeader::CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn) { GetMessageStart(pchMessageStart); strncpy(pchCommand, pszCommand, COMMAND_SIZE); nMessageSize = nMessageSizeIn; nChecksum = 0; } std::string CMessageHeader::GetCommand() const { if (pchCommand[COMMAND_SIZE-1] == 0) return std::string(pchCommand, pchCommand + strlen(pchCommand)); else return std::string(pchCommand, pchCommand + COMMAND_SIZE); } bool CMessageHeader::IsValid() const { // Check start string unsigned char pchMessageStartProtocol[4]; GetMessageStart(pchMessageStartProtocol); if (memcmp(pchMessageStart, pchMessageStartProtocol, sizeof(pchMessageStart)) != 0) return false; // Check the command string for errors for (const char* p1 = pchCommand; p1 < pchCommand + COMMAND_SIZE; p1++) { if (*p1 == 0) { // Must be all zeros after the first zero for (; p1 < pchCommand + COMMAND_SIZE; p1++) if (*p1 != 0) return false; } else if (*p1 < ' ' || *p1 > 0x7E) return false; } // Message size if (nMessageSize > MAX_SIZE) { printf("CMessageHeader::IsValid() : (%s, %u bytes) nMessageSize > MAX_SIZE\n", GetCommand().c_str(), nMessageSize); return false; } return true; } CAddress::CAddress() : CService() { Init(); } CAddress::CAddress(CService ipIn, uint64 nServicesIn) : CService(ipIn) { Init(); nServices = nServicesIn; } void CAddress::Init() { nServices = NODE_NETWORK; nTime = 100000000; nLastTry = 0; } CInv::CInv() { type = 0; hash = 0; } CInv::CInv(int typeIn, const uint256& hashIn) { type = typeIn; hash = hashIn; } CInv::CInv(const std::string& strType, const uint256& hashIn) { unsigned int i; for (i = 1; i < ARRAYLEN(ppszTypeName); i++) { if (strType == ppszTypeName[i]) { type = i; break; } } if (i == ARRAYLEN(ppszTypeName)) throw std::out_of_range(strprintf("CInv::CInv(string, uint256) : unknown type '%s'", strType.c_str())); hash = hashIn; } bool operator<(const CInv& a, const CInv& b) { return (a.type < b.type || (a.type == b.type && a.hash < b.hash)); } bool CInv::IsKnownType() const { return (type >= 1 && type < (int)ARRAYLEN(ppszTypeName)); } const char* CInv::GetCommand() const { if (!IsKnownType()) throw std::out_of_range(strprintf("CInv::GetCommand() : type=%d unknown type", type)); return ppszTypeName[type]; } std::string CInv::ToString() const { return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,20).c_str()); } void CInv::print() const { printf("CInv(%s)\n", ToString().c_str()); }
bitcf/bitcf
src/protocol.cpp
C++
gpl-3.0
4,685
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace MasterDatabaseExplorer.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); public static Settings Default { get { return defaultInstance; } } } }
asveredyuk/TimeMiner
project/MasterDatabaseExplorer/Properties/Settings.Designer.cs
C#
gpl-3.0
1,079
/****************************************************************************/ /// @file MSPhasedTrafficLightLogic.h /// @author Daniel Krajzewicz /// @date Sept 2002 /// @version $Id: MSPhasedTrafficLightLogic.h 22627 2017-01-18 12:56:36Z behrisch $ /// // The base class for traffic light logic with phases /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/ // Copyright (C) 2010-2017 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. // SUMO is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // /****************************************************************************/ #ifndef MSPhasedTrafficLightLogic_h #define MSPhasedTrafficLightLogic_h // =========================================================================== // included modules // =========================================================================== #ifdef _MSC_VER #include <windows_config.h> #else #include <config.h> #endif #include <utility> #include <vector> #include <bitset> #include <microsim/MSEventControl.h> #include <microsim/MSNet.h> #include "MSTrafficLightLogic.h" #include "MSPhaseDefinition.h" // =========================================================================== // class definitions // =========================================================================== /** * @class MSPhasedTrafficLightLogic * @brief A fixed traffic light logic * * The base class for a traffic light which switches between * it's phases and sets the lights to red in between. * Some functions are called with an information about the current step. This * is needed as a single logic may be used by many junctions and so the current * step is stored within them, not within methods. */ class MSPhasedTrafficLightLogic : public MSTrafficLightLogic { public: /** @brief Constructor * @param[in] tlcontrol The tls control responsible for this tls * @param[in] id This tls' id * @param[in] subid This tls' sub-id (program id) * @param[in] phases Definitions of the phases * @param[in] step The initial phase index * @param[in] delay The time to wait before the first switch */ MSPhasedTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& subid, const Phases& phases, int step, SUMOTime delay, const std::map<std::string, std::string>& parameters); /// @brief Destructor ~MSPhasedTrafficLightLogic(); /// @name Switching and setting current rows /// @{ /// MEMBER FACTORIZED TO PARENT CLASS (MSTrafficLightLogic) /** @brief Switches to the next phase * @param[in] isActive Whether this program is the currently used one * @return The time of the next switch * @see MSTrafficLightLogic::trySwitch */ /* SUMOTime trySwitch(bool isActive) throw();*/ /// @name Static Information Retrieval /// @{ /** @brief Returns the number of phases * @return The number of this tls program's phases * @see MSTrafficLightLogic::getPhaseNumber */ int getPhaseNumber() const; /** @brief Returns the phases of this tls program * @return The phases of this tls program * @see MSTrafficLightLogic::getPhases */ const Phases& getPhases() const; /** @brief Returns the definition of the phase from the given position within the plan * @param[in] givenstep The index of the phase within the plan * @return The definition of the phase at the given position * @see MSTrafficLightLogic::getPhase */ const MSPhaseDefinition& getPhase(int givenstep) const; /// @} /// @name Dynamic Information Retrieval /// @{ /** @brief Returns the current index within the program * @return The index of the current phase within the tls * @see MSTrafficLightLogic::getCurrentPhaseIndex */ int getCurrentPhaseIndex() const; /** @brief Returns the definition of the current phase * @return The current phase * @see MSTrafficLightLogic::getCurrentPhaseDef */ const MSPhaseDefinition& getCurrentPhaseDef() const; /// @} /// @name Conversion between time and phase /// @{ /** @brief Returns the index of the logic at the given simulation step * @return The (estimated) index of the tls at the given simulation time step * @see MSTrafficLightLogic::getPhaseIndexAtTime */ SUMOTime getPhaseIndexAtTime(SUMOTime simStep) const; /** @brief Returns the position (start of a phase during a cycle) from of a given step * @param[in] index The index of the phase to return the begin of * @return The begin time of the phase * @see MSTrafficLightLogic::getOffsetFromIndex */ SUMOTime getOffsetFromIndex(int index) const; /** @brief Returns the step (the phasenumber) of a given position of the cycle * @param[in] offset The offset (time) for which the according phase shall be returned * @return The according phase * @see MSTrafficLightLogic::getIndexFromOffset */ int getIndexFromOffset(SUMOTime offset) const; /// @} /// @name Changing phases and phase durations /// @{ /** @brief Changes the current phase and her duration * @param[in] tlcontrol The responsible traffic lights control * @param[in] simStep The current simulation step * @param[in] step Index of the phase to use * @param[in] stepDuration The left duration of the phase * @see MSTrafficLightLogic::changeStepAndDuration */ void changeStepAndDuration(MSTLLogicControl& tlcontrol, SUMOTime simStep, int step, SUMOTime stepDuration); /// @} /** @brief Replaces the phases and set the phase index */ void setPhases(const Phases& phases, int index); /// @} protected: /// @brief The list of phases this logic uses Phases myPhases; /// @brief Proceed to the next step void proceedToNextStep(); /// @brief Forces a specific step void setStep(int step); private: /// @brief frees memory responsibilities void deletePhases(); protected: /// @brief The current step int myStep; }; #endif /****************************************************************************/
702nADOS/sumo
src/microsim/traffic_lights/MSPhasedTrafficLightLogic.h
C
gpl-3.0
6,690
"""Feat components.""" from component_objects import Component, Element class FeatAddModal(Component): """Definition of feat add modal component.""" modal_div_id = 'addFeat' name_id = 'featAddNameInput' description_id = 'featAddDescriptionTextarea' tracked_id = 'featAddTrackedCheckbox' max_id = 'featAddMaxInput' short_rest_id = 'featAddShortRestInput' long_rest_id = 'featAddLongRestInput' add_id = 'featAddAddButton' modal_div = Element(id_=modal_div_id) name = Element(id_=name_id) description = Element(id_=description_id) tracked = Element(id_=tracked_id) max_ = Element(id_=max_id) short_rest = Element(id_=short_rest_id) long_rest = Element(id_=long_rest_id) add = Element(id_=add_id) class FeatEditModal(Component): """Definition of feat edit modal component.""" modal_div_id = 'viewWeapon' name_id = 'featEditNameInput' description_id = 'featEditDescriptionTextarea' tracked_id = 'featEditTrackedCheckbox' max_id = 'featEditMaxInput' short_rest_id = 'featEditShortRestInput' long_rest_id = 'featEditLongRestInput' done_id = 'featEditDoneButton' modal_div = Element(id_=modal_div_id) name = Element(id_=name_id) description = Element(id_=description_id) tracked = Element(id_=tracked_id) max_ = Element(id_=max_id) short_rest = Element(id_=short_rest_id) long_rest = Element(id_=long_rest_id) done = Element(id_=done_id) class FeatModalTabs(Component): """Definition of feat modal tabs component.""" preview_id = 'featModalPreview' edit_id = 'featModalEdit' preview = Element(id_=preview_id) edit = Element(id_=edit_id) class FeatsTable(Component): """Definition of feats edit modal componenet.""" add_id = 'featAddIcon' table_id = 'featTable' add = Element(id_=add_id) table = Element(id_=table_id)
adventurerscodex/uat
components/core/character/feats.py
Python
gpl-3.0
1,902
/* ** backtrace.c - ** ** See Copyright Notice in mruby.h */ #include <mruby.h> #include <mruby/variable.h> #include <mruby/proc.h> #include <mruby/array.h> #include <mruby/string.h> #include <mruby/class.h> #include <mruby/debug.h> #include <mruby/error.h> #include <mruby/numeric.h> #include <mruby/data.h> struct backtrace_location { int32_t lineno; mrb_sym method_id; const char *filename; }; typedef void (*each_backtrace_func)(mrb_state*, const struct backtrace_location*, void*); static const mrb_data_type bt_type = { "Backtrace", mrb_free }; mrb_value mrb_exc_inspect(mrb_state *mrb, mrb_value exc); mrb_value mrb_unpack_backtrace(mrb_state *mrb, mrb_value backtrace); static void each_backtrace(mrb_state *mrb, ptrdiff_t ciidx, const mrb_code *pc0, each_backtrace_func func, void *data) { ptrdiff_t i; if (ciidx >= mrb->c->ciend - mrb->c->cibase) ciidx = 10; /* ciidx is broken... */ for (i=ciidx; i >= 0; i--) { struct backtrace_location loc; mrb_callinfo *ci; mrb_irep *irep; const mrb_code *pc; ci = &mrb->c->cibase[i]; if (!ci->proc) continue; if (MRB_PROC_CFUNC_P(ci->proc)) continue; irep = ci->proc->body.irep; if (!irep) continue; if (mrb->c->cibase[i].err) { pc = mrb->c->cibase[i].err; } else if (i+1 <= ciidx) { if (!mrb->c->cibase[i + 1].pc) continue; pc = &mrb->c->cibase[i+1].pc[-1]; } else { pc = pc0; } loc.lineno = mrb_debug_get_line(mrb, irep, pc - irep->iseq); if (loc.lineno == -1) continue; loc.filename = mrb_debug_get_filename(mrb, irep, pc - irep->iseq); if (!loc.filename) { loc.filename = "(unknown)"; } loc.method_id = ci->mid; func(mrb, &loc, data); } } #ifndef MRB_DISABLE_STDIO static void print_backtrace(mrb_state *mrb, struct RObject *exc, mrb_value backtrace) { mrb_int i; mrb_int n = RARRAY_LEN(backtrace); mrb_value *loc, mesg; FILE *stream = stderr; if (n != 0) { fprintf(stream, "trace (most recent call last):\n"); for (i=n-1,loc=&RARRAY_PTR(backtrace)[i]; i>0; i--,loc--) { if (mrb_string_p(*loc)) { fprintf(stream, "\t[%d] %.*s\n", (int)i, (int)RSTRING_LEN(*loc), RSTRING_PTR(*loc)); } } if (mrb_string_p(*loc)) { fprintf(stream, "%.*s: ", (int)RSTRING_LEN(*loc), RSTRING_PTR(*loc)); } } mesg = mrb_exc_inspect(mrb, mrb_obj_value(exc)); fprintf(stream, "%.*s\n", (int)RSTRING_LEN(mesg), RSTRING_PTR(mesg)); } /* mrb_print_backtrace function to retrieve backtrace information from the last exception. */ MRB_API void mrb_print_backtrace(mrb_state *mrb) { mrb_value backtrace; if (!mrb->exc) { return; } backtrace = mrb_obj_iv_get(mrb, mrb->exc, mrb_intern_lit(mrb, "backtrace")); if (mrb_nil_p(backtrace)) return; if (!mrb_array_p(backtrace)) backtrace = mrb_unpack_backtrace(mrb, backtrace); print_backtrace(mrb, mrb->exc, backtrace); } #else MRB_API void mrb_print_backtrace(mrb_state *mrb) { } #endif static void count_backtrace_i(mrb_state *mrb, const struct backtrace_location *loc, void *data) { int *lenp = (int*)data; (*lenp)++; } static void pack_backtrace_i(mrb_state *mrb, const struct backtrace_location *loc, void *data) { struct backtrace_location **pptr = (struct backtrace_location**)data; struct backtrace_location *ptr = *pptr; *ptr = *loc; *pptr = ptr+1; } static mrb_value packed_backtrace(mrb_state *mrb) { struct RData *backtrace; ptrdiff_t ciidx = mrb->c->ci - mrb->c->cibase; int len = 0; int size; void *ptr; each_backtrace(mrb, ciidx, mrb->c->ci->pc, count_backtrace_i, &len); size = len * sizeof(struct backtrace_location); ptr = mrb_malloc(mrb, size); backtrace = mrb_data_object_alloc(mrb, NULL, ptr, &bt_type); backtrace->flags = (uint32_t)len; each_backtrace(mrb, ciidx, mrb->c->ci->pc, pack_backtrace_i, &ptr); return mrb_obj_value(backtrace); } void mrb_keep_backtrace(mrb_state *mrb, mrb_value exc) { mrb_sym sym = mrb_intern_lit(mrb, "backtrace"); mrb_value backtrace; int ai; if (mrb_iv_defined(mrb, exc, sym)) return; ai = mrb_gc_arena_save(mrb); backtrace = packed_backtrace(mrb); mrb_iv_set(mrb, exc, sym, backtrace); mrb_gc_arena_restore(mrb, ai); } mrb_value mrb_unpack_backtrace(mrb_state *mrb, mrb_value backtrace) { const struct backtrace_location *bt; mrb_int n, i; int ai; if (mrb_nil_p(backtrace)) { empty_backtrace: return mrb_ary_new_capa(mrb, 0); } if (mrb_array_p(backtrace)) return backtrace; bt = (struct backtrace_location*)mrb_data_check_get_ptr(mrb, backtrace, &bt_type); if (bt == NULL) goto empty_backtrace; n = (mrb_int)RDATA(backtrace)->flags; backtrace = mrb_ary_new_capa(mrb, n); ai = mrb_gc_arena_save(mrb); for (i = 0; i < n; i++) { const struct backtrace_location *entry = &bt[i]; mrb_value btline; btline = mrb_format(mrb, "%s:%d", entry->filename, (int)entry->lineno); if (entry->method_id != 0) { mrb_str_cat_lit(mrb, btline, ":in "); mrb_str_cat_cstr(mrb, btline, mrb_sym_name(mrb, entry->method_id)); } mrb_ary_push(mrb, backtrace, btline); mrb_gc_arena_restore(mrb, ai); } return backtrace; } MRB_API mrb_value mrb_exc_backtrace(mrb_state *mrb, mrb_value exc) { mrb_sym attr_name; mrb_value backtrace; attr_name = mrb_intern_lit(mrb, "backtrace"); backtrace = mrb_iv_get(mrb, exc, attr_name); if (mrb_nil_p(backtrace) || mrb_array_p(backtrace)) { return backtrace; } backtrace = mrb_unpack_backtrace(mrb, backtrace); mrb_iv_set(mrb, exc, attr_name, backtrace); return backtrace; } MRB_API mrb_value mrb_get_backtrace(mrb_state *mrb) { return mrb_unpack_backtrace(mrb, packed_backtrace(mrb)); }
ErikMinekus/sm-ripext
nghttp2/third-party/mruby/src/backtrace.c
C
gpl-3.0
5,808
Rscript method1-PigeonAllPups-1.R 11B_splitXY/100A-rmXY/0_cov5reads 1011B_splitXY/100A-rmXY/0_cov5reads/method1-PigeonAllPups-1/NC-vs-IVFfresh Rscript method1-PigeonAllPups-1.R 11B_splitXY/100A-rmXY/1_cov10reads 1011B_splitXY/100A-rmXY/1_cov10reads/method1-PigeonAllPups-1/NC-vs-IVFfresh Rscript method1-PigeonAllPups-1.R 11B_splitXY/100A-rmXY/2_cov20reads 1011B_splitXY/100A-rmXY/2_cov20reads/method1-PigeonAllPups-1/NC-vs-IVFfresh Rscript method1-PigeonAllPups-2.R 11B_splitXY/100A-rmXY/0_cov5reads 1011B_splitXY/100A-rmXY/0_cov5reads/method1-PigeonAllPups-2/NC-vs-IVFfrozen Rscript method1-PigeonAllPups-2.R 11B_splitXY/100A-rmXY/1_cov10reads 1011B_splitXY/100A-rmXY/1_cov10reads/method1-PigeonAllPups-2/NC-vs-IVFfrozen Rscript method1-PigeonAllPups-2.R 11B_splitXY/100A-rmXY/2_cov20reads 1011B_splitXY/100A-rmXY/2_cov20reads/method1-PigeonAllPups-2/NC-vs-IVFfrozen Rscript method1-PigeonAllPups-3.R 11B_splitXY/100A-rmXY/0_cov5reads 1011B_splitXY/100A-rmXY/0_cov5reads/method1-PigeonAllPups-3/NC-vs-ICSIfresh Rscript method1-PigeonAllPups-3.R 11B_splitXY/100A-rmXY/1_cov10reads 1011B_splitXY/100A-rmXY/1_cov10reads/method1-PigeonAllPups-3/NC-vs-ICSIfresh Rscript method1-PigeonAllPups-3.R 11B_splitXY/100A-rmXY/2_cov20reads 1011B_splitXY/100A-rmXY/2_cov20reads/method1-PigeonAllPups-3/NC-vs-ICSIfresh Rscript method1-PigeonAllPups-4.R 11B_splitXY/100A-rmXY/0_cov5reads 1011B_splitXY/100A-rmXY/0_cov5reads/method1-PigeonAllPups-4/NC-vs-ICSIfrozen Rscript method1-PigeonAllPups-4.R 11B_splitXY/100A-rmXY/1_cov10reads 1011B_splitXY/100A-rmXY/1_cov10reads/method1-PigeonAllPups-4/NC-vs-ICSIfrozen Rscript method1-PigeonAllPups-4.R 11B_splitXY/100A-rmXY/2_cov20reads 1011B_splitXY/100A-rmXY/2_cov20reads/method1-PigeonAllPups-4/NC-vs-ICSIfrozen
CTLife/SomeRecords
forRRBS/method1-PigeonAllPups.sh
Shell
gpl-3.0
1,961
#pragma once #include "gui/window.h" #include "common/udp.h" namespace D2K {namespace GUI {namespace Connection { class WindowClass : public GUI::Window { public: WindowClass(); ~WindowClass(); void SetVisible(bool visible); bool Update(); }; void ProcessCommandSettingsPacket(UDP::DS2KeyCommandSettingsPacket settings); extern GUI::Connection::WindowClass g_window; }}} // namespace D2K::GUI::Command
sypherce/ds2key
client/source/windows/connectionWindow.h
C
gpl-3.0
411
Rscript analyzeDMRs.R \ --file=5_DMR/2E_AlldiffMesites_q0.05_diff0.txt \ --outDir=5_DMR_Annotation \ --RefGenome=hg38 \ --RegionName=1000_Twins_AllPups_essential/A-rmXY/6_Analyze_Tiles_by_methylKit/1_NC1_vs_NC2/5_DMR \ > analyzeDMRs.runLog.txt 2>&1
CTLife/SomeRecords
forRRBS/merge_annotation/analyzeDMRs.sh
Shell
gpl-3.0
281
package introsde.rest.client; import java.net.URI; import javax.ws.rs.client.Client; import javax.ws.rs.client.ClientBuilder; import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriBuilder; import org.glassfish.jersey.client.ClientConfig; public class Test { public static void main(String[] args) { ClientConfig clientConfig = new ClientConfig(); Client client = ClientBuilder.newClient(clientConfig); WebTarget service = client.target(getBaseURI()); //1. http://localhost:5700/salutation/Cristhian?age=32 // // GET BASEURL/rest/helloworld // // Accept: text/plain System.out.println(service.path("salutation").request().accept(MediaType.TEXT_PLAIN).get().readEntity(String.class)); // 2. http://localhost:5700/salutation/Cristhian?age=32/salutation // // Get plain text System.out.println(service.path("salutation") .request().accept(MediaType.TEXT_PLAIN).get().readEntity(String.class)); // Get XML System.out.println(service.path("salutation") .request() .accept(MediaType.TEXT_XML).get().readEntity(String.class)); // // The HTML System.out.println(service.path("salutation").request() .accept(MediaType.TEXT_HTML).get().readEntity(String.class)); System.out.println(service.path("salutation").request() .accept(MediaType.APPLICATION_JSON).get().readEntity(String.class)); } private static URI getBaseURI() { return UriBuilder.fromUri( "http://localhost:5700/").build(); } }
IntroSDE/introsde
lab05/Examples/src/introsde/rest/client/Test.java
Java
gpl-3.0
1,518
#include "prizelistmodel.h" #include <QStringList> prizelistmodel::prizelistmodel(QObject *parent) : QAbstractListModel(parent) { content = new QStringList; } QVariant prizelistmodel::data(const QModelIndex &index, int role) const { if( !index.isValid() || index.row() > content->size() || (role != Qt::DisplayRole && role != Qt::EditRole) ) return QVariant(); if( index.row() == content->size() ) return QString(); else return content->at(index.row()); } bool prizelistmodel::setData(const QModelIndex &index, const QVariant &value, int role) { if( index.row() > content->size() || value.type() != QVariant::String || role != Qt::EditRole ) return false; bool ok = true; if( index.row() == content->size() ) ok = insertRows(index.row(),1,QModelIndex(),value.toString()); else (*content)[index.row()] = value.toString(); if( ok ) emit dataChanged(index,index); return ok; } int prizelistmodel::rowCount(const QModelIndex &) const { return content->size()+1; } Qt::ItemFlags prizelistmodel::flags(const QModelIndex &) const { return Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled; } QVariant prizelistmodel::headerData(int section, Qt::Orientation orientation, int role) const { if( role != Qt::DisplayRole ) return QVariant(); if( orientation == Qt::Horizontal ) return tr("Preis"); else //Qt::Vertical return section+1; } bool prizelistmodel::insertRows(int row, int count, const QModelIndex &parent, const QString &value) { if( row > content->size() || count == 0 ) return false; if( row < 0 ) row = 0; beginInsertRows(parent,row+1,row+count); for(int num = 0; num < count; num++) content->insert(row+1,value); endInsertRows(); return true; } bool prizelistmodel::removeRows(int row, int count, const QModelIndex &parent) { if( row < 0 || row >= content->size() ) return false; beginRemoveRows(parent,row,row+count-1); for(int num = 0; num < count; num++) content->removeAt(row); endRemoveRows(); return true; } void prizelistmodel::clear() { beginResetModel(); content->clear(); endResetModel(); } void prizelistmodel::newData() { beginResetModel(); endResetModel(); } bool prizelistmodel::moveRowDown(int row) { if( row < 0 || row >= content->size() ) //don't move the "pseudo-row" return false; if( row == content->size()-1 ) //we can't move anything below the pseudo-row, instead we insert a blank row above return insertRows(row-1,1,QModelIndex()); content->swap(row,row+1); emit dataChanged(createIndex(row,0),createIndex(row+1,0)); return true; } bool prizelistmodel::moveRowUp(int row) { if( row < 1 || row >= content->size() ) //don't move hightest row return false; content->swap(row-1,row); emit dataChanged(createIndex(row-1,0),createIndex(row,0)); return true; } bool prizelistmodel::duplicateRow(int row) { if( row < 0 || row >= content->size() ) return false; beginInsertRows(QModelIndex(),row+1,row+1); content->insert(row+1,content->at(row)); endInsertRows(); return true; }
flesniak/duckracer2
prizelistmodel.cpp
C++
gpl-3.0
3,254
/** * This file is part of alf.io. * * alf.io is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * alf.io is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with alf.io. If not, see <http://www.gnu.org/licenses/>. */ package alfio.manager.payment.saferpay; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.stream.JsonWriter; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import java.io.IOException; import java.io.StringWriter; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; @DisplayName("Request Header") class RequestHeaderBuilderTest { @Test void appendToComplete() throws IOException { var requestBuilder = new RequestHeaderBuilder("customerId", "requestId", 1); var out = new StringWriter(); requestBuilder.appendTo(new JsonWriter(out).beginObject()).endObject().flush(); checkJson(JsonParser.parseString(out.toString()).getAsJsonObject(), true); } @Test void appendToNoRetry() throws IOException { var requestBuilder = new RequestHeaderBuilder("customerId", "requestId", null); var out = new StringWriter(); requestBuilder.appendTo(new JsonWriter(out).beginObject()).endObject().flush(); checkJson(JsonParser.parseString(out.toString()).getAsJsonObject(), false); } private void checkJson(JsonObject json, boolean expectRetry) { var requestHeader = json.get("RequestHeader").getAsJsonObject(); assertEquals("customerId", requestHeader.get("CustomerId").getAsString()); assertEquals("requestId", requestHeader.get("RequestId").getAsString()); if(expectRetry) { assertEquals("1", requestHeader.get("RetryIndicator").getAsString()); } else { assertNull(requestHeader.get("RetryIndicator")); } } }
exteso/alf.io
src/test/java/alfio/manager/payment/saferpay/RequestHeaderBuilderTest.java
Java
gpl-3.0
2,377
/****************************************************************************/ /// @file SUMORouteLoader.h /// @author Daniel Krajzewicz /// @author Michael Behrisch /// @date Wed, 6 Nov 2002 /// @version $Id: SUMORouteLoader.h 13811 2013-05-01 20:31:43Z behrisch $ /// // A class that performs the loading of routes /****************************************************************************/ // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors /****************************************************************************/ // // This file is part of SUMO. // SUMO is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // /****************************************************************************/ #ifndef SUMORouteLoader_h #define SUMORouteLoader_h // =========================================================================== // included modules // =========================================================================== #ifdef _MSC_VER #include <windows_config.h> #else #include <config.h> #endif #include <utils/common/SUMOTime.h> // =========================================================================== // class declarations // =========================================================================== class SUMORouteHandler; class SUMOSAXReader; // =========================================================================== // class definitions // =========================================================================== /** * @class SUMORouteLoader */ class SUMORouteLoader { public: /// constructor SUMORouteLoader(SUMORouteHandler* handler); /// destructor ~SUMORouteLoader(); /** loads vehicles until a vehicle is read that starts after the specified time */ SUMOTime loadUntil(SUMOTime time); /// returns the information whether new data is available bool moreAvailable() const; private: /// the used SAXReader SUMOSAXReader* myParser; /// information whether more vehicles should be available bool myMoreAvailable; /// the used Handler SUMORouteHandler* myHandler; }; #endif /****************************************************************************/
rudhir-upretee/Sumo17_With_Netsim
src/utils/xml/SUMORouteLoader.h
C
gpl-3.0
2,462
#!/bin/sh # # This file is protected by Copyright. Please refer to the COPYRIGHT file # distributed with this source distribution. # # This file is part of GNUHAWK. # # GNUHAWK is free software: you can redistribute it and/or modify is under the # terms of the GNU General Public License as published by the Free Software # Foundation, either version 3 of the License, or (at your option) any later # version. # # GNUHAWK is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program. If not, see http://www.gnu.org/licenses/. # if [ "$1" = "rpm" ]; then # A very simplistic RPM build scenario if [ -e streams_to_vector_cc_3i.spec ]; then mydir=`dirname $0` tmpdir=`mktemp -d` cp -r ${mydir} ${tmpdir}/streams_to_vector_cc_3i-1.0.0 tar czf ${tmpdir}/streams_to_vector_cc_3i-1.0.0.tar.gz --exclude=".svn" -C ${tmpdir} streams_to_vector_cc_3i-1.0.0 rpmbuild -ta ${tmpdir}/streams_to_vector_cc_3i-1.0.0.tar.gz rm -rf $tmpdir else echo "Missing RPM spec file in" `pwd` exit 1 fi else for impl in cpp ; do cd $impl if [ -e build.sh ]; then ./build.sh $* elif [ -e reconf ]; then ./reconf && ./configure && make else echo "No build.sh found for $impl" fi cd - done fi
RedhawkSDR/integration-gnuhawk
components/streams_to_vector_cc_3i/build.sh
Shell
gpl-3.0
1,606
/* * QuestManager: An RPG plugin for the Bukkit API. * Copyright (C) 2015-2016 Github Contributors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package com.skyisland.questmanager.effects; import org.bukkit.Effect; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; /** * Effect signaling to the player that the entity they just interacted with was correct. * This EFFECT was made with the 'slay' requirement in mind, where it'll display effects when you kill * the right kind of enemy. * */ public class EntityConfirmEffect extends QuestEffect { private static final Effect EFFECT = Effect.STEP_SOUND; @SuppressWarnings("deprecation") private static final int BLOCK_TYPE = Material.EMERALD_BLOCK.getId(); /** * The number of particals */ private int magnitude; /** * * @param magnitude The number of particals, roughly */ public EntityConfirmEffect(int magnitude) { this.magnitude = magnitude; } @SuppressWarnings("deprecation") @Override public void play(Entity player, Location effectLocation) { if (!(player instanceof Player)) { return; } for (int i = 0; i < magnitude; i++) ((Player) player ) .playEffect(effectLocation, EFFECT, BLOCK_TYPE); } }
Dove-Bren/QuestManager
src/main/java/com/skyisland/questmanager/effects/EntityConfirmEffect.java
Java
gpl-3.0
1,904
/*====================================================================== maker :jiaxing.shen date :2014.12.10 email :55954781@qq.com ======================================================================*/ #include "m_include.h" #include "m_nvic.h" #include "m_eep.h" #include "stm32746g_discovery.h" #include "stm32f7xx_hal_flash.h" // //====================================================================== // 写入 //====================================================================== void c_eep::wirte(uint8 *source, uint32 tarAddr, uint16 len) { uint32_t FirstSector = 0, NbOfSectors = 0; uint32_t Address = 0, SECTORError = 0; __IO uint32_t data32 = 0 , MemoryProgramStatus = 0; FLASH_EraseInitTypeDef EraseInitStruct; // //------------------------------------ // 0. 关闭系统中断 nvic.globalDisable(); // //------------------------------------ // 1. 开启内部高速时钟 // RCC->CR |= ((uint32_t)RCC_CR_HSION); // while((RCC->CR & RCC_CR_HSIRDY) == 0); // //------------------------------------ // 2. 解锁 HAL_FLASH_Unlock(); // //------------------------------------ // 3. 擦除并写入数据 /* Get the 1st sector to erase */ FirstSector = GetSector(tarAddr); /* Get the number of sector to erase from 1st sector*/ NbOfSectors = 1; /* Fill EraseInit structure*/ EraseInitStruct.TypeErase = FLASH_TYPEERASE_SECTORS; EraseInitStruct.VoltageRange = FLASH_VOLTAGE_RANGE_3; EraseInitStruct.Sector = FirstSector; EraseInitStruct.NbSectors = NbOfSectors; if (HAL_FLASHEx_Erase(&EraseInitStruct, &SECTORError) != HAL_OK) { while (1) { /* Make LED1 blink (100ms on, 2s off) to indicate error in Erase operation */ BSP_LED_On(LED1); HAL_Delay(100); BSP_LED_Off(LED1); HAL_Delay(2000); } } Address = tarAddr; //while (Address < tarAddr) for(int i=0; i<len; i++) { if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_BYTE, Address, *source) == HAL_OK) { Address = Address + 1; source++; } else { /* Error occurred while writing data in Flash memory. User can add here some code to deal with this error */ while (1) { /* Make LED1 blink (100ms on, 2s off) to indicate error in Write operation */ BSP_LED_On(LED1); HAL_Delay(100); BSP_LED_Off(LED1); HAL_Delay(2000); } } } // EraseSector(tarAddr); // ProgramPage(tarAddr, len, source); // //------------------------------------ // 4. 锁定 HAL_FLASH_Lock(); // //------------------------------------ // 5. 关闭内部高速时钟 //RCC->CR &= ~((uint32_t)RCC_CR_HSION); // while(RCC->CR & RCC_CR_HSIRDY); // //------------------------------------ // 6. 开启中断 nvic.globalEnable(); } // //====================================================================== // 初始化EEP 功能 //====================================================================== /* * Initialize Flash Programming Functions * Parameter: adr: Device Base Address * clk: Clock Frequency (Hz) * fnc: Function Code (1 - Erase, 2 - Program, 3 - Verify) * Return Value: 0 - OK, 1 - Failed */ int c_eep::Init () { HAL_FLASH_Lock(); } // //====================================================================== // 结束解锁 //====================================================================== /* * De-Initialize Flash Programming Functions * Parameter: fnc: Function Code (1 - Erase, 2 - Program, 3 - Verify) * Return Value: 0 - OK, 1 - Failed */ int c_eep::UnInit () { HAL_FLASH_Unlock(); } // //====================================================================== // 扇区擦除 //====================================================================== /* * Erase Sector in Flash Memory * Parameter: adr: Sector Address * Return Value: 0 - OK, 1 - Failed */ int c_eep::EraseSector (unsigned long adr) { FLASH_Erase_Sector(adr,FLASH_VOLTAGE_RANGE_1);//? } // //====================================================================== // 页编程 //====================================================================== /* * Program Page in Flash Memory * Parameter: adr: Page Start Address * sz: Page Size * buf: Page Data * Return Value: 0 - OK, 1 - Failed */ int c_eep::ProgramPage (unsigned long adr, unsigned long sz, unsigned char *buf) { } /** * @brief Gets the sector of a given address * @param None * @retval The sector of a given address */ int c_eep::GetSector(uint32_t Address) { uint32_t sector = 0; if((Address < ADDR_FLASH_SECTOR_1) && (Address >= ADDR_FLASH_SECTOR_0)) { sector = FLASH_SECTOR_0; } else if((Address < ADDR_FLASH_SECTOR_2) && (Address >= ADDR_FLASH_SECTOR_1)) { sector = FLASH_SECTOR_1; } else if((Address < ADDR_FLASH_SECTOR_3) && (Address >= ADDR_FLASH_SECTOR_2)) { sector = FLASH_SECTOR_2; } else if((Address < ADDR_FLASH_SECTOR_4) && (Address >= ADDR_FLASH_SECTOR_3)) { sector = FLASH_SECTOR_3; } else if((Address < ADDR_FLASH_SECTOR_5) && (Address >= ADDR_FLASH_SECTOR_4)) { sector = FLASH_SECTOR_4; } else if((Address < ADDR_FLASH_SECTOR_6) && (Address >= ADDR_FLASH_SECTOR_5)) { sector = FLASH_SECTOR_5; } else if((Address < ADDR_FLASH_SECTOR_7) && (Address >= ADDR_FLASH_SECTOR_6)) { sector = FLASH_SECTOR_6; } else /* (Address < FLASH_END_ADDR) && (Address >= ADDR_FLASH_SECTOR_7) */ { sector = FLASH_SECTOR_7; } return sector; } // //====================================================================== c_eep eep; // //======================================================================
jackeyjiang/meizi_f7disc
GUIDemo/emwin_task/smarthome/fdm/m_eep.cpp
C++
gpl-3.0
6,013
/** ****************************************************************************** * \file LIB_EventQueue.c * \brief EventQueue execution class. * * For a detailed description, please refer to \a _ST_EventQueue_Handle_t * \author H. Zijlmans * \date 08-August-2016 ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "LIB_EventQueue.h" #include "LIB_Datatypes.h" #include "mxconstants.h" /** \addtogroup LIB * @{ */ /** \addtogroup Utils * @{ */ /** \addtogroup Eventqueue * This is the group containing the functions from the Eventqueue class. * @{ */ /** \addtogroup LIB_EventQueue_Private * This is the group containing the private functions from the EventQueue execution class. * @{ */ /* Private defines -----------------------------------------------------------*/ /** \brief The \a MAX_NUMBER_CALLBACKS defines the maximum number of callbacks that can be scheduled. * * This private MACRO should be tweaked to fit the application. Special care should be taken when * \a LIB_EventQueue_RegisterEventQueueAction() returns false, because this indicates more events are * scheduled than allowed by \a MAX_NUMBER_CALLBACKS. */ #define MAX_NUMBER_CALLBACKS EVENTQUEUE_QUEUE /* Private typedefs ----------------------------------------------------------*/ /** \brief _ST_EventQueue_Handle_t. * * The \a _ST_EventQueue_Handle_t struct may be used to register callbacks on the main loop. * The usage is as follows: * - \a LIB_EventQueue_Run() should be run in main loop * - Events can be scheduled by calling either \a LIB_EventQueue_RegisterEventQueueAction() or * \a LIB_EventQueue_RegisterPriorityEventQueueAction(). * - Events can be removed from the schedule executing \a LIB_EventQueue_UnRegisterEventQueueAction(). * - Additionally when used \a LIB_EventQueue_DumpEventQueueActions() can be used to dump the event queue. * - \a LIB_EventQueue_FindEventQueueAction() can be used to find an already scheduled event to prevent * duplicate queueing. * \todo The priority execution is not yet supported in eventqueue. */ typedef struct _ST_EventQueue_Handle_t ST_EventQueue_Handle_t; struct _ST_EventQueue_Handle_t { /** \brief pvAction pointer to the action callback that will be called on event. */ void (*pvAction )(void *); /** \brief pvUserData is a pointer to the scheduled callback userdata which can be used. When unused this should be set to 0. */ void *pvUserData; /** \brief Priority is a type \a _EN_EventQueue_Priority_t variable that indicates defines * the functions priority. * * The priority execution is not supported in the \a EventQueue_Run() function at this moment. */ EN_EventQueue_Priority_t enPriority; /** \brief usCountPeriod is used to store the N-number of times the function should be called on * \a LIB_EventQueue_Run() function execution. */ u16 usCountPeriod; /** \brief usCounter variable holds the current count for the function. This is used to determine * the execution in the \a LIB_EventQueue_Run() function. */ volatile u16 usCounter; /** \brief bActionUsed indicates if the callback is currently in use. */ volatile bool bActionUsed; /** \brief ubyCallbackUsers holds the amount of callbacks that are registered to the class. */ u8 ubyCallbackUsers; /** \brief pstNext is the pointer to the next action in the list. When this is 0, it's the last member. */ ST_EventQueue_Handle_t *pstNext; }; /* Private variables ---------------------------------------------------------*/ /** \brief The EventQueue_Callback is the static variable that holds the callback * registration. * * The number of callbacks that can be scheduled in \a LIB_EventQueue_Run() is limited * by the number \a MAX_NUMBER_CALLBACKS. */ static ST_EventQueue_Handle_t g_astEventQueue_Callback[MAX_NUMBER_CALLBACKS] = {{0}}; /** \brief s_RootEventQueue is a pointer to the static struct. */ static ST_EventQueue_Handle_t *g_pstRootEventQueue = 0; /* Private function prototypes -----------------------------------------------*/ ST_EventQueue_Handle_t *LIB_EventQueue_FindEventQueueAction(void (*pvHandler )(void *), void *pvUserData); /** @} */ /** @} */ /** @} */ /** @} */ /** \brief \a LIB_EventQueue_Run() is the function that should be called from main application to execute all registered actions * * When this function is executed in main loop it should be monitored for while loop starvation. Scheduling * long time processing callbacks to this function can cause this. */ void LIB_EventQueue_Run(void) { ST_EventQueue_Handle_t *pstAction = g_pstRootEventQueue; while (pstAction != 0) { if ((++pstAction->usCounter) == pstAction->usCountPeriod) { pstAction->usCounter = 0; pstAction->pvAction(pstAction->pvUserData); } pstAction = pstAction->pstNext; } } /** \brief LIB_EventQueue_FindEventQueueAction() can be used to find out if callbacks are already * registered in the \a _ST_EventQueue_Handle_t structure. * * \param pvHandler is the function pointer to the callback that is looked for in the struct. * \param pvUserData is the pointer to the userdata that is used in the callback. * \return The function return a pointer to a registered member if it exists. * \retval 0 will indicate the member is not already registered (with that userdata pointer) */ ST_EventQueue_Handle_t *LIB_EventQueue_FindEventQueueAction(void (*pvHandler )(void *), void* pvUserData) { ST_EventQueue_Handle_t *pstAction = g_pstRootEventQueue; while (pstAction != 0) { if ((pstAction->pvAction == pvHandler) && (pstAction->pvUserData == pvUserData)) { break; } pstAction = pstAction->pstNext; } return pstAction; } #ifdef EventQueue_DBG /** \brief \a LIB_EventQueue_DumpEventQueueActions() can be used to dump the current structure members. */ void LIB_EventQueue_DumpEventQueueActions(void) { ST_EventQueue_Handle_t *pstAction = g_pstRootEventQueue; printf("Priority Action UserData Counter CountPeriod CallbackUsers"); while (pstAction != 0) { printf("%-15s 0x%08X 0x%08X 0x%08X 0x%08X %2d", SYSTEM_PRINT_PRIORITY(pstAction->enPriority), pstAction->pvAction, pstAction->pvUserData, pstAction->usCounter, pstAction->usCountPeriod, pstAction->ubyCallbackUsers ); pstAction = pstAction->pstNext; } } #endif /** * \brief Un-Register a callback from the event queue. * \param pvHandler Callback to be unregistered * \param pvUserData Userdata used to identify callback in case it has been repeately registered * \return true if the callback was sucesfully unregistered, FALSE if the callback was not registered. */ bool LIB_EventQueue_UnRegisterEventQueueAction(void (*pvHandler )(void *), void* pvUserData) { ST_EventQueue_Handle_t *pstAction = g_pstRootEventQueue; ST_EventQueue_Handle_t *pstPrevAction = 0; while (pstAction != 0) { if ((pstAction->pvAction == pvHandler) && (pstAction->pvUserData == pvUserData)) { break; } pstPrevAction = pstAction; pstAction = pstAction->pstNext; } // Action not found if (pstAction == 0) { #ifdef EventQueue_DBG printf("System_UnRegisterEventQueueAction(): Cannot de-register eventqueue. Handler: 0x%08X, UserData: 0x%08X", pvHandler, pvUserData); #endif return false; } if (pstAction->ubyCallbackUsers == 1) { // Delete action from list if (pstPrevAction == 0) // Action is first in list { g_pstRootEventQueue = pstAction->pstNext; } else // Action is somewhere in middle of list { pstPrevAction->pstNext = pstAction->pstNext; } pstAction->pvUserData = 0; pstAction->usCounter = 0; pstAction->usCountPeriod = 0; pstAction->pvAction = 0; pstAction->enPriority = eEQLowPriority; pstAction->ubyCallbackUsers = 0; pstAction->bActionUsed = false; } else pstAction->ubyCallbackUsers--; return true; } /** * \brief Register a callback that is to be executed on the main loop. * \param pvHandler Callback to be registered * \param usCountN Call the event every N execution cycles * \param pvUserData Userdata to be passed to the callback * \param enPriority Priority of Action. Action is inserted after all actions with same priority * \retval true if the callback was successfully registered * \retval false otherwise (too-many callbacks registered or the callback was already registered). * */ bool LIB_EventQueue_RegisterPriorityEventQueueAction(void (*pvHandler )(void *), u16 usCountN, void* pvUserData, EN_EventQueue_Priority_t enPriority) { u8 ubyIndex; ST_EventQueue_Handle_t *pstAction, *pstNextAction, *pstPrevAction; //ASSERT(pvHandler); if (usCountN == 0) usCountN = 1; pstAction = LIB_EventQueue_FindEventQueueAction(pvHandler, pvUserData); // Action already registered if (pstAction != 0) { pstAction->ubyCallbackUsers++; return true; } // Find empty stop in list for (ubyIndex = 0; (ubyIndex < MAX_NUMBER_CALLBACKS); ubyIndex++) { if(g_astEventQueue_Callback[ubyIndex].bActionUsed == false) { g_astEventQueue_Callback[ubyIndex].bActionUsed = true; pstAction = &g_astEventQueue_Callback[ubyIndex]; break; } } if (pstAction == 0) { #ifdef EventQueue_DBG printf("System_RegisterEventQueueAction(): Max number of eventqueues registered. Handler: 0x%08X, UserData: 0x%08X", pvHandler, pvUserData); #endif return false; } // Fill in data pstAction->pvAction = pvHandler; pstAction->pvUserData = pvUserData; pstAction->usCounter = 0; pstAction->usCountPeriod = usCountN; pstAction->enPriority = enPriority; pstAction->ubyCallbackUsers = 1; // Find two nodes in list between which action needs to be inserted pstPrevAction = 0; pstNextAction = g_pstRootEventQueue; while (pstNextAction != 0) { if ((pstNextAction->enPriority < enPriority)) { break; } pstPrevAction = pstNextAction; pstNextAction = pstNextAction->pstNext; } // Add action to tree // First add link between new action and next action // Next brake link between prevAction and nextAction and connect new action pstAction->pstNext = pstNextAction; // First in list if (pstPrevAction == 0) g_pstRootEventQueue = pstAction; else pstPrevAction->pstNext = pstAction; return true; } /** \brief \a LIB_EventQueue_RegisterEventQueueAction() Register a callback that is to be executed on the main loop. * \param pvHandler Callback to be registered * \param usCountN Call the event every N execution cycles * \param pvUserData Userdata to be passed to the callback * \retval true if the callback was sucesfully registered * \retval false otherwise (too-many callbacks registered or the callback was already registered). */ bool LIB_EventQueue_RegisterEventQueueAction(void (*pvHandler )(void *), u16 usCountN, void* pvUserData) { return LIB_EventQueue_RegisterPriorityEventQueueAction(pvHandler, usCountN, pvUserData, eEQMediumPriority); }
hugozijlmans/LoRa_Sx1272
Software/LoRa/Src/LIB_EventQueue.c
C
gpl-3.0
11,270