repo_name
stringlengths 4
116
| path
stringlengths 3
942
| size
stringlengths 1
7
| content
stringlengths 3
1.05M
| license
stringclasses 15
values |
|---|---|---|---|---|
Traderain/Wolven-kit
|
CP77.CR2W/Types/cp77/AutoRevealStatListener.cs
|
381
|
using CP77.CR2W.Reflection;
using FastMember;
using static CP77.CR2W.Types.Enums;
namespace CP77.CR2W.Types
{
[REDMeta]
public class AutoRevealStatListener : gameScriptStatsListener
{
[Ordinal(0)] [RED("owner")] public wCHandle<gameObject> Owner { get; set; }
public AutoRevealStatListener(CR2WFile cr2w, CVariable parent, string name) : base(cr2w, parent, name) { }
}
}
|
gpl-3.0
|
M4nu/TeamSpeak3PHPFramework
|
docs/html/functions_0x65.html
|
8219
|
<!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>TeamSpeak 3 PHP Framework: Class Members</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>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</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">TeamSpeak 3 PHP Framework
 <span id="projectnumber">1.1.12</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li class="current"><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div id="navrow3" class="tabs2">
<ul class="tablist">
<li class="current"><a href="functions.html"><span>All</span></a></li>
<li><a href="functions_func.html"><span>Functions</span></a></li>
<li><a href="functions_vars.html"><span>Variables</span></a></li>
</ul>
</div>
<div id="navrow4" class="tabs3">
<ul class="tablist">
<li><a href="functions.html#index_0x24"><span>$</span></a></li>
<li><a href="functions_0x5f.html#index__"><span>_</span></a></li>
<li><a href="functions_0x61.html#index_a"><span>a</span></a></li>
<li><a href="functions_0x62.html#index_b"><span>b</span></a></li>
<li><a href="functions_0x63.html#index_c"><span>c</span></a></li>
<li><a href="functions_0x64.html#index_d"><span>d</span></a></li>
<li class="current"><a href="functions_0x65.html#index_e"><span>e</span></a></li>
<li><a href="functions_0x66.html#index_f"><span>f</span></a></li>
<li><a href="functions_0x67.html#index_g"><span>g</span></a></li>
<li><a href="functions_0x68.html#index_h"><span>h</span></a></li>
<li><a href="functions_0x69.html#index_i"><span>i</span></a></li>
<li><a href="functions_0x6b.html#index_k"><span>k</span></a></li>
<li><a href="functions_0x6c.html#index_l"><span>l</span></a></li>
<li><a href="functions_0x6d.html#index_m"><span>m</span></a></li>
<li><a href="functions_0x6e.html#index_n"><span>n</span></a></li>
<li><a href="functions_0x6f.html#index_o"><span>o</span></a></li>
<li><a href="functions_0x70.html#index_p"><span>p</span></a></li>
<li><a href="functions_0x72.html#index_r"><span>r</span></a></li>
<li><a href="functions_0x73.html#index_s"><span>s</span></a></li>
<li><a href="functions_0x74.html#index_t"><span>t</span></a></li>
<li><a href="functions_0x75.html#index_u"><span>u</span></a></li>
<li><a href="functions_0x76.html#index_v"><span>v</span></a></li>
<li><a href="functions_0x77.html#index_w"><span>w</span></a></li>
</ul>
</div>
</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('functions_0x65.html','');
</script>
<div id="doc-content">
<div class="contents">
<div class="textblock">Here is a list of all documented class members with links to the class documentation for each member:</div>
<h3><a class="anchor" id="index_e"></a>- e -</h3><ul>
<li>emit()
: <a class="el" href="class_team_speak3___helper___signal.html#a26e8fc61637d146b0347b7c9e09587ab">TeamSpeak3_Helper_Signal</a>
</li>
<li>encipher()
: <a class="el" href="class_team_speak3___helper___crypt.html#a0795a29c94afaf2e8642d7b9fe8aa0e7">TeamSpeak3_Helper_Crypt</a>
</li>
<li>encrypt()
: <a class="el" href="class_team_speak3___helper___crypt.html#a23ce290df045657a686c2802fe826a74">TeamSpeak3_Helper_Crypt</a>
</li>
<li>endsWith()
: <a class="el" href="class_team_speak3___helper___string.html#ab368725237c5ebff2116de6a8ba36c59">TeamSpeak3_Helper_String</a>
</li>
<li>ERROR
: <a class="el" href="class_team_speak3.html#a5e20ff014c021e5dc0f04777b272ec84">TeamSpeak3</a>
</li>
<li>escape()
: <a class="el" href="class_team_speak3___helper___string.html#ad1a297278673af0f99df8c8e2af09e9a">TeamSpeak3_Helper_String</a>
</li>
<li>EVENT
: <a class="el" href="class_team_speak3.html#a4dbceb88091137f08da2f78d893a22c9">TeamSpeak3</a>
</li>
<li>execute()
: <a class="el" href="class_team_speak3___node___abstract.html#af6811efc5065b8aadfd6792334ea6977">TeamSpeak3_Node_Abstract</a>
</li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Variables</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="footer">Generated on Sat Feb 18 2012 00:43:39 for TeamSpeak 3 PHP Framework 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>
|
gpl-3.0
|
D-Vaillant/julius
|
julius/__init__.py
|
51
|
from .main import create_random_key, vigenere, otp
|
gpl-3.0
|
kelubo/wfbook
|
电/电子/基础知识/Crystal晶振.md
|
639
|
# 石英晶体振荡器 Crystal
符号:B BC(Z,X或G)
## 分类
| 分类方式 | 种类 |
|------------|--------------------------------------------------------|
| 封装方式 | 金属封装,玻璃封装,陶瓷封装,塑料封装 |
| 频率精度 | 普通型,中精度型,高精度型 |
| 用途 | 通用晶体振荡器,时钟脉冲用振荡器,微处理器用振荡器,钟表用振荡器 |
| 引出电极数目 | 二端型,三端型,四端型 |
## 命名
|
gpl-3.0
|
sperner/Pro_Orth
|
dbop_lizenz.h
|
1854
|
/**
* Project: Programmier-Praktikum mit Datenbanken
* File name: dbop_lizenz.h
* Description: Database-Operation with Lizenz-Object
*
* @author: Julian Kaufmann & Sven Sperner
* @version $Id: gpl.txt,v 1.0 2010/06/05 15:00 sven Exp $
*
* @see The GNU Public License (GPL)
**/
/*
* 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, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DBOP_LIZENZ_H
#define DBOP_LIZENZ_H
#include <QDialog>
#include <QMessageBox>
#include <QPushButton>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QSqlError>
#include <QStringList>
#include "ui_dbop_lizenz.h"
#include "dbop_produkt.h"
#include "dbop_personenkunde.h"
#include <QDebug>
namespace Ui
{
class DBOp_Lizenz;
}
class DBOp_Lizenz : public QDialog
{
Q_OBJECT
public:
DBOp_Lizenz(QString Id,QWidget *parent = 0);
~DBOp_Lizenz();
protected:
void changeEvent(QEvent *aEvent);
private:
Ui::DBOp_Lizenz *ui;
QString lzId;
QSqlQuery *query;
void getAutoID();
void getProdukte();
void getPersonenkunden();
void getLizenz();
private slots:
void neuProdukt();
void neuPersonenkunde();
void insertLizenz();
void updateLizenz();
};
#endif // DBOP_LIZENZ_H
|
gpl-3.0
|
Legroupesuper/Objets--Chimiques--Java---INSA-4info
|
chemicalforall/doc/fr/insa/rennes/info/chemical/backend/class-use/SubSolution.html
|
28740
|
<!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_03-icedtea) on Thu May 31 16:38:10 CEST 2012 -->
<title>Uses of Class fr.insa.rennes.info.chemical.backend.SubSolution</title>
<meta name="date" content="2012-05-31">
<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 fr.insa.rennes.info.chemical.backend.SubSolution";
}
//-->
</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="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">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?fr/insa/rennes/info/chemical/backend//class-useSubSolution.html" target="_top">Frames</a></li>
<li><a href="SubSolution.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 fr.insa.rennes.info.chemical.backend.SubSolution" class="title">Uses of Class<br>fr.insa.rennes.info.chemical.backend.SubSolution</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="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a></span><span class="tabEnd"> </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="#org.chemicalmozart.model.implementations.reactionrules">org.chemicalmozart.model.implementations.reactionrules</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="#org.chemicalmozart.utils">org.chemicalmozart.utils</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="org.chemicalmozart.model.implementations.reactionrules">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a> in <a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/package-summary.html">org.chemicalmozart.model.implementations.reactionrules</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/package-summary.html">org.chemicalmozart.model.implementations.reactionrules</a> that return <a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a></span><span class="tabEnd"> </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><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">HarmonicRR4.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR4.html#get_barInCreationSolution()">get_barInCreationSolution</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">HarmonicRR2.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR2.html#get_barInCreationSolution()">get_barInCreationSolution</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">HarmonicRR1.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR1.html#get_barInCreationSolution()">get_barInCreationSolution</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">HarmonicRR3.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR3.html#get_barInCreationSolution()">get_barInCreationSolution</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">HarmonicRR6.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR6.html#get_barInCreationSolution()">get_barInCreationSolution</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">HarmonicRR5.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR5.html#get_barInCreationSolution()">get_barInCreationSolution</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">RythmicRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/RythmicRR.html#get_rythmeSolution()">get_rythmeSolution</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">StartMelodicRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/StartMelodicRR.html#get_sol()">get_sol</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">GetPitchRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/GetPitchRR.html#get_subSol()">get_subSol</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">MoveToResultRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/MoveToResultRR.html#get_subSolResult()">get_subSolResult</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">PickOneRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/PickOneRR.html#get_temporaryBar()">get_temporaryBar</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a></code></td>
<td class="colLast"><span class="strong">StructuralRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/StructuralRR.html#getSol()">getSol</a></strong>()</code> </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="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/package-summary.html">org.chemicalmozart.model.implementations.reactionrules</a> with parameters of type <a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a></span><span class="tabEnd"> </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">HarmonicRR4.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR4.html#set_barInCreationSolution(fr.insa.rennes.info.chemical.backend.SubSolution)">set_barInCreationSolution</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _barInCreationSolution)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">HarmonicRR2.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR2.html#set_barInCreationSolution(fr.insa.rennes.info.chemical.backend.SubSolution)">set_barInCreationSolution</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _barInCreationSolution)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">HarmonicRR1.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR1.html#set_barInCreationSolution(fr.insa.rennes.info.chemical.backend.SubSolution)">set_barInCreationSolution</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _barInCreationSolution)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">HarmonicRR3.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR3.html#set_barInCreationSolution(fr.insa.rennes.info.chemical.backend.SubSolution)">set_barInCreationSolution</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _barInCreationSolution)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">HarmonicRR6.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR6.html#set_barInCreationSolution(fr.insa.rennes.info.chemical.backend.SubSolution)">set_barInCreationSolution</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _barInCreationSolution)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">HarmonicRR5.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/HarmonicRR5.html#set_barInCreationSolution(fr.insa.rennes.info.chemical.backend.SubSolution)">set_barInCreationSolution</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _barInCreationSolution)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">RythmicRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/RythmicRR.html#set_rythmeSolution(fr.insa.rennes.info.chemical.backend.SubSolution)">set_rythmeSolution</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _rythmeSolution)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">StartMelodicRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/StartMelodicRR.html#set_sol(fr.insa.rennes.info.chemical.backend.SubSolution)">set_sol</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _sol)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">GetPitchRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/GetPitchRR.html#set_subSol(fr.insa.rennes.info.chemical.backend.SubSolution)">set_subSol</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _subSol)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">MoveToResultRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/MoveToResultRR.html#set_subSolResult(fr.insa.rennes.info.chemical.backend.SubSolution)">set_subSolResult</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _subSolResult)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">PickOneRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/PickOneRR.html#set_temporaryBar(fr.insa.rennes.info.chemical.backend.SubSolution)">set_temporaryBar</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _temporaryBar)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">StructuralRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/model/implementations/reactionrules/StructuralRR.html#setSol(fr.insa.rennes.info.chemical.backend.SubSolution)">setSol</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a> sol)</code> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList"><a name="org.chemicalmozart.utils">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a> in <a href="../../../../../../../org/chemicalmozart/utils/package-summary.html">org.chemicalmozart.utils</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../../../../../org/chemicalmozart/utils/package-summary.html">org.chemicalmozart.utils</a> that return <a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a></span><span class="tabEnd"> </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><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">StartToWriteRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/utils/StartToWriteRR.html#get_barSubSol()">get_barSubSol</a></strong>()</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">SolutionWriterRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/utils/SolutionWriterRR.html#get_resultSolution()">get_resultSolution</a></strong>()</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>></code></td>
<td class="colLast"><span class="strong">GetWriterRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/utils/GetWriterRR.html#get_subSol()">get_subSol</a></strong>()</code> </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="../../../../../../../org/chemicalmozart/utils/package-summary.html">org.chemicalmozart.utils</a> with parameters of type <a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a></span><span class="tabEnd"> </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">StartToWriteRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/utils/StartToWriteRR.html#set_barSubSol(fr.insa.rennes.info.chemical.backend.SubSolution)">set_barSubSol</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _barSubSol)</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">SolutionWriterRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/utils/SolutionWriterRR.html#set_resultSolution(fr.insa.rennes.info.chemical.backend.SubSolution)">set_resultSolution</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _resultSolution)</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><span class="strong">GetWriterRR.</span><code><strong><a href="../../../../../../../org/chemicalmozart/utils/GetWriterRR.html#set_subSol(fr.insa.rennes.info.chemical.backend.SubSolution)">set_subSol</a></strong>(<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolution</a><<a href="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolutionElements.html" title="class in fr.insa.rennes.info.chemical.backend">SubSolutionElements</a>> _subSol)</code> </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="../../../../../../../fr/insa/rennes/info/chemical/backend/SubSolution.html" title="class in fr.insa.rennes.info.chemical.backend">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?fr/insa/rennes/info/chemical/backend//class-useSubSolution.html" target="_top">Frames</a></li>
<li><a href="SubSolution.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>
|
gpl-3.0
|
acoene/vinamax
|
var.go
|
4996
|
package vinamax
import (
"log"
)
var (
//These variables can be set in the input files
B_ext func(t float64) (float64, float64, float64) // External applied field in T
B_ext_space func(t, x, y, z float64) (float64, float64, float64) // External applied field in T
Dt float64 = -1 // Timestep in s
Mindt float64 = 1e-20 //smallest allowed timestep
Maxdt float64 = 1 //largest allowed timestep
T float64 // Time in s
Alpha float64 = -1 // Gilbert damping constant
gammaoveralpha float64 //g/1+alfa^2
Temp float64 = -1 // Temperature in K
Ku1 float64 = 0 // Uniaxial anisotropy constant in J/m**3
Kc1 float64 = 0 // Cubic anisotropy constant in J/m**3
Errortolerance float64 = 1e-5
Thresholdbeta float64 = 0.3 // The threshold value for the FMM
demagtime float64
universe node // The entire universe of the simulation
FMM bool = false // Calculate demag with FMM method
Demag bool = true // Calculate demag
demagevery bool = false // Calculate demag only after certain interval
Adaptivestep bool = false
outdir string // The output directory
solver string = "dopri" // The solver used
outputinterval float64
maxtauwitht float64 = 0. //maximum torque during the simulations with temperature
// suggest_timestep bool = false
order int = 5 //the order of the solver
constradius float64
logradius_m float64
logradius_s float64
Tau0 float64 =1e-8
msatcalled bool = false
radiuscalled bool = false
constradiuscalled bool = false
logradiuscalled bool = false
uaniscalled bool = false
c1called bool = false
c2called bool = false
worldcalled bool = false
magnetisationcalled bool = false
treecalled bool = false
outputcalled bool = false
randomseedcalled bool = false
tableaddcalled bool = false
Jumpnoise bool = false
Brown bool = false
)
//initialised B_ext functions
func init() {
B_ext = func(t float64) (float64, float64, float64) { return 0, 0, 0 } // External applied field in T
B_ext_space = func(t, x, y, z float64) (float64, float64, float64) { return 0, 0, 0 } // External applied field in T
}
//demag every interval
func Demagevery(t float64) {
demagevery = true
demagtime = t
}
//test the inputvalues for unnatural things
func testinput() {
if Demag == true && demagevery == true {
log.Fatal("You cannot call both Demagevery and Demag, pick one")
}
if Dt < 0 {
log.Fatal("Dt cannot be smaller than 0, did you forget to initialise?")
}
if Alpha < 0 {
log.Fatal("Alpha cannot be smaller than 0, did you forget to initialise?")
}
if Temp < 0 {
log.Fatal("Temp cannot be smaller than 0, did you forget to initialise?")
}
if universe.number == 0 {
log.Fatal("There are no particles in the geometry")
}
}
//checks the inputfiles for functions that should have been called but weren't
func syntaxrun() {
if msatcalled == false {
log.Fatal("You have to specify msat")
}
if radiuscalled == false {
log.Fatal("You have to specify the size of the particles")
}
if uaniscalled == false && Ku1 != 0 {
log.Fatal("You have to specify the uniaxial anisotropy-axis")
}
if (c1called == false || c2called == false) && Kc1 != 0 {
log.Fatal("You have to specify the cubic anisotropy-axes")
}
if worldcalled == false {
log.Fatal("You have define a \"World\"")
}
if magnetisationcalled == false {
log.Fatal("You have specify the initial magnetisation")
}
if treecalled == false && FMM == true {
log.Fatal("You have to run Maketree() as last command in front of Run() when using the FMM method")
}
if Temp != 0 && randomseedcalled == false {
log.Fatal("You have to run Setrandomseed() when using nonzero temperatures")
}
if tableaddcalled == true && outputcalled == false {
log.Fatal("You have to run Output(interval) when calling tableadd")
}
if Brown == true && Adaptivestep == true {
log.Fatal("Brown Temperature can only be used with fixed timestep")
}
if Jumpnoise == true {
resetswitchtimes(universe.lijst)
}
if Temp != 0 && Brown == false && Jumpnoise == false {
log.Fatal("You have to specify which temperature you want to use: \"Jumpnoise\" or \"Brown\"")
}
if Brown {
calculatetempnumbers(universe.lijst)
}
}
|
gpl-3.0
|
chc2212/Xelnaga-Starcraft-game-AI-bot-AIIDE2014
|
src/src/DefenseManager.cpp
|
9063
|
#include <DefenseManager.h>
#include <BorderManager.h>
using namespace BWAPI;
DefenseManager::DefenseManager(Arbitrator::Arbitrator<BWAPI::Unit*,double>* arbitrator)
{
firsss2 = false; //chc
very_early_rush = false;
early_attack_assimi = true;
very_early_attack_gate = true;
early_attack_gate = true;
early_rush =false;
firsss=false;
lastFrameCheck = 0;
this->arbitrator = arbitrator;
}
void DefenseManager::setBorderManager(BorderManager* borderManager)
{
this->borderManager=borderManager;
}
void DefenseManager::setBaseManager(BaseManager *baseManager)
{
this->baseManager = baseManager;
}
void DefenseManager::setInformationManager(InformationManager *informationManager)
{
this->informationManager = informationManager;
}
std::set<BWAPI::Unit*>& DefenseManager::getIdleDefenders()
{
idleDefenders.clear();
for (std::map<BWAPI::Unit*, DefenseData>::iterator it = defenders.begin(); it != defenders.end(); it++)
{
if ((it->second.mode == DefenseData::Idle) || (it->second.mode == DefenseData::Moving))
idleDefenders.insert(it->first);
}
return idleDefenders;
}
void DefenseManager::onOffer(std::set<BWAPI::Unit*> units)
{
for(std::set<BWAPI::Unit*>::iterator u = units.begin(); u != units.end(); u++)
{
if (defenders.find(*u) == defenders.end())
{
arbitrator->accept(this, *u);
DefenseData temp;
defenders.insert(std::make_pair(*u, temp));
}
}
}
void DefenseManager::onRevoke(BWAPI::Unit* unit, double bid)
{
defenders.erase(unit);
}
void DefenseManager::onRemoveUnit(BWAPI::Unit* unit)
{
defenders.erase(unit);
}
void DefenseManager::update()
{
//chc
int enemy_assimilator = 0;
int enemy_gateway = 0;
for (std::set<BWAPI::Unit *>::const_iterator en = Broodwar->enemy()->getUnits().begin(); en != BWAPI::Broodwar->enemy()->getUnits().end(); ++en)
{
if((*en)->getType() == BWAPI::UnitTypes::Protoss_Assimilator)
enemy_assimilator++;
if((*en)->getType() == BWAPI::UnitTypes::Protoss_Gateway)
enemy_gateway++;
}
if(enemy_assimilator == 0)
early_attack_assimi = false;
if(enemy_gateway >= 2)
early_attack_gate = false;
if(enemy_gateway >=3)
very_early_attack_gate = false;
if(!very_early_rush && !firsss2)
{
if(BWAPI::Broodwar->self()->allUnitCount(BWAPI::UnitTypes::Protoss_Cybernetics_Core) == 1)
{
if(Broodwar->self()->incompleteUnitCount(UnitTypes::Protoss_Cybernetics_Core) != 1) // »çÀ̹ö ³×½ºÆ½Äھ Áö¾îÁö°í ÀÖ´Â µµÁßÀÌ ¾Æ´Ï¶ó¸é
firsss2 = true; //´õ ÀÌ»ó ÀÌ if¹®À¸·Î ¸øµé¾î¿È.
if(!very_early_attack_gate && early_attack_assimi == false)
very_early_rush = true;
}
}
if ((lastFrameCheck == 0) || (BWAPI::Broodwar->getFrameCount() > lastFrameCheck + 10))
{
lastFrameCheck = BWAPI::Broodwar->getFrameCount();
// Bid on all completed military units
std::set<BWAPI::Unit*> myPlayerUnits=BWAPI::Broodwar->self()->getUnits();
for (std::set<BWAPI::Unit*>::iterator u = myPlayerUnits.begin(); u != myPlayerUnits.end(); u++)
{
if ((*u)->isCompleted() &&
!(*u)->getType().isWorker() &&
!(*u)->getType().isBuilding() &&
(*u)->getType().canAttack() &&
(*u)->getType() != BWAPI::UnitTypes::Zerg_Egg &&
(*u)->getType() != BWAPI::UnitTypes::Zerg_Larva)
{
arbitrator->setBid(this, *u, 20);
}
}
bool borderUpdated=false;
if (myBorder!=borderManager->getMyBorder())
{
myBorder=borderManager->getMyBorder();
borderUpdated=true;
}
//search among our bases which ones are in a border region
std::vector<Base*> borderBases;
for each (Base *base in baseManager->getAllBases())
{
bool isBorderBase = false;
for each (BWTA::Chokepoint *c in base->getBaseLocation()->getRegion()->getChokepoints())
{
if (myBorder.find(c) != myBorder.end())
{
isBorderBase = true;
break;
}
}
if (isBorderBase)
borderBases.push_back(base);
}
std::set<BWTA::BaseLocation*> enemyBasesLocation = informationManager->getEnemyBases();
myBorderVector.clear();
for(int i=0; i < (int)borderBases.size(); i++)
{
//search the nearest enemy base from current borderBases[i]
BWTA::BaseLocation *nearestEnemyBaseLocation;
double shortestDistance = 9999999;
for each (BWTA::BaseLocation *bl in enemyBasesLocation)
{
double distance = borderBases[i]->getBaseLocation()->getGroundDistance(bl);
if (distance < shortestDistance)
{
shortestDistance = distance;
nearestEnemyBaseLocation = bl;
}
}
if (nearestEnemyBaseLocation == NULL)
nearestEnemyBaseLocation = informationManager->getEnemyStartLocation();
//now search the nearest choke of borderBases[i] from the enemy base
BWTA::Chokepoint *bestChoke;
shortestDistance = 9999999;
for each(BWTA::Chokepoint *c in borderBases[i]->getBaseLocation()->getRegion()->getChokepoints())
{
double distance = nearestEnemyBaseLocation->getPosition().getApproxDistance(c->getCenter());
if (distance < shortestDistance)
{
shortestDistance = distance;
bestChoke = c;
}
}
myBorderVector.push_back(bestChoke);
}
//Order all units to choke
/*
int i=0;
if (!myBorder.empty())
{
for (std::map<BWAPI::Unit*,DefenseData>::iterator u = defenders.begin(); u != defenders.end(); u++)
{
if ((*u).second.mode == DefenseData::Idle || borderUpdated)
{
BWAPI::Position chokePosition=myBorderVector[i]->getCenter();
i++;
if (i>=(int)myBorderVector.size())
i=0;
(*u).first->attack(chokePosition);
(*u).second.mode = DefenseData::Moving;
}
}
}
*/
/*
//Àû ÃÊÅ©Æ÷ÀÎÆ®Å×½ºÆ®
if (enemyBorder!=borderManager->getEnemyBorder())
{
enemyBorder=borderManager->getEnemyBorder();
enemyBorderVector.clear();
for(std::set<BWTA::Chokepoint*>::iterator i=enemyBorder.begin();i!=enemyBorder.end();i++)
enemyBorderVector.push_back(*i);
//borderUpdated=true;
}
//Order all units to choke
int i=0;
if (!enemyBorder.empty())
{
for (std::map<BWAPI::Unit*,DefenseData>::iterator u = defenders.begin(); u != defenders.end(); u++)
{
BWAPI::Position chokePosition2=enemyBorderVector[i]->getCenter();
i++;
if (i>=(int)myBorderVector.size())
i=0;
// (*u).first->attackMove(chokePosition);
// (*u).second.mode = DefenseData::Moving;
} }
*/
//////////////////
//ÇÁ·ÎÅ佺À̸é
if((Broodwar->enemy()->getRace() == Races::Protoss || Broodwar->enemy()->getRace() == Races::Zerg || Broodwar->enemy()->getRace() == Races::Terran) && very_early_rush == false) //chc¼öÁ¤
{
round = (int)myBorderVector.size() - 1;
if (!myBorder.empty())
{
for (std::map<BWAPI::Unit*,DefenseData>::iterator u = defenders.begin(); u != defenders.end(); u++)
{
if (u->first->isIdle())
{
u->second.mode = DefenseData::Idle;
}
if (u->second.mode == DefenseData::Idle || borderUpdated)
{
BWAPI::Position chokePosition=myBorderVector[round]->getCenter();
round--;
if (round < 0)
round = (int)myBorderVector.size() - 1;
//wait to the 2/3 between your current position and the center of the choke to protect
int borderBasesSize = (int)borderBases.size();
BWAPI::Position lastBase = borderBases[borderBasesSize - round - 1]->getBaseLocation()->getPosition();
int x_wait = chokePosition.x() - lastBase.x();
int y_wait = chokePosition.y() - lastBase.y();
x_wait = (x_wait / 4) * 3;
y_wait = (y_wait / 4) * 3;
x_wait += lastBase.x();
y_wait += lastBase.y();
BWAPI::Position waitPosition(x_wait, y_wait);
(*u).first->attack(waitPosition);
(*u).second.mode = DefenseData::Moving;
}
if (u->first->isUnderAttack())
{
std::set<BWAPI::Unit *> backup = this->getIdleDefenders();
for each (BWAPI::Unit *bck in backup)
{
bck->attack(u->first->getPosition());
defenders[bck].mode = DefenseData::Defending;
}
}
}
}
}
// round = (int)myBorderVector.size() - 1;
else
{
int i=0;
if (!myBorder.empty())
{
for (std::map<BWAPI::Unit*,DefenseData>::iterator u = defenders.begin(); u != defenders.end(); u++)
{
if (u->first->isIdle())
{
u->second.mode = DefenseData::Idle;
}
if (u->second.mode == DefenseData::Idle || borderUpdated)
{
BWAPI::Position chokePosition=myBorderVector[i]->getCenter();
i++;
if (i>=(int)myBorderVector.size())
i=0;
(*u).first->attack(chokePosition);
(*u).second.mode = DefenseData::Moving;
}
if (u->first->isUnderAttack())
{
std::set<BWAPI::Unit *> backup = this->getIdleDefenders();
for each (BWAPI::Unit *bck in backup)
{
bck->attack(u->first->getPosition());
defenders[bck].mode = DefenseData::Defending;
}
}
}
}
}
}
}
std::string DefenseManager::getName() const
{
return "Defense Manager";
}
std::string DefenseManager::getShortName() const
{
return "Def";
}
|
gpl-3.0
|
rafaellc28/Portfolio
|
doc/api/files/__/__/_rvm/gems/ruby-2_1_1/gems/railties-4_2_0/lib/rails/console/app_rb.html
|
2778
|
<?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>app.rb</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>
app.rb
</h1>
<ul class="files">
<li>
../../.rvm/gems/ruby-2.1.1/gems/railties-4.2.0/lib/rails/console/app.rb
</li>
<li>Last modified: 2015-02-02 12:12:31 -0200</li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- File only: requires -->
<div class="sectiontitle">Required Files</div>
<ul>
<li>active_support/all</li>
<li>action_controller</li>
</ul>
<!-- Namespace -->
<div class="sectiontitle">Namespace</div>
<ul>
<li>
<span class="type">MODULE</span>
<a href="../../../../../../../../../../../classes/ActionDispatch.html">ActionDispatch</a>
</li>
<li>
<span class="type">MODULE</span>
<a href="../../../../../../../../../../../classes/ActionDispatch/Integration.html">ActionDispatch::Integration</a>
</li>
<li>
<span class="type">MODULE</span>
<a href="../../../../../../../../../../../classes/Rails.html">Rails</a>
</li>
<li>
<span class="type">MODULE</span>
<a href="../../../../../../../../../../../classes/Rails/ConsoleMethods.html">Rails::ConsoleMethods</a>
</li>
</ul>
<!-- Methods -->
</div>
</div>
</body>
</html>
|
gpl-3.0
|
robbyn/easyguest
|
legal/license_de.html
|
51476
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.2 (Linux)">
<META NAME="AUTHOR" CONTENT="Maurice Perry">
<META NAME="CREATED" CONTENT="20070909;10282500">
<META NAME="CHANGEDBY" CONTENT="Maurice Perry">
<META NAME="CHANGED" CONTENT="20070909;10291300">
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H1 ALIGN=CENTER>GNU General Public License
</H1>
<P><STRONG>Deutsche Übersetzung der Version 3, 29. Juni 2007 </STRONG>
</P>
<P><EM>Den offiziellen englischen Originaltext finden Sie unter
<A HREF="http://www.gnu.org/licenses/gpl.html">http://www.gnu.org/licenses/gpl.html</A>.
</EM>
</P>
<BLOCKQUOTE>Deutsche Übersetzung: <A HREF="http://www.peter.gerwinski.de/">Peter
Gerwinski</A>, 5.7.2007
</BLOCKQUOTE>
<BLOCKQUOTE>Dies ist eine inoffizielle deutsche Übersetzung der
GNU General Public License, die nicht von der Free Software
Foundation herausgegeben wurde. Es handelt sich hierbei <EM>nicht</EM>
um eine rechtsgültige Festlegung der Bedingungen für die
Weitergabe von Software, die der GNU GPL unterliegt; dies leistet nur
der englische Originaltext. Wir hoffen jedoch, daß diese
Übersetzung deutschsprachigen Lesern helfen wird, die GNU GPL
besser zu verstehen.
</BLOCKQUOTE>
<BLOCKQUOTE><EM>This is an unofficial translation of the GNU General
Public License into German. It was not published by the Free Software
Foundation, and does not legally state the distribution terms for
software that uses the GNU GPL—only the original English text of
the GNU GPL does that. However, we hope that this translation will
help German speakers understand the GNU GPL better. </EM>
</BLOCKQUOTE>
<H1 ALIGN=CENTER>GNU General Public License</H1>
<P ALIGN=CENTER><STRONG>Deutsche Übersetzung der Version 3, 29.
Juni 2007 </STRONG>
</P>
<P ALIGN=CENTER><STRONG>Copyright © 2007 Free Software
Foundation, Inc. (<A HREF="http://fsf.org/">http://fsf.org/</A>) 51
Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA </STRONG>
</P>
<P>Es ist jedermann gestattet, diese Lizenzurkunde zu vervielfältigen
und unveränderte Kopien zu verbreiten; Änderungen sind
jedoch nicht erlaubt.
</P>
<P><STRONG>Diese Übersetzung ist kein rechtskräftiger
Ersatz für die <A HREF="http://www.gnu.org/licenses/gpl.html">englischsprachige
Originalversion</A>! </STRONG>
</P>
<H2>Vorwort</H2>
<P>Die GNU General Public License – die Allgemeine Öffentliche
GNU-Lizenz – ist eine freie Copyleft-Lizenz für Software und
andere Arten von Werken.
</P>
<P>Die meisten Lizenzen für Software und andere nutzbaren Werke
sind daraufhin entworfen worden, Ihnen die Freiheit zu nehmen, die
Werke mit anderen zu teilen und zu verändern. Im Gegensatz dazu
soll Ihnen die <EM>GNU General Public License</EM> die Freiheit
garantieren, alle Versionen eines Programms zu teilen und zu
verändern. Sie soll sicherstellen, daß die Software für
alle ihre Benutzer frei bleibt. Wir, die Free Software Foundation,
nutzen die GNU General Public License für den größten
Teil unserer Software; sie gilt außerdem für jedes andere
Werk, dessen Autoren es auf diese Weise freigegeben haben. Auch Sie
können diese Lizenz auf Ihre Programme anwenden.
</P>
<P>Wenn wir von freier Software sprechen, so beziehen wir uns auf
Freiheit, nicht auf den Preis. Unsere Allgemeinen Öffentlichen
Lizenzen sind darauf angelegt, sicherzustellen, daß Sie die
Freiheit haben, Kopien freier Software zu verbreiten (und dafür
etwas zu berechnen, wenn Sie möchten), die Möglichkeit, daß
Sie die Software als Quelltext erhalten oder den Quelltext auf Wunsch
bekommen, daß Sie die Software ändern oder Teile davon in
neuen freien Programmen verwenden dürfen und daß Sie
wissen, daß Sie dies alles tun dürfen.
</P>
<P>Um Ihre Rechte zu schützen, müssen wir andere daran
hindern, Ihnen diese Rechte zu verweigern oder Sie aufzufordern, auf
diese Rechte zu verzichten. Aus diesem Grunde tragen Sie eine
Verantwortung, wenn Sie Kopien der Software verbreiten oder die
Software verändern: die Verantwortung, die Freiheit anderer zu
respektieren.
</P>
<P>Wenn Sie beispielsweise die Kopien eines solchen Programms
verbreiten – kostenlos oder gegen Bezahlung – müssen Sie an
die Empfänger dieselben Freiheiten weitergeben, die Sie selbst
erhalten haben. Sie müssen sicherstellen, daß auch die
Empfänger die Software im Quelltext erhalten bzw. den
Quelltext erhalten können. Und Sie müssen ihnen diese
Bedingungen zeigen, damit sie ihre Rechte kennen.
</P>
<P>Software-Entwickler, die die GNU GPL nutzen, schützen Ihre
Rechte in zwei Schritten: (1) Sie machen ihr Urheberrecht (Copyright)
auf die Software geltend, und (2) sie bieten Ihnen diese Lizenz an,
die Ihnen das Recht gibt, die Software zu vervielfältigen, zu
verbreiten und/oder zu verändern.
</P>
<P>Um die Entwickler und Autoren zu schützen, stellt die GPL
darüberhinaus klar, daß für diese freie Software
keinerlei Garantie besteht. Um sowohl der Anwender als auch der
Autoren Willen erfordert die GPL, daß modifizierte Versionen
der Software als solche gekennzeichnet werden, damit Probleme mit der
modifizierten Software nicht fälschlicherweise mit den Autoren
der Originalversion in Verbindung gebracht werden.
</P>
<P>Manche Geräte sind daraufhin entworfen worden, ihren
Anwendern zu verweigern, modifizierte Versionen der darauf laufenden
Software zu installieren oder laufen zu lassen, wohingegen der
Hersteller diese Möglichkeit hat. Dies ist grundsätzlich
unvereinbar mit dem Ziel, die Freiheit der Anwender zu schützen,
die Software zu modifizieren. Derartige gezielte mißbräuchliche
Verhaltensmuster finden auf dem Gebiet persönlicher
Gebrauchsgegenstände statt – also genau dort, wo sie am
wenigsten akzeptabel sind. Aus diesem Grunde wurde diese Version der
GPL daraufhin entworfen, diese Praxis für diese Produkte zu
verbieten. Sollten derartige Probleme substantiell auf anderen
Gebieten auftauchen, sind wir bereit, diese Regelung auf diese
Gebiete auszudehnen, soweit dies notwendig ist, um die Freiheit der
Benutzer zu schützen.
</P>
<P>Schließlich und endlich ist jedes Computerprogramm permanent
durch Software-Patente bedroht. Staaten sollten es nicht zulassen,
daß Patente die Entwicklung und Anwendung von Software für
allgemein einsetzbare Computer einschränken, aber in Staaten, wo
dies geschieht, wollen wir die spezielle Gefahr vermeiden, daß
Patente dazu verwendet werden, ein freies Programm im Endeffekt
proprietär zu machen. Um dies zu verhindern, stellt die GPL
sicher, daß Patente nicht verwendet werden können, um das
Programm nicht-frei zu machen.
</P>
<P>Es folgen die präzisen Bedingungen für das Kopieren,
Verbreiten und Modifizieren.
</P>
<H2>LIZENZBEDINGUNGEN</H2>
<H3>0. Definitionen</H3>
<P>„Diese Lizenz“ bezieht sich auf die Version 3 der GNU General
Public License.
</P>
<P>Mit „Urheberrecht“ sind auch urheberrechtähnliche Rechte
gemeint, die auf andere Arten von Werken Anwendung finden,
beispielsweise auf Fotomasken in der Halbleitertechnologie.
</P>
<P>„Das Programm“ bezeichnet jedes urheberrechtlich schützbare
Werk, das unter diese Lizenz gestellt wurde. Jeder Lizenznehmer wird
als „Sie“ angeredet. „Lizenznehmer“ und „Empfänger“
können natürliche oder rechtliche Personen sein.
</P>
<P>Ein Werk zu „modifizieren“ bedeutet, aus einem Werk zu
kopieren oder es ganz oder teilweise auf eine Weise umzuarbeiten, die
eine urheberrechtliche Erlaubnis erfordert und kein
Eins-zu-eins-Kopieren darstellt. Das daraus hervorgehende Werk wird
als „modifizierte Version“ des früheren Werks oder als auf
dem früheren Werk „basierendes“ Werk bezeichnet.
</P>
<P>Ein „betroffenes Werk“ bezeichnet entweder das unmodifizierte
Programm oder ein auf dem Programm basierendes Werk.
</P>
<P>Ein Werk zu „propagieren“ bezeichnet jedwede Handlung mit dem
Werk, für die man wegen Verletzung anwendbaren Urheberrechts
direkt oder indirekt zur Verantwortung gezogen würde,
ausgenommen das Ausführen auf einem Computer oder das
Modifizieren einer privaten Kopie. von Modifikationen, die an
niemanden weitergegeben werden. Unter das Propagieren eines Werks
fallen Kopieren, Weitergeben (mit oder ohne Modifikationen),
öffentliches Zugänglichmachen und in manchen Staaten noch
weitere Tätigkeiten.
</P>
<P>Ein Werk zu „übertragen“ bezeichnet jede Art von
Propagation, die es Dritten ermöglicht, das Werk zu kopieren
oder Kopien zu erhalten. Reine Interaktion mit einem Benutzer über
ein Computer-Netzwerk ohne Übergabe einer Kopie ist keine
Übertragung.
</P>
<P>Eine interaktive Benutzerschnittstelle zeigt „angemessene
rechtliche Hinweise“ in dem Umfang, daß sie eine
zweckdienliches und deutlich sichtbare Funktion bereitstellt, die (1)
einen angemessenen Copyright-Vermerk zeigt und (2) dem Benutzer
mitteilt, daß keine Garantie für das Werk besteht
(ausgenommen in dem Umfang, in dem Garantie gewährt wird), daß
Lizenznehmer das Werk gemäß dieser Lizenz übertragen
dürfen und wie man ein Exemplar dieser Lizenz zu Gesicht
bekommen kann. Wenn die Benutzerschnittstelle eine Liste von
Benutzerkommandos oder Optionen anzeigt, zum Beispiel ein Menü,
dann erfüllt ein deutlich sichtbarer Punkt in dieser Liste
dieses Kriterium.
</P>
<H3>1. Quelltext</H3>
<P>Der „Quelltext“ eines Werkes bezeichnet diejenige Form des
Werkes, die für Bearbeitungen vorzugsweise verwendet wird.
„Objekt-Code“ bezeichnet jede Nicht-Quelltext-Form eines Werks.
</P>
<P>Eine „Standardschnittstelle“ bezeichnet eine Schnittstelle,
die entweder ein offizieller Standard eines anerkannten
Standardisierungsgremiums ist oder – im Falle von Schnittstellen,
die für eine spezielle Programmiersprache spezifiziert wurden –
eine Schnittstelle, die unter Entwicklern, die in dieser
Programmiersprache arbeiten, weithin gebräuchlich ist.
</P>
<P>Die „Systembibliotheken“ eines ausführbaren Werks
enthalten alles, ausgenommen das Werk als Ganzes, was (a)
normalerweise zum Lieferumfang einer Hauptkomponente gehört,
aber selbst nicht die Hauptkomponente ist, und (b) ausschließlich
dazu dient, das Werk zusammen mit der Hauptkomponente benutzen zu
können oder eine Standardschnittstelle zu implementieren, für
die eine Implementation als Quelltext öffentlich erhältlich
ist. Eine „Hauptkomponente“ bezeichnet in diesem Zusammenhang
eine größere wesentliche Komponente (Betriebssystemkern,
Fenstersystem usw.) des spezifischen Betriebssystems (soweit
vorhanden), auf dem das ausführbare Werk läuft, oder des
Compilers, der zur Erzeugung des Objekt-Codes eingesetzt wurde, oder
des für die Ausführung verwendeten
Objekt-Code-Interpreters.
</P>
<P>Der „korrespondierende Quelltext“ eines Werks in Form von
Objekt-Code bezeichnet den vollständigen Quelltext, der benötigt
wird, um das Werk zu erzeugen, es zu installieren, um (im Falle eines
ausführbaren Werks) den Objekt-Code auszuführen und um das
Werk zu modifizieren, einschließlich der Skripte zur Steuerung
dieser Aktivitäten. Er schließt jedoch nicht die
Systembibliotheken, allgemein einsetzbare Werkzeuge oder allgemein
erhältliche freie Computerprogramme mit ein, die in
unmodifizierter Form verwendet werden, um die o.a. Tätigkeiten
durchzuführen, die aber nicht Teil des Werks sind. Zum Beispiel
enthält der korrespondierende Quelltext die zum
Programmquelltext gehörenden Schnittstellendefinitionsdateien
sowie die Quelltexte von dynamisch eingebundenen Bibliotheken und
Unterprogrammen, auf die das Werk konstruktionsbedingt angewiesen
ist, beispielsweise durch komplexe Datenkommunikation oder
Ablaufsteuerung zwischen diesen Unterprogrammen und anderen Teilen
des Werks.
</P>
<P>Der korrespondierende Quelltext braucht nichts zu enthalten, das
der Anwender aus anderen Teilen des korrespondierenden Quelltextes
automatisch regenerieren kann.
</P>
<P>Der korrespondierende Quelltext eines Werks in Quelltextform ist
das Werk selbst.
</P>
<H3>2. Grundlegende Genehmigungen</H3>
<P>Alle unter dieser Lizenz gewährten Rechte werden gewährt
auf Grundlage des Urheberrechts an dem Programm, und sie sind
unwiderruflich, solange die festgelegten Bedingungen erfüllt
sind. Diese Lizenz erklärt ausdrücklich Ihr
uneingeschränktes Recht zur Ausführung des unmodifizierten
Programms. Die beim Ausführen eines betroffenen Werks erzeugten
Ausgabedaten fallen unter diese Lizenz nur dann, wenn sie, in
Anbetracht ihres Inhalts, ein betroffenes Werk darstellen. Diese
Lizenz erkennt Ihr im Urheberrecht vorgesehenes Recht auf angemessene
Benutzung – oder seine Entsprechung – an.
</P>
<P>Sie dürfen betroffene Werke, die Sie nicht übertragen,
uneingeschränkt erzeugen, ausführen und propagieren,
solange Ihre Lizenz ansonsten in Kraft bleibt. Sie dürfen
betroffene Werke an Dritte übertragen für den einzigen
Zweck, Modifikationen exklusiv für Sie durchzuführen oder
Einrichtungen für Sie bereitzustellen, um diese Werke
auszuführen, vorausgesetzt, Sie erfüllen alle Bedingungen
dieser Lizenz für das Übertragen von Material, dessen
Urheberrecht nicht bei Ihnen liegt. Diejenigen, die auf diese Weise
betroffene Werke für Sie anfertigen oder ausführen, müssen
dies ausschließlich in Ihrem Namen tun, unter Ihrer Anleitung
und Kontrolle und unter Bedingungen, die ihnen verbieten, außerhalb
ihrer Beziehung zu Ihnen weitere Kopien Ihres urheberrechtlich
geschützten Materials anzufertigen.
</P>
<P>Übertragung ist in jedem Fall ausschließlich unter den
unten aufgeführten Bedingungen gestattet. Unterlizensierung ist
nicht gestattet, ist aber wegen §10 unnötig.
</P>
<H3>3. Schutz von Anwenderrechten vor Umgehungsverbotgesetzen</H3>
<P>Kein betroffenes Werk darf als Teil eines wirksamen technischen
Mechanismus' unter jedwedem anwendbarem Recht betrachtet werden, das
die Auflagen von Artikel 11 des am 20. Dezember 1996 verabschiedeten
WIPO-Urheberrechtsvertrags oder unter vergleichbaren Gesetzen, die
die Umgehung derartiger Mechanismen verbietet oder einschränkt.
</P>
<P>Wenn Sie ein betroffenes Werk übertragen, verzichten Sie auf
jedes Recht, die Umgehung technischer Mechanismen zu verbieten,
insoweit diese Umgehung durch die Ausübung der von dieser Lizenz
gewährten Rechte in bezug auf das betroffene Werk herbeigeführt
wird, und Sie weisen jede Absicht von sich, die Benutzung oder
Modifikation des Werks zu beschränken, um Ihre Rechtsansprüche
oder Rechtsansprüche Dritter zum Verbot der Umgehung technischer
Mechanismen gegen die Anwender des Werks durchzusetzen.
</P>
<H3>4. Unveränderte Kopien</H3>
<P>Sie dürfen auf beliebigen Medien unveränderte Kopien des
Quelltextes des Programms, wie sie ihn erhalten, übertragen,
sofern Sie auf deutliche und angemessene Weise auf jeder Kopie einen
angemessenen Urheberrechts-Vermerk veröffentlichen, alle
Hinweise intakt lassen, daß diese Lizenz und sämtliche
gemäß §7 hinzugefügten Einschränkungen auf
den Quelltext anwendbar sind, alle Hinweise auf das
Nichtvorhandensein einer Garantie intakt lassen und allen Empfängern
gemeinsam mit dem Programm ein Exemplar dieser Lizenz zukommen
lassen.
</P>
<P>Sie dürfen für jede übertragene Kopie ein Entgelt –
oder auch kein Entgelt – verlangen, und Sie dürfen
Kundendienst- oder Garantieleistungen gegen Entgelt anbieten.
</P>
<H3>5. Übertragung modifizierter Quelltextversionen</H3>
<P>Sie dürfen ein auf dem Programm basierendes Werk oder die
nötigen Modifikationen, um es aus dem Programm zu generieren,
kopieren und übertragen in Form von Quelltext unter den
Bestimmungen von §4, vorausgesetzt, daß Sie zusätzlich
alle im folgenden genannten Bedingungen erfüllen:
</P>
<TABLE CELLPADDING=2 CELLSPACING=5>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>a)</P>
</TD>
<TD>
<P>Das veränderte Werk muß auffällige Vermerke
tragen, die besagen, daß Sie es modifiziert haben, und die
ein darauf bezogenes Datum angeben.
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>b)</P>
</TD>
<TD>
<P>Das veränderte Werk muß auffällige Vermerke
tragen, die besagen, daß es unter dieser Lizenz
einschließlich der gemäß §7 hinzugefügten
Bedingungen herausgegeben wird. Diese Anforderung wandelt die
Anforderung aus §4 ab, „alle Hinweise intakt zu lassen“.
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>c)</P>
</TD>
<TD>
<P>Sie müssen das Gesamtwerk als Ganzes gemäß
dieser Lizenz an jeden lizensieren, der in den Besitz einer Kopie
gelangt. Diese Lizenz wird daher – ggf. einschließlich
zusätzlicher Bedingungen gemäß §7 – für
das Werk als Ganzes und alle seine Teile gelten, unabhängig
davon, wie diese zusammengepackt werden. Diese Lizenz erteilt
keine Erlaubnis, das Werk in irgendeiner anderen Weise zu
lizensieren, setzt aber eine derartige Erlaubnis nicht außer
Kraft, wenn Sie sie diese gesondert erhalten haben.
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>d)</P>
</TD>
<TD>
<P>Wenn das Werk über interaktive Benutzerschnittstellen
verfügt, müssen diese jeweils angemessene rechtliche
Hinweise anzeigen. Wenn allerdings das Programm interaktive
Benutzerschnittstellen hat, die keine angemessenen rechtlichen
Hinweise anzeigen, braucht Ihr Werk nicht dafür zu sorgen,
daß sie dies tun.
</P>
</TD>
</TR>
</TABLE>
<P>Die Zusammenstellung eines betroffenen Werks mit anderen
gesonderten und unabhängigen Werken, die nicht ihrer Natur nach
Erweiterungen des betroffenen Werks sind und die nicht mit ihm in
einer Weise kombiniert sind, um ein größeres Programm zu
bilden, in oder auf einem<!-- volume of a --> Speicher- oder
Verbreitungsmedium wird als „Aggregat“ bezeichnet, wenn die
Zusammenstellung und das sich für sie ergebende Urheberrecht
nicht dazu verwendet werden, den Zugriff oder die Rechte der Benutzer
der Zusammenstellung weiter einzuschränken, als dies die
einzelnen Werke erlauben. Die Aufnahme des betroffenen Werks in ein
Aggregat sorgt nicht dafür, daß diese Lizenz auf die
anderen Teile des Aggregats wirke.
</P>
<H3>6. Übertragung in Nicht-Quelltext-Form</H3>
<P>Sie dürfen ein betroffenes Werk in Form von Objekt-Code unter
den Bedingungen der Paragraphen 4 und 5 kopieren und übertragen
– vorausgesetzt, daß Sie außerdem den maschinenlesbaren
korrespondierenden Quelltext unter den Bedingungen dieser Lizenz
übertragen auf eine der folgenden Weisen:
</P>
<TABLE CELLPADDING=2 CELLSPACING=5>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>a)</P>
</TD>
<TD>
<P>Sie übertragen den Objekt-Code in einem physikalischen
Produkt (einschließlich ein physikalisches Speichermedium)
gemeinsam mit dem korrespondierenden Quelltext, der sich
unveränderlich auf einem haltbaren physikalischen Medium
befindet, das üblicherweise für den Austausch von
Software verwendet wird.
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>b)</P>
</TD>
<TD>
<P>Sie übertragen den Objekt-Code in einem physikalischen
Produkt (einschließlich ein physikalisches Speichermedium)
gemeinsam mit einem schriftlichen Angebot, das mindestens drei
Jahre lang gültig sein muß und so lange, wie Sie
Ersatzteile und Kundendienst für dieses Produktmodell
anbieten, jedem, der im Besitz des Objekt-Codes ist, entweder (1)
eine Kopie des korrespondierenden Quelltextes der gesamten
Software, die in dem Produkt enthalten und von dieser Lizenz
betroffen ist, zur Verfügung zu stellen – auf einem
haltbaren physikalischen Medium, das üblicherweise für
den Austausch von Software verwendet wird, und zu nicht höheren
Kosten als denen, die begründbar durch den physikalischen
Vorgang der Übertragung des Quelltextes anfallen, oder (2)
kostenlosen Zugriff, um den korrespondierenden Quelltext von einem
Netzwerk-Server zu kopieren.
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>c)</P>
</TD>
<TD>
<P>Sie übertragen Kopien des Objekt-Codes gemeinsam mit einer
Kopie des schriftlichen Angebots, den korrespondierenden Quelltext
zur Verfügung zu stellen. Diese Alternative ist nur für
gelegentliche, nicht-kommerzielle Übertragung zulässig
und nur, wenn Sie den Objekt-Code als mit einem entsprechenden
Angebot gemäß Absatz 6b erhalten haben.
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>d)</P>
</TD>
<TD>
<P>Sie übertragen den Objekt-Code dadurch, daß Sie
Zugriff auf eine dafür vorgesehene Stelle gewähren, und
bieten gleichwertigen Zugriff auf den korrespondierenden Quelltext
auf gleichem Weg auf dieselbe Stelle und ohne zusätzliche
Kosten. Sie müssen nicht von den Empfängern verlangen,
den korrespondierenden Quelltext gemeinsam mit dem Objekt-Code zu
kopieren. Wenn es sich bei der für das Kopieren vorgesehenen
Stelle um einen Netzwerk-Server handelt, darf sich der
korrespondierende Quelltext auf einem anderen Server befinden (von
Ihnen oder von einem Dritten betrieben), der gleichwertige
Kopiermöglichkeiten unterstützt – vorausgesetzt Sie
legen dem Objekt-Code klare Anleitungen bei, die besagen, wo der
korrespondierende Quelltext zu finden ist. Unabhängig davon,
welcher Netzwerk-Server den korrespondierenden Quelltext
beherbergt, bleiben Sie verpflichtet, sicherzustellen, daß
dieser lange genug bereitgestellt wird, um diesen Bedingungen zu
genügen.
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>e)</P>
</TD>
<TD>
<P>Sie übertragen den Objekt-Code unter Verwendung von
Peer-To-Peer-Übertragung – vorausgesetzt, Sie informieren
andere Teilnehmer darüber, wo der Objekt-Code und der
korrespondierende Quelltext des Werks unter den Bedingungen von
Absatz 6d öffentlich und kostenfrei angeboten werden.
</P>
</TD>
</TR>
</TABLE>
<P>Ein abtrennbarer Anteil des Objekt-Codes, dessen Quelltext von dem
korrespondierenden Quelltext als Systembibliothek ausgeschlossen ist,
braucht bei der Übertragung des Werks als Objekt-Code nicht
miteinbezogen zu werden.
</P>
<P>Ein „Benutzerprodukt“ ist entweder (1) ein
„Endbenutzerprodukt“, womit ein materieller persönlicher
Besitz gemeint ist, der normalerweise für den persönlichen
oder familiären Gebrauch oder im Haushalt eingesetzt wird, oder
(2) alles, was für den Einbau in eine Wohnung hin entworfen oder
dafür verkauft wird. Bei der Entscheidung, ob ein Produkt ein
Endbenutzerprodukt ist, sollen Zweifelsfälle als erfaßt
gelten. Wenn ein spezieller Anwender ein spezielles Produkt erhält,
bezeichnet „normalerweise einsetzen“ eine typische oder
weitverbreitete Anwendung dieser Produktklasse, unabhängig vom
Status des speziellen Anwenders oder der Art und Weise, wie der
spezielle Anwender des spezielle Produkt tatsächlich einsetzt
oder wie von ihm erwartet wird, daß er es einsetzt. Ein Produkt
gilt als Endbenutzerprodukt unabhängig davon, ob es
substantiellen kommerziellen, industriellen oder
nicht-endbenutzerspezifischen Nutzen hat, es sei denn, dieser Nutzen
stellt das einzige signifikante Anwendungsgebiet des Produkts dar.
</P>
<P>Mit „Installationsinformationen“ für ein Benutzerprodukt
sind jedwede Methoden, Prozeduren, Berechtigungsschlüssel oder
andere informationen gemeint, die notwendig sind, um modifizierte
Versionen eines betroffenen Werks, die aus einer modifizierten
Version seines korrespondierenden Quelltextes hervorgegangen sind,
auf dem Produkt zu installieren und auszuführen. Die
Informationen müssen ausreichen, um sicherzustellen, daß
das Weiterfunktionieren des modifizierten Objekt-Codes in keinem Fall
verhindert oder gestört wird aus dem einzigen Grunde, weil
Modifikationen vorgenommen worden sind.
</P>
<P>Wenn Sie Objekt-Code gemäß diesem Paragraphen innerhalb
oder zusammen mit oder speziell für den Gebrauch innerhalb eines
Benutzerprodukts übertragen und die Übertragung als Teil
einer Transaktion stattfindet, in der das Recht auf den Besitz und
die Benutzung des Benutzerprodukts dauerhaft auf den Empfänger
übergeht (unabhängig davon, wie diese Transaktion
charakterisiert ist), müssen dem gemäß diesem
Paragraphen mitübertragenen korrespondierenden Quelltext die
Installationsinformationen beiliegen. Diese Anforderung gilt jedoch
nicht, wenn weder Sie noch irgendeine Drittpartei die Möglichkeit
behält, modifizierten Objekt-Code auf dem Benutzerprodukt zu
installieren (zum Beispiel, wenn das Werk in einem ROM installiert
wurde).
</P>
<P>Die Anforderung, Installationsinformationen bereitzustellen,
schließt keine Anforderung mit ein, weiterhin Kundendienst,
Garantie oder Updates für ein Werk bereitzustellen, das vom
Empfänger modifiziert oder installiert worden ist, oder für
das Benutzerprodukt, in dem das Werk modifiziert oder installiert
worden ist. Der Zugriff auf ein Computer-Netzwerk darf verweigert
werden, wenn die Modifikation selbst die Funktion des Netzwerks
grundlegend nachteilig beeinflußt oder wenn sie die Regeln und
Protokolle für die Kommunikation über das Netzwerk
verletzt.
</P>
<P>Der korrespondierende Quelltext und die
Installationsinformationen, die in Übereinstimmung mit diesem
Paragraphen übertragen werden, müssen in einem öffentlich
dokumentierten Format vorliegen (für das eine Implementation in
Form von Quelltext öffentlich zugänglich ist), und sie
dürfen keine speziellen Passwörter oder Schlüssel für
das Auspacken, Lesen oder Kopieren erfordern.
</P>
<H3>7. Zusätzliche Bedingungen</H3>
<P>„Zusätzliche Genehmigungen“ sind Bedingungen, die die
Bedingungen dieser Lizenz ergänzen, indem sie Ausnahmen von
einer oder mehreren Auflagen zulassen. Zusätzliche Genehmigungen
zur Anwendung auf das gesamte Programm sollen so betrachtet werden,
als wären sie in dieser Lizenz enthalten, soweit dies unter
anwendbarem Recht zulässig ist. Wenn zusätzliche
Genehmigungen nur für einen Teil des Programms gelten, darf
dieser Teil separat unter diesen Genehmigungen verwendet werden; das
gesamte Programm jedoch unterliegt weiterhin dieser Lizenz ohne
Beachtung der zusätzlichen Genehmigungen.
</P>
<P>Ungeachtet jeglicher anderer Regelungen dieser Lizenz dürfen
Sie für Material, das Sie einem betroffenen Werk hinzufügen
(sofern Sie durch die Urheberrechtsinhaber dieses Materials
autorisiert sind), die Bedingungen dieser Lizenz um folgendes
ergänzen:
</P>
<TABLE CELLPADDING=2 CELLSPACING=5>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>a)</P>
</TD>
<TD>
<P>Gewährleistungsausschluß oder Haftungsbegrenzung
abweichend von §§15 und 16 dieser Lizenz oder
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>b)</P>
</TD>
<TD>
<P>die Anforderung, spezifizierte sinnvolle rechtliche Hinweise
oder Autorenschaftshinweise in diesem Material oder in den
angemessenen rechtlichen Hinweisen, die von den sie enthaltenen
Werken angezeigt werden, zu erhalten, oder
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>c)</P>
</TD>
<TD>
<P>das Verbot, die Herkunft des Materials falsch darzustellen oder
die Anforderung, daß modifizierte Versionen des Materials
auf angemessens Weise als vom Original verschieden markiert
werden, oder
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>d)</P>
</TD>
<TD>
<P>Begrenzung der Verwendung der Namen von Lizenzgebern oder
Autoren des Materials für Werbezwecke oder
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>e)</P>
</TD>
<TD>
<P>das Zurückweisen der Einräumung von Rechten gemäß
dem Markenrecht zur Benutzung gewisser Produktnamen, Produkt- oder
Service-Marken oder
</P>
</TD>
</TR>
<TR>
<TD VALIGN=TOP>
<P ALIGN=RIGHT>f)</P>
</TD>
<TD>
<P>die Erfordernis der Freistellung des Lizenznehmers und der
Autoren des Materials durch jeden, der die Software (oder
modifizierte Versionen davon) überträgt, mit
vertraglichen Prämissen der Verantwortung gegenüber dem
Empfänger für jede Verantwortung, die diese
vertraglichen Prämissen diesen Lizenzgebern und Autoren
direkt auferlegen.
</P>
</TD>
</TR>
</TABLE>
<P>Alle anderen hinzugefügten einschränkenden Bedingungen
werden als „zusätzliche Einschränkungen“ im Sinne von
§10 betrachtet. Wenn das Programm, wie Sie es erhalten haben,
oder ein Teil davon dieser Lizenz untersteht zuzüglich einer
weiteren Bedingung, die eine zusätzliche Einschränkung
darstellt, dürfen Sie diese Bedingung entfernen. Wenn ein
Lizenzdokument eine zusätzliche Einschränkung enthält,
aber die Relizensierung unter dieser Lizenz erlaubt, dürfen Sie
dem betroffenen Werk Material hinzufügen, das den Bedingungen
jenes Lizenzdokuments unterliegt, unter der Voraussetzung, daß
die zusätzlichen Einschränkungen bei einer derartigen
Relizensierung oder Übertragung verfallen.
</P>
<P>Wenn Sie einem betroffenen Werk in Übereinstimmung mit diesem
Paragraphen Bedingungen hinzufügen, müssen Sie in den
betroffenen Quelltextdateien eine Aufstellung der zusätzlichen
Bedingungen plazieren, die auf diese Quelltextdatei Anwendung finden,
oder einen Hinweis darauf, wo die Zusätzlichen Bedingungen zu
finden sind.
</P>
<P>Zusätzliche Bedingungen, seien es Genehmigungen oder
Einschränkungen, dürfen in Form einer separaten
schriftlichen Lizenz oder in Form von Ausnahmen festgelegt werden;
die o.a. Anforderungen gelten in jedem Fall.
</P>
<H3>8. Kündigung</H3>
<P>Sie dürfen das Programm nicht verbreiten oder modifizieren,
sofern es nicht durch diese Lizenz ausdrücklich gestattet ist.
Jeder anderweitige Versuch der Verbreitung oder Modifizierung ist
nichtig und beendet automatisch Ihre Rechte unter dieser Lizenz
(einschließlich aller Patentlizenzen gemäß §11
Abs. 3).
</P>
<P>Wenn Sie jedoch alle Verletzungen dieser Lizenz beenden, wird Ihre
Lizenz durch einen speziellen Urheberrechtsinhaber wiederhergestellt,
und zwar (a) vorübergehend, solange nicht bzw. bis der
Rechteinhaber Ihre Lizenz ausdrücklich und endgültig
kündigt, und (b) dauerhaft, sofern es der Rechteinhaber
versäumt, Sie auf sinnvolle Weise auf die Lizenzverletzung
innerhalb von 60 Tagen ab deren Beendigung hinzuweisen.
</P>
<P>Darüberhinaus wird Ihre Lizenz durch einen speziellen
Urheberrechtsinhaber permanent wiederhergestellt, wenn Sie der
Rechteinhaber auf sinnvolle Weise auf die Verletzung hinweist, wenn
außerdem dies das erste Mal ist, daß Sie auf die
Verletzung dieser Lizenz (für jedes Werk) des Rechteinhabers
hingewiesen werden, und wenn Sie die Verletzung innerhalb von 30
Tagen ab dem Eingang des Hinweises einstellen.
</P>
<P>Die Beendigung Ihrer Rechte unter dieser Lizenz beendet nicht die
Lizenzen Dritter, die von Ihnen Kopien oder Rechte unter dieser
Lizenz erhalten haben. Wenn Ihre Rechte beendet und nicht dauerhaft
wiederhergestellt worden sind, sind Sie nicht berechtigt, neue
Lizenzen für dasselbe Material gemäß §10 zu
erhalten.
</P>
<H3>9. Annahme der Lizenz keine Voraussetzung für den Besitz von
Kopien</H3>
<P>Um eine Kopie des Programms auszuführen, ist es nicht
erforderlich, daß Sie diese Lizenz annehmen. Die nebenbei
stattfindende Verbreitung eines betroffenen Werks, die sich
ausschließlich als Konsequenz der Teilnahme an einer
Peer-To-Peer-Datenübertragung ergibt, um eine Kopie
entgegennehmen zu können, erfordert ebenfalls keine Annahme
dieser Lizenz. Jedoch gibt Ihnen nichts außer dieser Lizenz die
Erlaubnis, das Programm oder jedes betroffene Werk zu verbreiten oder
zu verändern. Diese Handlungen verstoßen gegen das
Urheberrecht, wenn Sie diese Lizenz nicht anerkennen. Indem Sie daher
ein betroffenes Werk verändern oder propagieren, erklären
Sie Ihr Einverständnis mit dieser Lizenz, die Ihnen diese
Tätigkeiten erlaubt.
</P>
<H3>10. Automatische Lizensierung nachgeordneter Anwender</H3>
<P>Jedesmal, wenn Sie ein betroffenes Werk übertragen, erhält
der Empfänger automatisch vom ursprünglichen Lizenzgeber
die Lizenz, das Werk auszuführen, zu verändern und zu
propagieren – in Übereinstimmung mit dieser Lizenz. Sie sind
nicht dafür verantwortlich, die Einhaltung dieser Lizenz durch
Dritte durchzusetzen.
</P>
<P>Eine „Organisations-Transaktion“ ist entweder eine
Transaktion, bei der die Kontrolle über eine Organisation oder
das im wesentlichen gesamte Kapital einer solchen, übertragen
wird, oder sie ist die Aufteilung einer Organisation in mehrere oder
die Fusion mehrerer Organisationen zu einer. Wenn die Propagation
eines betroffenen Werks durch eine Organisations-Transaktion erfolgt,
erhält jeder an der Transaktion Beteiligte, der eine Kopie des
Werks erhält, zugleich jedwede Lizenz an dem Werk, die der
Interessenvorgänger des Beteiligten hatte, sowie das Recht auf
den Besitz des korrespondierenden Quelltextes des Werks vom
Interessenvorgänger, wenn dieser ihn hat oder mit vertretbarem
Aufwand beschaffen kann.
</P>
<P>Sie dürfen keine zusätzlichen Einschränkungen bzgl.
der Ausübung der unter dieser Lizenz gewährten oder
zugesicherten Rechte vornehmen. Beispielsweise dürfen Sie keine
Lizenzgebühr oder sonstige Gebühr für die Ausübung
der unter dieser Lizenz gewährten Rechte verlangen, und Sie
dürfen keine Rechtsstreitigkeit beginnen (eingeschlossen Kreuz-
oder Gegenansprüche in einem Gerichtsverfahren), in der Sie
unterstellen, daß irgendein Patentanspruch durch Erzeugung,
Anwendung, Verkauf, Verkaufsangebot oder Import des Programms oder
irgendeines Teils davon verletzt wurde.
</P>
<H3>11. Patente</H3>
<P>Ein „Kontributor“ ist ein Urheberrechtsinhaber, der die
Benutzung des Programms oder eines auf dem Programm basierenden Werks
unter dieser Lizenz erlaubt. Das auf diese Weise lizensierte Werk
bezeichnen wir als die „Kontributor-Version“ des Kontributors.
</P>
<P>Die „wesentlichen Patentansprüche“ eines Kontributors
sind all diejenigen Patentansprüche, die der Kontributor besitzt
oder kontrolliert, ob bereits erworben oder erst in Zukunft zu
erwerben, die durch irgendeine Weise des gemäß dieser
Lizenz erlaubten Erzeugens, Ausführens oder Verkaufens seiner
Kontributor-Version verletzt würden. Dies schließt keine
Patentansprüche ein, die erst als Konsequenz weiterer
Modifizierung seiner Kontributor-Version entstünden. Für
den Zweck dieser Definition schließt "Kontrolle" das
Recht mit ein, Unterlizenzen für ein Patent zu erteilen auf eine
Weise, die mit den Erfordernissen dieser Lizenz vereinbar ist.
</P>
<P>Jeder Kontributor gewährt Ihnen eine nicht-exklusive,
weltweite und gebührenfreie Patentlizenz gemäß den
wesentlichen Patentansprüchen des Kontributors, den Inhalt
seiner Kontributor-Version zu erzeugen, zu verkaufen, zum Verkauf
anzubieten, zu importieren und außerdem auszuführen, zu
modifizieren und zu propagieren.
</P>
<P>In den folgenden drei Absätzen ist eine „Patentlizenz“
jedwede ausdrückliche Vereinbarung oder Verpflichtung, wie auch
immer benannt, ein Patent nicht geltend zu machen (beispielsweise
eine ausdrückliche Erlaubnis, ein Patent zu nutzen oder eine
Zusicherung, bei Patentverletzung nicht zu klagen). Jemandem eine
solche Patentlizenz zu „erteilen“ bedeutet, eine solche
Vereinbarung oder Verpflichtung zu beschließen, ein Patent
nicht gegen ihn durchzusetzen.
</P>
<P>Wenn Sie ein betroffenes Werk übertragen, das wissentlich auf
eine Patentlizenz angewiesen ist, und wenn der korrespondierende
Quelltext nicht für jeden zum Kopieren zur Verfügung
gestellt wird – kostenlos, unter den Bedingungen dieser Lizenz und
über einen öffentlich zugänglichen Netzwerk-Server
oder andere leicht zugängliche Mittel –, dann müssen Sie
entweder (1) dafür sorgen, daß der korrespondierende
Quelltext auf diese Weise verfügbar gemacht wird oder (2) dafür
sorgen, daß Ihnen selbst die Vorteile der Patentlizenz für
dieses spezielle Werk entzogen werden oder (3) in einer mit den
Erfordernissen dieser Lizenz vereinbaren Weise bewirken, daß
die Patentlizenz auf nachgeordnete Empfänger ausgedehnt wird.
„Wissentlich angewiesen sein“ bedeutet, daß Sie
tatsächliches Wissen darüber haben, daß – außer
wegen der Patentlizenz – Ihre Übertragung des betroffenen
Werks in einen Staat oder die Benutzung des betroffenen Werks durch
Ihren Empfänger in einem Staat, eins oder mehrere
identifizierbare Patente in diesem Staat verletzen würden, deren
Gültigkeit Ihnen glaubhaft erscheint.
</P>
<P>Wenn Sie, als Folge von oder in Verbindung mit einer einzelnen
Transaktion oder Vereinbarung, ein betroffenes Werk übertragen
oder durch Vermittlung einer Übertragung propagieren, und Sie
gewähren einigen Empfängern eine Patentlizenz, die ihnen
das Benutzen, Propagieren, Modifizieren und Übertragen einer
speziellen Kopie des betroffenen Werks gestatten, dann wird die von
Ihnen gewährte Patentlizenz automatisch auf alle Empfänger
des betroffenen Werks und darauf basierender Werke ausgedehnt.
</P>
<P>Eine Patentlizenz ist „diskriminierend“, wenn sie in ihrem
Gültigkeitsbereich die speziell unter dieser Lizenz gewährten
Rechte nicht einschließt, wenn sie die Ausübung dieser
Rechte verbietet oder wenn sie die Nichtausübung einer oder
mehrerer dieser Rechte zur Bedingung hat. Sie dürfen ein
betroffenes Werk nicht übertragen, wenn Sie Partner in einem
Vertrag mit einer Drittpartei sind, die auf dem Gebiet der
Verbreitung von Software geschäftlich tätig ist, gemäß
dem Sie dieser Drittpartei Zahlungen leisten, die auf dem Maß
Ihrer Aktivität des Übertragens des Werks basieren, und
gemäß dem die Drittpartei eine diskriminierende
Patentlizenz all denjenigen gewährt, die das Werk von Ihnen
erhielten, (a) in Verbindung mit von Ihnen übertragenen Kopien
des betroffenen Werks (oder Kopien dieser Kopien) oder (b)
hauptsächlich für und in Verbindung mit spezifischen
Produkten oder Zusammenstellungen, die das betroffene Werk enthalten,
es sei denn, Sie sind in diesen Vertrag vor dem 28. März 2007
eingetreten oder die Patentlizenz wurde vor diesem Datum erteilt.
</P>
<P>Nichts in dieser Lizenz soll in einer Weise ausgelegt werden, die
irgendeine implizite Lizenz oder sonstige Abwehr gegen
Rechtsverletzung ausschließt oder begrenzt, die Ihnen ansonsten
gemäß anwendbarem Patentrecht zustünde.
</P>
<H3>12. Keine Preisgabe der Freiheit Dritter</H3>
<P>Sollten Ihnen (durch Gerichtsbeschluß, Vergleich oder
anderweitig) Bedingungen auferlegt werden, die den Bedingungen dieser
Lizenz widersprechen, so befreien Sie diese Umstände nicht von
den Bestimmungen dieser Lizenz. Wenn es Ihnen nicht möglich ist,
ein betroffenes Werk unter gleichzeitiger Beachtung der Bedingungen
in dieser Lizenz und Ihrer anderweitigen Verpflichtungen zu
übertragen, dann dürfen Sie als Folge das Programm
überhaupt nicht übertragen. Wenn Sie zum Beispiel
Bedingungen akzeptieren, die Sie dazu verpflichten, von denen, denen
Sie das Programm übertragen haben, eine Gebühr für die
weitere Übertragung einzufordern, dann besteht der einzige Weg,
sowohl jene Bedingungen als auch diese Lizenz zu befolgen darin, ganz
auf die Übertragung des Programms zu verzichten.
</P>
<H3>13. Nutzung zusammen mit der GNU Affero General Public License</H3>
<P>Ungeachtet anderer Regelungen dieser Lizenz, ist es Ihnen
gestattet, ein betroffenes Werk mit einem Werk zu einem einzelnen,
kombinierten Werk zu verbinden (linken) oder zu kombinieren, das
unter Version 3 der GNU Affero General Public License steht, und das
Ergebnis zu übertragen. Die Bedingungen dieser Lizenz bleiben
weiterhin auf denjenigen Teil anwendbar, der das betroffene Werk
darstellt, aber die speziellen Anforderungen der GNU Affero General
Public License, §13, die sich auf Interaktion über ein
Computer-Netzwerk beziehen, werden auf die Kombination als solche
anwendbar.
</P>
<H3>14. Überarbeitungen dieser Lizenz</H3>
<P>Die Free Software Foundation kann von Zeit zu Zeit überarbeitete
und/oder neue Versionen der <EM>General Public License</EM>
veröffentlichen. Solche neuen Versionen werden vom Grundprinzip
her der gegenwärtigen entsprechen, können aber im Detail
abweichen, um neuen Problemen und Anforderungen gerecht zu werden.
</P>
<P>Jede Version dieser Lizenz hat eine eindeutige Versionsnummer.
Wenn in einem Programm angegeben wird, daß es dieser Lizenz in
einer bestimmten Versionsnummer „oder jeder späteren Version“
<EM>(“or any later version”)</EM> unterliegt, so haben Sie die
Wahl, entweder den Bestimmungen der genannten Version zu folgen oder
denen jeder beliebigen späteren Version, die von der Free
Software Foundation veröffentlicht wurde. Wenn das Programm
keine Versionsnummer angibt, können Sie eine beliebige Version
wählen, die je von der Free Software Foundation veröffentlicht
wurde.
</P>
<H3>15. Gewährleistungsausschluß</H3>
<P><STRONG>Es besteht keinerlei Gewährleistung für das
Programm, soweit dies gesetzlich zulässig ist. Sofern nicht
anderweitig schriftlich bestätigt, stellen die
Urheberrechtsinhaber und/oder Dritte das Programm so zur Verfügung,
„wie es ist“, ohne irgendeine Gewährleistung, weder
ausdrücklich noch implizit, einschließlich – aber nicht
begrenzt auf – die implizite Gewährleistung der Marktreife
oder der Verwendbarkeit für einen bestimmten Zweck. Das volle
Risiko bezüglich Qualität und Leistungsfähigkeit des
Programms liegt bei Ihnen. Sollte sich das Programm als fehlerhaft
herausstellen, liegen die Kosten für notwendigen Service,
Reparatur oder Korrektur bei Ihnen. </STRONG>
</P>
<H3>16. Haftungsbegrenzung</H3>
<P><STRONG>In keinem Fall, außer wenn durch geltendes Recht
gefordert oder schriftlich zugesichert, ist irgendein
Urheberrechtsinhaber oder irgendein Dritter, der das Programm wie
oben erlaubt modifiziert oder übertragen hat, Ihnen gegenüber
für irgendwelche Schäden haftbar, einschließlich
jeglicher allgemeiner oder spezieller Schäden, Schäden
durch Seiteneffekte (Nebenwirkungen) oder Folgeschäden, die aus
der Benutzung des Programms oder der Unbenutzbarkeit des Programms
folgen (einschließlich – aber nicht beschränkt auf –
Datenverluste, fehlerhafte Verarbeitung von Daten, Verluste, die von
Ihnen oder anderen getragen werden müssen, oder dem Unvermögen
des Programms, mit irgendeinem anderen Programm zusammenzuarbeiten),
selbst wenn ein Urheberrechtsinhaber oder Dritter über die
Möglichkeit solcher Schäden unterrichtet worden war. </STRONG>
</P>
<H3>17. Interpretation von §§ 15 und 16</H3>
<P>Sollten der o.a. Gewährleistungsausschluß und die o.a.
Haftungsbegrenzung aufgrund ihrer Bedingungen gemäß
lokalem Recht unwirksam sein, sollen Bewertungsgerichte dasjenige
lokale Recht anwenden, das einer absoluten Aufhebung jeglicher
zivilen Haftung in Zusammenhang mit dem Programm am nächsten
kommt, es sei denn, dem Programm lag eine entgeltliche
Garantieerklärung oder Haftungsübernahme bei.
</P>
<H2>ENDE DER LIZENZBEDINGUNGEN</H2>
<H2>Wie Sie diese Bedingungen auf Ihre eigenen, neuen Programme
anwenden können
</H2>
<P>Wenn Sie ein neues Programm entwickeln und wollen, daß es
vom größtmöglichen Nutzen für die Allgemeinheit
ist, dann erreichen Sie das am besten, indem Sie es zu freier
Software machen, die jeder unter diesen Bestimmungen weiterverbreiten
und verändern kann.
</P>
<P>Um dies zu erreichen, fügen Sie die folgenden Vermerke zu
Ihrem Programm hinzu. Am sichersten ist es, sie an den Anfang einer
jeden Quelldatei zu stellen, um den Gewährleistungsausschluß
möglichst deutlich darzustellen; zumindest aber sollte jede
Datei die „Copyright“-Zeile besitzen sowie einen kurzen Hinweis
darauf, wo die vollständigen Vermerke zu finden sind.
</P>
<BLOCKQUOTE><TT>[</TT><TT><I>eine Zeile mit dem Programmnamen und
einer kurzen Beschreibung</I></TT><TT>]<BR>Copyright (C)
[</TT><TT><I>Jahr</I></TT><TT>] [</TT><TT><I>Name des
Autors</I></TT><TT>] </TT>
</BLOCKQUOTE>
<BLOCKQUOTE><TT>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. </TT>
</BLOCKQUOTE>
<BLOCKQUOTE><TT>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. </TT>
</BLOCKQUOTE>
<BLOCKQUOTE><TT>You should have received a copy of the GNU General
Public License along with this program; if not, see
<http://www.gnu.org/licenses/>. </TT>
</BLOCKQUOTE>
<P>Auf Deutsch:
</P>
<BLOCKQUOTE><TT>[</TT><TT><I>eine Zeile mit dem Programmnamen und
einer kurzen Beschreibung</I></TT><TT>]<BR>Copyright (C)
[</TT><TT><I>Jahr</I></TT><TT>] [</TT><TT><I>Name des
Autors</I></TT><TT>] </TT>
</BLOCKQUOTE>
<BLOCKQUOTE><TT>Dieses Programm ist freie Software. Sie können
es unter den Bedingungen der GNU General Public License, wie von der
Free Software Foundation veröffentlicht, weitergeben und/oder
modifizieren, entweder gemäß Version 3 der Lizenz oder
(nach Ihrer Option) jeder späteren Version. </TT>
</BLOCKQUOTE>
<BLOCKQUOTE><TT>Die Veröffentlichung dieses Programms erfolgt in
der Hoffnung, daß es Ihnen von Nutzen sein wird, aber OHNE
IRGENDEINE GARANTIE, sogar ohne die implizite Garantie der MARKTREIFE
oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK. Details
finden Sie in der GNU General Public License. </TT>
</BLOCKQUOTE>
<BLOCKQUOTE><TT>Sie sollten ein Exemplar der GNU General Public
License zusammen mit diesem Programm erhalten haben. Falls nicht,
siehe <http://www.gnu.org/licenses/>. </TT>
</BLOCKQUOTE>
<P>Fügen Sie auch einen kurzen Hinweis hinzu, wie Sie
elektronisch und per Brief erreichbar sind.
</P>
<P>Wenn Ihr Programm interaktive Befehle in einem Terminal
entgegennimmt, sorgen Sie dafür, daß es nach dem Start
einen kurzen Vermerk ausgibt:
</P>
<BLOCKQUOTE><TT>[Programm] Copyright (C) [</TT><TT><I>Jahr</I></TT><TT>] [</TT><TT><I>Name
des Autors</I></TT><TT>]<BR>This program comes with ABSOLUTELY NO
WARRANTY; for details type ‘show w’.<BR>This is free software,
and you are welcome to redistribute it under certain conditions; type
‘show c’ for details. </TT>
</BLOCKQUOTE>
<P>Auf Deutsch:
</P>
<BLOCKQUOTE><TT>[Programm] Copyright (C) [</TT><TT><I>Jahr</I></TT><TT>] [</TT><TT><I>Name
des Autors</I></TT><TT>] Für dieses Programm besteht KEINERLEI
GARANTIE; geben Sie "show w" für Details ein.<BR>Dies
ist freie Software, die Sie unter bestimmten Bedingungen weitergeben
dürfen; geben Sie "show c" für Details ein. </TT>
</BLOCKQUOTE>
<P>Die hypothetischen Kommandos „<CODE>show w</CODE>“ und „<CODE>show
c</CODE>“ sollten die entsprechenden Teile der GNU-GPL anzeigen.
Natürlich können die von Ihnen verwendeten Kommandos auch
anders lauten; für ein Programm mit graphischer
Benutzeroberfläche werden Sie sicherlich eine „About-Box“
verwenden.
</P>
<P>Soweit vorhanden, sollten Sie auch Ihren Arbeitgeber (wenn Sie als
Programmierer arbeiten) oder Ihre Schule einen Urheberrechteverzicht
für das Programm unterschreiben lassen. Für weitere
Informationen darüber und wie Sie die GNU GPL anwenden und
befolgen, siehe <A HREF="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</A>.
</P>
<P>Diese <EM>General Public License</EM> gestattet nicht die
Einbindung Ihres Programms in proprietäre Programme. Wenn Ihr
Programm eine Funktionsbibliothek ist, dann kann es sinnvoller sein,
das Linken proprietärer Programme mit dieser Bibliothek zu
gestatten. Wenn dies Ihre Absicht ist, sollten Sie die <A HREF="http://www.gnu.de/documents/lgpl.de.html">GNU
Lesser General Public License</A> anstelle dieser Lizenz verwenden.
Lesen Sie aber bitte vorher
<A HREF="http://www.gnu.org/philosophy/why-not-lgpl.html">http://www.gnu.org/philosophy/why-not-lgpl.html</A>.
</P>
<P ALIGN=CENTER>* * *</P>
<P>Copyright-Notiz des englischsprachigen Orignals:<BR>Copyright
notice above.<BR>51 Franklin Street, Fifth Floor, Boston, MA 02110,
USA<BR>Verbatim copying and distribution of this entire article is
permitted in any medium without royalty provided this notice is
preserved.
</P>
<P>Übersetzung:<BR>Copyright-Notiz siehe oben.<BR>51 Franklin
Street, Fifth Floor, Boston, MA 02110, USA<BR>Es ist gebührenfrei
gestattet, diesen Artikel als Ganzes und unverändert in
beliebigen Medien zu kopieren und weiterzugeben, sofern dieser
Hinweis erhalten bleiben.
</P>
<P><BR><BR>
</P>
</BODY>
</HTML>
|
gpl-3.0
|
omgslinux/oc2
|
src/OCAX/Backup/BackupBundle.php
|
118
|
<?php
namespace OCAX\Backup;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class BackupBundle extends Bundle
{
}
|
gpl-3.0
|
manuporto/megaman
|
extern/libSDL2pp/examples/mixer.cc
|
2304
|
/*
libSDL2pp - C++11 bindings/wrapper for SDL2
Copyright (C) 2015 Dmitry Marakasov <amdmi3@amdmi3.ru>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#include <iostream>
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2pp/SDL.hh>
#include <SDL2pp/SDLMixer.hh>
#include <SDL2pp/Mixer.hh>
#include <SDL2pp/Chunk.hh>
using namespace SDL2pp;
int main(int, char*[]) try {
SDL sdl(SDL_INIT_AUDIO);
SDLMixer mixerlib(MIX_INIT_OGG);
Mixer mixer(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, MIX_DEFAULT_CHANNELS, 4096);
Chunk sound(TESTDATA_DIR "/test.ogg");
mixer.SetChannelFinishedHandler([](int channel){
std::cerr << "Channel " << channel << " finished playback" << std::endl;
});
int chan;
// Fade in
chan = mixer.FadeInChannel(-1, sound, 0, 1000);
std::cerr << "Fading sound in on channel " << chan << "\n";
SDL_Delay(2000);
// Mix 3 sounds
chan = mixer.PlayChannel(-1, sound);
std::cerr << "Playing sound on channel " << chan << "\n";
SDL_Delay(250);
chan = mixer.PlayChannel(-1, sound);
std::cerr << "Playing sound on channel " << chan << "\n";
SDL_Delay(250);
chan = mixer.PlayChannel(-1, sound);
std::cerr << "Playing sound on channel " << chan << "\n";
SDL_Delay(2000);
// Fade out
chan = mixer.PlayChannel(-1, sound);
std::cerr << "Fading out sound on channel " << chan << "\n";
mixer.FadeOutChannel(chan, 2000);
SDL_Delay(2000);
return 0;
} catch (std::exception& e) {
std::cerr << "Error: " << e.what() << std::endl;
return 1;
}
|
gpl-3.0
|
Zapuss/ZapekFapeCore
|
src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
|
8541
|
/*
* Copyright (C) 2011-2012 Project SkyFire <http://www.projectskyfire.org/>
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
*
* 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 "ScriptPCH.h"
#include "ruby_sanctum.h"
enum Texts
{
SAY_AGGRO = 0, // You will sssuffer for this intrusion! (17528)
SAY_CONFLAGRATION = 1, // Burn in the master's flame! (17532)
EMOTE_ENRAGED = 2, // %s becomes enraged!
SAY_KILL = 3, // Halion will be pleased. (17530) - As it should be.... (17529)
};
enum Spells
{
SPELL_CONFLAGRATION = 74452,
SPELL_FLAME_BEACON = 74453,
SPELL_CONFLAGRATION_2 = 74454, // Unknown dummy effect
SPELL_ENRAGE = 78722,
SPELL_FLAME_BREATH = 74403,
};
enum Events
{
EVENT_ENRAGE = 1,
EVENT_FLIGHT = 2,
EVENT_FLAME_BREATH = 3,
EVENT_CONFLAGRATION = 4,
// Event group
EVENT_GROUP_LAND_PHASE = 1,
};
enum MovementPoints
{
POINT_FLIGHT = 1,
POINT_LAND = 2,
};
enum Misc
{
SOUND_ID_DEATH = 17531,
};
Position const SavianaRagefireFlyPos = {3155.51f, 683.844f, 95.20f, 4.69f};
Position const SavianaRagefireLandPos = {3151.07f, 636.443f, 79.54f, 4.69f};
class boss_saviana_ragefire : public CreatureScript
{
public:
boss_saviana_ragefire() : CreatureScript("boss_saviana_ragefire") { }
struct boss_saviana_ragefireAI : public BossAI
{
boss_saviana_ragefireAI(Creature* creature) : BossAI(creature, DATA_SAVIANA_RAGEFIRE)
{
}
void Reset()
{
_Reset();
me->SetReactState(REACT_AGGRESSIVE);
}
void EnterCombat(Unit* /*who*/)
{
_EnterCombat();
Talk(SAY_AGGRO);
events.Reset();
events.ScheduleEvent(EVENT_ENRAGE, 20000, EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLAME_BREATH, 14000, EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLIGHT, 60000);
}
void JustDied(Unit* /*killer*/)
{
_JustDied();
me->PlayDirectSound(SOUND_ID_DEATH);
}
void MovementInform(uint32 type, uint32 point)
{
if (type != POINT_MOTION_TYPE)
return;
switch (point)
{
case POINT_FLIGHT:
events.ScheduleEvent(EVENT_CONFLAGRATION, 1000);
Talk(SAY_CONFLAGRATION);
break;
case POINT_LAND:
me->SetFlying(false);
me->SetLevitate(false);
me->SetReactState(REACT_AGGRESSIVE);
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
DoStartMovement(me->getVictim());
break;
default:
break;
}
}
void JustReachedHome()
{
_JustReachedHome();
me->SetFlying(false);
me->SetLevitate(false);
}
void KilledUnit(Unit* victim)
{
if (victim->GetTypeId() == TYPEID_PLAYER)
Talk(SAY_KILL);
}
void UpdateAI(uint32 const diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_FLIGHT:
{
me->SetFlying(true);
me->SetLevitate(true);
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->MovePoint(POINT_FLIGHT, SavianaRagefireFlyPos);
events.ScheduleEvent(EVENT_FLIGHT, 50000);
events.DelayEvents(12500, EVENT_GROUP_LAND_PHASE);
break;
}
case EVENT_CONFLAGRATION:
DoCast(me, SPELL_CONFLAGRATION, true);
break;
case EVENT_ENRAGE:
DoCast(me, SPELL_ENRAGE);
Talk(EMOTE_ENRAGED);
events.ScheduleEvent(EVENT_ENRAGE, urand(15000, 20000), EVENT_GROUP_LAND_PHASE);
break;
case EVENT_FLAME_BREATH:
DoCastVictim(SPELL_FLAME_BREATH);
events.ScheduleEvent(EVENT_FLAME_BREATH, urand(20000, 30000), EVENT_GROUP_LAND_PHASE);
break;
default:
break;
}
}
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const
{
return GetRubySanctumAI<boss_saviana_ragefireAI>(creature);
}
};
class ConflagrationTargetSelector
{
public:
ConflagrationTargetSelector() { }
bool operator()(Unit* unit)
{
return unit->GetTypeId() != TYPEID_PLAYER;
}
};
class spell_saviana_conflagration_init : public SpellScriptLoader
{
public:
spell_saviana_conflagration_init() : SpellScriptLoader("spell_saviana_conflagration_init") { }
class spell_saviana_conflagration_init_SpellScript : public SpellScript
{
PrepareSpellScript(spell_saviana_conflagration_init_SpellScript);
void FilterTargets(std::list<Unit*>& unitList)
{
unitList.remove_if (ConflagrationTargetSelector());
uint8 maxSize = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 6 : 3);
if (unitList.size() > maxSize)
Trinity::RandomResizeList(unitList, maxSize);
}
void HandleDummy(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetCaster()->CastSpell(GetHitUnit(), SPELL_FLAME_BEACON, true);
GetCaster()->CastSpell(GetHitUnit(), SPELL_CONFLAGRATION_2, false);
}
void Register()
{
OnUnitTargetSelect += SpellUnitTargetFn(spell_saviana_conflagration_init_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_init_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_saviana_conflagration_init_SpellScript();
}
};
class spell_saviana_conflagration_throwback : public SpellScriptLoader
{
public:
spell_saviana_conflagration_throwback() : SpellScriptLoader("spell_saviana_conflagration_throwback") { }
class spell_saviana_conflagration_throwback_SpellScript : public SpellScript
{
PrepareSpellScript(spell_saviana_conflagration_throwback_SpellScript);
void HandleScript(SpellEffIndex effIndex)
{
PreventHitDefaultEffect(effIndex);
GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
GetHitUnit()->GetMotionMaster()->MovePoint(POINT_LAND, SavianaRagefireLandPos);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_saviana_conflagration_throwback_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_saviana_conflagration_throwback_SpellScript();
}
};
void AddSC_boss_saviana_ragefire()
{
new boss_saviana_ragefire();
new spell_saviana_conflagration_init();
new spell_saviana_conflagration_throwback();
}
|
gpl-3.0
|
adithya321/SOS-The-Healthcare-Companion
|
app/src/main/java/com/zduo/sos/activity/AddA1CActivity.java
|
3876
|
/*
* SOS
* Copyright (C) 2016 zDuo (Adithya J, Vazbloke)
*
* 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.zduo.sos.activity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.widget.TextView;
import android.widget.Toast;
import com.zduo.sos.R;
import com.zduo.sos.db.HB1ACReading;
import com.zduo.sos.presenter.AddA1CPresenter;
import com.zduo.sos.tools.FormatDateTime;
import java.util.Calendar;
public class AddA1CActivity extends AddReadingActivity {
private TextView readingTextView;
private TextView unitTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_add_hb1ac);
Toolbar toolbar = (Toolbar) findViewById(R.id.activity_main_toolbar);
if (toolbar != null) {
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setElevation(2);
}
this.retrieveExtra();
AddA1CPresenter presenter = new AddA1CPresenter(this);
setPresenter(presenter);
presenter.setReadingTimeNow();
readingTextView = (TextView) findViewById(R.id.hb1ac_add_value);
unitTextView = (TextView) findViewById(R.id.hb1ac_unit);
this.createDateTimeViewAndListener();
this.createFANViewAndListener();
if (!"percentage".equals(presenter.getA1CUnitMeasuerement())) {
unitTextView.setText(getString(R.string.mmol_mol));
}
// If an id is passed, open the activity in edit mode
FormatDateTime formatDateTime = new FormatDateTime(getApplicationContext());
if (this.isEditing()) {
setTitle(R.string.title_activity_add_hb1ac_edit);
HB1ACReading readingToEdit = presenter.getHB1ACReadingById(getEditId());
readingTextView.setText(readingToEdit.getReading() + "");
Calendar cal = Calendar.getInstance();
cal.setTime(readingToEdit.getCreated());
this.getAddDateTextView().setText(formatDateTime.getDate(cal));
this.getAddTimeTextView().setText(formatDateTime.getTime(cal));
presenter.updateReadingSplitDateTime(readingToEdit.getCreated());
} else {
this.getAddDateTextView().setText(formatDateTime.getCurrentDate());
this.getAddTimeTextView().setText(formatDateTime.getCurrentTime());
}
}
@Override
protected void dialogOnAddButtonPressed() {
AddA1CPresenter presenter = (AddA1CPresenter) getPresenter();
if (this.isEditing()) {
presenter.dialogOnAddButtonPressed(this.getAddTimeTextView().getText().toString(),
this.getAddDateTextView().getText().toString(), readingTextView.getText().toString(), this.getEditId());
} else {
presenter.dialogOnAddButtonPressed(this.getAddTimeTextView().getText().toString(),
this.getAddDateTextView().getText().toString(), readingTextView.getText().toString());
}
}
public void showErrorMessage() {
Toast.makeText(getApplicationContext(), getString(R.string.dialog_error2), Toast.LENGTH_SHORT).show();
}
}
|
gpl-3.0
|
PascalKieslich/mousetrap-os
|
validation/README.md
|
766
|
# Validation
This directory contains a number of files concerning a technical validation of the mousetrap plugin.
The most important ones are:
* [validation_experiment_1000.osexp](validation_experiment_1000.osexp)
is the OpenSesame experiment used in the validation.
* [mouse_diagonal.csv](mouse_diagonal.csv) and [mouse_triangular.csv](mouse_triangular.csv)
contain the mouse paths used by the external hardware to generate the cursor movements.
* [validation_data](validation_data)
contains the raw data files from the validation.
* [mousetrap_validation.Rmd](mousetrap_validation.Rmd)
is the R Markdown script that analyses the validation data.
* [mousetrap_validation.pdf](mousetrap_validation.pdf)
displays the results of the validation analyses.
|
gpl-3.0
|
DeanAaron/Python3
|
python-3.5.1-docs-en/c-api/module.html
|
53232
|
<!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/html; charset=utf-8" />
<title>Module Objects — Python 3.5.1 documentation</title>
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '3.5.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<script type="text/javascript" src="../_static/sidebar.js"></script>
<link rel="search" type="application/opensearchdescription+xml"
title="Search within Python 3.5.1 documentation"
href="../_static/opensearch.xml"/>
<link rel="author" title="About these documents" href="../about.html" />
<link rel="copyright" title="Copyright" href="../copyright.html" />
<link rel="top" title="Python 3.5.1 documentation" href="../contents.html" />
<link rel="up" title="Concrete Objects Layer" href="concrete.html" />
<link rel="next" title="Iterator Objects" href="iterator.html" />
<link rel="prev" title="File Objects" href="file.html" />
<link rel="shortcut icon" type="image/png" href="../_static/py.png" />
<script type="text/javascript" src="../_static/copybutton.js"></script>
<script type="text/javascript" src="../_static/version_switch.js"></script>
</head>
<body role="document">
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="iterator.html" title="Iterator Objects"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="file.html" title="File Objects"
accesskey="P">previous</a> |</li>
<li><img src="../_static/py.png" alt=""
style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://www.python.org/">Python</a> »</li>
<li>
<span class="version_switcher_placeholder">3.5.1</span>
<a href="../index.html">Documentation </a> »
</li>
<li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> »</li>
<li class="nav-item nav-item-2"><a href="concrete.html" accesskey="U">Concrete Objects Layer</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="module-objects">
<span id="moduleobjects"></span><h1>Module Objects<a class="headerlink" href="#module-objects" title="Permalink to this headline">¶</a></h1>
<span class="target" id="index-0"></span><dl class="var">
<dt id="c.PyModule_Type">
<a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject">PyTypeObject</a> <code class="descname">PyModule_Type</code><a class="headerlink" href="#c.PyModule_Type" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-1">This instance of <a class="reference internal" href="type.html#c.PyTypeObject" title="PyTypeObject"><code class="xref c c-type docutils literal"><span class="pre">PyTypeObject</span></code></a> represents the Python module type. This
is exposed to Python programs as <code class="docutils literal"><span class="pre">types.ModuleType</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_Check">
int <code class="descname">PyModule_Check</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_Check" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if <em>p</em> is a module object, or a subtype of a module object.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_CheckExact">
int <code class="descname">PyModule_CheckExact</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *p</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_CheckExact" title="Permalink to this definition">¶</a></dt>
<dd><p>Return true if <em>p</em> is a module object, but not a subtype of
<a class="reference internal" href="#c.PyModule_Type" title="PyModule_Type"><code class="xref c c-data docutils literal"><span class="pre">PyModule_Type</span></code></a>.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_NewObject">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyModule_NewObject</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *name</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_NewObject" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-2">Return a new module object with the <a class="reference internal" href="../reference/import.html#__name__" title="__name__"><code class="xref py py-attr docutils literal"><span class="pre">__name__</span></code></a> attribute set to <em>name</em>.
The module’s <a class="reference internal" href="../reference/import.html#__name__" title="__name__"><code class="xref py py-attr docutils literal"><span class="pre">__name__</span></code></a>, <code class="xref py py-attr docutils literal"><span class="pre">__doc__</span></code>, <a class="reference internal" href="../reference/import.html#__package__" title="__package__"><code class="xref py py-attr docutils literal"><span class="pre">__package__</span></code></a>, and
<a class="reference internal" href="../reference/import.html#__loader__" title="__loader__"><code class="xref py py-attr docutils literal"><span class="pre">__loader__</span></code></a> attributes are filled in (all but <a class="reference internal" href="../reference/import.html#__name__" title="__name__"><code class="xref py py-attr docutils literal"><span class="pre">__name__</span></code></a> are set
to <code class="docutils literal"><span class="pre">None</span></code>); the caller is responsible for providing a <a class="reference internal" href="../reference/import.html#__file__" title="__file__"><code class="xref py py-attr docutils literal"><span class="pre">__file__</span></code></a>
attribute.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.3.</span></p>
</div>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 3.4: </span><a class="reference internal" href="../reference/import.html#__package__" title="__package__"><code class="xref py py-attr docutils literal"><span class="pre">__package__</span></code></a> and <a class="reference internal" href="../reference/import.html#__loader__" title="__loader__"><code class="xref py py-attr docutils literal"><span class="pre">__loader__</span></code></a> are set to <code class="docutils literal"><span class="pre">None</span></code>.</p>
</div>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_New">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyModule_New</code><span class="sig-paren">(</span>const char<em> *name</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_New" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: New reference.</em><p>Similar to <code class="xref c c-func docutils literal"><span class="pre">PyImport_NewObject()</span></code>, but the name is an UTF-8 encoded
string instead of a Unicode object.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_GetDict">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyModule_GetDict</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_GetDict" title="Permalink to this definition">¶</a></dt>
<dd><em class="refcount">Return value: Borrowed reference.</em><p id="index-3">Return the dictionary object that implements <em>module</em>‘s namespace; this object
is the same as the <code class="xref py py-attr docutils literal"><span class="pre">__dict__</span></code> attribute of the module object. This
function never fails. It is recommended extensions use other
<code class="xref c c-func docutils literal"><span class="pre">PyModule_*()</span></code> and <code class="xref c c-func docutils literal"><span class="pre">PyObject_*()</span></code> functions rather than directly
manipulate a module’s <code class="xref py py-attr docutils literal"><span class="pre">__dict__</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_GetNameObject">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyModule_GetNameObject</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_GetNameObject" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-4">Return <em>module</em>‘s <a class="reference internal" href="../reference/import.html#__name__" title="__name__"><code class="xref py py-attr docutils literal"><span class="pre">__name__</span></code></a> value. If the module does not provide one,
or if it is not a string, <a class="reference internal" href="../library/exceptions.html#SystemError" title="SystemError"><code class="xref py py-exc docutils literal"><span class="pre">SystemError</span></code></a> is raised and <em>NULL</em> is returned.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.3.</span></p>
</div>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_GetName">
char* <code class="descname">PyModule_GetName</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_GetName" title="Permalink to this definition">¶</a></dt>
<dd><p>Similar to <a class="reference internal" href="#c.PyModule_GetNameObject" title="PyModule_GetNameObject"><code class="xref c c-func docutils literal"><span class="pre">PyModule_GetNameObject()</span></code></a> but return the name encoded to
<code class="docutils literal"><span class="pre">'utf-8'</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_GetState">
void* <code class="descname">PyModule_GetState</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_GetState" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the “state” of the module, that is, a pointer to the block of memory
allocated at module creation time, or <em>NULL</em>. See
<a class="reference internal" href="#c.PyModuleDef.m_size" title="PyModuleDef.m_size"><code class="xref c c-member docutils literal"><span class="pre">PyModuleDef.m_size</span></code></a>.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_GetDef">
<a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a>* <code class="descname">PyModule_GetDef</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_GetDef" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a pointer to the <a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef"><code class="xref c c-type docutils literal"><span class="pre">PyModuleDef</span></code></a> struct from which the module was
created, or <em>NULL</em> if the module wasn’t created from a definition.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_GetFilenameObject">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyModule_GetFilenameObject</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_GetFilenameObject" title="Permalink to this definition">¶</a></dt>
<dd><p id="index-5">Return the name of the file from which <em>module</em> was loaded using <em>module</em>‘s
<a class="reference internal" href="../reference/import.html#__file__" title="__file__"><code class="xref py py-attr docutils literal"><span class="pre">__file__</span></code></a> attribute. If this is not defined, or if it is not a
unicode string, raise <a class="reference internal" href="../library/exceptions.html#SystemError" title="SystemError"><code class="xref py py-exc docutils literal"><span class="pre">SystemError</span></code></a> and return <em>NULL</em>; otherwise return
a reference to a Unicode object.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.2.</span></p>
</div>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_GetFilename">
char* <code class="descname">PyModule_GetFilename</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_GetFilename" title="Permalink to this definition">¶</a></dt>
<dd><p>Similar to <a class="reference internal" href="#c.PyModule_GetFilenameObject" title="PyModule_GetFilenameObject"><code class="xref c c-func docutils literal"><span class="pre">PyModule_GetFilenameObject()</span></code></a> but return the filename
encoded to ‘utf-8’.</p>
<div class="deprecated">
<p><span class="versionmodified">Deprecated since version 3.2: </span><a class="reference internal" href="#c.PyModule_GetFilename" title="PyModule_GetFilename"><code class="xref c c-func docutils literal"><span class="pre">PyModule_GetFilename()</span></code></a> raises <code class="xref c c-type docutils literal"><span class="pre">UnicodeEncodeError</span></code> on
unencodable filenames, use <a class="reference internal" href="#c.PyModule_GetFilenameObject" title="PyModule_GetFilenameObject"><code class="xref c c-func docutils literal"><span class="pre">PyModule_GetFilenameObject()</span></code></a> instead.</p>
</div>
</dd></dl>
<div class="section" id="initializing-c-modules">
<span id="initializing-modules"></span><h2>Initializing C modules<a class="headerlink" href="#initializing-c-modules" title="Permalink to this headline">¶</a></h2>
<p>Modules objects are usually created from extension modules (shared libraries
which export an initialization function), or compiled-in modules
(where the initialization function is added using <a class="reference internal" href="import.html#c.PyImport_AppendInittab" title="PyImport_AppendInittab"><code class="xref c c-func docutils literal"><span class="pre">PyImport_AppendInittab()</span></code></a>).
See <a class="reference internal" href="../extending/building.html#building"><span>Building C and C++ Extensions</span></a> or <a class="reference internal" href="../extending/embedding.html#extending-with-embedding"><span>Extending Embedded Python</span></a> for details.</p>
<p>The initialization function can either pass pass a module definition instance
to <a class="reference internal" href="#c.PyModule_Create" title="PyModule_Create"><code class="xref c c-func docutils literal"><span class="pre">PyModule_Create()</span></code></a>, and return the resulting module object,
or request “multi-phase initialization” by returning the definition struct itself.</p>
<dl class="type">
<dt id="c.PyModuleDef">
<code class="descname">PyModuleDef</code><a class="headerlink" href="#c.PyModuleDef" title="Permalink to this definition">¶</a></dt>
<dd><p>The module definition struct, which holds all information needed to create
a module object. There is usually only one statically initialized variable
of this type for each module.</p>
<dl class="member">
<dt id="c.PyModuleDef.m_base">
PyModuleDef_Base <code class="descname">m_base</code><a class="headerlink" href="#c.PyModuleDef.m_base" title="Permalink to this definition">¶</a></dt>
<dd><p>Always initialize this member to <code class="xref py py-const docutils literal"><span class="pre">PyModuleDef_HEAD_INIT</span></code>.</p>
</dd></dl>
<dl class="member">
<dt id="c.PyModuleDef.m_name">
char* <code class="descname">m_name</code><a class="headerlink" href="#c.PyModuleDef.m_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Name for the new module.</p>
</dd></dl>
<dl class="member">
<dt id="c.PyModuleDef.m_doc">
char* <code class="descname">m_doc</code><a class="headerlink" href="#c.PyModuleDef.m_doc" title="Permalink to this definition">¶</a></dt>
<dd><p>Docstring for the module; usually a docstring variable created with
<code class="xref c c-func docutils literal"><span class="pre">PyDoc_STRVAR()</span></code> is used.</p>
</dd></dl>
<dl class="member">
<dt id="c.PyModuleDef.m_size">
Py_ssize_t <code class="descname">m_size</code><a class="headerlink" href="#c.PyModuleDef.m_size" title="Permalink to this definition">¶</a></dt>
<dd><p>Module state may be kept in a per-module memory area that can be
retrieved with <a class="reference internal" href="#c.PyModule_GetState" title="PyModule_GetState"><code class="xref c c-func docutils literal"><span class="pre">PyModule_GetState()</span></code></a>, rather than in static globals.
This makes modules safe for use in multiple sub-interpreters.</p>
<p>This memory area is allocated based on <em>m_size</em> on module creation,
and freed when the module object is deallocated, after the
<code class="xref c c-member docutils literal"><span class="pre">m_free</span></code> function has been called, if present.</p>
<p>Setting <code class="docutils literal"><span class="pre">m_size</span></code> to <code class="docutils literal"><span class="pre">-1</span></code> means that the module does not support
sub-interpreters, because it has global state.</p>
<p>Setting it to a non-negative value means that the module can be
re-initialized and specifies the additional amount of memory it requires
for its state. Non-negative <code class="docutils literal"><span class="pre">m_size</span></code> is required for multi-phase
initialization.</p>
<p>See <span class="target" id="index-6"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-3121"><strong>PEP 3121</strong></a> for more details.</p>
</dd></dl>
<dl class="member">
<dt id="c.PyModuleDef.m_methods">
<a class="reference internal" href="structures.html#c.PyMethodDef" title="PyMethodDef">PyMethodDef</a>* <code class="descname">m_methods</code><a class="headerlink" href="#c.PyModuleDef.m_methods" title="Permalink to this definition">¶</a></dt>
<dd><p>A pointer to a table of module-level functions, described by
<a class="reference internal" href="structures.html#c.PyMethodDef" title="PyMethodDef"><code class="xref c c-type docutils literal"><span class="pre">PyMethodDef</span></code></a> values. Can be <em>NULL</em> if no functions are present.</p>
</dd></dl>
<dl class="member">
<dt id="c.PyModuleDef.m_slots">
<a class="reference internal" href="#c.PyModuleDef_Slot" title="PyModuleDef_Slot">PyModuleDef_Slot</a>* <code class="descname">m_slots</code><a class="headerlink" href="#c.PyModuleDef.m_slots" title="Permalink to this definition">¶</a></dt>
<dd><p>An array of slot definitions for multi-phase initialization, terminated by
a <code class="docutils literal"><span class="pre">{0,</span> <span class="pre">NULL}</span></code> entry.
When using single-phase initialization, <em>m_slots</em> must be <em>NULL</em>.</p>
<div class="versionchanged">
<p><span class="versionmodified">Changed in version 3.5: </span>Prior to version 3.5, this member was always set to <em>NULL</em>,
and was defined as:</p>
<blockquote>
<div><dl class="member">
<dt id="c.PyModuleDef.m_reload">
<a class="reference internal" href="gcsupport.html#c.inquiry" title="inquiry">inquiry</a> <code class="descname">m_reload</code><a class="headerlink" href="#c.PyModuleDef.m_reload" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</div></blockquote>
</div>
</dd></dl>
<dl class="member">
<dt id="c.PyModuleDef.m_traverse">
<a class="reference internal" href="gcsupport.html#c.traverseproc" title="traverseproc">traverseproc</a> <code class="descname">m_traverse</code><a class="headerlink" href="#c.PyModuleDef.m_traverse" title="Permalink to this definition">¶</a></dt>
<dd><p>A traversal function to call during GC traversal of the module object, or
<em>NULL</em> if not needed.</p>
</dd></dl>
<dl class="member">
<dt id="c.PyModuleDef.m_clear">
<a class="reference internal" href="gcsupport.html#c.inquiry" title="inquiry">inquiry</a> <code class="descname">m_clear</code><a class="headerlink" href="#c.PyModuleDef.m_clear" title="Permalink to this definition">¶</a></dt>
<dd><p>A clear function to call during GC clearing of the module object, or
<em>NULL</em> if not needed.</p>
</dd></dl>
<dl class="member">
<dt id="c.PyModuleDef.m_free">
freefunc <code class="descname">m_free</code><a class="headerlink" href="#c.PyModuleDef.m_free" title="Permalink to this definition">¶</a></dt>
<dd><p>A function to call during deallocation of the module object, or <em>NULL</em> if
not needed.</p>
</dd></dl>
</dd></dl>
<div class="section" id="single-phase-initialization">
<h3>Single-phase initialization<a class="headerlink" href="#single-phase-initialization" title="Permalink to this headline">¶</a></h3>
<p>The module initialization function may create and return the module object
directly. This is referred to as “single-phase initialization”, and uses one
of the following two module creation functions:</p>
<dl class="function">
<dt id="c.PyModule_Create">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyModule_Create</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a><em> *def</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_Create" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new module object, given the definition in <em>def</em>. This behaves
like <a class="reference internal" href="#c.PyModule_Create2" title="PyModule_Create2"><code class="xref c c-func docutils literal"><span class="pre">PyModule_Create2()</span></code></a> with <em>module_api_version</em> set to
<code class="xref py py-const docutils literal"><span class="pre">PYTHON_API_VERSION</span></code>.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_Create2">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyModule_Create2</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a><em> *def</em>, int<em> module_api_version</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_Create2" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new module object, given the definition in <em>def</em>, assuming the
API version <em>module_api_version</em>. If that version does not match the version
of the running interpreter, a <a class="reference internal" href="../library/exceptions.html#RuntimeWarning" title="RuntimeWarning"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeWarning</span></code></a> is emitted.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Most uses of this function should be using <a class="reference internal" href="#c.PyModule_Create" title="PyModule_Create"><code class="xref c c-func docutils literal"><span class="pre">PyModule_Create()</span></code></a>
instead; only use this if you are sure you need it.</p>
</div>
</dd></dl>
<p>Before it is returned from in the initialization function, the resulting module
object is typically populated using functions like <a class="reference internal" href="#c.PyModule_AddObject" title="PyModule_AddObject"><code class="xref c c-func docutils literal"><span class="pre">PyModule_AddObject()</span></code></a>.</p>
</div>
<div class="section" id="multi-phase-initialization">
<span id="id1"></span><h3>Multi-phase initialization<a class="headerlink" href="#multi-phase-initialization" title="Permalink to this headline">¶</a></h3>
<p>An alternate way to specify extensions is to request “multi-phase initialization”.
Extension modules created this way behave more like Python modules: the
initialization is split between the <em>creation phase</em>, when the module object
is created, and the <em>execution phase</em>, when it is populated.
The distinction is similar to the <a class="reference internal" href="../reference/datamodel.html#object.__new__" title="object.__new__"><code class="xref py py-meth docutils literal"><span class="pre">__new__()</span></code></a> and <a class="reference internal" href="../reference/datamodel.html#object.__init__" title="object.__init__"><code class="xref py py-meth docutils literal"><span class="pre">__init__()</span></code></a> methods
of classes.</p>
<p>Unlike modules created using single-phase initialization, these modules are not
singletons: if the <em>sys.modules</em> entry is removed and the module is re-imported,
a new module object is created, and the old module is subject to normal garbage
collection – as with Python modules.
By default, multiple modules created from the same definition should be
independent: changes to one should not affect the others.
This means that all state should be specific to the module object (using e.g.
using <a class="reference internal" href="#c.PyModule_GetState" title="PyModule_GetState"><code class="xref c c-func docutils literal"><span class="pre">PyModule_GetState()</span></code></a>), or its contents (such as the module’s
<code class="xref py py-attr docutils literal"><span class="pre">__dict__</span></code> or individual classes created with <a class="reference internal" href="type.html#c.PyType_FromSpec" title="PyType_FromSpec"><code class="xref c c-func docutils literal"><span class="pre">PyType_FromSpec()</span></code></a>).</p>
<p>All modules created using multi-phase initialization are expected to support
<a class="reference internal" href="init.html#sub-interpreter-support"><span>sub-interpreters</span></a>. Making sure multiple modules
are independent is typically enough to achieve this.</p>
<p>To request multi-phase initialization, the initialization function
(PyInit_modulename) returns a <a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef"><code class="xref c c-type docutils literal"><span class="pre">PyModuleDef</span></code></a> instance with non-empty
<a class="reference internal" href="#c.PyModuleDef.m_slots" title="PyModuleDef.m_slots"><code class="xref c c-member docutils literal"><span class="pre">m_slots</span></code></a>. Before it is returned, the <code class="docutils literal"><span class="pre">PyModuleDef</span></code>
instance must be initialized with the following function:</p>
<dl class="function">
<dt id="c.PyModuleDef_Init">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyModuleDef_Init</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a><em> *def</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModuleDef_Init" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensures a module definition is a properly initialized Python object that
correctly reports its type and reference count.</p>
<p>Returns <em>def</em> cast to <code class="docutils literal"><span class="pre">PyObject*</span></code>, or <em>NULL</em> if an error occurred.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.5.</span></p>
</div>
</dd></dl>
<p>The <em>m_slots</em> member of the module definition must point to an array of
<code class="docutils literal"><span class="pre">PyModuleDef_Slot</span></code> structures:</p>
<dl class="type">
<dt id="c.PyModuleDef_Slot">
<code class="descname">PyModuleDef_Slot</code><a class="headerlink" href="#c.PyModuleDef_Slot" title="Permalink to this definition">¶</a></dt>
<dd><dl class="member">
<dt id="c.PyModuleDef_Slot.slot">
int <code class="descname">slot</code><a class="headerlink" href="#c.PyModuleDef_Slot.slot" title="Permalink to this definition">¶</a></dt>
<dd><p>A slot ID, chosen from the available values explained below.</p>
</dd></dl>
<dl class="member">
<dt id="c.PyModuleDef_Slot.value">
void* <code class="descname">value</code><a class="headerlink" href="#c.PyModuleDef_Slot.value" title="Permalink to this definition">¶</a></dt>
<dd><p>Value of the slot, whose meaning depends on the slot ID.</p>
</dd></dl>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.5.</span></p>
</div>
</dd></dl>
<p>The <em>m_slots</em> array must be terminated by a slot with id 0.</p>
<p>The available slot types are:</p>
<dl class="var">
<dt id="c.Py_mod_create">
<code class="descname">Py_mod_create</code><a class="headerlink" href="#c.Py_mod_create" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies a function that is called to create the module object itself.
The <em>value</em> pointer of this slot must point to a function of the signature:</p>
<dl class="function">
<dt id="c.create_module">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">create_module</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *spec</em>, <a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a><em> *def</em><span class="sig-paren">)</span><a class="headerlink" href="#c.create_module" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>The function receives a <a class="reference internal" href="../library/importlib.html#importlib.machinery.ModuleSpec" title="importlib.machinery.ModuleSpec"><code class="xref py py-class docutils literal"><span class="pre">ModuleSpec</span></code></a>
instance, as defined in <span class="target" id="index-7"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0451"><strong>PEP 451</strong></a>, and the module definition.
It should return a new module object, or set an error
and return <em>NULL</em>.</p>
<p>This function should be kept minimal. In particular, it should not
call arbitrary Python code, as trying to import the same module again may
result in an infinite loop.</p>
<p>Multiple <code class="docutils literal"><span class="pre">Py_mod_create</span></code> slots may not be specified in one module
definition.</p>
<p>If <code class="docutils literal"><span class="pre">Py_mod_create</span></code> is not specified, the import machinery will create
a normal module object using <a class="reference internal" href="#c.PyModule_New" title="PyModule_New"><code class="xref c c-func docutils literal"><span class="pre">PyModule_New()</span></code></a>. The name is taken from
<em>spec</em>, not the definition, to allow extension modules to dynamically adjust
to their place in the module hierarchy and be imported under different
names through symlinks, all while sharing a single module definition.</p>
<p>There is no requirement for the returned object to be an instance of
<a class="reference internal" href="#c.PyModule_Type" title="PyModule_Type"><code class="xref c c-type docutils literal"><span class="pre">PyModule_Type</span></code></a>. Any type can be used, as long as it supports
setting and getting import-related attributes.
However, only <code class="docutils literal"><span class="pre">PyModule_Type</span></code> instances may be returned if the
<code class="docutils literal"><span class="pre">PyModuleDef</span></code> has non-<em>NULL</em> <code class="docutils literal"><span class="pre">m_methods</span></code>, <code class="docutils literal"><span class="pre">m_traverse</span></code>, <code class="docutils literal"><span class="pre">m_clear</span></code>,
<code class="docutils literal"><span class="pre">m_free</span></code>; non-zero <code class="docutils literal"><span class="pre">m_size</span></code>; or slots other than <code class="docutils literal"><span class="pre">Py_mod_create</span></code>.</p>
</dd></dl>
<dl class="var">
<dt id="c.Py_mod_exec">
<code class="descname">Py_mod_exec</code><a class="headerlink" href="#c.Py_mod_exec" title="Permalink to this definition">¶</a></dt>
<dd><p>Specifies a function that is called to <em>execute</em> the module.
This is equivalent to executing the code of a Python module: typically,
this function adds classes and constants to the module.
The signature of the function is:</p>
<dl class="function">
<dt id="c.exec_module">
int <code class="descname">exec_module</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>*<em> module</em><span class="sig-paren">)</span><a class="headerlink" href="#c.exec_module" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<p>If multiple <code class="docutils literal"><span class="pre">Py_mod_exec</span></code> slots are specified, they are processed in the
order they appear in the <em>m_slots</em> array.</p>
</dd></dl>
<p>See <span class="target" id="index-8"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0489"><strong>PEP 489</strong></a> for more details on multi-phase initialization.</p>
</div>
<div class="section" id="low-level-module-creation-functions">
<h3>Low-level module creation functions<a class="headerlink" href="#low-level-module-creation-functions" title="Permalink to this headline">¶</a></h3>
<p>The following functions are called under the hood when using multi-phase
initialization. They can be used directly, for example when creating module
objects dynamically. Note that both <code class="docutils literal"><span class="pre">PyModule_FromDefAndSpec</span></code> and
<code class="docutils literal"><span class="pre">PyModule_ExecDef</span></code> must be called to fully initialize a module.</p>
<dl class="function">
<dt id="c.PyModule_FromDefAndSpec">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a> * <code class="descname">PyModule_FromDefAndSpec</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a><em> *def</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *spec</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_FromDefAndSpec" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new module object, given the definition in <em>module</em> and the
ModuleSpec <em>spec</em>. This behaves like <a class="reference internal" href="#c.PyModule_FromDefAndSpec2" title="PyModule_FromDefAndSpec2"><code class="xref c c-func docutils literal"><span class="pre">PyModule_FromDefAndSpec2()</span></code></a>
with <em>module_api_version</em> set to <code class="xref py py-const docutils literal"><span class="pre">PYTHON_API_VERSION</span></code>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.5.</span></p>
</div>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_FromDefAndSpec2">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a> * <code class="descname">PyModule_FromDefAndSpec2</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a><em> *def</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *spec</em>, int<em> module_api_version</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_FromDefAndSpec2" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new module object, given the definition in <em>module</em> and the
ModuleSpec <em>spec</em>, assuming the API version <em>module_api_version</em>.
If that version does not match the version of the running interpreter,
a <a class="reference internal" href="../library/exceptions.html#RuntimeWarning" title="RuntimeWarning"><code class="xref py py-exc docutils literal"><span class="pre">RuntimeWarning</span></code></a> is emitted.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Most uses of this function should be using <a class="reference internal" href="#c.PyModule_FromDefAndSpec" title="PyModule_FromDefAndSpec"><code class="xref c c-func docutils literal"><span class="pre">PyModule_FromDefAndSpec()</span></code></a>
instead; only use this if you are sure you need it.</p>
</div>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.5.</span></p>
</div>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_ExecDef">
int <code class="descname">PyModule_ExecDef</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em>, <a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a><em> *def</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_ExecDef" title="Permalink to this definition">¶</a></dt>
<dd><p>Process any execution slots (<a class="reference internal" href="#c.Py_mod_exec" title="Py_mod_exec"><code class="xref c c-data docutils literal"><span class="pre">Py_mod_exec</span></code></a>) given in <em>def</em>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.5.</span></p>
</div>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_SetDocString">
int <code class="descname">PyModule_SetDocString</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em>, const char<em> *docstring</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_SetDocString" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the docstring for <em>module</em> to <em>docstring</em>.
This function is called automatically when creating a module from
<code class="docutils literal"><span class="pre">PyModuleDef</span></code>, using either <code class="docutils literal"><span class="pre">PyModule_Create</span></code> or
<code class="docutils literal"><span class="pre">PyModule_FromDefAndSpec</span></code>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.5.</span></p>
</div>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_AddFunctions">
int <code class="descname">PyModule_AddFunctions</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em>, <a class="reference internal" href="structures.html#c.PyMethodDef" title="PyMethodDef">PyMethodDef</a><em> *functions</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_AddFunctions" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the functions from the <em>NULL</em> terminated <em>functions</em> array to <em>module</em>.
Refer to the <a class="reference internal" href="structures.html#c.PyMethodDef" title="PyMethodDef"><code class="xref c c-type docutils literal"><span class="pre">PyMethodDef</span></code></a> documentation for details on individual
entries (due to the lack of a shared module namespace, module level
“functions” implemented in C typically receive the module as their first
parameter, making them similar to instance methods on Python classes).
This function is called automatically when creating a module from
<code class="docutils literal"><span class="pre">PyModuleDef</span></code>, using either <code class="docutils literal"><span class="pre">PyModule_Create</span></code> or
<code class="docutils literal"><span class="pre">PyModule_FromDefAndSpec</span></code>.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.5.</span></p>
</div>
</dd></dl>
</div>
<div class="section" id="support-functions">
<h3>Support functions<a class="headerlink" href="#support-functions" title="Permalink to this headline">¶</a></h3>
<p>The module initialization function (if using single phase initialization) or
a function called from a module execution slot (if using multi-phase
initialization), can use the following functions to help initialize the module
state:</p>
<dl class="function">
<dt id="c.PyModule_AddObject">
int <code class="descname">PyModule_AddObject</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em>, const char<em> *name</em>, <a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *value</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_AddObject" title="Permalink to this definition">¶</a></dt>
<dd><p>Add an object to <em>module</em> as <em>name</em>. This is a convenience function which can
be used from the module’s initialization function. This steals a reference to
<em>value</em>. Return <code class="docutils literal"><span class="pre">-1</span></code> on error, <code class="docutils literal"><span class="pre">0</span></code> on success.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_AddIntConstant">
int <code class="descname">PyModule_AddIntConstant</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em>, const char<em> *name</em>, long<em> value</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_AddIntConstant" title="Permalink to this definition">¶</a></dt>
<dd><p>Add an integer constant to <em>module</em> as <em>name</em>. This convenience function can be
used from the module’s initialization function. Return <code class="docutils literal"><span class="pre">-1</span></code> on error, <code class="docutils literal"><span class="pre">0</span></code> on
success.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_AddStringConstant">
int <code class="descname">PyModule_AddStringConstant</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em>, const char<em> *name</em>, const char<em> *value</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_AddStringConstant" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a string constant to <em>module</em> as <em>name</em>. This convenience function can be
used from the module’s initialization function. The string <em>value</em> must be
<em>NULL</em>-terminated. Return <code class="docutils literal"><span class="pre">-1</span></code> on error, <code class="docutils literal"><span class="pre">0</span></code> on success.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_AddIntMacro">
int <code class="descname">PyModule_AddIntMacro</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em>, macro<span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_AddIntMacro" title="Permalink to this definition">¶</a></dt>
<dd><p>Add an int constant to <em>module</em>. The name and the value are taken from
<em>macro</em>. For example <code class="docutils literal"><span class="pre">PyModule_AddIntMacro(module,</span> <span class="pre">AF_INET)</span></code> adds the int
constant <em>AF_INET</em> with the value of <em>AF_INET</em> to <em>module</em>.
Return <code class="docutils literal"><span class="pre">-1</span></code> on error, <code class="docutils literal"><span class="pre">0</span></code> on success.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyModule_AddStringMacro">
int <code class="descname">PyModule_AddStringMacro</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em>, macro<span class="sig-paren">)</span><a class="headerlink" href="#c.PyModule_AddStringMacro" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a string constant to <em>module</em>.</p>
</dd></dl>
</div>
</div>
<div class="section" id="module-lookup">
<h2>Module lookup<a class="headerlink" href="#module-lookup" title="Permalink to this headline">¶</a></h2>
<p>Single-phase initialization creates singleton modules that can be looked up
in the context of the current interpreter. This allows the module object to be
retrieved later with only a reference to the module definition.</p>
<p>These functions will not work on modules created using multi-phase initialization,
since multiple such modules can be created from a single definition.</p>
<dl class="function">
<dt id="c.PyState_FindModule">
<a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a>* <code class="descname">PyState_FindModule</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a><em> *def</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyState_FindModule" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the module object that was created from <em>def</em> for the current interpreter.
This method requires that the module object has been attached to the interpreter state with
<a class="reference internal" href="#c.PyState_AddModule" title="PyState_AddModule"><code class="xref c c-func docutils literal"><span class="pre">PyState_AddModule()</span></code></a> beforehand. In case the corresponding module object is not
found or has not been attached to the interpreter state yet, it returns <em>NULL</em>.</p>
</dd></dl>
<dl class="function">
<dt id="c.PyState_AddModule">
int <code class="descname">PyState_AddModule</code><span class="sig-paren">(</span><a class="reference internal" href="structures.html#c.PyObject" title="PyObject">PyObject</a><em> *module</em>, <a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a><em> *def</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyState_AddModule" title="Permalink to this definition">¶</a></dt>
<dd><p>Attaches the module object passed to the function to the interpreter state. This allows
the module object to be accessible via <a class="reference internal" href="#c.PyState_FindModule" title="PyState_FindModule"><code class="xref c c-func docutils literal"><span class="pre">PyState_FindModule()</span></code></a>.</p>
<p>Only effective on modules created using single-phase initialization.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.3.</span></p>
</div>
</dd></dl>
<dl class="function">
<dt id="c.PyState_RemoveModule">
int <code class="descname">PyState_RemoveModule</code><span class="sig-paren">(</span><a class="reference internal" href="#c.PyModuleDef" title="PyModuleDef">PyModuleDef</a><em> *def</em><span class="sig-paren">)</span><a class="headerlink" href="#c.PyState_RemoveModule" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes the module object created from <em>def</em> from the interpreter state.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 3.3.</span></p>
</div>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../contents.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Module Objects</a><ul>
<li><a class="reference internal" href="#initializing-c-modules">Initializing C modules</a><ul>
<li><a class="reference internal" href="#single-phase-initialization">Single-phase initialization</a></li>
<li><a class="reference internal" href="#multi-phase-initialization">Multi-phase initialization</a></li>
<li><a class="reference internal" href="#low-level-module-creation-functions">Low-level module creation functions</a></li>
<li><a class="reference internal" href="#support-functions">Support functions</a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-lookup">Module lookup</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="file.html"
title="previous chapter">File Objects</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="iterator.html"
title="next chapter">Iterator Objects</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../bugs.html">Report a Bug</a></li>
<li><a href="../_sources/c-api/module.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="iterator.html" title="Iterator Objects"
>next</a> |</li>
<li class="right" >
<a href="file.html" title="File Objects"
>previous</a> |</li>
<li><img src="../_static/py.png" alt=""
style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://www.python.org/">Python</a> »</li>
<li>
<span class="version_switcher_placeholder">3.5.1</span>
<a href="../index.html">Documentation </a> »
</li>
<li class="nav-item nav-item-1"><a href="index.html" >Python/C API Reference Manual</a> »</li>
<li class="nav-item nav-item-2"><a href="concrete.html" >Concrete Objects Layer</a> »</li>
</ul>
</div>
<div class="footer">
© <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
<br />
The Python Software Foundation is a non-profit corporation.
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
Last updated on Jan 22, 2016.
<a href="../bugs.html">Found a bug</a>?
<br />
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
</div>
</body>
</html>
|
gpl-3.0
|
liflab/labpal
|
docs/doc/ca/uqac/lif/labpal/macro/class-use/NumberMacro.html
|
6762
|
<!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 (1.8.0_201) on Thu Oct 01 18:36:30 EDT 2020 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
<title>Uses of Class ca.uqac.lif.labpal.macro.NumberMacro (LabPal Documentation)</title>
<meta name="date" content="2020-10-01">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class ca.uqac.lif.labpal.macro.NumberMacro (LabPal Documentation)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<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="../../../../../../ca/uqac/lif/labpal/macro/NumberMacro.html" title="class in ca.uqac.lif.labpal.macro">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-all.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?ca/uqac/lif/labpal/macro/class-use/NumberMacro.html" target="_top">Frames</a></li>
<li><a href="NumberMacro.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 ca.uqac.lif.labpal.macro.NumberMacro" class="title">Uses of Class<br>ca.uqac.lif.labpal.macro.NumberMacro</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../../../../ca/uqac/lif/labpal/macro/NumberMacro.html" title="class in ca.uqac.lif.labpal.macro">NumberMacro</a></span><span class="tabEnd"> </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="#ca.uqac.lif.labpal.macro">ca.uqac.lif.labpal.macro</a></td>
<td class="colLast">
<div class="block">Provides classes for creating user-defined data points
computed from the contents of a laboratory.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="ca.uqac.lif.labpal.macro">
<!-- -->
</a>
<h3>Uses of <a href="../../../../../../ca/uqac/lif/labpal/macro/NumberMacro.html" title="class in ca.uqac.lif.labpal.macro">NumberMacro</a> in <a href="../../../../../../ca/uqac/lif/labpal/macro/package-summary.html">ca.uqac.lif.labpal.macro</a></h3>
<table class="useSummary" border="0" cellpadding="3" cellspacing="0" summary="Use table, listing subclasses, and an explanation">
<caption><span>Subclasses of <a href="../../../../../../ca/uqac/lif/labpal/macro/NumberMacro.html" title="class in ca.uqac.lif.labpal.macro">NumberMacro</a> in <a href="../../../../../../ca/uqac/lif/labpal/macro/package-summary.html">ca.uqac.lif.labpal.macro</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../ca/uqac/lif/labpal/macro/ConstantNumberMacro.html" title="class in ca.uqac.lif.labpal.macro">ConstantNumberMacro</a></span></code>
<div class="block">Macro that outputs a single number that does not depend on the lab's state.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<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="../../../../../../ca/uqac/lif/labpal/macro/NumberMacro.html" title="class in ca.uqac.lif.labpal.macro">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-all.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?ca/uqac/lif/labpal/macro/class-use/NumberMacro.html" target="_top">Frames</a></li>
<li><a href="NumberMacro.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 ======= -->
<p class="legalCopy"><small><i>Copyright © Sylvain Hallé. All Rights Reserved.</i></small></p>
</body>
</html>
|
gpl-3.0
|
FilipeNavas/ne04j-sistemaontologia
|
doc/java/api/org/neo4j/graphdb/factory/class-use/GraphDatabaseBuilder.Delegator.html
|
6385
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_35) on Tue Apr 02 11:39:59 BST 2013 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class org.neo4j.graphdb.factory.GraphDatabaseBuilder.Delegator (Neo4j Community 2.0.0-M01 API)
</TITLE>
<META NAME="date" CONTENT="2013-04-02">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class org.neo4j.graphdb.factory.GraphDatabaseBuilder.Delegator (Neo4j Community 2.0.0-M01 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/neo4j/graphdb/factory/GraphDatabaseBuilder.Delegator.html" title="class in org.neo4j.graphdb.factory"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Neo4j Community</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/neo4j/graphdb/factory//class-useGraphDatabaseBuilder.Delegator.html" target="_top"><B>FRAMES</B></A>
<A HREF="GraphDatabaseBuilder.Delegator.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<CENTER>
<H2>
<B>Uses of Class<br>org.neo4j.graphdb.factory.GraphDatabaseBuilder.Delegator</B></H2>
</CENTER>
No usage of org.neo4j.graphdb.factory.GraphDatabaseBuilder.Delegator
<P>
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/neo4j/graphdb/factory/GraphDatabaseBuilder.Delegator.html" title="class in org.neo4j.graphdb.factory"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
Neo4j Community</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV
NEXT</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html?org/neo4j/graphdb/factory//class-useGraphDatabaseBuilder.Delegator.html" target="_top"><B>FRAMES</B></A>
<A HREF="GraphDatabaseBuilder.Delegator.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2002-2013 <a href="http://neo4j.org/">The Neo4j Graph Database Project</a>. All Rights Reserved.
</BODY>
</HTML>
|
gpl-3.0
|
logxen/Fritzing
|
src/dialogs/recoverydialog.h
|
1952
|
/*******************************************************************
Part of the Fritzing project - http://fritzing.org
Copyright (c) 2007-2010 Fachhochschule Potsdam - http://fh-potsdam.de
Fritzing 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.
Fritzing 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 Fritzing. If not, see <http://www.gnu.org/licenses/>.
********************************************************************
$Revision: 4346 $:
$Author: cohen@irascible.com $:
$Date: 2010-07-08 23:30:53 -0700 (Thu, 08 Jul 2010) $
********************************************************************/
#ifndef RECOVERYDIALOG_H
#define RECOVERYDIALOG_H
#include <QDialog>
#include <QTreeWidget>
#include <QString>
#include <QFileInfoList>
#include <QStyleOptionViewItem>
class CenteredTreeWidget : public QTreeWidget {
Q_OBJECT
public:
CenteredTreeWidget(QWidget *parent = 0);
protected:
QStyleOptionViewItem viewOptions () const;
};
class RecoveryDialog : public QDialog {
Q_OBJECT
public:
RecoveryDialog(QFileInfoList fileList, QWidget *parent = 0, Qt::WindowFlags flags = 0);
QList<QTreeWidgetItem*> getFileList();
protected:
QString getOriginalFileName(const QString & path);
QList<QTreeWidgetItem*> m_fileList;
QTreeWidget *m_recoveryList;
QPushButton *m_recover;
QPushButton *m_ignore;
protected slots:
void updateRecoverButton();
};
#endif // RECOVERYDIALOG_H
|
gpl-3.0
|
fajrin1243/karani
|
assets/css/pages.css
|
15304
|
/*
Template Name: Moltran Dashboard
Author: CoderThemes
Email: coderthemes@gmail.com
File: Pages
*/
/*
- Profile
- Timeline-2
- Pricing
- Sweet Alerts
- Maps
- Email
- Timeline
- Charts
- Count Down
- Gallery
- Maintenance
- Account Pages
*/
/* ==============
Profile
===================*/
.bg-img {
background: url(../images/small/bg.jpg) center;
background-size: cover;
}
.bg-overlay {
-moz-border-radius: 6px 6px 0px 0px;
-webkit-border-radius: 6px 6px 0px 0px;
background-color: rgba(49, 126, 235, 0.4);
border-radius: 6px 6px 0px 0px;
height: 100%;
left: 0px;
position: absolute;
top: 0px;
width: 100%;
}
.bg-picture {
-webkit-background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
margin: -20px -25px 0px -25px;
padding: 100px 0px;
position: relative;
}
.bg-picture > .bg-picture-overlay {
background-image: -o-linear-gradient(top, rgba(255, 255, 255, 0) 0, rgba(0, 0, 0, 0.4) 100%);
background-image: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0)), to(rgba(0, 0, 0, 0.4)));
background-image: -webkit-linear-gradient(top, rgba(255, 255, 255, 0) 0, rgba(0, 0, 0, 0.4) 100%);
background-image: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0, rgba(0, 0, 0, 0.4) 100%);
bottom: 0;
left: 0;
position: absolute;
right: 0;
top: 0;
}
.profile-info-name {
position: relative;
}
.profile-tab-content {
background-color: transparent !important;
box-shadow: none !important;
margin-top: 35px;
}
.user-tabs {
background-color: #ffffff;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
margin-left: -35px;
padding-left: 25px;
margin-right: -20px;
padding-right: 10px;
}
.user-tabs .nav.nav-tabs {
box-shadow: none !important;
}
.user-tabs .nav.nav-tabs a {
text-transform: uppercase;
}
.user-tabs .pull-right .btn {
margin-top: 8px;
}
.about-info-p {
margin-bottom: 20px;
}
.about-info-p p {
font-size: 16px;
}
/* ==============
Timeline -2
===================*/
.timeline-2 {
border-left: 2px solid #14082d;
position: relative;
}
.timeline-2 .time-item:after {
background-color: #ffffff;
border-color: #14082d;
border-radius: 10px;
border-style: solid;
border-width: 2px;
bottom: 0;
content: '';
height: 14px;
left: 0;
margin-left: -8px;
position: absolute;
top: 5px;
width: 14px;
}
.time-item {
border-color: #dee5e7;
padding-bottom: 1px;
position: relative;
}
.time-item:before {
content: " ";
display: table;
}
.time-item:after {
background-color: #ffffff;
border-color: #14082d;
border-radius: 10px;
border-style: solid;
border-width: 2px;
bottom: 0;
content: '';
height: 14px;
left: 0;
margin-left: -8px;
position: absolute;
top: 5px;
width: 14px;
}
.time-item-item:after {
content: " ";
display: table;
}
.item-info {
margin-bottom: 15px;
margin-left: 15px;
}
.item-info p {
margin-bottom: 10px !important;
}
/* ==============
Pricing
===================*/
.pricing-plan {
padding-bottom: 50px;
}
.price_card {
-moz-border-radius: 5px;
-moz-box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
-webkit-border-radius: 5px;
background: #fafafa;
border-radius: 5px;
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
margin-bottom: 30px;
padding-bottom: 20px;
position: relative;
webkit-box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
}
.price_card .name {
display: block;
font-size: 16px;
font-weight: 700;
padding: 0 0 30px;
text-align: center;
width: 100%;
}
.price_card button {
margin-top: 20px;
}
.pricing-header {
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
color: #ffffff;
}
.price {
display: block;
font-size: 48px;
font-weight: 300;
padding: 30px 0 10px;
text-align: center;
width: 100%;
}
.price-features {
color: #8a8a8a;
list-style: none;
margin: 0;
padding: 0;
text-align: center;
}
.price-features li {
margin: 0 35px;
padding: 20px 15px;
}
.pricing-item {
margin: 0 0 30px;
position: relative;
text-align: center;
}
.pricing-item-inner {
-moz-transition: all 0.27s cubic-bezier(0, 0, 0.58, 1);
-ms-transition: all 0.27s cubic-bezier(0, 0, 0.58, 1);
-o-transition: all 0.27s cubic-bezier(0, 0, 0.58, 1);
-webkit-transition: all 0.27s cubic-bezier(0, 0, 0.58, 1);
border-radius: 7px;
border: 2px solid rgba(151, 160, 175, 0.2);
transition: all 0.27s cubic-bezier(0, 0, 0.58, 1);
vertical-align: middle;
}
.pricing-wrap {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
overflow: hidden;
padding: 30px 20px;
position: relative;
text-align: center;
}
.pricing-icon {
font-size: 32px;
padding-bottom: 5px;
padding-top: 10px;
position: relative;
z-index: 1;
}
.pricing-title {
font-size: 16px;
font-weight: 700;
margin-bottom: 40px;
position: relative;
text-transform: uppercase;
z-index: 1;
}
.pr-list {
color: #97a0af;
font-size: 12px;
font-weight: 400;
margin: 0 -20px 30px;
padding: 0;
text-transform: uppercase;
}
.pr-list li {
list-style: none;
padding: 12px 20px;
}
.pricing-num {
font-size: 40px;
font-weight: 700;
line-height: 1;
}
.pricing-num sup {
font-size: 18px;
font-weight: 400;
left: -3px;
margin-left: -7px;
position: relative;
top: -20px;
}
.pr-per {
color: #97a0af;
font-size: 12px;
}
.pr-button {
margin-top: 30px;
}
/* ==============
Sweet Alert
===================*/
.sweet-alert p {
font-size: 14px;
font-weight: 500;
line-height: 22px;
}
button.confirm {
background-color: #5e35b1 !important;
border-color: #5e35b1 !important;
box-shadow: none !important;
}
/* ==============
Maps
===================*/
.gmaps,
.gmaps-panaroma {
height: 300px;
background: #eeeeee;
border-radius: 3px;
}
.gmaps-overlay {
display: block;
text-align: center;
color: #ffffff;
font-size: 16px;
line-height: 40px;
background: #5e35b1;
border-radius: 4px;
padding: 10px 20px;
}
.gmaps-overlay_arrow {
left: 50%;
margin-left: -16px;
width: 0;
height: 0;
position: absolute;
}
.gmaps-overlay_arrow.above {
bottom: -15px;
border-left: 16px solid transparent;
border-right: 16px solid transparent;
border-top: 16px solid #5e35b1;
}
.gmaps-overlay_arrow.below {
top: -15px;
border-left: 16px solid transparent;
border-right: 16px solid transparent;
border-bottom: 16px solid #5e35b1;
}
/* ==============
Email
===================*/
.mails a {
color: #444444;
}
.mails .checkbox {
margin-bottom: 0px;
margin-top: 0px;
vertical-align: middle;
}
.mails .checkbox label {
min-height: 16px;
}
/* ==============
Time line-1
===================*/
.cd-container {
width: 90%;
max-width: 1170px;
margin: 0 auto;
}
.cd-container::after {
content: '';
display: table;
clear: both;
}
#cd-timeline {
margin-bottom: 2em;
margin-top: 2em;
padding: 2em 0;
position: relative;
}
#cd-timeline::before {
background: #ffffff;
content: '';
height: 100%;
left: 18px;
position: absolute;
top: 0;
width: 4px;
}
@media only screen and (min-width: 1170px) {
#cd-timeline {
margin-bottom: 3em;
margin-top: 3em;
}
#cd-timeline::before {
left: 50%;
margin-left: -2px;
}
}
.cd-timeline-block {
margin: 2em 0;
position: relative;
}
.cd-timeline-block:after {
clear: both;
content: "";
display: table;
}
.cd-timeline-block:first-child {
margin-top: 0;
}
.cd-timeline-block:last-child {
margin-bottom: 0;
}
@media only screen and (min-width: 1170px) {
.cd-timeline-block {
margin: 4em 0;
}
.cd-timeline-block:first-child {
margin-top: 0;
}
.cd-timeline-block:last-child {
margin-bottom: 0;
}
}
.cd-timeline-img {
position: absolute;
top: 0;
left: 0;
width: 40px;
height: 40px;
border-radius: 50%;
box-shadow: 0 0 0 4px white, inset 0 2px 0 rgba(0, 0, 0, 0.08), 0 3px 0 4px rgba(0, 0, 0, 0.05);
text-align: center;
line-height: 40px;
font-size: 20px;
color: #fff;
}
.cd-timeline-img.cd-success {
background: #00b19d;
}
.cd-timeline-img.cd-info {
background: #29b6f6;
}
.cd-timeline-img.cd-pink {
background: #ec407a;
}
.cd-timeline-img.cd-danger {
background: #ef5350;
}
.cd-timeline-img.cd-primary {
background: #5e35b1;
}
.cd-timeline-img.cd-warning {
background: #ffd740;
}
@media only screen and (min-width: 1170px) {
.cd-timeline-img {
width: 60px;
height: 60px;
line-height: 60px;
left: 50%;
margin-left: -30px;
-webkit-transform: translateZ(0);
-webkit-backface-visibility: hidden;
}
.cssanimations .cd-timeline-img.is-hidden {
visibility: hidden;
}
.cssanimations .cd-timeline-img.bounce-in {
visibility: visible;
-webkit-animation: cd-bounce-1 0.6s;
-moz-animation: cd-bounce-1 0.6s;
animation: cd-bounce-1 0.6s;
}
}
.cd-timeline-content {
-moz-box-shadow: 0 5px 5px -5px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 5px 5px -5px rgba(0, 0, 0, 0.1);
background: white;
border-radius: 0;
box-shadow: 0 5px 5px -5px rgba(0, 0, 0, 0.1);
margin-left: 60px;
padding: 1em;
position: relative;
}
.cd-timeline-content img {
display: block;
width: 100%;
}
.cd-timeline-content:after {
clear: both;
content: "";
display: table;
}
.cd-timeline-content h2 {
margin-top: 0;
}
.cd-timeline-content p {
color: #666666;
font-size: 14px;
margin: 10px 0px 10px 0px;
}
.cd-timeline-content .cd-read-more {
background: #acb7c0;
border-radius: 0.25em;
color: white;
display: inline-block;
float: right;
font-size: 14px;
padding: .8em 1em;
}
.cd-timeline-content .cd-date {
display: inline-block;
font-size: 14px;
}
.cd-timeline-content h3 {
font-size: 21px;
margin: 0px;
}
.no-touch .cd-timeline-content .cd-read-more:hover {
background-color: #bac4cb;
}
.cd-timeline-content .cd-date {
float: left;
padding: .8em 0;
opacity: .7;
}
.cd-timeline-content::before {
content: '';
position: absolute;
top: 16px;
right: 100%;
height: 0;
width: 0;
border: 7px solid transparent;
border-right: 7px solid white;
}
@media only screen and (min-width: 1170px) {
.cd-timeline-content {
margin-left: 0;
padding: 1.6em;
width: 45%;
}
.cd-timeline-content::before {
top: 24px;
left: 100%;
border-color: transparent;
border-left-color: white;
}
.cd-timeline-content .cd-read-more {
float: left;
}
.cd-timeline-content .cd-date {
position: absolute;
width: 100%;
left: 122%;
top: 6px;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content {
float: right;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content::before {
top: 24px;
left: auto;
right: 100%;
border-color: transparent;
border-right-color: white;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content .cd-read-more {
float: right;
}
.cd-timeline-block:nth-child(even) .cd-timeline-content .cd-date {
left: auto;
right: 122%;
text-align: right;
}
.cssanimations .cd-timeline-content.is-hidden {
visibility: hidden;
}
.cssanimations .cd-timeline-content.bounce-in {
visibility: visible;
-webkit-animation: cd-bounce-2 0.6s;
-moz-animation: cd-bounce-2 0.6s;
animation: cd-bounce-2 0.6s;
}
}
@media only screen and (min-width: 1170px) {
.cssanimations .cd-timeline-block:nth-child(even) .cd-timeline-content.bounce-in {
-webkit-animation: cd-bounce-2-inverse 0.6s;
-moz-animation: cd-bounce-2-inverse 0.6s;
animation: cd-bounce-2-inverse 0.6s;
}
}
/* ==============
Charts
===================*/
.jqstooltip {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
.chart {
position: relative;
display: inline-block;
width: 110px;
height: 110px;
margin-top: 20px;
margin-bottom: 20px;
text-align: center;
}
.chart canvas {
position: absolute;
top: 0;
left: 0;
}
.chart.chart-widget-pie {
margin-top: 5px;
margin-bottom: 5px;
}
.percent {
display: inline-block;
line-height: 110px;
z-index: 2;
}
.percent:after {
content: '%';
margin-left: 0.1em;
font-size: .8em;
}
#flotTip {
padding: 4px 8px;
background-color: #000000;
z-index: 100;
color: #ffffff;
opacity: .7;
font-size: 12px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
/* ==============
Count Down
===================*/
.home-wrapper {
margin: 10% 0px;
}
.home-text {
font-family: 'Nunito', sans-serif;
}
.lj-countdown {
color: #5e35b1;
margin-top: 40px;
text-align: center;
}
.lj-countdown div {
display: inline-block;
}
.lj-countdown div span {
display: block;
width: 150px;
}
.lj-countdown div span:first-child {
font-size: 3em;
font-weight: 700;
height: 48px;
line-height: 48px;
}
.lj-countdown div span:last-child {
color: #333333;
font-size: 0.9em;
height: 25px;
line-height: 25px;
}
.lj-countdown > * {
text-align: center;
}
/* ==============
Gallery
===================*/
.portfolioFilter a {
-moz-box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
-moz-transition: all 0.3s ease-out;
-ms-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
-webkit-box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
-webkit-transition: all 0.3s ease-out;
box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.1);
color: #333333;
padding: 5px 10px;
transition: all 0.3s ease-out;
}
.portfolioFilter a:hover {
background-color: #5e35b1;
color: #ffffff;
}
.portfolioFilter a.current {
background-color: #5e35b1;
color: #ffffff;
}
.thumb {
background-color: #ffffff;
border-radius: 3px;
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
margin-top: 30px;
padding-bottom: 10px;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
width: 100%;
}
.thumb-img {
border-radius: 2px;
overflow: hidden;
width: 100%;
}
.gal-detail h4 {
margin-top: 16px;
}
/* ==============
Maintenance
===================*/
.icon-main {
font-size: 88px;
margin-bottom: 50px;
}
.maintenance-page {
margin: 10% 0%;
}
.mainten-box {
margin-bottom: 30px;
}
.mainten-box .text-m-mode {
margin: 0px auto;
width: 80%;
}
.media-main a.pull-left {
width: 100px;
}
.media-main .info {
color: #000000;
overflow: hidden;
}
.media-main .info h4 {
margin-bottom: 5px;
padding-top: 10px;
}
/* ==============
Accounts Pages
===================*/
.wrapper-page {
margin: 7.5% auto;
width: 420px;
}
.panel-pages {
border-radius: 6px;
}
.panel-pages .panel-body {
padding: 30px;
}
.panel-pages .panel-heading {
-moz-border-radius: 6px 6px 0px 0px;
-webkit-border-radius: 6px 6px 0px 0px;
border-radius: 6px 6px 0px 0px;
padding: 40px 20px;
position: relative;
}
.panel-pages .panel-heading h3 {
position: relative;
z-index: 999;
}
.user-thumb {
margin-top: -44px;
position: relative;
z-index: 999;
}
.user-thumb img {
height: 88px;
margin: 0px auto;
width: 88px;
}
.ex-page-content h1 {
color: #252932;
font-size: 98px;
font-weight: 700;
line-height: 150px;
text-shadow: rgba(61, 61, 61, 0.3) 1px 1px, rgba(61, 61, 61, 0.2) 2px 2px, rgba(61, 61, 61, 0.3) 3px 3px;
}
|
gpl-3.0
|
normeno/laravel-blog
|
resources/views/layouts/partials/frontendhead.blade.php
|
4423
|
<header>
<!--Navigation-->
<nav id="menu" class="navbar container">
<div class="navbar-header">
<button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"><i class="fa fa-bars"></i></button>
<a class="navbar-brand" href="#">
<div class="logo"><span>Newspaper</span></div>
</a>
</div>
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li><a href="index.html">Home</a></li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Login <i class="fa fa-arrow-circle-o-down"></i></a>
<div class="dropdown-menu">
<div class="dropdown-inner">
<ul class="list-unstyled">
<li><a href="archive.html">Text 101</a></li>
<li><a href="archive.html">Text 102</a></li>
</ul>
</div>
</div>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Video <i class="fa fa-arrow-circle-o-down"></i></a>
<div class="dropdown-menu">
<div class="dropdown-inner">
<ul class="list-unstyled">
<li><a href="archive.html">Text 201</a></li>
<li><a href="archive.html">Text 202</a></li>
<li><a href="archive.html">Text 203</a></li>
<li><a href="archive.html">Text 204</a></li>
<li><a href="archive.html">Text 205</a></li>
</ul>
</div>
</div>
</li>
<li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">Category <i class="fa fa-arrow-circle-o-down"></i></a>
<div class="dropdown-menu" style="margin-left: -203.625px;">
<div class="dropdown-inner">
<ul class="list-unstyled">
<li><a href="archive.html">Text 301</a></li>
<li><a href="archive.html">Text 302</a></li>
<li><a href="archive.html">Text 303</a></li>
<li><a href="archive.html">Text 304</a></li>
<li><a href="archive.html">Text 305</a></li>
</ul>
<ul class="list-unstyled">
<li><a href="archive.html">Text 306</a></li>
<li><a href="archive.html">Text 307</a></li>
<li><a href="archive.html">Text 308</a></li>
<li><a href="archive.html">Text 309</a></li>
<li><a href="archive.html">Text 310</a></li>
</ul>
<ul class="list-unstyled">
<li><a href="archive.html">Text 311</a></li>
<li><a href="archive.html">Text 312</a></li>
<li><a href="archive.html#">Text 313</a></li>
<li><a href="archive.html#">Text 314</a></li>
<li><a href="archive.html">Text 315</a></li>
</ul>
</div>
</div>
</li>
<li><a href="archive.html"><i class="fa fa-cubes"></i> Blocks</a></li>
<li><a href="contact.html"><i class="fa fa-envelope"></i> Contact</a></li>
</ul>
<ul class="list-inline navbar-right top-social">
<li><a href="#"><i class="fa fa-facebook"></i></a></li>
<li><a href="#"><i class="fa fa-twitter"></i></a></li>
<li><a href="#"><i class="fa fa-pinterest"></i></a></li>
<li><a href="#"><i class="fa fa-google-plus-square"></i></a></li>
<li><a href="#"><i class="fa fa-youtube"></i></a></li>
</ul>
</div>
</nav>
</header>
|
gpl-3.0
|
IntellectualSites/PlotSquared
|
Core/src/main/java/com/plotsquared/core/plot/flag/implementations/BlockedCmdsFlag.java
|
2524
|
/*
* _____ _ _ _____ _
* | __ \| | | | / ____| | |
* | |__) | | ___ | |_| (___ __ _ _ _ __ _ _ __ ___ __| |
* | ___/| |/ _ \| __|\___ \ / _` | | | |/ _` | '__/ _ \/ _` |
* | | | | (_) | |_ ____) | (_| | |_| | (_| | | | __/ (_| |
* |_| |_|\___/ \__|_____/ \__, |\__,_|\__,_|_| \___|\__,_|
* | |
* |_|
* PlotSquared plot management system for Minecraft
* Copyright (C) 2014 - 2022 IntellectualSites
*
* 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 <https://www.gnu.org/licenses/>.
*/
package com.plotsquared.core.plot.flag.implementations;
import com.plotsquared.core.configuration.caption.TranslatableCaption;
import com.plotsquared.core.plot.flag.FlagParseException;
import com.plotsquared.core.plot.flag.types.ListFlag;
import org.checkerframework.checker.nullness.qual.NonNull;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
public class BlockedCmdsFlag extends ListFlag<String, BlockedCmdsFlag> {
public static final BlockedCmdsFlag BLOCKED_CMDS_FLAG_NONE =
new BlockedCmdsFlag(Collections.emptyList());
protected BlockedCmdsFlag(List<String> valueList) {
super(valueList, TranslatableCaption.of("flags.flag_category_string_list"),
TranslatableCaption.of("flags.flag_description_blocked_cmds")
);
}
@Override
public BlockedCmdsFlag parse(@NonNull String input) throws FlagParseException {
return flagOf(Arrays.asList(input.split(",")));
}
@Override
public String getExample() {
return "gamemode survival, spawn";
}
@Override
protected BlockedCmdsFlag flagOf(@NonNull List<String> value) {
return new BlockedCmdsFlag(value);
}
}
|
gpl-3.0
|
ScaniaTV/PhantomBot
|
Dockerfile
|
2017
|
#
# Copyright (C) 2016-2018 phantombot.tv
#
# 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/>.
#
# Build container
FROM openjdk:8-jdk as builder
ARG PROJECT_NAME=PhantomBot
ARG BASEDIR=/opt/${PROJECT_NAME}
ARG BUILDDIR=${BASEDIR}_build
ARG DATADIR=${BASEDIR}_data
ENV DEBIAN_FRONTEND=noninteractive
RUN mkdir -p "${BUILDDIR}" \
&& apt-get update -q \
&& apt-get install -yqq ant \
&& apt-get clean \
&& rm -rf \
/var/lib/apt/lists/* \
/tmp/* \
/var/tmp/*
COPY . "${BUILDDIR}"
RUN cd "${BUILDDIR}" \
&& ant jar
# Application container
FROM openjdk:8-jre-alpine
ARG PROJECT_NAME=PhantomBot
ARG BASEDIR=/opt/${PROJECT_NAME}
ARG BUILDDIR=${BASEDIR}_build
ARG DATADIR=${BASEDIR}_data
RUN mkdir -p "${BASEDIR}" "${DATADIR}" "${BASEDIR}/logs"
COPY --from=builder "${BUILDDIR}/dist/build/." "${BASEDIR}/"
RUN cd "${BASEDIR}" \
&& rm -rf \
&& mv "${BASEDIR}/addons" "${DATADIR}/" \
&& mv "${BASEDIR}/logs" "${DATADIR}/" \
&& mv "${BASEDIR}/config" "${DATADIR}/" \
&& mkdir "${DATADIR}/dbbackup" \
&& ln -s "${DATADIR}/addons" \
&& ln -s "${DATADIR}/logs" \
&& ln -s "${DATADIR}/config" \
&& ln -s "${DATADIR}/dbbackup"
VOLUME "${DATADIR}"
WORKDIR "${BASEDIR}"
EXPOSE 25000 25001 25002 25003 25004 25005
CMD [ \
"java", \
"-Dinteractive", \
"-Dfile.encoding=UTF-8", \
"-jar", \
"PhantomBot.jar" \
]
|
gpl-3.0
|
Tay-nakub/Stockcontrol
|
StockControl/Process/Types.cs
|
21576
|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Linq;
using Microsoft.VisualBasic.FileIO;
using Telerik.WinControls.UI;
namespace StockControl
{
public partial class Types : Telerik.WinControls.UI.RadRibbonForm
{
public Types()
{
InitializeComponent();
}
//private int RowView = 50;
//private int ColView = 10;
DataTable dt = new DataTable();
private void radMenuItem2_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
HistoryView hw = new HistoryView(this.Name);
this.Cursor = Cursors.Default;
hw.ShowDialog();
}
private void radRibbonBar1_Click(object sender, EventArgs e)
{
}
private void GETDTRow()
{
dt.Columns.Add(new DataColumn("GroupCode", typeof(string)));
dt.Columns.Add(new DataColumn("TypeCode", typeof(string)));
dt.Columns.Add(new DataColumn("TypeDetail", typeof(string)));
dt.Columns.Add(new DataColumn("TypeActive", typeof(bool)));
}
private void Unit_Load(object sender, EventArgs e)
{
RMenu3.Click += RMenu3_Click;
RMenu4.Click += RMenu4_Click;
RMenu5.Click += RMenu5_Click;
RMenu6.Click += RMenu6_Click;
radGridView1.ReadOnly = true;
radGridView1.AutoGenerateColumns = false;
GETDTRow();
DataLoad();
LoadDefualt();
}
private void RMenu6_Click(object sender, EventArgs e)
{
DeleteUnit();
DataLoad();
}
private void RMenu5_Click(object sender, EventArgs e)
{
EditClick();
}
private void RMenu4_Click(object sender, EventArgs e)
{
ViewClick();
}
private void RMenu3_Click(object sender, EventArgs e)
{
NewClick();
}
private void LoadDefualt()
{
try
{
using (DataClasses1DataContext db = new DataClasses1DataContext())
{
var gt = (from ix in db.tb_GroupTypes where ix.GroupActive == true select ix).ToList();
GridViewComboBoxColumn comboBoxColumn = this.radGridView1.Columns["GroupCode"] as GridViewComboBoxColumn;
comboBoxColumn.DisplayMember = "GroupCode";
comboBoxColumn.ValueMember = "GroupCode";
comboBoxColumn.DataSource = gt;
//comboBoxColumn.DataSource= new string[] { "INSERT","Mr.", "Mrs.", "Dr.", "Ms." };
//GridViewComboBoxColumn lookUpColumn = new GridViewComboBoxColumn();
//lookUpColumn.FieldName = "GroupCode1";
//lookUpColumn.Name = "GroupCode1";
//lookUpColumn.HeaderText = "GroupCode";
//lookUpColumn.DataSource = new string[] { "Mr.", "Mrs.", "Dr.", "Ms." };
//lookUpColumn.Width = 100;
//lookUpColumn.IsVisible = true;
//this.radGridView1.Columns.Add(lookUpColumn);
}
}catch(Exception ex) {
MessageBox.Show(ex.Message);
dbClss.AddError("เพิ่มปรเภท", ex.Message, this.Name);
}
}
private void DataLoad()
{
//dt.Rows.Clear();
using (DataClasses1DataContext db = new DataClasses1DataContext())
{
//dt = ClassLib.Classlib.LINQToDataTable(db.tb_Units.ToList());
radGridView1.DataSource = db.tb_Types.ToList();
int ck = 0;
foreach(var x in radGridView1.Rows)
{
x.Cells["dgvCodeTemp"].Value = x.Cells["GroupCode"].Value.ToString();
x.Cells["dgvCodeTemp2"].Value = x.Cells["TypeCode"].Value.ToString();
x.Cells["dgvOldDetail"].Value= x.Cells["TypeDetail"].Value.ToString();
x.Cells["GroupCode"].ReadOnly = true;
x.Cells["TypeCode"].ReadOnly = true;
x.Cells["GroupCode"].Style.ForeColor = Color.MidnightBlue;
x.Cells["TypeCode"].Style.ForeColor = Color.MidnightBlue;
if (row >= 0 && row == ck)
{
x.ViewInfo.CurrentRow = x;
}
ck += 1;
}
}
// radGridView1.DataSource = dt;
}
private bool CheckDuplicate(string code,string Typecode)
{
bool ck = false;
using (DataClasses1DataContext db = new DataClasses1DataContext())
{
int i = (from ix in db.tb_Types where ix.GroupCode == code && ix.TypeCode==Typecode select ix).Count();
if (i > 0)
ck = false;
else
ck = true;
}
return ck;
}
private bool AddUnit()
{
bool ck = false;
int C = 0;
try
{
radGridView1.EndEdit();
using (DataClasses1DataContext db = new DataClasses1DataContext())
{
foreach (var g in radGridView1.Rows)
{
if (!Convert.ToString(g.Cells["GroupCode"].Value).Equals("")
&& !Convert.ToString(g.Cells["TypeCode"].Value).Equals(""))
{
if (Convert.ToString(g.Cells["dgvC"].Value).Equals("T"))
{
if (Convert.ToString(g.Cells["dgvCodeTemp"].Value).Equals("")
&& Convert.ToString(g.Cells["dgvCodeTemp2"].Value).Equals("")
)
{
// MessageBox.Show("11");
tb_Type gy = new tb_Type();
gy.GroupCode = Convert.ToString(g.Cells["GroupCode"].Value);
gy.TypeCode= Convert.ToString(g.Cells["TypeCode"].Value);
gy.TypeActive = Convert.ToBoolean(g.Cells["TypeActive"].Value);
gy.TypeDetail= Convert.ToString(g.Cells["TypeDetail"].Value);
db.tb_Types.InsertOnSubmit(gy);
db.SubmitChanges();
C += 1;
dbClss.AddHistory(this.Name, "เพิ่มประเภท", "Insert Type Code [" + gy.TypeCode+ "]","");
}
else
{
var unit1 = (from ix in db.tb_Types
where ix.GroupCode == Convert.ToString(g.Cells["dgvCodeTemp"].Value)
&& ix.TypeCode == Convert.ToString(g.Cells["dgvCodeTemp2"].Value)
select ix).First();
unit1.TypeDetail = Convert.ToString(g.Cells["TypeDetail"].Value);
unit1.TypeActive = Convert.ToBoolean(g.Cells["TypeActive"].Value);
C += 1;
db.SubmitChanges();
dbClss.AddHistory(this.Name, "แก้ไข", "Update Type Code [" + unit1.TypeCode+ "]","");
}
}
}
}
}
}
catch (Exception ex) { MessageBox.Show(ex.Message);
dbClss.AddError("เพิ่มปรเภท", ex.Message, this.Name);
}
if (C > 0)
MessageBox.Show("บันทึกสำเร็จ!");
return ck;
}
private bool DeleteUnit()
{
bool ck = false;
int C = 0;
try
{
if (row >= 0)
{
string CodeDelete = Convert.ToString(radGridView1.Rows[row].Cells["GroupCode"].Value);
string CodeDelete2 = Convert.ToString(radGridView1.Rows[row].Cells["TypeCode"].Value);
string CodeTemp = Convert.ToString(radGridView1.Rows[row].Cells["dgvCodeTemp"].Value);
string CodeTemp2 = Convert.ToString(radGridView1.Rows[row].Cells["dgvCodeTemp2"].Value);
radGridView1.EndEdit();
if (MessageBox.Show("ต้องการลบรายการ ( "+ CodeDelete+" ) หรือไม่ ?", "ลบรายการ", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
using (DataClasses1DataContext db = new DataClasses1DataContext())
{
if (!CodeDelete.Equals("") && !CodeDelete2.Equals(""))
{
if (!CodeTemp.Equals("") && !CodeTemp2.Equals(""))
{
var unit1 = (from ix in db.tb_Types
where ix.GroupCode == CodeDelete
&& ix.TypeCode == CodeDelete2
select ix).ToList();
foreach (var d in unit1)
{
db.tb_Types.DeleteOnSubmit(d);
dbClss.AddHistory(this.Name, "ลบประเภท", "Delete Type Code ["+d.TypeCode+"]","");
}
C += 1;
db.SubmitChanges();
}
}
}
}
}
}
catch (Exception ex) { MessageBox.Show(ex.Message);
dbClss.AddError("ลบประเภท", ex.Message, this.Name);
}
if (C > 0)
{
row = row - 1;
MessageBox.Show("ลบรายการ สำเร็จ!");
}
return ck;
}
private void btnCancel_Click(object sender, EventArgs e)
{
DataLoad();
}
private void NewClick()
{
radGridView1.ReadOnly = false;
radGridView1.AllowAddNewRow = false;
btnEdit.Enabled = false;
btnView.Enabled = true;
radGridView1.Rows.AddNew();
}
private void EditClick()
{
radGridView1.ReadOnly = false;
btnEdit.Enabled = false;
btnView.Enabled = true;
radGridView1.AllowAddNewRow = false;
}
private void ViewClick()
{
radGridView1.ReadOnly = true;
btnView.Enabled = false;
btnEdit.Enabled = true;
radGridView1.AllowAddNewRow = false;
DataLoad();
}
private void btnNew_Click(object sender, EventArgs e)
{
NewClick();
}
private void btnView_Click(object sender, EventArgs e)
{
ViewClick();
}
private void btnEdit_Click(object sender, EventArgs e)
{
EditClick();
}
private void btnSave_Click(object sender, EventArgs e)
{
if(MessageBox.Show("ต้องการบันทึก ?","บันทึก",MessageBoxButtons.YesNo,MessageBoxIcon.Question)==DialogResult.Yes)
{
AddUnit();
DataLoad();
}
}
private void radGridView1_CellEndEdit(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
try
{
radGridView1.Rows[e.RowIndex].Cells["dgvC"].Value = "T";
string check1 = Convert.ToString(radGridView1.Rows[e.RowIndex].Cells["GroupCode"].Value);
string check2 = Convert.ToString(radGridView1.Rows[e.RowIndex].Cells["TypeCode"].Value);
string TM= Convert.ToString(radGridView1.Rows[e.RowIndex].Cells["dgvCodeTemp"].Value);
if (!check1.Trim().Equals("") && !check2.Trim().Equals("") && TM.Equals(""))
{
if (!CheckDuplicate(check1.Trim(), check2.Trim()))
{
MessageBox.Show("ข้อมูล รหัสปรเภท ซ้ำ");
radGridView1.Rows[e.RowIndex].Cells["TypeCode"].Value = "";
radGridView1.Rows[e.RowIndex].Cells["GroupCode"].IsSelected = true;
}
}
}
catch { }
}
private void Unit_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
// MessageBox.Show(e.KeyCode.ToString());
}
private void radGridView1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
{
// MessageBox.Show(e.KeyCode.ToString());
if(e.KeyData==(Keys.Control|Keys.S))
{
if (MessageBox.Show("ต้องการบันทึก ?", "บันทึก", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
AddUnit();
DataLoad();
}
}
else if (e.KeyData == (Keys.Control | Keys.N))
{
if (MessageBox.Show("ต้องการสร้างใหม่ ?", "สร้างใหม่", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
NewClick();
}
}
}
private void btnDelete_Click(object sender, EventArgs e)
{
DeleteUnit();
DataLoad();
}
int row = -1;
private void radGridView1_CellClick(object sender, Telerik.WinControls.UI.GridViewCellEventArgs e)
{
row = e.RowIndex;
}
private void btnExport_Click(object sender, EventArgs e)
{
//dbClss.ExportGridCSV(radGridView1);
dbClss.ExportGridXlSX(radGridView1);
}
private void btnImport_Click(object sender, EventArgs e)
{
OpenFileDialog op = new OpenFileDialog();
op.Filter = "Spread Sheet files (*.csv)|*.csv|All files (*.csv)|*.csv";
if (op.ShowDialog() == DialogResult.OK)
{
using (TextFieldParser parser = new TextFieldParser(op.FileName))
{
dt.Rows.Clear();
parser.TextFieldType = FieldType.Delimited;
parser.SetDelimiters(",");
int a = 0;
int c = 0;
while (!parser.EndOfData)
{
//Processing row
a += 1;
DataRow rd = dt.NewRow();
// MessageBox.Show(a.ToString());
string[] fields = parser.ReadFields();
c = 0;
foreach (string field in fields)
{
c += 1;
//TODO: Process field
//MessageBox.Show(field);
if (a>1)
{
if(c==1)
rd["GroupCode"] = Convert.ToString(field);
else if(c==2)
rd["Typecode"] = Convert.ToString(field);
else if(c==3)
rd["TypeDetail"] = Convert.ToString(field);
else if (c == 4)
rd["TypeActive"] = Convert.ToBoolean(field);
}
else
{
if (c == 1)
rd["GroupCode"] = "";
else if (c == 2)
rd["Typecode"] = "";
else if (c == 3)
rd["TypeDetail"] = "";
else if (c == 4)
rd["TypeActive"] = false;
}
//
//rd[""] = "";
//rd[""]
}
dt.Rows.Add(rd);
}
}
if(dt.Rows.Count>0)
{
dbClss.AddHistory(this.Name, "Import [Type]", "Import file CSV in to System", "");
ImportData();
MessageBox.Show("Import Completed.");
DataLoad();
}
}
}
private void ImportData()
{
try
{
using (DataClasses1DataContext db = new DataClasses1DataContext())
{
foreach (DataRow rd in dt.Rows)
{
if (!rd["GroupCode"].ToString().Equals("") && !rd["TypeCode"].ToString().Equals(""))
{
var x = (from ix in db.tb_Types
where ix.GroupCode.ToLower().Trim() == rd["GroupCode"].ToString().ToLower().Trim()
&& ix.TypeCode.ToLower().Trim() == rd["TypeCode"].ToString().ToLower().Trim()
select ix).FirstOrDefault();
if(x==null)
{
tb_Type ts = new tb_Type();
ts.GroupCode= Convert.ToString(rd["GroupCode"].ToString());
ts.TypeCode = Convert.ToString(rd["TypeCode"].ToString());
ts.TypeDetail= Convert.ToString(rd["TypeDetail"].ToString());
ts.TypeActive = Convert.ToBoolean(rd["TypeActive"].ToString());
db.tb_Types.InsertOnSubmit(ts);
db.SubmitChanges();
}
else
{
x.TypeDetail= Convert.ToString(rd["TypeDetail"].ToString());
x.TypeActive = Convert.ToBoolean(rd["TypeActive"].ToString());
db.SubmitChanges();
}
}
}
}
}
catch(Exception ex) { MessageBox.Show(ex.Message);
dbClss.AddError("InportData", ex.Message, this.Name);
}
}
private void btnFilter1_Click(object sender, EventArgs e)
{
radGridView1.EnableFiltering = true;
}
private void btnUnfilter1_Click(object sender, EventArgs e)
{
radGridView1.EnableFiltering = false;
}
private void radMenuItem1_Click(object sender, EventArgs e)
{
this.Close();
}
private void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
{
if (e.CellElement.ColumnInfo.HeaderText == "รหัสประเภทกลุ่ม" )
{
if (e.CellElement.RowInfo.Cells["GroupCode"].Value != null)
{
if (!e.CellElement.RowInfo.Cells["GroupCode"].Value.Equals(""))
{
e.CellElement.DrawFill = true;
// e.CellElement.ForeColor = Color.Blue;
e.CellElement.NumberOfColors = 1;
e.CellElement.BackColor = Color.WhiteSmoke;
}
//else
//{
// e.CellElement.DrawFill = true;
// //e.CellElement.ForeColor = Color.Yellow;
// e.CellElement.NumberOfColors = 1;
// e.CellElement.BackColor = Color.WhiteSmoke;
//}
}
}
}
}
}
|
gpl-3.0
|
mcpat/microjiac-examples-public
|
pingpong/src/main/java/de/jiac/micro/examples/pingpong/PingNodeLauncher.java
|
1256
|
/*
* MicroJIAC - A Lightweight Agent Framework
* This file is part of Example: PingPong.
*
* Copyright (c) 2007-2011 DAI-Labor, Technische Universität Berlin
*
* This library includes software developed at DAI-Labor, Technische
* Universität Berlin (http://www.dai-labor.de)
*
* This library 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 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* $Id$
*/
package de.jiac.micro.examples.pingpong;
import de.jiac.micro.internal.ApplicationLauncher;
/**
* @author Marcel Patzlaff
* @version $Revision:$
*/
public class PingNodeLauncher {
public static void main(String[] args) {
ApplicationLauncher.main(new String[] {"config.ping"});
}
}
|
gpl-3.0
|
Webcampak/v2.0
|
src/www/interface/dev/app/controller/dashboard/SourceDiskUsage.js
|
5637
|
/*
Copyright 2010-2012 Infracom & Eurotechnia (support@webcampak.com)
This file is part of the Webcampak project.
Webcampak 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.
Webcampak is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
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 Webcampak.
If not, see http://www.gnu.org/licenses/.
*/
console.log('Log: Load: Webcampak.controller.dashboard.SourceDiskUsage');
Ext.define('Webcampak.controller.dashboard.SourceDiskUsage', {
extend: 'Ext.app.Controller',
stores: [
'dashboard.SourceDiskUsage',
'permissions.sources.Sources'
],
models: [
'dashboard.SourceDiskUsage'
],
views: [
'dashboard.sourcediskusage.SourceDiskUsageWindow',
'dashboard.sourcediskusage.SourceDiskUsage',
'dashboard.sourcediskusage.SourcesList'
],
refs: [
{ref: 'sourcediskusagewindow', selector: 'sourcediskusagewindow', xtype: 'sourcediskusagewindow'},
{ref: 'sourcediskusage', selector: 'sourcediskusage', xtype: 'sourcediskusage'},
{ref: 'statssourceslist', selector: 'statssourceslist', xtype: 'statssourceslist'}
],
onLaunch: function() {
console.log('Log: Controller->Dashboard->SourceDiskUsage: Controller onLaunch: function()');
/*
//Show Files Graph window (stats about size of pictures per day)
if(!this.getSourcediskusagewindow().isVisible()) {
this.getSourcediskusagewindow().show();
console.log('Log: Controller->Menu: openPhotos - getSourcepicturefileswindow().show()');
//Load the sources store
this.getPermissionsSourcesSourcesStore().on('load',this.loadGraphContent,this,{single:true});
this.getPermissionsSourcesSourcesStore().load();
} else {
this.getSourcediskusagewindow().hide();
console.log('Log: Controller->Menu: openPhotos - getSourcepicturefileswindow().hide()');
}
*/
},
init: function() {
console.log('Log: Controller->Dashboard->SourceDiskUsage: Controller init: function()');
// Start listening for events on views
this.control({
'sourcediskusagewindow button[action=reload]': {click: this.reloadGraph},
'sourcediskusagewindow button[action=save]': {click: this.saveGraph},
'statssourceslist': {select: this.onSourceSelected},
'sourcediskusagewindow combo[action=updateRange]': {select: this.onUpdateRange},
'sourcediskusagewindow': {resize: this.windowResize}
});
},
loadGraphContent: function() {
console.log('Log: Controller->Dashboard->SourceDiskUsage: loadGraphContent: function()');
},
windowResize: function() {
console.log('Log: Controller->Dashboard->SourceDiskUsage: windowResize: function()');
this.getSourcediskusage().axes.items[1].setTitle(Ext.getStore('permissions.sources.Sources').first().get('name'));
Ext.getStore('dashboard.SourceDiskUsage').getProxy().setExtraParam('sourceid', Ext.getStore('permissions.sources.Sources').first().get('sourceid'));
//Load the latest picture for the selected source
this.getDashboardSourceDiskUsageStore().on('load',this.loadGraphContent,this,{single:true});
this.getDashboardSourceDiskUsageStore().load();
},
onUpdateRange: function(selModel, selection) {
console.log('Log: Controller->Dashboard->SourceDiskUsage: onUpdateRange: function()');
console.log('Log: Controller->Dashboard->SourceDiskUsage: onUpdateRange: Selected range is:' + selection[0].get('name'));
Ext.getStore('dashboard.SourceDiskUsage').getProxy().setExtraParam('range', selection[0].get('value'));
//Load the latest picture for the selected source
this.getDashboardSourceDiskUsageStore().on('load',this.loadGraphContent,this,{single:true});
this.getDashboardSourceDiskUsageStore().load();
},
onSourceSelected: function(selModel, selection) {
console.log('Log: Controller->Dashboard->SourceDiskUsage: onSourceSelected: function()');
console.log('Log: Controller->Dashboard->SourceDiskUsage: onSourceSelected: Selected name is:' + selection[0].get('name'));
console.log('Log: Controller->Dashboard->SourceDiskUsage: onSourceSelected: Selected Sourceid is:' + selection[0].get('sourceid'));
Ext.getStore('dashboard.SourceDiskUsage').getProxy().setExtraParam('sourceid', selection[0].get('sourceid'));
//Set Sourcename as the title
// this.getSourcediskusagewindow().setTitle(i18n.gettext('Graph: Disk usage per source') + " (" + selection[0].get('name') + ")");
this.getSourcediskusage().axes.items[1].setTitle(selection[0].get('name'));
//Load the latest picture for the selected source
this.getDashboardSourceDiskUsageStore().on('load',this.loadGraphContent,this,{single:true});
this.getDashboardSourceDiskUsageStore().load();
},
reloadGraph: function() {
console.log('Log: Controller->Dashboard->SourceDiskUsage: Controller reloadGraph: function()');
this.getDashboardSourceDiskUsageStore().load();
},
saveGraph: function() {
console.log('Log: Controller->Dashboard->SourceDiskUsage: Controller saveGraph: function()');
currentChart = this.getSourcediskusage();
Ext.MessageBox.confirm(i18n.gettext('Confirm Download'), i18n.gettext('Would you like to download the chart as an image?'), function(choice){
if(choice == 'yes'){
currentChart.save({
type: 'image/png'
});
}
});
}
});
|
gpl-3.0
|
gohdan/DFC
|
known_files/hashes/bitrix/modules/bitrix.sitecommunity/install/wizards/bitrix/demo_community/site/templates/stretchy/themes/red/colors.css
|
61
|
Bitrix 16.5 Business Demo = a90672e9493af33ea4ad4ebb96d9172b
|
gpl-3.0
|
mirror/freedownload
|
FDMCustomized/FDMCustGenerator/StdAfx.h
|
424
|
/*
Free Download Manager Copyright (c) 2003-2016 FreeDownloadManager.ORG
*/
#if !defined(AFX_STDAFX_H__65DF8D90_CB44_4243_BA88_A32AAF32A2E6__INCLUDED_)
#define AFX_STDAFX_H__65DF8D90_CB44_4243_BA88_A32AAF32A2E6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "../../common/vms_sifdm_cl/tstring.h"
//{{AFX_INSERT_LOCATION}}
#endif
|
gpl-3.0
|
saurabhaec/PHPLogger
|
PHPLogger.php
|
2465
|
<?php
/**
* @auther Saurabh Chandra Patel
* @link https://github.com/saurabhaec/PHPLogger/ for PHP Log report
* @license https://github.com/saurabhaec/PHPLogger/blob/master/LICENSE GNU GENERAL PUBLIC LICENSE
*/
class PHPLogger implements \SplSubject {
/**
* [$name log file name ]
* @var [type]
*/
private $filename;
/**
* [$observers description]
* @var array
*/
private $observers = array();
/**
* [$content description]
* @var [type]
*/
private $content;
/**
* [$path description]
* @var [type]
*/
private $path = '/var/log/';
/**
* [__construct description]
* @param [type] $name [description]
*/
public function __construct($path) {
$this->filename = date('y-m-d') . '.log';
$this->path = $path;
}
public function __get($pro) {
return $this->$pro;
}
/**
* [__set description]
* @param [string] $pro [description]
* @param [string] $value [description]
*/
public function __set($pro, $value) {
return $this->$pro = $value;
}
//add observer
/**
* [attach description]
* @param \SplObserver $observer [description]
* @return [null] [description]
*/
public function attach(\SplObserver $observer) {
$this->observers[] = $observer;
}
//remove observer
/**
* [detach description]
* @param \SplObserver $observer [description]
* @return [null] [description]
*/
public function detach(\SplObserver $observer) {
$key = array_search($observer, $this->observers, true);
if ($key) {
unset($this->observers[$key]);
}
}
public function getContent() {
return $this->content . " ({$this->filename})";
}
//notify observers(or some of them)
/**
* [notify description]
* @return [null] [description]
*/
public function notify() {
foreach ($this->observers as $value) {
$value->update($this);
}
}
public function writeLog() {
$this->notify();
}
}
class Reportlog implements SplObserver {
private $action;
/**
* [__construct description]
* @param $action [report identifiers]
*/
public function __construct($action) {
$this->action = $action;
}
/**
* [update description]
* @param \SplSubject $subject [description]
* @return [type] [description]
*/
public function update(\SplSubject $subject) {
$msg = date('y-m-d H:i:s') . "\t" . $this->action . "\n";
$path = $subject->__get('path') . '' . $subject->__get('filename');
error_log($msg, 3, $path);
}
}
?>
|
gpl-3.0
|
JBJuillard/libuc
|
src/stdlst/mlifo_pop.c
|
1500
|
/*
** mlifo_pop.c
**
** mlifo_pop function of Undefined-C library
**
** By: Juillard Jean-Baptiste (jbjuillard@gmail.com)
**
** Created: 2017/03/09 by Juillard Jean-Baptiste
** Updated: 2018/03/14 by Juillard Jean-Baptiste
**
** This file is a part 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, or
** (at your option) any later version.
**
** There 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; see the file LICENSE. If not, write to
** the Free Software Foundation, Inc., 51 Franklin Street, Fifth
** Floor, Boston, MA 02110-1301, USA.
*/
#include <stdlib.h> /* Dev: a modifier après implataion de free */
#include <libuc/errno.h>
#include <libuc/stdlst.h>
void **mlifo_pop(mlifo_t **mstk)
{
register mlifo_t *tmp;
register void **kptr;
errno = 0;
if (!mstk)
{
errno = EINVAL;
return (NULL);
}
else if (!*mstk)
return (NULL);
tmp = *mstk;
*mstk = tmp->next;
kptr = tmp->kptr;
tmp->kptr = (void **)(NULL);
tmp->sptr = (size_t *)(NULL);
tmp->next = (mlifo_t *)(NULL);
free((void *)(tmp));
return (kptr);
}
|
gpl-3.0
|
mokasin/musicrawler
|
lib/database/database.go
|
4976
|
/* Copyright 2012, mokasin
*
* 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 database
import (
"database/sql"
"errors"
"fmt"
_ "github.com/mattn/go-sqlite3"
"os"
"time"
)
var (
ErrNoOpenTransaction = errors.New("No open transaction.")
ErrExistingTransaction = errors.New("There is an existing transaction.")
ErrDatabaseExists = errors.New("Can't create new database. A database already exists.")
)
type CreateTableFunc func(db *Database) error
// A Result is a mapping from column name to its value.
type Result map[string]interface{}
type Database struct {
Filename string
db *sql.DB
mtime int64
tx *sql.Tx // global transaction
txOpen bool // flag true, when exists an open transaction
fctables []CreateTableFunc
newDB bool
}
// Creates a new Database struct and connects it to the database at filename.
// Needs to be closed with method Close()!
func NewDatabase(filename string) (*Database, error) {
_, err := os.Stat(filename)
newdatabase := os.IsNotExist(err)
db, err := sql.Open("sqlite3", filename)
if err != nil {
return nil, err
}
datab := &Database{Filename: filename, db: db, newDB: newdatabase}
// Make it nosync and disable the journal
if _, err := db.Exec("PRAGMA synchronous=OFF"); err != nil {
return nil, err
}
if _, err := db.Exec("PRAGMA journal_mode=OFF"); err != nil {
return nil, err
}
//if _, err := db.Exec("PRAGMA case_sensitive_like=TRUE"); err != nil {
// return nil, err
//}
return datab, nil
}
func (self *Database) Mtime() int64 {
return self.mtime
}
// Closes the opened database.
func (self *Database) Close() {
self.db.Close()
}
// Creates the basic database structure.
func (self *Database) CreateDatabase() error {
if !self.newDB {
return ErrDatabaseExists
}
if len(self.fctables) == 0 {
return fmt.Errorf("Can't create database. " +
"No functions to create the tables are registered.")
}
if err := self.BeginTransaction(); err != nil {
return err
}
defer self.EndTransaction()
for _, t := range self.fctables {
err := t(self)
if err != nil {
return err
}
}
return nil
}
// Add registers a new function to create a table.
func (self *Database) Register(m CreateTableFunc) {
self.fctables = append(self.fctables, m)
}
// BeginTransaction starts a new database transaction.
func (self *Database) BeginTransaction() (err error) {
if self.txOpen {
return ErrExistingTransaction
}
self.tx, err = self.db.Begin()
if err != nil {
return err
}
self.txOpen = true
// Updating mtime when something has changed
self.mtime = time.Now().Unix()
return nil
}
// EndTransaction closes a opened database transaction.
func (self *Database) EndTransaction() error {
if !self.txOpen {
return ErrNoOpenTransaction
}
self.txOpen = false
return self.tx.Commit()
}
// Execute just executes sql query in global transaction.
func (self *Database) Execute(sql string, args ...interface{}) (res sql.Result, err error) {
if !self.txOpen {
err = self.BeginTransaction()
if err != nil {
return nil, err
}
defer self.EndTransaction()
}
res, err = self.tx.Exec(sql, args...)
return res, err
}
// QueryDB queries the database with a given SQL-string and arguments args and
// returns the result as a map from column name to its value.
func (self *Database) Query(sql string, args ...interface{}) ([]Result, error) {
if !self.txOpen {
err := self.BeginTransaction()
if err != nil {
return nil, err
}
defer self.EndTransaction()
}
// do the actual query
rows, err := self.tx.Query(sql, args...)
if err != nil {
return nil, err
}
defer rows.Close()
// find out about the columns in the database
columns, err := rows.Columns()
if err != nil {
return nil, err
}
// prepare result
var result []Result
// stupid trick, because rows.Scan will not take []interface as args
col_vals := make([]interface{}, len(columns))
col_args := make([]interface{}, len(columns))
// initialize col_args
for i := 0; i < len(columns); i++ {
col_args[i] = &col_vals[i]
}
// read out columns and save them in a Result map
for rows.Next() {
if err := rows.Scan(col_args...); err != nil {
return nil, err
}
res := make(Result)
for i := 0; i < len(columns); i++ {
res[columns[i]] = col_vals[i]
}
result = append(result, res)
}
return result, rows.Err()
}
|
gpl-3.0
|
simoninireland/simplicial
|
test/test_triangularlattice.py
|
4117
|
# Tests of triangular lattices
#
# Copyright (C) 2017--2019 Simon Dobson
#
# This file is part of simplicial, simplicial topology in Python.
#
# Simplicial 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.
#
# Simplicial 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 Simplicial. If not, see <http://www.gnu.org/licenses/gpl.html>.
import unittest
import six
from simplicial import *
import math
import numpy.random
class TriangularLatticeTests(unittest.TestCase):
def _simplexCounts( self, r, c ):
"""Check we have the right numbers of simplices."""
self._complex = TriangularLattice(r, c)
ntriperr = 2 * (c - 1) + 1
ns = self._complex.numberOfSimplicesOfOrder()
self.assertEqual(ns[0], r * c)
if len(ns) > 1:
self.assertEqual(ns[1], (r - 1) * (2 * c - 1) + (r - 2) * c)
if len(ns) > 2:
self.assertEqual(ns[2], (r - 2) * ntriperr)
def testSimplest(self):
"""Test simplest triangular lattice."""
self._simplexCounts(2, 2)
def testNextSimplest(self):
"""Test the next simplest lattice."""
self._simplexCounts(3, 3)
def testEvenEven( self ):
"""Test a lattice with even rows and columns."""
self._simplexCounts(10, 10)
def testEvenOdd( self ):
"""Test a lattice with even rows and odd columns."""
self._simplexCounts(10, 11)
def testOddEven( self ):
"""Test a lattice with odd rows and even columns."""
self._simplexCounts(11, 10)
def testOddOdd( self ):
"""Test a lattice with odd rows and columns."""
self._simplexCounts(11, 10)
def testEuler( self ):
"""Test the Euler characteristic calculations."""
self._complex = TriangularLattice(20, 20)
self.assertEqual(self._complex.eulerCharacteristic(), 1)
def testRegularEmbedding( self ):
"""Test that the embedding is regular."""
self._complex = TriangularLattice(10, 10)
e = TriangularLatticeEmbedding(self._complex, 11, 11)
pos = e.positionsOf()
eps = 0.0001
# all columns equidistant
for i in range(10):
for j in range(9):
s1 = self._complex._indexOfVertex(i, j)
s2 = self._complex._indexOfVertex(i, j + 1)
self.assertTrue(pos[s2][0] - pos[s1][0] < (11.0 / 10) + eps)
# all rows equidistant
for i in range(9):
for j in range(10):
s1 = self._complex._indexOfVertex(i, j)
s2 = self._complex._indexOfVertex(i + 1, j)
self.assertTrue(pos[s2][1] - pos[s1][1] < (11.0 / 10) + eps)
# odd rows are offset
for i in range(9):
for j in range(9):
s1 = self._complex._indexOfVertex(i, j)
s2 = self._complex._indexOfVertex(i + 1, j)
if i % 2 == 0:
self.assertTrue(pos[s2][0] > pos[s1][0])
else:
self.assertTrue(pos[s2][0] < pos[s1][0])
def testPerturbedEmbedding( self ):
"""Test that we can perturb the embedding with explicit new positions."""
self._complex = TriangularLattice(10, 10)
e = TriangularLatticeEmbedding(self._complex, 11, 11)
ss = list(self._complex.simplicesOfOrder(0))
pos = e.positionsOf()
# choose a random simplex
i = int(numpy.random.random() * len(ss))
s = ss[i]
# re-position simplex
e.positionSimplex(s, [ 12, 13 ])
# make sure position is preserved
pos1 = e.positionsOf()
six.assertCountEqual(self, pos1[s], [ 12, 13 ])
|
gpl-3.0
|
mhawksey/moocinabox
|
oocinabox/responsive-child-octel/sidebar-bbpress.php
|
1109
|
<?php
// Exit if accessed directly
if ( !defined('ABSPATH')) exit;
/**
* Main Widget Template
*
*
* @file sidebar.php
* @package Responsive
* @author Emil Uzelac
* @copyright 2003 - 2013 ThemeID
* @license license.txt
* @version Release: 1.0
* @filesource wp-content/themes/responsive/sidebar.php
* @link http://codex.wordpress.org/Theme_Development#Widgets_.28sidebar.php.29
* @since available since Release 1.0
*/
?>
<div id="widgets" class="grid col-300 fit">
<?php responsive_widgets(); // above widgets hook ?>
<?php if (!dynamic_sidebar('bbpress')) : ?>
<div class="widget-wrapper">
<div class="widget-title"><?php _e('In Archive', 'responsive'); ?></div>
<ul>
<?php wp_get_archives( array( 'type' => 'monthly' ) ); ?>
</ul>
</div><!-- end of .widget-wrapper -->
<?php endif; //end of main-sidebar ?>
<?php responsive_widgets_end(); // after widgets hook ?>
</div><!-- end of #widgets -->
|
gpl-3.0
|
brandon1024/find
|
popup/css/searchpane.css
|
1700
|
/* Search Pane Style */
div#popup-body {
width: 100%;
}
div#popup-body-container {
max-width: 100%;
display: flex;
justify-content: center;
align-items: center;
}
div#search-field-container,
div#search-controls-container {
display: inline-flex;
}
div#search-field-container {
width: 100%;
}
div#search-controls-container {
border-left: 1px solid #e0e0e0;
margin-left: 5px;
}
div#search-info {
min-width: 60px;
text-align: right;
user-select: none;
cursor: default;
}
span#index-text {
color: #CCCCCC;
white-space: nowrap;
text-align: right;
}
img.extension-error-icon {
width: 10px;
height: 10px;
display: none;
}
button.controls-button#search-prev-button {
background-image: url(/popup/img/icon/chevron-up.svg);
background-size: 12px 12px;
}
button.controls-button#search-next-button {
background-image: url(/popup/img/icon/chevron-down.svg);
background-size: 12px 12px;
}
button.controls-button#search-toggle-options-button {
background-image: url(/popup/img/icon/wrench.svg);
background-size: 12px 12px;
}
button.controls-button#saved-expressions-toggle-button {
background-image: url(/popup/img/icon/bookmark.svg);
background-size: 12px 12px;
}
button.controls-button#copy-text-to-clipboard-button {
background-image: url(/popup/img/icon/copy-to-clipboard-line.svg);
background-size: 12px 12px;
}
button.controls-button#close-button {
background-image: url(/popup/img/icon/cross.svg);
background-size: 10px 10px;
}
button.controls-button#find-replace-button {
background-image: url(/popup/img/icon/document-remove.svg);
background-size: 12px 12px;
}
|
gpl-3.0
|
SimonItaly/duckhunt
|
doc/html/navtreeindex1.js
|
675
|
var NAVTREEINDEX1 =
{
"var__init_8h.html#a0764b32f40bbe284b6ba2a1fee678d6c":[2,0,0,16,4],
"var__init_8h.html#a2fd24bcbadb8b59c176dccc6f13250e9":[2,0,0,16,3],
"var__init_8h.html#a3482785bd2a4c8b307f9e0b6f54e2c36":[2,0,0,16,8],
"var__init_8h.html#a6b57f01d3c576db5368dd0efc2f435a4":[2,0,0,16,1],
"var__init_8h.html#a78fa3957d73de49cb81d047857504218":[2,0,0,16,5],
"var__init_8h.html#a8194731fdeea643e725e3a89d2f7ec59":[2,0,0,16,6],
"var__init_8h.html#ab454541ae58bcf6555e8d723b1eb95e7":[2,0,0,16,7],
"var__init_8h.html#abe06f96c5aeacdb02e4b66e34e609982":[2,0,0,16,2],
"var__init_8h.html#ae86e3a2639bfd6cac9c94470ec2825c8":[2,0,0,16,9],
"var__init_8h_source.html":[2,0,0,16]
};
|
gpl-3.0
|
DroneBucket/Drone_Bucket_CrazyFlie2_NRF_Firmware
|
nrf51_sdk/Documentation/s120/html/a00572.js
|
265
|
var a00572 =
[
[ "Nrf_bootloader", "a00573.html", null ],
[ "Nrf_dfu", "a00574.html", null ],
[ "Nrf_dfu_transport", "a00575.html", null ],
[ "Nrf_bootloader_util", "a00576.html", null ],
[ "Ble_sdk_app_bootloader_main", "a00577.html", null ]
];
|
gpl-3.0
|
Greymerk/minecraft-roguelike
|
src/main/java/greymerk/roguelike/dungeon/segment/SegmentGenerator.java
|
4198
|
package greymerk.roguelike.dungeon.segment;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import greymerk.roguelike.dungeon.IDungeonLevel;
import greymerk.roguelike.theme.ITheme;
import greymerk.roguelike.util.WeightedChoice;
import greymerk.roguelike.util.WeightedRandomizer;
import greymerk.roguelike.worldgen.Cardinal;
import greymerk.roguelike.worldgen.Coord;
import greymerk.roguelike.worldgen.IStair;
import greymerk.roguelike.worldgen.IWorldEditor;
public class SegmentGenerator implements ISegmentGenerator{
protected Segment arch;
protected WeightedRandomizer<Segment> segments;
public SegmentGenerator(){
this(Segment.ARCH);
}
public SegmentGenerator(Segment arch){
this.segments = new WeightedRandomizer<Segment>();
this.arch = arch;
}
public SegmentGenerator(SegmentGenerator toCopy){
this.arch = toCopy.arch;
this.segments = new WeightedRandomizer<Segment>(toCopy.segments);
}
public SegmentGenerator(JsonObject json){
String archType = json.get("arch").getAsString();
arch = Segment.valueOf(archType);
this.segments = new WeightedRandomizer<Segment>();
JsonArray segmentList = json.get("segments").getAsJsonArray();
for(JsonElement e : segmentList){
JsonObject segData = e.getAsJsonObject();
this.add(segData);
}
}
public void add(JsonObject entry){
String segType = entry.get("type").getAsString();
Segment type = Segment.valueOf(segType);
if(entry.has("arch")){
boolean a = entry.get("arch").getAsBoolean();
if(a) this.arch = type;
return;
}
int weight = entry.has("weight") ? entry.get("weight").getAsInt() : 1;
this.segments.add(new WeightedChoice<Segment>(type, weight));
}
public void add(Segment toAdd, int weight){
this.segments.add(new WeightedChoice<Segment>(toAdd, weight));
}
@Override
public List<ISegment> genSegment(IWorldEditor editor, Random rand, IDungeonLevel level, Cardinal dir, Coord pos) {
int x = pos.getX();
int y = pos.getY();
int z = pos.getZ();
List<ISegment> segs = new ArrayList<ISegment>();
for(Cardinal orth : Cardinal.orthogonal(dir)){
ISegment seg = pickSegment(editor, rand, level, dir, pos);
if(seg == null) return segs;
seg.generate(editor, rand, level, orth, level.getSettings().getTheme(), new Coord(pos));
segs.add(seg);
}
if(!level.hasNearbyNode(pos) && rand.nextInt(3) == 0) addSupport(editor, rand, level.getSettings().getTheme(), x, y, z);
return segs;
}
private ISegment pickSegment(IWorldEditor editor, Random rand, IDungeonLevel level, Cardinal dir, Coord pos){
int x = pos.getX();
int z = pos.getZ();
if((dir == Cardinal.NORTH || dir == Cardinal.SOUTH) && z % 3 == 0){
if(z % 6 == 0) return Segment.getSegment(arch);
return this.segments.isEmpty()
? Segment.getSegment(Segment.WALL)
: Segment.getSegment(this.segments.get(rand));
}
if((dir == Cardinal.WEST || dir == Cardinal.EAST) && x % 3 == 0){
if(x % 6 == 0) return Segment.getSegment(arch);
return this.segments.isEmpty()
? Segment.getSegment(Segment.WALL)
: Segment.getSegment(this.segments.get(rand));
}
return null;
}
private void addSupport(IWorldEditor editor, Random rand, ITheme theme, int x, int y, int z){
if(!editor.isAirBlock(new Coord(x, y - 2, z))) return;
editor.fillDown(rand, new Coord(x, y - 2, z), theme.getPrimary().getPillar());
IStair stair = theme.getPrimary().getStair();
stair.setOrientation(Cardinal.WEST, true);
stair.set(editor, new Coord(x - 1, y - 2, z));
stair.setOrientation(Cardinal.EAST, true);
stair.set(editor, new Coord(x + 1, y - 2, z));
stair.setOrientation(Cardinal.SOUTH, true);
stair.set(editor, new Coord(x, y - 2, z + 1));
stair.setOrientation(Cardinal.NORTH, true);
stair.set(editor, new Coord(x, y - 2, z - 1));
}
public static SegmentGenerator getRandom(Random rand, int count) {
SegmentGenerator segments = new SegmentGenerator(Segment.ARCH);
for(int i = 0; i < count; ++i){
segments.add(Segment.getRandom(rand), 1);
}
return segments;
}
}
|
gpl-3.0
|
yiendos/snowsport
|
application/site/component/signatures/view/signature/html.php
|
1434
|
<?php
/**
* Belgian Police Web Platform - Signatures Component
*
* @copyright Copyright (C) 2012 - 2013 Timble CVBA. (http://www.timble.net)
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html>
* @link https://github.com/belgianpolice/internet-platform
*/
use Nooku\Library;
class SignaturesViewSignatureHtml extends SignaturesViewHtml
{
public function render()
{
//Get the article
$signature = $this->getModel()->getData();
$category = $this->getCategory();
//Set the pathway
$this->getObject('application')->getPathway()->addItem($category->title, $this->getTemplate()->getHelper('route')->category(array('row' => $category)));
$this->getObject('application')->getPathway()->addItem($signature->title, '');
// Get the zone
$this->zone = $this->getObject('com:police.model.zone')->id($this->getObject('application')->getCfg('site' ))->getRow();
//Get the attachments
if ($signature->id && $signature->isAttachable()) {
$this->attachments($signature->getAttachments());
}
return parent::render();
}
public function getCategory()
{
//Get the category
$category = $this->getObject('com:signatures.model.categories')
->table('signatures')
->slug($this->getModel()->getState()->category)
->getRow();
return $category;
}
}
|
gpl-3.0
|
austin98x/cross-platform-desktop-app
|
gui/qt-demo/main.cpp
|
2452
|
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the examples of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
** the names of its contributors may be used to endorse or promote
** products derived from this software without specific prior written
** permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
** $QT_END_LICENSE$
**
****************************************************************************/
//! [0]
#include "stdafx.h"
#include <QApplication>
#include "mainwindow.h"
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(application);
QApplication app(argc, argv);
app.setOrganizationName("Trolltech");
app.setApplicationName("Application Example");
MainWindow mainWin;
mainWin.show();
return app.exec();
}
//! [0]
|
gpl-3.0
|
tgerring/go-ethereum
|
core/vm/vm_jit_fake.go
|
906
|
// Copyright 2015 The go-ethereum Authors
// This file is part of go-ethereum.
//
// go-ethereum 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.
//
// go-ethereum 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 go-ethereum. If not, see <http://www.gnu.org/licenses/>.
// +build !evmjit
package vm
import "fmt"
func NewJitVm(env Environment) VirtualMachine {
fmt.Printf("Warning! EVM JIT not enabled.\n")
return New(env)
}
|
gpl-3.0
|
dasuimao/U-BOOT-Tiny4412
|
include/configs/bf537-minotaur.h
|
4166
|
/*
* U-Boot - Configuration file for CSP Minotaur board
*
* Thu Oct 25 15:30:44 CEST 2007 <hackfin@section5.ch>
* Minotaur config, brushed up for official uClinux dist.
* Parallel flash support disabled, SPI flash boot command
* added ('run flashboot').
*
* Flash image map:
*
* 0x00000000 u-boot bootstrap
* 0x00010000 environment
* 0x00020000 u-boot code
* 0x00030000 uImage.initramfs
*
*/
#ifndef __CONFIG_BF537_MINOTAUR_H__
#define __CONFIG_BF537_MINOTAUR_H__
#include <asm/config-pre.h>
/*
* Processor Settings
*/
#define CONFIG_BFIN_CPU bf537-0.2
#define CONFIG_BFIN_BOOT_MODE BFIN_BOOT_SPI_MASTER
/*
* Clock Settings
* CCLK = (CLKIN * VCO_MULT) / CCLK_DIV
* SCLK = (CLKIN * VCO_MULT) / SCLK_DIV
*/
/* CONFIG_CLKIN_HZ is any value in Hz */
#define CONFIG_CLKIN_HZ 25000000
/* CLKIN_HALF controls the DF bit in PLL_CTL 0 = CLKIN */
/* 1 = CLKIN / 2 */
#define CONFIG_CLKIN_HALF 0
/* PLL_BYPASS controls the BYPASS bit in PLL_CTL 0 = do not bypass */
/* 1 = bypass PLL */
#define CONFIG_PLL_BYPASS 0
/* VCO_MULT controls the MSEL (multiplier) bits in PLL_CTL */
/* Values can range from 0-63 (where 0 means 64) */
#define CONFIG_VCO_MULT 20
/* CCLK_DIV controls the core clock divider */
/* Values can be 1, 2, 4, or 8 ONLY */
#define CONFIG_CCLK_DIV 1
/* SCLK_DIV controls the system clock divider */
/* Values can range from 1-15 */
#define CONFIG_SCLK_DIV 5
/*
* Memory Settings
*/
#define CONFIG_MEM_SIZE 32
#define CONFIG_MEM_ADD_WDTH 9
#define CONFIG_EBIU_SDRRC_VAL 0x306
#define CONFIG_EBIU_SDGCTL_VAL 0x91114d
#define CONFIG_EBIU_AMGCTL_VAL 0xFF
#define CONFIG_EBIU_AMBCTL0_VAL 0x7BB07BB0
#define CONFIG_EBIU_AMBCTL1_VAL 0xFFC27BB0
#define CONFIG_SYS_MONITOR_LEN (256 << 10)
#define CONFIG_SYS_MALLOC_LEN (128 << 10)
/*
* Network Settings
*/
#ifndef __ADSPBF534__
#define CONFIG_BFIN_MAC
#define CONFIG_NETCONSOLE 1
#endif
#ifdef CONFIG_BFIN_MAC
#define CONFIG_IPADDR 192.168.0.15
#define CONFIG_NETMASK 255.255.255.0
#define CONFIG_GATEWAYIP 192.168.0.1
#define CONFIG_SERVERIP 192.168.0.2
#define CONFIG_HOSTNAME bf537-minotaur
#endif
#define CONFIG_SYS_AUTOLOAD "no"
#define CONFIG_ROOTPATH "/romfs"
/*
* SPI Settings
*/
#define CONFIG_BFIN_SPI
#define CONFIG_ENV_SPI_MAX_HZ 30000000
#define CONFIG_SF_DEFAULT_SPEED 30000000
/*
* Env Storage Settings
*/
#define CONFIG_ENV_IS_IN_SPI_FLASH
#define CONFIG_ENV_OFFSET 0x10000
#define CONFIG_ENV_SIZE 0x10000
#define CONFIG_ENV_SECT_SIZE 0x10000
#define CONFIG_ENV_IS_EMBEDDED_IN_LDR
/*
* I2C settings
*/
#define CONFIG_SYS_I2C
#define CONFIG_SYS_I2C_ADI
#define CONFIG_SYS_I2C_SPEED 50000
#define CONFIG_SYS_I2C_SLAVE 0
/*
* Misc Settings
*/
#define CONFIG_SYS_LONGHELP 1
#define CONFIG_CMDLINE_EDITING 1
#define CONFIG_ENV_OVERWRITE 1
#define CONFIG_BAUDRATE 57600
#define CONFIG_UART_CONSOLE 0
#define CONFIG_BFIN_SERIAL
#define CONFIG_PANIC_HANG 1
#define CONFIG_RTC_BFIN 1
#define CONFIG_BOOT_RETRY_TIME -1
#define CONFIG_LOADS_ECHO 1
#define CONFIG_CMD_BOOTLDR
#define CONFIG_CMD_DATE
#define CONFIG_BOOTCOMMAND "run ramboot"
#define CONFIG_BOOTARGS "root=/dev/mtdblock0 rw"
#define BOOT_ENV_SETTINGS \
"update=tftpboot $(loadaddr) u-boot.ldr;" \
"sf probe " __stringify(BFIN_BOOT_SPI_SSEL) ";" \
"sf erase 0 0x30000;" \
"sf write $(loadaddr) 0 $(filesize)" \
"flashboot=sf read 0x1000000 0x30000 0x320000;" \
"bootm 0x1000000\0"
#ifdef CONFIG_BFIN_MAC
# define NETWORK_ENV_SETTINGS \
"nfsargs=setenv bootargs root=/dev/nfs rw " \
"nfsroot=$(serverip):$(rootpath)\0" \
"addip=setenv bootargs $(bootargs) " \
"ip=$(ipaddr):$(serverip):$(gatewayip):$(netmask)" \
":$(hostname):eth0:off\0" \
"ramboot=tftpboot $(loadaddr) linux;" \
"run ramargs;run addip;bootelf\0" \
"nfsboot=tftpboot $(loadaddr) linux;" \
"run nfsargs;run addip;bootelf\0"
#else
# define NETWORK_ENV_SETTINGS
#endif
#define CONFIG_EXTRA_ENV_SETTINGS \
NETWORK_ENV_SETTINGS \
"ramargs=setenv bootargs " CONFIG_BOOTARGS "\0" \
BOOT_ENV_SETTINGS
#endif
|
gpl-3.0
|
michaelthe/webrtchat-libs
|
README.md
|
46
|
webrtchat-libs
==============
webrtchat libs
|
gpl-3.0
|
SunakazeKun/PMDe
|
src/com/aurum/mystery2/game/DungeonPokemon.java
|
4157
|
/*
* Copyright (C) 2016 - 2017 Aurum
*
* Mystery 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.
*
* Mystery 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.aurum.mystery2.game;
import com.aurum.mystery2.BitConverter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.aurum.mystery2.ByteBuffer;
import com.aurum.mystery2.ByteOrder;
import com.aurum.mystery2.Lists;
public class DungeonPokemon implements Cloneable {
// Entry fields
public List<Entry> entries;
// Other fields
public int offset;
// Static fields
public static final int SIZE = 0x8;
private static final byte[] NULL = new byte[SIZE];
public static class Entry implements Cloneable {
public int species, level, probability;
@Override
public String toString() {
return Lists.pokemon.get(species) + ": Lv. " + level + " (" + probability + ")";
}
@Override
public Object clone() {
try {
return super.clone();
}
catch (CloneNotSupportedException ex) {
return null;
}
}
}
@Override
public Object clone() {
try {
DungeonPokemon clone = (DungeonPokemon) super.clone();
clone.entries = new ArrayList();
for (Entry entry : entries)
clone.entries.add((Entry) entry.clone());
return clone;
}
catch (CloneNotSupportedException ex) {
return null;
}
}
public boolean checkProbabilitySum() {
int sum = 0;
for (Entry entry : entries)
sum += entry.probability;
return sum != 10000;
}
public static DungeonPokemon unpack(ByteBuffer buffer) {
DungeonPokemon pokemon = new DungeonPokemon();
pokemon.offset = buffer.position();
pokemon.entries = new ArrayList();
int storedoffset = buffer.position();
int diff = 0;
while(!Arrays.equals(buffer.readBytes(SIZE), NULL)) {
buffer.seek(storedoffset);
Entry entry = new Entry();
int mask = buffer.readUnsignedShort();
entry.level = (mask ^ 0x1A8) / 0x200;
entry.species = mask - 0x200 * entry.level;
entry.probability = buffer.readUnsignedShort();
int val = entry.probability;
if (val != 0) {
val -= diff;
diff = entry.probability;
}
entry.probability = val;
pokemon.entries.add(entry);
buffer.skip(0x4);
storedoffset = buffer.position();
}
return pokemon;
}
public static byte[] pack(DungeonPokemon pokemon) {
ByteBuffer buffer = new ByteBuffer(pokemon.entries.size() * 8 + 8, ByteOrder.LITTLE_ENDIAN);
int sum = 0;
for (Entry entry : pokemon.entries) {
buffer.writeUnsignedShort(entry.species + entry.level * 0x200);
if (sum < 10000) {
int val = (entry.probability != 0) ? sum += entry.probability : 0;
buffer.writeUnsignedShort(val);
buffer.writeUnsignedShort(val);
}
else {
buffer.writeUnsignedShort(0);
buffer.writeUnsignedShort(0);
}
buffer.writeUnsignedShort(0);
}
buffer.writeBytes(NULL);
return buffer.getBuffer();
}
}
|
gpl-3.0
|
mfrasca/jskat-gui
|
src/main/java/org/jskat/gui/action/iss/ShowLoginPanelAction.java
|
1581
|
/**
* JSkat - A skat program written in Java
* by Jan Schäfer, Markus J. Luzius and Daniel Loreck
*
* Version 0.11.0
* Copyright (C) 2012-08-28
*
* Licensed under the Apache License, Version 2.0. 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.
*/
package org.jskat.gui.action.iss;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import org.jskat.gui.action.AbstractJSkatAction;
import org.jskat.gui.action.JSkatAction;
import org.jskat.gui.img.JSkatGraphicRepository.Icon;
import org.jskat.util.JSkatResourceBundle;
/**
* Implements the action for showing about dialog
*/
public class ShowLoginPanelAction extends AbstractJSkatAction {
private static final long serialVersionUID = 1L;
/**
* @see AbstractJSkatAction#AbstractJSkatAction()
*/
public ShowLoginPanelAction() {
putValue(Action.NAME,
JSkatResourceBundle.instance().getString("play_on_iss")); //$NON-NLS-1$
setActionCommand(JSkatAction.SHOW_ISS_LOGIN);
setIcon(Icon.CONNECT_ISS);
}
/**
* @see AbstractAction#actionPerformed(ActionEvent)
*/
@Override
public void actionPerformed(final ActionEvent e) {
jskat.getIssController().showISSLoginPanel();
}
}
|
gpl-3.0
|
lcpt/xc
|
src/utility/actor/shadow/Shadow.h
|
4917
|
//----------------------------------------------------------------------------
// XC program; finite element analysis code
// for structural analysis and design.
//
// Copyright (C) Luis Claudio Pérez Tato
//
// This program derives from OpenSees <http://opensees.berkeley.edu>
// developed by the «Pacific earthquake engineering research center».
//
// Except for the restrictions that may arise from the copyright
// of the original program (see copyright_opensees.txt)
// XC 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 software 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/>.
//----------------------------------------------------------------------------
/* ****************************************************************** **
** OpenSees - Open System for Earthquake Engineering Simulation **
** Pacific Earthquake Engineering Research Center **
** **
** **
** (C) Copyright 1999, The Regents of the University of California **
** All Rights Reserved. **
** **
** Commercial use of this program without express permission of the **
** University of California, Berkeley, is strictly prohibited. See **
** file 'COPYRIGHT' in main directory for information on usage and **
** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
** **
** Developed by: **
** Frank McKenna (fmckenna@ce.berkeley.edu) **
** Gregory L. Fenves (fenves@ce.berkeley.edu) **
** Filip C. Filippou (filippou@ce.berkeley.edu) **
** **
** ****************************************************************** */
// $Revision: 1.3 $
// $Date: 2005/11/23 18:25:17 $
// $Source: /usr/local/cvs/OpenSees/SRC/actor/shadow/Shadow.h,v $
// Written: fmk
// Revision: A
//
// Purpose: This file contains the class definition for Shadow.
// Shadow is meant to be an abstract base class and thus no objects of it's type
// can be instantiated.
//
// What: "@(#) Shadow.h, revA"
#ifndef Shadow_h
#define Shadow_h
#include "utility/actor/ShadowActorBase.h"
namespace XC {
class MachineBroker;
class Message;
class Channel;
class ChannelAddress;
class MovableObject;
class Matrix;
class Vector;
class ID;
class FEM_ObjectBroker;
//! @ingroup IPComm
//!
//! Local object associated with an actor.
//!
//! Object associated with an Actor object which
//! may exist in another process. The Shadow acts like a normal object in
//! the users address space, data and processing that is done by the
//! Shadow may be stored and processed in a remote process, the Actor object
//! resides in this remote address space. The Actor and the Shadow both
//! have a Channel, a communication port. This allows the two to
//! communicate with each other.
class Shadow: public ShadowActorBase
{
private:
ChannelAddress *theRemoteActorsAddress; //!< Adress of the actor.
public:
Shadow(Channel &theChannel, FEM_ObjectBroker &);
Shadow(Channel &theChannel, FEM_ObjectBroker &, ChannelAddress &theAddress);
Shadow(int actorType, FEM_ObjectBroker &, MachineBroker &, int compDemand);
virtual int sendObject(MovableObject &theObject);
virtual int recvObject(MovableObject &theObject);
virtual int sendMessage(const Message &theMessage);
virtual int recvMessage(Message &theMessage);
virtual int sendMatrix(const Matrix &theMatrix);
virtual int recvMatrix(Matrix &theMatrix);
virtual int sendVector(const Vector &theVector);
virtual int recvVector(Vector &theVector);
virtual int sendID(const ID &theID);
virtual int recvID(ID &theID);
ChannelAddress *getActorAddressPtr(void) const;
};
} // end of XC namespace
#endif
|
gpl-3.0
|
xmjiao/octave-debian
|
libinterp/operators/op-fs-fs.cc
|
6381
|
/*
Copyright (C) 1996-2017 John W. Eaton
This file is part of Octave.
Octave 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.
Octave 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 Octave; see the file COPYING. If not, see
<http://www.gnu.org/licenses/>.
*/
#if defined (HAVE_CONFIG_H)
# include "config.h"
#endif
#include "Array-util.h"
#include "errwarn.h"
#include "ovl.h"
#include "ov.h"
#include "ov-scalar.h"
#include "ov-float.h"
#include "ov-flt-re-mat.h"
#include "ov-typeinfo.h"
#include "ov-null-mat.h"
#include "ops.h"
#include "xdiv.h"
#include "xpow.h"
// scalar unary ops.
DEFUNOP (not, float_scalar)
{
const octave_float_scalar& v = dynamic_cast<const octave_float_scalar&> (a);
float x = v.float_value ();
if (octave::math::isnan (x))
octave::err_nan_to_logical_conversion ();
return octave_value (x == 0.0f);
}
DEFUNOP_OP (uplus, float_scalar, /* no-op */)
DEFUNOP_OP (uminus, float_scalar, -)
DEFUNOP_OP (transpose, float_scalar, /* no-op */)
DEFUNOP_OP (hermitian, float_scalar, /* no-op */)
DEFNCUNOP_METHOD (incr, float_scalar, increment)
DEFNCUNOP_METHOD (decr, float_scalar, decrement)
// float by float ops.
DEFBINOP_OP (add, float_scalar, float_scalar, +)
DEFBINOP_OP (sub, float_scalar, float_scalar, -)
DEFBINOP_OP (mul, float_scalar, float_scalar, *)
DEFBINOP (div, float_scalar, float_scalar)
{
const octave_float_scalar& v1 = dynamic_cast<const octave_float_scalar&> (a1);
const octave_float_scalar& v2 = dynamic_cast<const octave_float_scalar&> (a2);
float d = v2.float_value ();
if (d == 0.0)
warn_divide_by_zero ();
return octave_value (v1.float_value () / d);
}
DEFBINOP_FN (pow, float_scalar, float_scalar, xpow)
DEFBINOP (ldiv, float_scalar, float_scalar)
{
const octave_float_scalar& v1 = dynamic_cast<const octave_float_scalar&> (a1);
const octave_float_scalar& v2 = dynamic_cast<const octave_float_scalar&> (a2);
float d = v1.float_value ();
if (d == 0.0)
warn_divide_by_zero ();
return octave_value (v2.float_value () / d);
}
DEFBINOP_OP (lt, float_scalar, float_scalar, <)
DEFBINOP_OP (le, float_scalar, float_scalar, <=)
DEFBINOP_OP (eq, float_scalar, float_scalar, ==)
DEFBINOP_OP (ge, float_scalar, float_scalar, >=)
DEFBINOP_OP (gt, float_scalar, float_scalar, >)
DEFBINOP_OP (ne, float_scalar, float_scalar, !=)
DEFBINOP_OP (el_mul, float_scalar, float_scalar, *)
DEFBINOP (el_div, float_scalar, float_scalar)
{
const octave_float_scalar& v1 = dynamic_cast<const octave_float_scalar&> (a1);
const octave_float_scalar& v2 = dynamic_cast<const octave_float_scalar&> (a2);
float d = v2.float_value ();
if (d == 0.0)
warn_divide_by_zero ();
return octave_value (v1.float_value () / d);
}
DEFBINOP_FN (el_pow, float_scalar, float_scalar, xpow)
DEFBINOP (el_ldiv, float_scalar, float_scalar)
{
const octave_float_scalar& v1 = dynamic_cast<const octave_float_scalar&> (a1);
const octave_float_scalar& v2 = dynamic_cast<const octave_float_scalar&> (a2);
float d = v1.float_value ();
if (d == 0.0)
warn_divide_by_zero ();
return octave_value (v2.float_value () / d);
}
DEFSCALARBOOLOP_OP (el_and, float_scalar, float_scalar, &&)
DEFSCALARBOOLOP_OP (el_or, float_scalar, float_scalar, ||)
DEFNDCATOP_FN (fs_fs, float_scalar, float_scalar, float_array, float_array,
concat)
DEFNDCATOP_FN (s_fs, scalar, float_scalar, float_array, float_array, concat)
DEFNDCATOP_FN (fs_s, float_scalar, scalar, float_array, float_array, concat)
void
install_fs_fs_ops (void)
{
INSTALL_UNOP (op_not, octave_float_scalar, not);
INSTALL_UNOP (op_uplus, octave_float_scalar, uplus);
INSTALL_UNOP (op_uminus, octave_float_scalar, uminus);
INSTALL_UNOP (op_transpose, octave_float_scalar, transpose);
INSTALL_UNOP (op_hermitian, octave_float_scalar, hermitian);
INSTALL_NCUNOP (op_incr, octave_float_scalar, incr);
INSTALL_NCUNOP (op_decr, octave_float_scalar, decr);
INSTALL_BINOP (op_add, octave_float_scalar, octave_float_scalar, add);
INSTALL_BINOP (op_sub, octave_float_scalar, octave_float_scalar, sub);
INSTALL_BINOP (op_mul, octave_float_scalar, octave_float_scalar, mul);
INSTALL_BINOP (op_div, octave_float_scalar, octave_float_scalar, div);
INSTALL_BINOP (op_pow, octave_float_scalar, octave_float_scalar, pow);
INSTALL_BINOP (op_ldiv, octave_float_scalar, octave_float_scalar, ldiv);
INSTALL_BINOP (op_lt, octave_float_scalar, octave_float_scalar, lt);
INSTALL_BINOP (op_le, octave_float_scalar, octave_float_scalar, le);
INSTALL_BINOP (op_eq, octave_float_scalar, octave_float_scalar, eq);
INSTALL_BINOP (op_ge, octave_float_scalar, octave_float_scalar, ge);
INSTALL_BINOP (op_gt, octave_float_scalar, octave_float_scalar, gt);
INSTALL_BINOP (op_ne, octave_float_scalar, octave_float_scalar, ne);
INSTALL_BINOP (op_el_mul, octave_float_scalar, octave_float_scalar, el_mul);
INSTALL_BINOP (op_el_div, octave_float_scalar, octave_float_scalar, el_div);
INSTALL_BINOP (op_el_pow, octave_float_scalar, octave_float_scalar, el_pow);
INSTALL_BINOP (op_el_ldiv, octave_float_scalar, octave_float_scalar, el_ldiv);
INSTALL_BINOP (op_el_and, octave_float_scalar, octave_float_scalar, el_and);
INSTALL_BINOP (op_el_or, octave_float_scalar, octave_float_scalar, el_or);
INSTALL_CATOP (octave_float_scalar, octave_float_scalar, fs_fs);
INSTALL_CATOP (octave_scalar, octave_float_scalar, s_fs);
INSTALL_CATOP (octave_float_scalar, octave_scalar, fs_s);
INSTALL_ASSIGNCONV (octave_float_scalar, octave_float_scalar,
octave_float_matrix);
INSTALL_ASSIGNCONV (octave_scalar, octave_float_scalar, octave_matrix);
INSTALL_ASSIGNCONV (octave_float_scalar, octave_null_matrix,
octave_float_matrix);
INSTALL_ASSIGNCONV (octave_float_scalar, octave_null_str,
octave_float_matrix);
INSTALL_ASSIGNCONV (octave_float_scalar, octave_null_sq_str,
octave_float_matrix);
}
|
gpl-3.0
|
Unofficial-Extend-Project-Mirror/foam-extend-foam-extend-3.2
|
src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/vanAlbada/vanAlbada.H
|
2902
|
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 3.2
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
foam-extend 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.
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::vanAlbadaLimiter
Description
Class with limiter function which returns the limiter for the
vanAlbada differencing scheme based on r obtained from the LimiterFunc
class.
Used in conjunction with the template class LimitedScheme.
SourceFiles
vanAlbada.C
\*---------------------------------------------------------------------------*/
#ifndef vanAlbada_H
#define vanAlbada_H
#include "vector.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class vanAlbadaLimiter Declaration
\*---------------------------------------------------------------------------*/
template<class LimiterFunc>
class vanAlbadaLimiter
:
public LimiterFunc
{
public:
vanAlbadaLimiter(Istream&)
{}
scalar limiter
(
const scalar cdWeight,
const scalar faceFlux,
const typename LimiterFunc::phiType& phiP,
const typename LimiterFunc::phiType& phiN,
const typename LimiterFunc::gradPhiType& gradcP,
const typename LimiterFunc::gradPhiType& gradcN,
const vector& d
) const
{
scalar r = LimiterFunc::r
(
faceFlux, phiP, phiN, gradcP, gradcN, d
);
// New formulation. Oliver Borm and Aleks Jemcov
// HJ, 13/Jan/2011
return max((r + 1)/(r + 1/stabilise(r, SMALL)), 0);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
|
gpl-3.0
|
benrr101/dolomite
|
DolomiteDatabase/Foreign Keys/FK_AVAILABLEQUALITIES_QUALITY.sql
|
142
|
ALTER TABLE [dbo].[AvailableQualities]
ADD CONSTRAINT [FK_AVAILABLEQUALITIES_QUALITY]
FOREIGN KEY (Quality)
REFERENCES [Qualities] (Id)
|
gpl-3.0
|
magnuspub/Prusa_RAMBO_Firmware
|
Firmware/language_cz.h
|
15728
|
/**
* English
*
* LCD Menu Messages
* Please note these are limited to 17 characters!
*
*/
#define WELCOME_MSG CUSTOM_MENDEL_NAME " ok"
#define MSG_SD_INSERTED "Karta vlozena"
#define MSG_SD_REMOVED "Karta vyjmuta"
#define MSG_MAIN "Hlavni nabidka"
#define MSG_DISABLE_STEPPERS "Vypnout motory"
#define MSG_AUTO_HOME "Auto home"
#define MSG_SET_HOME_OFFSETS "Nastav pocatek home"
#define MSG_SET_ORIGIN "Nastav pocatek"
#define MSG_COOLDOWN "Zchladit"
#define MSG_SWITCH_PS_ON "Vypnout zdroj"
#define MSG_SWITCH_PS_OFF "Zapnout zdroj"
#define MSG_MOVE_AXIS "Posunout osu"
#define MSG_MOVE_X "Posunout X"
#define MSG_MOVE_Y "Posunout Y"
#define MSG_MOVE_Z "Posunout Z"
#define MSG_MOVE_E "Extruder"
#define MSG_SPEED "Rychlost"
#define MSG_NOZZLE "Tryska"
#define MSG_NOZZLE1 "Tryska2"
#define MSG_NOZZLE2 "Tryska3"
#define MSG_BED "Bed"
#define MSG_FAN_SPEED "Rychlost vent."
#define MSG_FLOW "Prutok"
#define MSG_FLOW0 "Prutok 0"
#define MSG_FLOW1 "Prutok 1"
#define MSG_FLOW2 "Prutok 2"
#define MSG_CONTROL "Kontrola"
#define MSG_MIN " \002 Min"
#define MSG_MAX " \002 Max"
#define MSG_FACTOR " \002 Fact"
#define MSG_TEMPERATURE "Teplota"
#define MSG_MOTION "Pohyb"
#define MSG_VOLUMETRIC "Filament"
#define MSG_VOLUMETRIC_ENABLED "E in mm3"
#define MSG_STORE_EPROM "Store memory"
#define MSG_LOAD_EPROM "Ulozit pamet"
#define MSG_RESTORE_FAILSAFE "Obnovit vychozi"
#define MSG_REFRESH "\xF8" "Obnovit"
#define MSG_WATCH "Informace"
#define MSG_TUNE "Ladit"
#define MSG_PAUSE_PRINT "Pozastavit tisk"
#define MSG_RESUME_PRINT "Pokracovat"
#define MSG_STOP_PRINT "Zastavit tisk"
#define MSG_CARD_MENU "Tisk z SD"
#define MSG_NO_CARD "Zadna SD karta"
#define MSG_DWELL "Sleep..."
#define MSG_USERWAIT "Wait for user..."
#define MSG_RESUMING "Obnoveni tisku"
#define MSG_PRINT_ABORTED "Tisk prerusen"
#define MSG_NO_MOVE "No move."
#define MSG_KILLED "KILLED. "
#define MSG_STOPPED "STOPPED. "
#define MSG_FILAMENTCHANGE "Vymenit filament"
#define MSG_INIT_SDCARD "Inic. SD"
#define MSG_CNG_SDCARD "Vymenit SD"
#define MSG_BABYSTEP_X "Babystep X"
#define MSG_BABYSTEP_Y "Babystep Y"
#define MSG_BABYSTEP_Z "Doladeni osy Z"
#define MSG_ADJUSTZ "Auto doladit Z ?"
#define MSG_PICK_Z "Vyberte vytisk"
#define MSG_HOMEYZ "Kalibrovat Z"
#define MSG_HOMEYZ_PROGRESS "Kalibruji Z"
#define MSG_HOMEYZ_DONE "Kalibrace OK"
#define MSG_SETTINGS "Nastaveni"
#define MSG_PREHEAT "Predehrev"
#define MSG_UNLOAD_FILAMENT "Vyjmout filament"
#define MSG_LOAD_FILAMENT "Zavest filament"
#define MSG_RECTRACT "Rectract"
#define MSG_ERROR "CHYBA:"
#define MSG_PREHEAT_NOZZLE "Predehrejte trysku!"
#define MSG_SUPPORT "Podpora"
#define MSG_CORRECTLY "Vymena ok?"
#define MSG_YES "Ano"
#define MSG_NO "Ne"
#define MSG_NOT_LOADED "Filament nezaveden"
#define MSG_NOT_COLOR "Barva neni cista"
#define MSG_LOADING_FILAMENT "Zavadeni filamentu"
#define MSG_PLEASE_WAIT "Prosim cekejte"
#define MSG_LOADING_COLOR "Cisteni barvy"
#define MSG_CHANGE_SUCCESS "Zmena uspesna!"
#define MSG_PRESS "a stisknete tlacitko"
#define MSG_INSERT_FILAMENT "Vlozte filament"
#define MSG_CHANGING_FILAMENT "Vymena filamentu!"
#define MSG_SILENT_MODE_ON "Mod [tichy]"
#define MSG_SILENT_MODE_OFF "Mod [vys. vykon]"
#define MSG_REBOOT "Restartujte tiskarnu"
#define MSG_TAKE_EFFECT " pro projeveni zmen"
#define MSG_Enqueing "enqueing \""
#define MSG_POWERUP "PowerUp"
#define MSG_CONFIGURATION_VER " Last Updated: "
#define MSG_FREE_MEMORY " Free Memory: "
#define MSG_PLANNER_BUFFER_BYTES " PlannerBufferBytes: "
#define MSG_OK "ok"
#define MSG_ERR_CHECKSUM_MISMATCH "checksum mismatch, Last Line: "
#define MSG_ERR_NO_CHECKSUM "No Checksum with line number, Last Line: "
#define MSG_BEGIN_FILE_LIST "Begin file list"
#define MSG_END_FILE_LIST "End file list"
#define MSG_M104_INVALID_EXTRUDER "M104 Invalid extruder "
#define MSG_M105_INVALID_EXTRUDER "M105 Invalid extruder "
#define MSG_M200_INVALID_EXTRUDER "M200 Invalid extruder "
#define MSG_M218_INVALID_EXTRUDER "M218 Invalid extruder "
#define MSG_M221_INVALID_EXTRUDER "M221 Invalid extruder "
#define MSG_ERR_NO_THERMISTORS "No thermistors - no temperature"
#define MSG_M109_INVALID_EXTRUDER "M109 Invalid extruder "
#define MSG_HEATING "Zahrivani"
#define MSG_HEATING_COMPLETE "Zahrivani OK."
#define MSG_BED_HEATING "Zahrivani bed"
#define MSG_BED_DONE "Bed OK."
#define MSG_M115_REPORT "FIRMWARE_NAME:Marlin V1.0.2; Sprinter/grbl mashup for gen6 FIRMWARE_URL:" FIRMWARE_URL " PROTOCOL_VERSION:" PROTOCOL_VERSION " MACHINE_TYPE:" CUSTOM_MENDEL_NAME " EXTRUDER_COUNT:" STRINGIFY(EXTRUDERS) " UUID:" MACHINE_UUID "\n"
#define MSG_ERR_KILLED "Printer halted. kill() called!"
#define MSG_ERR_STOPPED "Printer stopped due to errors. Fix the error and use M999 to restart. (Temperature is reset. Set it after restarting)"
#define MSG_RESEND "Resend: "
#define MSG_M119_REPORT "Reporting endstop status"
#define MSG_ENDSTOP_HIT "TRIGGERED"
#define MSG_ENDSTOP_OPEN "open"
#define MSG_SD_CANT_OPEN_SUBDIR "Cannot open subdir"
#define MSG_SD_INIT_FAIL "SD init fail"
#define MSG_SD_VOL_INIT_FAIL "volume.init failed"
#define MSG_SD_OPENROOT_FAIL "openRoot failed"
#define MSG_SD_CARD_OK "SD card ok"
#define MSG_SD_WORKDIR_FAIL "workDir open failed"
#define MSG_SD_OPEN_FILE_FAIL "open failed, File: "
#define MSG_SD_FILE_OPENED "File opened: "
#define MSG_SD_FILE_SELECTED "File selected"
#define MSG_SD_WRITE_TO_FILE "Writing to file: "
#define MSG_SD_PRINTING_BYTE "SD printing byte "
#define MSG_SD_NOT_PRINTING "Not SD printing"
#define MSG_SD_ERR_WRITE_TO_FILE "error writing to file"
#define MSG_SD_CANT_ENTER_SUBDIR "Cannot enter subdir: "
#define MSG_STEPPER_TOO_HIGH "Steprate too high: "
#define MSG_ENDSTOPS_HIT "endstops hit: "
#define MSG_ERR_COLD_EXTRUDE_STOP " cold extrusion prevented"
#define MSG_BABYSTEPPING_X "Babystepping X"
#define MSG_BABYSTEPPING_Y "Babystepping Y"
#define MSG_BABYSTEPPING_Z "Dostavovani Z"
#define MSG_SERIAL_ERROR_MENU_STRUCTURE "Error in menu structure"
#define MSG_LANGUAGE_NAME "Cestina"
#define MSG_LANGUAGE_SELECT "Vyber jazyka"
#define MSG_PRUSA3D "prusa3d.cz"
#define MSG_PRUSA3D_FORUM "forum.prusa3d.cz"
#define MSG_PRUSA3D_HOWTO "howto.prusa3d.cz"
#define MSG_HOMEYZ "Kalibrovat Z"
#define MSG_HOMEYZ_PROGRESS "Kalibruji Z"
#define MSG_HOMEYZ_DONE "Kalibrace OK"
#define MSG_SELFTEST_ERROR "Selftest error !"
#define MSG_SELFTEST_PLEASECHECK "Zkontrolujte :"
#define MSG_SELFTEST_NOTCONNECTED "Nezapojeno "
#define MSG_SELFTEST_HEATERTHERMISTOR "Heater/Thermistor"
#define MSG_SELFTEST_BEDHEATER "Bed / Heater"
#define MSG_SELFTEST_WIRINGERROR "Chyba zapojeni"
#define MSG_SELFTEST_ENDSTOPS "Endstops"
#define MSG_SELFTEST_MOTOR "Motor"
#define MSG_SELFTEST_ENDSTOP "Endstop"
#define MSG_SELFTEST_ENDSTOP_NOTHIT "Endstop not hit"
#define MSG_SELFTEST_OK "Self test OK"
#define(length=20) MSG_SELFTEST_FAN "Test ventilatoru";
#define(length=20) MSG_SELFTEST_COOLING_FAN "Predni tiskovy vent?";
#define(length=20) MSG_SELFTEST_EXTRUDER_FAN "Levy vent na trysce?";
#define MSG_SELFTEST_FAN_YES "Toci se";
#define MSG_SELFTEST_FAN_NO "Netoci se";
#define MSG_STATS_TOTALFILAMENT "Filament celkem :"
#define MSG_STATS_TOTALPRINTTIME "Celkovy cas :"
#define MSG_STATS_FILAMENTUSED "Filament : "
#define MSG_STATS_PRINTTIME "Cas tisku : "
#define MSG_SELFTEST_START "Self test start "
#define MSG_SELFTEST_CHECK_ENDSTOPS "Kontrola endstops"
#define MSG_SELFTEST_CHECK_HOTEND "Kontrola hotend "
#define MSG_SELFTEST_CHECK_X "Kontrola X axis "
#define MSG_SELFTEST_CHECK_Y "Kontrola Y axis "
#define MSG_SELFTEST_CHECK_Z "Kontrola Z axis "
#define MSG_SELFTEST_CHECK_BED "Kontrola bed "
#define MSG_SELFTEST_CHECK_ALLCORRECT "Vse OK "
#define MSG_SELFTEST "Selftest "
#define MSG_SELFTEST_FAILED "Selftest selhal "
#define MSG_STATISTICS "Statistika "
#define MSG_USB_PRINTING "Tisk z USB "
#define MSG_SHOW_END_STOPS "Stav konc. spin."
#define MSG_CALIBRATE_BED "Kalibrace XYZ"
#define MSG_CALIBRATE_BED_RESET "Reset XYZ kalibr."
#define MSG_MOVE_CARRIAGE_TO_THE_TOP "Kalibrace XYZ. Otacenim tlacitka posunte Z osu az k~hornimu dorazu. Potvrdte tlacitkem."
#define MSG_MOVE_CARRIAGE_TO_THE_TOP_Z "Kalibrace Z. Otacenim tlacitka posunte Z osu az k~hornimu dorazu. Potvrdte tlacitkem."
#define MSG_CONFIRM_NOZZLE_CLEAN "Pro uspesnou kalibraci ocistete prosim tiskovou trysku. Potvrdte tlacitkem."
#define MSG_CONFIRM_CARRIAGE_AT_THE_TOP "Dojely oba Z voziky k~hornimu dorazu?"
#define MSG_FIND_BED_OFFSET_AND_SKEW_LINE1 "Hledam kalibracni bod podlozky"
#define MSG_FIND_BED_OFFSET_AND_SKEW_LINE2 " z 4"
#define MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE1 "Zlepsuji presnost kalibracniho bodu"
#define MSG_IMPROVE_BED_OFFSET_AND_SKEW_LINE2 " z 9"
#define MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE1 "Merim referencni vysku kalibracniho bodu"
#define MSG_MEASURE_BED_REFERENCE_HEIGHT_LINE2 " z 9"
#define MSG_BED_SKEW_OFFSET_DETECTION_POINT_NOT_FOUND "Kalibrace XYZ selhala. Kalibracni bod podlozky nenalezen."
#define MSG_BED_SKEW_OFFSET_DETECTION_FITTING_FAILED "Kalibrace XYZ selhala. Nahlednete do manualu."
#define MSG_BED_SKEW_OFFSET_DETECTION_PERFECT "Kalibrace XYZ v poradku. X/Y osy jsou kolme. Gratuluji!"
#define MSG_BED_SKEW_OFFSET_DETECTION_SKEW_MILD "Kalibrace XYZ v poradku. X/Y osy mirne zkosene. Dobra prace!"
#define MSG_BED_SKEW_OFFSET_DETECTION_SKEW_EXTREME "Kalibrace XYZ v poradku. Zkoseni bude automaticky vyrovnano pri tisku."
#define MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_LEFT_FAR "Kalibrace XYZ selhala. Levy predni bod moc vpredu. Srovnejte tiskarnu."
#define MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_RIGHT_FAR "Kalibrace XYZ selhala. Pravy predni bod moc vpredu. Srovnejte tiskarnu."
#define MSG_BED_SKEW_OFFSET_DETECTION_FAILED_FRONT_BOTH_FAR "Kalibrace XYZ selhala. Predni kalibracni body moc vpredu. Srovnejte tiskarnu."
#define MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_LEFT_FAR "Kalibrace XYZ nepresna. Levy predni bod moc vpredu."
#define MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_RIGHT_FAR "Kalibrace XYZ nepresna. Pravy predni bod moc vpredu."
#define MSG_BED_SKEW_OFFSET_DETECTION_WARNING_FRONT_BOTH_FAR "Kalibrace XYZ nepresna. Predni kalibracni body moc vpredu."
#define MSG_BED_LEVELING_FAILED_POINT_LOW "Kalibrace Z selhala. Sensor nesepnul. Znecistena tryska? Cekam na reset."
#define MSG_BED_LEVELING_FAILED_POINT_HIGH "Kalibrace Z selhala. Sensor sepnul prilis vysoko. Cekam na reset."
#define MSG_BED_LEVELING_FAILED_PROBE_DISCONNECTED "Kalibrace Z selhala. Sensor je odpojeny nebo preruseny kabel. Cekam na reset."
#define MSG_NEW_FIRMWARE_AVAILABLE "Vysla nova verze firmware:"
#define MSG_NEW_FIRMWARE_PLEASE_UPGRADE "Prosim aktualizujte."
#define MSG_FOLLOW_CALIBRATION_FLOW "Tiskarna nebyla jeste zkalibrovana. Postupujte prosim podle manualu, kapitola Zaciname, odstavec Postup kalibrace."
#define MSG_BABYSTEP_Z_NOT_SET "Neni zkalibrovana vzdalenost trysky od tiskove podlozky. Postupujte prosim podle manualu, kapitola Zaciname, odstavec Nastaveni prvni vrstvy."
#define MSG_BED_CORRECTION_MENU "Korekce podlozky"
#define MSG_BED_CORRECTION_LEFT "Vlevo [um]"
#define MSG_BED_CORRECTION_RIGHT "Vpravo [um]"
#define MSG_BED_CORRECTION_FRONT "Vpredu [um]"
#define MSG_BED_CORRECTION_REAR "Vzadu [um]"
#define MSG_BED_CORRECTION_RESET "Reset"
#define MSG_MESH_BED_LEVELING "Mesh Bed Leveling"
#define MSG_MENU_CALIBRATION "Kalibrace"
#define MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_OFF "SD card [normal]"
#define MSG_TOSHIBA_FLASH_AIR_COMPATIBILITY_ON "SD card [FlshAir]"
#define MSG_LOOSE_PULLEY "Uvolnena remenicka"
#define MSG_FILAMENT_LOADING_T0 "Vlote filament do extruderu 1. Potvrdte tlacitkem."
#define MSG_FILAMENT_LOADING_T1 "Vlote filament do extruderu 2. Potvrdte tlacitkem."
#define MSG_FILAMENT_LOADING_T2 "Vlote filament do extruderu 3. Potvrdte tlacitkem."
#define MSG_FILAMENT_LOADING_T3 "Vlote filament do extruderu 4. Potvrdte tlacitkem."
#define MSG_CHANGE_EXTR "Zmenit extruder"
#define MSG_FIL_LOADED_CHECK "Je filament zaveden?"
#define MSG_FIL_TUNING "Otacenim tlacitka doladte pozici filamentu."
#define MSG_FIL_ADJUSTING "Probiha srovnani filamentu. Prosim cekejte."
#define MSG_CONFIRM_NOZZLE_CLEAN_FIL_ADJ "Filamenty jsou srovnany. Pro uspesnou kalibraci prosim ocistete trysku. Po te potvrdte tlacitkem."
#define MSG_CALIBRATE_E "Kalibrovat E"
#define MSG_E_CAL_KNOB "Otacejte tlacitkem dokud znacka nedosahne tela extruderu. Potvrdte tlacitkem."
#define MSG_MARK_FIL "Oznacte filament 100 mm od tela extruderu a po te potvrdte tlacitkem."
#define MSG_CLEAN_NOZZLE_E "E kalibrace ukoncena. Prosim ocistete trysku. Po te potvrdte tlacitkem."
#define MSG_WAITING_TEMP "Cekani na zchladnuti trysky a podlozky."
#define MSG_FILAMENT_CLEAN "Je barva cista?"
#define MSG_UNLOADING_FILAMENT "Vysouvam filament"
#define MSG_PAPER "Umistete list papiru na podlozku a udrzujte jej pod tryskou behem mereni prvnich 4 bodu. Pokud tryska zachyti papir, vypnete tiskarnu."
|
gpl-3.0
|
Martin-Spamer/java-coaching
|
src/test/java/patterns/builder/BuilderTest.java
|
817
|
package patterns.builder;
import org.junit.Test;
import static org.junit.Assert.assertNotNull;
import lombok.extern.slf4j.Slf4j;
/**
* The BuilderTest class.
*/
@Slf4j
public final class BuilderTest {
/**
* Unit Test to build one.
*/
@Test
public void testBuilderOne() {
final BuilderOne builder = new BuilderOne();
assertNotNull(builder);
final AbstractPart product = builder.build();
log.info("product = {}", product);
}
/**
* Unit Test to build two.
*/
@Test
public void testBuilderTwo() {
final BuilderTwo builder = new BuilderTwo();
assertNotNull(builder);
final AbstractPart product = builder.build();
log.info("product = {}", product);
}
}
|
gpl-3.0
|
davidswelt/aquamacs-emacs
|
aquamacs/doc/Aquamacs Help/misc/vip.html/Differences-from-Vi.html
|
7381
|
<!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">
<!-- Copyright (C) 1987, 2001-2016 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover Texts being "A GNU Manual",
and with the Back-Cover Texts as in (a) below. A copy of the license
is included in the section entitled "GNU Free Documentation License".
(a) The FSF's Back-Cover Text is: "You have the freedom to copy and
modify this GNU manual." -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 16.1), see www.w3.org" />
<title>VIP: Differences from Vi</title>
<meta name="description" content="VIP: Differences from Vi" />
<meta name="keywords" content="VIP: Differences from Vi" />
<meta name="resource-type" content="document" />
<meta name="distribution" content="global" />
<meta name="Generator" content="makeinfo" />
<meta http-equiv="Content-Type" content=
"text/html; charset=us-ascii" />
<link href="index.html#Top" rel="start" title="Top" />
<link href=
"GNU-Free-Documentation-License.html#GNU-Free-Documentation-License"
rel="index" title="GNU Free Documentation License" />
<link href="index.html#SEC_Contents" rel="contents" title=
"Table of Contents" />
<link href="Survey.html#Survey" rel="up" title="Survey" />
<link href="Undoing.html#Undoing" rel="next" title="Undoing" />
<link href="Insert-Mode.html#Insert-Mode" rel="prev" title=
"Insert Mode" />
<style type="text/css">
/*<![CDATA[*/
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
/*]]>*/
</style>
<style type="text/css">
/*<![CDATA[*/
body {
background-color: #FFFFFF;
color: #000000;
}
:link { color: #0000FF }
:visited { color: #800080 }
:active { color: #FF0000 }
/*]]>*/
</style>
</head>
<body lang="en" xml:lang="en">
<a name="Differences-from-Vi" id="Differences-from-Vi"></a>
<div class="header">
<p>Previous: <a href="Modes-in-VIP.html#Modes-in-VIP"
accesskey="p" rel="prev">Modes in VIP</a>, Up: <a href=
"Survey.html#Survey" accesskey="u" rel="up">Survey</a>
[<a href="index.html#SEC_Contents" title="Table of contents"
rel="contents">Contents</a>][<a href=
"GNU-Free-Documentation-License.html#GNU-Free-Documentation-License"
title="Index" rel="index">Index</a>]</p>
</div>
<hr />
<a name="Differences-from-Vi-1" id="Differences-from-Vi-1"></a>
<h3 class="section">1.4 Differences from Vi</h3>
<p>The major differences from Vi are explained below.</p>
<table class="menu" border="0" cellspacing="0">
<tr>
<td align="left" valign="top">• <a href=
"Undoing.html#Undoing" accesskey="1">Undoing</a>:</td>
<td> </td>
<td align="left" valign="top">You can undo more in VIP.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"Changing.html#Changing" accesskey="2">Changing</a>:</td>
<td> </td>
<td align="left" valign="top">Commands for changing the
text.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"Searching.html#Searching" accesskey="3">Searching</a>:</td>
<td> </td>
<td align="left" valign="top">Search commands.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"z-Command.html#z-Command" accesskey="4">z Command</a>:</td>
<td> </td>
<td align="left" valign="top">You can now use zH, zM and zL
as well as z- etc.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"Counts.html#Counts" accesskey="5">Counts</a>:</td>
<td> </td>
<td align="left" valign="top">Some Vi commands which do not
accept a count now accept one.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"Marking.html#Marking" accesskey="6">Marking</a>:</td>
<td> </td>
<td align="left" valign="top">You can now mark the current
point, beginning of the buffer etc.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"Region-Commands.html#Region-Commands" accesskey="7">Region
Commands</a>:</td>
<td> </td>
<td align="left" valign="top">You can now give a region as an
argument for delete commands etc.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"New-Commands.html#New-Commands" accesskey="8">New
Commands</a>:</td>
<td> </td>
<td align="left" valign="top">Some new commands not available
in Vi are added.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"New-Bindings.html#New-Bindings" accesskey="9">New
Bindings</a>:</td>
<td> </td>
<td align="left" valign="top">Bindings of some keys are
changed for the convenience of editing under Emacs.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"Window-Commands.html#Window-Commands">Window
Commands</a>:</td>
<td> </td>
<td align="left" valign="top">Commands for moving among
windows etc.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"Buffer-Commands.html#Buffer-Commands">Buffer
Commands</a>:</td>
<td> </td>
<td align="left" valign="top">Commands for selecting buffers
etc.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"File-Commands.html#File-Commands">File Commands</a>:</td>
<td> </td>
<td align="left" valign="top">Commands for visiting files
etc.</td>
</tr>
<tr>
<td align="left" valign="top">• <a href=
"Misc-Commands.html#Misc-Commands">Misc Commands</a>:</td>
<td> </td>
<td align="left" valign="top">Other useful commands.</td>
</tr>
</table>
</body>
</html>
|
gpl-3.0
|
msteudtn/Mat-O-Wahl
|
extras/statistics_db/read_db_write_text.php
|
2864
|
<?php
/*
EINSATZZWECK / USE CASE
* Auslesen der Statistik aus der Datenbank
* Schreiben der Ergebnisse in eine Textdatei
* Die Textdatei kann dann von RESULTS.HTML und RESULTS.JS ausgelesen werden
* Read statistics from database
* Write results into text-file
* The text-file can be accessed via RESULTS.HTML and RESULTS.JS.
*/
$filename = 'results_db.txt';
$somecontent = "";
echo "<p>Current file path and file: <strong>".$_SERVER['SCRIPT_FILENAME']."</strong></p>";
// https://www.w3schools.com/php/php_mysql_select.asp
// Include Database Settings
echo "<p> Loading DB-Settings ... </p>";
include "../statistics/db_settings.php";
// Establish Connection
echo "<p> Establishing Connection ... </p>";
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
echo "<p> Checking Connection ... </p>";
if ($conn->connect_error) {
die("Mat-o-Wahl: Connection failed: " . $conn->connect_error);
}
echo "<p> Query SQL ... </p>";
$sql = "SELECT ip, timestamp, personal, parties FROM `$tablename` ";
$result = $conn->query($sql);
$counter = 0;
if ($result->num_rows > 0) {
// output data of each row
echo "<p> Reading data for file ".$filename." ... </p>";
while($row = $result->fetch_assoc()) {
$counter++;
$ip = $row["ip"];
$timestamp = $row["timestamp"];
$mowpersonal = $row["personal"];
$mowparties = $row["parties"];
echo $counter." ip: " .$ip. " - Date: " .$timestamp. " Personal: " .$mowpersonal. " Parties: " .$mowparties. "<br /> ";
$somecontent .= "".$ip." ".$timestamp." ".$mowpersonal." ".$mowparties."\n";
}
}
else {
echo "<p> Error: 0 results </p>";
}
echo "<p> Closing Connection. </p>";
$conn->close();
// DE: Sichergehen, dass die Datei existiert und beschreibbar ist
// EN: Let's make sure the file exists and is writable first.
if (is_writable($filename)) {
// DE: Wir öffnen $filename im "WRITE" - Modus, so dass die Datei neu geschrieben wird.
// EN: In our example we're opening $filename in WRITE mode to write it new.
if (!$handle = fopen($filename, "w")) {
print "<strong> Cannot open file ($filename) </strong> ";
exit;
}
// DE: Schreibe $somecontent in die geöffnete Datei.
// EN: Write $somecontent to our opened file.
if (!fwrite($handle, $somecontent)) {
print "<strong> Cannot write to file $filename </strong> ";
exit;
}
print "Success! <br /> wrote: ($somecontent) <br />to file ($filename)";
fclose($handle);
} else {
print "<strong> The file $filename is not writable </strong> ";
}
echo "<p> You can now change the <strong>`var fileResults`</strong> in <strong>/SYSTEM/RESULTS.JS</strong> to <strong>".$filename."</strong> "
?>
|
gpl-3.0
|
keralang/Kerafiles
|
README.md
|
53
|
Kerafiles
=========
Kera file for Arsenic Biosensor
|
gpl-3.0
|
UoA-eResearch/saga-gis
|
saga-gis/src/modules/grid/grid_calculus_bsl/ausdruck.cpp
|
17374
|
/**********************************************************
* Version $Id$
*********************************************************/
//#include "..\stdafx.h"
#include <iostream>
#include <vector>
#include <functional>
#include "ausdruck.h"
#include "funktion.h"
using namespace std;
class compare_BB_Funktion : public greater<BBFunktion *>
{
public:
bool operator()(const BBFunktion * &x, const BBFunktion * &y) const
{
return x->name < y->name;
};
};
BBBaumInteger::BBBaumInteger()
{
typ = NoOp;
memset(&k, 0, sizeof(BBKnoten));
}
BBBaumInteger::~BBBaumInteger()
{
if (typ == NoOp)
return;
switch(typ)
{
case BIOperator:
if (k.BiOperator.links != NULL)
delete k.BiOperator.links;
if (k.BiOperator.rechts != NULL)
delete k.BiOperator.rechts;
break;
case UniOperator:
if (k.UniOperator.rechts != NULL)
delete k.UniOperator.rechts;
break;
case MIndex:
if (k.MatrixIndex.P != NULL)
delete k.MatrixIndex.P;
break;
case Funktion:
if (k.func != NULL)
delete k.func;
break;
case IZahl:
case FZahl:
case IVar:
case FVar:
break;
}
memset(&k, 0, sizeof(BBKnoten));
}
BBBaumMatrixPoint::BBBaumMatrixPoint() : typ(NoOp) , isMatrix(true)
{
memset(&k, 0, sizeof(BBKnoten));
}
BBBaumMatrixPoint::~BBBaumMatrixPoint()
{
if (typ == NoOp)
return;
switch(typ)
{
case BIOperator:
if (k.BiOperator.links != NULL)
delete k.BiOperator.links;
if (k.BiOperator.rechts != NULL)
delete k.BiOperator.rechts;
break;
case UniOperator:
if (k.UniOperator.rechts != NULL)
delete k.UniOperator.rechts;
break;
case IFAusdruck:
if (k.IntFloatAusdruck.b != NULL)
delete k.IntFloatAusdruck.b;
break;
case MVar:
case PVar:
break;
}
memset(&k, 0, sizeof(BBKnoten));
}
bool getFirstCharKlammer(const string& statement, const string& cmp, char& c, int& pos)
{
if (statement.empty())
return false;
int klammer_ebene = 0, klammerE_ebene = 0;
for (int i=0; i<statement.size()-1; i++)
{
if (statement[i] == '(')
klammer_ebene++;
if (statement[i] == ')')
klammer_ebene--;
if (statement[i] == '[')
klammerE_ebene++;
if (statement[i] == ']')
klammerE_ebene--;
if (klammer_ebene == 0 && klammerE_ebene == 0 && i != statement.size() -1 && i != 0)
{
//int p = cmp.find_first_of(statement[i]);
//if (cmp.find_first_of(statement[i]) >= 0)
int j;
for (j=0; j<cmp.size(); j++)
if (cmp[j] == statement[i])
break;
if (j < cmp.size())
{
c = statement[i];
pos = i;
return true;
}
}
}
return false;
}
bool getLastCharKlammer(const string& statement, const string& cmp, char& c, int& pos)
{
if (statement.empty())
return false;
int char_found = -1;
int klammer_ebene = 0, klammerE_ebene = 0;
for (int i=0; i<statement.size()-1; i++)
{
if (statement[i] == '(')
klammer_ebene++;
if (statement[i] == ')')
klammer_ebene--;
if (statement[i] == '[')
klammerE_ebene++;
if (statement[i] == ']')
klammerE_ebene--;
if (klammer_ebene == 0 && klammerE_ebene == 0 && i != statement.size() -1 && i != 0)
{
int j;
for (j=0; j<cmp.size(); j++)
if (cmp[j] == statement[i])
char_found = i;
}
}
if (char_found > 0)
{
c = statement[char_found];
pos = char_found;
return true;
}
return false;
}
bool isKlammer(const string& statement)
{
// klammer-Level zählen
if (statement.empty())
return false;
if (statement[0] != '(' || statement[statement.size()-1] != ')')
return false;
int klammer_ebene = 0;
for (int i=0; i<statement.size()-1; i++)
{
if (statement[i] == '(')
klammer_ebene++;
if (statement[i] == ')')
klammer_ebene--;
if (klammer_ebene == 0 && i != statement.size() -1)
return false;
}
return true;
}
//++++++++++++++ Integer/ Float ++++++++++++++++++++++++++
bool isBiOperator(const string& statement, char& c, int& pos)
{
// Klammern zählen, da nur zwischen Klammer-Level NULL
// ein Operator stehen darf
// den Operator mit der niedrigsten Priorität zuerst ausführen, da er
// in der Baum-Struktur "oben" stehen muß !
if (getFirstCharKlammer(statement, "+", c, pos))
return true;
if (getLastCharKlammer(statement, "-", c, pos))
return true;
if (getFirstCharKlammer(statement, "*", c, pos))
return true;
if (getLastCharKlammer(statement, "/", c, pos))
return true;
if (getFirstCharKlammer(statement, "^", c, pos))
return true;
//-->
if (getFirstCharKlammer(statement, "%", c, pos))
return true;
//<--
return false;
}
bool isUniOperator(const string& statement, char& c)
{
c = statement[0];
return (c == '-' || c == '+');
}
bool isMatrixIndex(const string& statement, BBMatrix *& bm, BBBaumMatrixPoint *& bp, bool getMem /* = true */)
{
// wenn X[p] enthält und X = Matrix und p = Point
if (statement.empty())
return false;
string s(statement);
int pos1, pos2;
pos1 = s.find('[');
if (pos1 > 0)
{
pos2 = s.find(']');
if ( pos2 > pos1 && pos2 == s.size()-1 )
{
// ersten Teil
string m, p;
m = s.substr(0, pos1);
p = s.substr(pos1+1, pos2-pos1-1);
BBTyp *tm;
BBBaumMatrixPoint *bmp;
if (isMVar(m, tm))
{
try
{
// erst Testen
pars_matrix_point(p, bmp, false, false);
}
catch (BBFehlerException)
{
return false;
}
if (!getMem) // falls nichts allokieren -> test erfolgreich
return true;
try
{
// dann allokieren
pars_matrix_point(p, bmp, false);
}
catch (BBFehlerException)
{
return false;
}
bm = (BBMatrix *) tm;
bp = bmp;
return true;
}
/* if (isMVar(m, tm) && isPVar(p, tp))
{
bm = (BBMatrix *) tm;
bp = (BBPoint *) tp;
return true;
}
*/
}
}
return false;
}
bool isFZahl(const string& statement)
{
// Format: [+-]d[d][.[d[dd]][e|E +|- d[d]]]
if (statement .size() > 50)
return false;
char buff[100];
double f;
int anz = sscanf(statement.data(), "%f%s", &f, buff);
return (anz == 1);
}
bool isIZahl(const string& statement)
{
if (statement.empty())
return false;
string s(statement);
// eventuel voranstehenden +-
if (s[0] == '+')
s.erase(s.begin());
else if (s[0] == '-')
s.erase(s.begin());
if (s.empty())
return false;
int p = s.find_first_not_of("1234567890");
if (p >= 0)
return false;
return true;
}
bool isFVar(const string& statement, BBTyp * & b)
{
b = isVar(statement);
if (b == NULL)
return false;
if (b->type == BBTyp::FType)
return true;
return false;
}
bool isIVar(const string& statement, BBTyp * & b)
{
b = isVar(statement);
if (b == NULL)
return false;
if (b->type == BBTyp::IType)
return true;
return false;
}
bool isPVar(const string& statement, BBTyp * & b)
{
b = isVar(statement);
if (b == NULL)
return false;
if (b->type == BBTyp::PType)
return true;
return false;
}
bool isMVar(const string& statement, BBTyp * & b)
{
b = isVar(statement);
if (b == NULL)
return false;
if (b->type == BBTyp::MType)
return true;
return false;
}
BBFunktion *isFktName(const string& s)
{
if (FunktionList.empty())
return NULL;
T_FunktionList::iterator it;
for (it = FunktionList.begin(); it != FunktionList.end(); it++)
{
if ((*it)->name == s)
return (*it);
}
return NULL;
}
bool getNextFktToken(const string& s, int& pos, string& erg)
{
// Syntax xx[,xx[,xx...]]
if (pos >= s.size())
return false;
string ss(s.substr(pos));
int pos1 = ss.find_first_of(',');
if (pos1 >= 0)
{
erg = ss.substr(0, pos1);
pos += pos1;
}
else
{
erg = ss;
pos = s.size();
}
if (erg.empty())
return false;
return true;
}
bool isFunktion (const string& statement, BBFktExe * & fktexe, bool getMem /* = true */, bool AlleFunktionen /* = true */)
{
// Syntax: fktname([arg1[, arg2]])
string s(statement);
int pos1, pos2;
pos1 = s.find_first_of('(');
pos2 = s.find_last_of(')');
if (pos1 <= 0 || pos2 != s.size()-1)
return false;
// Variablen-Name
string sub1, sub2;
sub1 = s.substr(0, pos1);
trim(sub1);
sub2 = s.substr(pos1+1, pos2-pos1-1);
trim(sub2);
if (sub1.empty())
return false;
BBFunktion *fkt = isFktName(sub1);
if (fkt == NULL)
return false;
if (!AlleFunktionen)
{ // nur diejenigen Funktionen mit Return-Typ
if (fkt->ret.typ == BBArgumente::NoOp) // kein Return-Typ
return false;
}
if (sub2.empty()) // keine Argumente
{
if (!fkt->args.empty())
return false;
if (getMem)
{
fktexe = new BBFktExe;
fktexe->args = fkt->args;
fktexe->f = fkt; // vorher ... = NULL;
}
return true;
}
else
{
// Argumente zählen
// 1. Float/Integer lassen sich konvertieren
// 2. Matrix
// 3. Point
if (getMem)
{
fktexe = new BBFktExe;
fktexe->args = fkt->args; // vector kopieren
fktexe->f = fkt;
}
int anz = fkt->args.size();
int possub2 = 0;
for (int i=0; i<anz; i++)
{
// finde Token
string ss;
if (!getNextFktToken(sub2, possub2, ss))
return false;
// BBTyp *bt = isVar(ss);
// if (bt == NULL)
// return false;
if (fkt->args[i].typ == BBArgumente::ITyp ||
fkt->args[i].typ == BBArgumente::FTyp)
{
// if (bt->type != BBTyp::IType ||
// bt->type != BBTyp::FType)
// return false;
try
{
BBBaumInteger *b;
pars_integer_float(ss, b, getMem);
if (getMem)
fktexe->args[i].ArgTyp.IF = b;
}
catch (BBFehlerException)
{
if (getMem)
delete fktexe;
return false;
}
}
else
{
/* if (fkt->args[i].typ == BBArgumente::MTyp &&
bt->type != BBTyp::MType)
return false;
if (fkt->args[i].typ == BBArgumente::PTyp &&
bt->type != BBTyp::PType)
return false;
*/
try
{
BBBaumMatrixPoint *b;
pars_matrix_point(ss, b, fkt->args[i].typ == BBArgumente::MTyp, getMem);
if (getMem)
fktexe->args[i].ArgTyp.MP = b;
}
catch (BBFehlerException)
{
if (getMem)
delete fktexe;
return false;
}
}
possub2++; // Komma entfernen
}
if (possub2 < sub2.size()) // zuviel Parameter angegeben
{
if (getMem)
delete fktexe;
return false;
}
}
return true;
}
// ------------- Hauptroutine -------------------
static char c;
static BBTyp *b;
static BBMatrix *bm;
static BBPoint *bp;
static BBBaumMatrixPoint *bmp;
static int pos;
static BBFktExe *bfkt;
void pars_integer_float(const string& statement, BBBaumInteger * & Knoten, int getMem /* = true */)
{
string s(statement);
trim(s);
if (s.empty())
throw BBFehlerException();
if (isKlammer(s))
{
s.erase(s.begin());
s.erase(s.end()-1);
pars_integer_float(s, Knoten, getMem);
}
else if (isMatrixIndex(s, bm, bmp, getMem!=0))
{
if (getMem)
{
Knoten = new BBBaumInteger;
Knoten->typ = BBBaumInteger::MIndex;
Knoten->k.MatrixIndex.M = bm;
Knoten->k.MatrixIndex.P = bmp;
}
}
else if (isBiOperator(s, c, pos))
{
string links = s.substr(0, pos);
string rechts = s.substr(pos+1, s.size()-pos-1);
if (links.empty() || rechts.empty())
throw BBFehlerException();
if (getMem)
{
Knoten = new BBBaumInteger;
Knoten->typ = BBBaumInteger::BIOperator;
switch(c)
{
case '+':
Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Plus;
break;
case '-':
Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Minus;
break;
case '*':
Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Mal;
break;
case '/':
Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Geteilt;
break;
case '^':
Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Hoch;
break;
//-->
case '%':
Knoten->k.BiOperator.OpTyp = BBBaumInteger::BBKnoten::BBBiOperator::Modulo;
break;
//<--
}
pars_integer_float(links, Knoten->k.BiOperator.links);
pars_integer_float(rechts, Knoten->k.BiOperator.rechts);
}
else
{
pars_integer_float(links, Knoten, getMem);
pars_integer_float(rechts, Knoten, getMem);
}
}
else if (isUniOperator(s, c))
{
s.erase(s.begin());
if (getMem)
{
Knoten = new BBBaumInteger;
Knoten->typ = BBBaumInteger::UniOperator;
Knoten->k.UniOperator.OpTyp = (c == '+' ? BBBaumInteger::BBKnoten::BBUniOperator::Plus : BBBaumInteger::BBKnoten::BBUniOperator::Minus);
pars_integer_float(s, Knoten->k.UniOperator.rechts);
}
else
pars_integer_float(s, Knoten->k.UniOperator.rechts, getMem);
}
else if (isFZahl(s))
{
if (getMem)
{
Knoten = new BBBaumInteger;
Knoten->typ = BBBaumInteger::FZahl;
Knoten->k.FZahl = atof(s.data());
}
}
else if (isIZahl(s))
{
if (getMem)
{
Knoten = new BBBaumInteger;
Knoten->typ = BBBaumInteger::IZahl;
Knoten->k.IZahl = (int)atof(s.data());
}
}
else if (isFVar(s, b))
{
if (getMem)
{
Knoten = new BBBaumInteger;
Knoten->typ = BBBaumInteger::FVar;
Knoten->k.FVar = getVarF(b);
}
}
else if (isIVar(s, b))
{
if (getMem)
{
Knoten = new BBBaumInteger;
Knoten->typ = BBBaumInteger::IVar;
Knoten->k.IVar = getVarI(b);
}
}
else if (isFunktion (s, bfkt, getMem!=0, false)) // nur die Funktionen mit Return-Typ
{
if (getMem)
{
Knoten = new BBBaumInteger;
Knoten->typ = BBBaumInteger::Funktion;
Knoten->k.func = bfkt;
}
}
else
throw BBFehlerException();
}
bool isIntFloatAusdruck(const string& s)
{
try
{
BBBaumInteger *knoten = NULL;
pars_integer_float(s, knoten, false);
}
catch (BBFehlerException)
{
return false;
}
return true;
}
//++++++++++++++ Point ++++++++++++++++++++++++++
// Operator p/p + -
// Operator p/i i/p p/f f/p * /
//++++++++++++++ Matrix ++++++++++++++++++++++++++
// Operator M/M + -
// Operator M/i i/M M/f f/M * /
void pars_matrix_point(const string& statement, BBBaumMatrixPoint * &Knoten, bool matrix, bool getMem /* = true */)
{
string s(statement);
trim(s);
if (s.empty())
throw BBFehlerException();
if (isKlammer(s))
{
s.erase(s.begin());
s.erase(s.end()-1);
pars_matrix_point(s, Knoten, matrix, getMem);
}
else if (isUniOperator(s, c))
{
s.erase(s.begin());
if (getMem)
{
Knoten = new BBBaumMatrixPoint;
Knoten->typ = BBBaumMatrixPoint::UniOperator;
Knoten->k.UniOperator.OpTyp = (c == '+' ? BBBaumMatrixPoint::BBKnoten::BBUniOperator::Plus : BBBaumMatrixPoint::BBKnoten::BBUniOperator::Minus);
Knoten->isMatrix = matrix;
pars_matrix_point(s, Knoten->k.UniOperator.rechts, matrix);
}
else
pars_matrix_point(s, Knoten, matrix, getMem);
}
else if (isBiOperator(s, c, pos))
{
string links = s.substr(0, pos);
string rechts = s.substr(pos+1, s.size()-pos-1);
if (links.empty() || rechts.empty())
throw BBFehlerException();
if (getMem)
{
Knoten = new BBBaumMatrixPoint;
Knoten->typ = BBBaumMatrixPoint::BIOperator;
Knoten->isMatrix = matrix;
switch(c)
{
case '+':
Knoten->k.BiOperator.OpTyp = BBBaumMatrixPoint::BBKnoten::BBBiOperator::Plus;
break;
case '-':
Knoten->k.BiOperator.OpTyp = BBBaumMatrixPoint::BBKnoten::BBBiOperator::Minus;
break;
case '*':
Knoten->k.BiOperator.OpTyp = BBBaumMatrixPoint::BBKnoten::BBBiOperator::Mal;
break;
case '/':
Knoten->k.BiOperator.OpTyp = BBBaumMatrixPoint::BBKnoten::BBBiOperator::Geteilt;
break;
case '^':
throw BBFehlerException();
break;
case '%':
throw BBFehlerException();
break;
}
pars_matrix_point(links, Knoten->k.BiOperator.links, matrix);
pars_matrix_point(rechts, Knoten->k.BiOperator.rechts, matrix);
if (c == '+' || c == '-')
{
// Operator nur zwischen zwei Points
if (matrix && ( (Knoten->k.BiOperator.rechts)->typ != BBBaumMatrixPoint::MVar ||
(Knoten->k.BiOperator.links )->typ != BBBaumMatrixPoint::MVar ))
{
throw BBFehlerException();
}
if (!matrix && ((Knoten->k.BiOperator.rechts)->typ != BBBaumMatrixPoint::PVar ||
(Knoten->k.BiOperator.links )->typ != BBBaumMatrixPoint::PVar ))
{
throw BBFehlerException();
}
}
if (c == '*' || c == '/')
{
// Operator nur zwischen i/f und p, Reihenfolge egal
int pvar = 0;
int mvar = 0;
if ((Knoten->k.BiOperator.rechts)->typ == BBBaumMatrixPoint::PVar)
pvar++;
if ((Knoten->k.BiOperator.rechts)->typ == BBBaumMatrixPoint::MVar)
mvar++;
if ((Knoten->k.BiOperator.links)->typ == BBBaumMatrixPoint::PVar)
pvar++;
if ((Knoten->k.BiOperator.links)->typ == BBBaumMatrixPoint::MVar)
mvar++;
if (matrix && (mvar != 1 || pvar != 0))
throw BBFehlerException();
if (!matrix && (pvar != 1 || mvar != 0))
throw BBFehlerException();
}
}
else
{
pars_matrix_point(links, Knoten, matrix, getMem);
pars_matrix_point(rechts, Knoten, matrix, getMem);
}
}
else if (matrix && isMVar(s, b))
{
if (getMem)
{
Knoten = new BBBaumMatrixPoint;
Knoten->typ = BBBaumMatrixPoint::MVar;
Knoten->k.M = getVarM(b);
Knoten->isMatrix = matrix;
}
}
else if (!matrix && isPVar(s, b))
{
if (getMem)
{
Knoten = new BBBaumMatrixPoint;
Knoten->typ = BBBaumMatrixPoint::PVar;
Knoten->k.P = getVarP(b);
Knoten->isMatrix = matrix;
}
}
else if (isIntFloatAusdruck(s))
{
if (getMem)
{
Knoten = new BBBaumMatrixPoint;
Knoten->typ = BBBaumMatrixPoint::IFAusdruck;
Knoten->isMatrix = matrix;
pars_integer_float(s, Knoten->k.IntFloatAusdruck.b);
}
else
{
BBBaumInteger *k = NULL;
pars_integer_float(s, k, getMem);
}
}
else
throw BBFehlerException();
}
|
gpl-3.0
|
BertoDiaz/Inventory_App_v2
|
blog/templates/blog/computing_list.html
|
6333
|
{% extends 'blog/base_computing.html' %}
{% load static %}
{% block content %}
<div class="row">
{% if messages %}
<div class="col-md-6">
<div class="messages">
<div class="alert alert-info" style="padding-top: 20px;">
{% for message in messages %}
<h4{% if message.tags %} class="messages{{ message.tags }}"{% endif %}><strong>{{ message }}</strong></h4>
{% endfor %}
</div>
</div>
</div>
{% else %}
<div class="col-md-8">
<div class="inventory" style="margin-top: 15px;">
<table class="table table-hover">
<thead>
<tr>
<th>NAME</th>
<th>USER</th>
<th>MODEL</th>
<th>SETUP</th>
<th>LOCATION</th>
</tr>
</thead>
<tbody>
{% for computing in computings %}
<tr onclick="window.location='{% url 'blog:computing_detail' pk=computing.pk %}';">
<td style="vertical-align: middle; width:5%;"><h5><strong>{{ computing.name }}</strong></h5></td>
<td style="vertical-align: middle; width:10%;">{{ computing.user_name }}</td>
<td style="vertical-align: middle; width:10%;">{{ computing.model }}</td>
<td style="vertical-align: middle; width:5%;">{{ computing.setup }}</td>
<td style="vertical-align: middle; width:5%;">{{ computing.location }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="col-md-3 col-md-offset-1">
<h3>Locations</h3>
<div class="col-md-2">
<div class="row" style="margin-right: 20px; margin-bottom: 20px;">
<button type="submit" class="btn btn-default" onclick="toggle_visibility('Lab2027', 'Lab2031', 'Lab2035', 'Office2099', 'Office2101');">Lab 2027</button>
</div>
<div class="row" style="margin-right: 20px; margin-bottom: 20px;">
<button type="submit" class="btn btn-default" onclick="toggle_visibility('Lab2031', 'Lab2027', 'Lab2035', 'Office2099', 'Office2101');">Lab 2031</button>
</div>
<div class="row" style="margin-right: 20px; margin-bottom: 20px;">
<button type="submit" class="btn btn-default" onclick="toggle_visibility('Lab2035', 'Lab2027', 'Lab2031', 'Office2099', 'Office2101');">Lab 2035</button>
</div>
<div class="row" style="margin-right: 20px; margin-bottom: 20px;">
<button type="submit" class="btn btn-default" onclick="toggle_visibility('Office2099', 'Lab2027', 'Lab2031', 'Lab2035', 'Office2101');">Office 2099</button>
</div>
<div class="row">
<button type="submit" class="btn btn-default" onclick="toggle_visibility('Office2101', 'Lab2027', 'Lab2031', 'Lab2035', 'Office2099');">Office 2101</button>
</div>
</div>
<div class="col-md-1"></div>
<div class="col-md-2 col-md-offset-1">
<div id="Lab2027" style="display:none;">
<img src="{% static 'images/planos/Lab_2027_1.jpg' %}" alt="Lab 2027" height="700">
</div>
<div id="Lab2031" style="display:none;">
<img src="{% static 'images/planos/Lab_2031.png' %}" alt="Lab 2031" height="700">
</div>
<div id="Lab2035" style="display:none;">
<img src="{% static 'images/planos/Lab_2035.jpg' %}" alt="Lab 2035" height="700">
</div>
<div id="Office2099" style="display:none;">
<img src="{% static 'images/planos/Office_2099.jpg' %}" alt="Office 2099" height="500">
</div>
<div id="Office2101" style="display:none;">
<img src="{% static 'images/planos/Office_2101.jpg' %}" alt="Office 2101" height="500">
</div>
</div>
</div>
{% endif %}
</div>
{% if computings.has_other_pages %}
<div class="row">
<div class="col-md-6">
<div style="text-align: center;">
<nav aria-label="Page navigation">
<ul class="pagination pagination-sm">
{% if computings.has_previous %}
<li><a href="?page={{ computings.previous_page_number }}">«</a></li>
{% else %}
<li class="disabled"><span>«</span></li>
{% endif %}
{% for i in computings.paginator.page_range %}
{% if computings.number == i %}
<li class="active"><span>{{ i }} <span class="sr-only">(current)</span></span></li>
{% else %}
<li><a href="?page={{ i }}">{{ i }}</a></li>
{% endif %}
{% endfor %}
{% if computings.has_next %}
<li><a href="?page={{ computings.next_page_number }}">»</a></li>
{% else %}
<li class="disabled"><span>»</span></li>
{% endif %}
</ul>
</nav>
</div>
</div>
</div>
{% endif %}
{% endblock content %}
|
gpl-3.0
|
Great-Li-Xin/00864088
|
[书上的例题、练习与习题]/第04章/例题/例4-08-2.c
|
226
|
#include <stdio.h>
int main(void){
int max=0,cj=0;
printf("Enter mark: ");
while (cj>=0){
scanf("%d",&cj);
if (cj>max){
max=cj;
}
}
printf("max=%d",max);
return 0;
}
|
gpl-3.0
|
ayosec/spwd
|
README.md
|
2196
|
# ShorterPWD
ShorterPWD is a tool to show the current path, trimming the parents to fit a certain width. It is intended to be used in the prompt (`PS1` or equivalent).
## Example
First, we start in a *very* long path:
```console
$ mkdir -p /tmp/lorem/ipsum/dolor/sit/amet/consectetur/adipisicing/elit/sed/do/eiusmod
$ cd /tmp/lorem/ipsum/dolor/sit/amet/consectetur/adipisicing/
```
Then, with `spwd -m 40` we print the path trimmed to 40 characters:
```console
$ spwd -m 40
/t/l/i/d/s/amet/consectetur/adipisicing
$ cd elit/sed/do/eiusmod
$ spwd -m 40
/t/l/i/d/s/a/c/a/elit/sed/do/eiusmod
$ spwd -m 20
/t/l/i/d/s/a/c/a/e/s/d/eiusmod
```
The parents are trimmed to their first character until the length of the path is smaller than the value in the `-m` option. The last part is never trimmed.
You can always trim all parents with `spwd -m 0`.
## Aliases
spwd can replace a path prefix with an alias.
The aliases are defined in a file with the following format:
```
alias1 = path1
# Comment
alias2 = path2
```
To use them, add the `-a path` option to the `spwd` command.
Theses aliases are never trimmed.
### Example
First, create a file `~/.config/spwd/aliases`:
```
[My Projects] = /here/are/my/projects
[Work] = /home/user/content/work
```
Then, update the `PS1` variable to include the `-a` option:
```bash
PS1='\u@\h $(spwd -m 40 -a ~/.config/spwd/aliases)\$ '
```
Now, we can see our alias in the prompt instead of the full path.
```
~ $ cd /here/are/my/projects/something
[My Projects]/something $
```
## Installation
Use `make install` to compile and install the tool.
```
$ git clone https://github.com/ayosec/spwd.git
$ cd spwd
$ make test
$ sudo make install
```
By default it is installed in `/usr/local/bin`. If you want a different destination use the `DEST` variable. For example, to install the tool in `/usr/bin`, type:
```bash
$ sudo make DEST=/usr install
```
## Usage
To use spwd in your prompt, replace the sequence `\w` with `$(spwd -m XX)` in your `PS1` variable.
For example, instead of:
```bash
PS1='\u@\h \w\$ '
```
Use:
```bash
PS1='\u@\h $(spwd -m 40)\$ '
```
## Tests
To launch the tests type `make test` in the root directory.
|
gpl-3.0
|
zenn1989/scoria-interlude
|
L2Jscoria-Game/data/scripts/quests/112_WalkOfFate/__init__.py
|
2208
|
# Rewritten by RayzoR
import sys
from com.l2scoria.gameserver.model.quest import State
from com.l2scoria.gameserver.model.quest import QuestState
from com.l2scoria.gameserver.model.quest.jython import QuestJython as JQuest
qn = "112_WalkOfFate"
# ~~~~~ npcId list: ~~~~~
Livina = 30572
Karuda = 32017
# ~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~ itemId list: ~~~~~~
EnchantD = 956
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onAdvEvent (self,event,npc,player) :
st = player.getQuestState(qn)
if not st: return
htmltext = event
cond = st.getInt("cond")
if event == "32017-02.htm" and cond == 1 :
st.giveItems(57,22308)
st.giveItems(EnchantD,1)
st.addExpAndSp(112876,5774)
st.exitQuest(False)
st.playSound("ItemSound.quest_finish")
elif event == "30572-02.htm" :
st.playSound("ItemSound.quest_accept")
st.setState(STARTED)
st.set("cond","1")
return htmltext
def onTalk (self,npc,player):
htmltext = "<html><head><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>"
st = player.getQuestState(qn)
if not st : return htmltext
state = st.getState()
npcId = npc.getNpcId()
cond = st.getInt("cond")
if state == COMPLETED :
htmltext = "<html><body>This quest has already been completed.</body></html>"
elif state == CREATED :
if npcId == Livina :
if player.getLevel() >= 20 :
htmltext = "30572-01.htm"
else:
htmltext = "30572-00.htm"
st.exitQuest(1)
elif state == STARTED :
if npcId == Livina :
htmltext = "30572-03.htm"
elif npcId == Karuda :
htmltext = "32017-01.htm"
return htmltext
QUEST = Quest(112,qn,"Walk of Fate")
CREATED = State('Start', QUEST)
STARTED = State('Started', QUEST)
COMPLETED = State('Completed', QUEST)
QUEST.setInitialState(CREATED)
QUEST.addStartNpc(Livina)
QUEST.addTalkId(Livina)
QUEST.addTalkId(Karuda)
|
gpl-3.0
|
davidswelt/aquamacs-emacs
|
aquamacs/doc/Aquamacs Help/sc/Author-Names.html
|
6907
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta name="generator" content=
"HTML Tidy for Mac OS X (vers 31 October 2006 - Apple Inc. build 16.1), see www.w3.org" />
<title>Author Names - Supercite User's Manual</title>
<meta http-equiv="Content-Type" content="text/html" />
<meta name="description" content="Supercite User's Manual" />
<meta name="generator" content="makeinfo 4.13" />
<link title="Top" rel="start" href="index.html#Top" />
<link rel="up" href=
"Selecting-an-Attribution.html#Selecting-an-Attribution" title=
"Selecting an Attribution" />
<link rel="prev" href=
"Anonymous-Attributions.html#Anonymous-Attributions" title=
"Anonymous Attributions" />
<link rel="next" href=
"Configuring-the-Citation-Engine.html#Configuring-the-Citation-Engine"
title="Configuring the Citation Engine" />
<link href="http://www.gnu.org/software/texinfo/" rel=
"generator-home" title="Texinfo Homepage" /><!--
This document describes Supercite, an Emacs package for citing and
attributing replies to mail and news messages.
Copyright (C) 1993, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
2008, 2009, 2010 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with no Invariant Sections, with the Front-Cover texts
being ``A GNU Manual'', and with the Back-Cover Texts as in (a)
below. A copy of the license is included in the section entitled
``GNU Free Documentation License''.
(a) The FSF's Back-Cover Text is: ``You have the freedom to copy
and modify this GNU manual. Buying copies from the FSF supports
it in developing GNU and promoting software freedom.''
-->
<meta http-equiv="Content-Style-Type" content="text/css" />
<style type="text/css">
/*<![CDATA[*/
<!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
-->
/*]]>*/
</style>
</head>
<body>
<div class="node">
<a name="Author-Names" id="Author-Names"></a>
<p>Next: <a rel="next" accesskey="n" href=
"Configuring-the-Citation-Engine.html#Configuring-the-Citation-Engine">Configuring
the Citation Engine</a>, Previous: <a rel="previous"
accesskey="p" href=
"Anonymous-Attributions.html#Anonymous-Attributions">Anonymous
Attributions</a>, Up: <a rel="up" accesskey="u" href=
"Selecting-an-Attribution.html#Selecting-an-Attribution">Selecting
an Attribution</a></p>
<hr />
</div>
<p><a name="index-author-names-206" id=
"index-author-names-206"></a></p>
<h3 class="section">7.3 Author Names</h3>
<p>Supercite employs a number of heuristics to decipher the
author's name based on value of the ‘<samp><span class=
"samp">From:</span></samp>’ mail field of the original
message. Supercite can recognize almost all of the common
‘<samp><span class="samp">From:</span></samp>’ field
formats in use. If you encounter a ‘<samp><span class=
"samp">From:</span></samp>’ field that Supercite cannot
parse, please report this bug using <kbd>M-x
report-emacs-bug</kbd>.</p>
<p><a name="index-sc_002dtitlecue_002dregexp-207" id=
"index-sc_002dtitlecue_002dregexp-207"></a><a name=
"index-titlecue_002dregexp-_0028sc_002d_0029-208" id=
"index-titlecue_002dregexp-_0028sc_002d_0029-208"></a>There are a
number of Supercite variables that control how author names are
extracted from the ‘<samp><span class=
"samp">From:</span></samp>’ header. Some headers may
contain a descriptive title as in:</p>
<pre class="example">
From: computer!speedy!doe (John Xavier-Doe -- Decent Hacker)
</pre>
<p>Supercite knows which part of the ‘<samp><span class=
"samp">From:</span></samp>’ header is email address and
which part is author name, but in this case the string
<code>"Decent Hacker"</code> is not part of the author's name.
You can tell Supercite to ignore the title, while still
recognizing hyphenated names through the use of a regular
expression in the variable <code>sc-titlecue-regexp</code>. This
variable has the default value of <code>"\\\\s +-+\\\\s
+"</code>. Any text after this regexp is encountered is ignored
as noise.</p>
<p><a name="index-sc_002dname_002dfilter_002dalist-209" id=
"index-sc_002dname_002dfilter_002dalist-209"></a><a name=
"index-name_002dfilter_002dalist-_0028sc_002d_0029-210" id=
"index-name_002dfilter_002dalist-_0028sc_002d_0029-210"></a>Some
‘<samp><span class="samp">From:</span></samp>’
headers may contain extra titles in the name fields not separated
by a title cue, but which are nonetheless not part of the
author's name proper. Examples include the titles
“Dr.”, “Mr.”, “Ms.”,
“Jr.”, “Sr.”, and “III”
(e.g., Thurston Howe, the Third). Also, some companies prepend or
append the name of the division, organization, or project on the
author's name. All of these titles are noise which should be
ignored. The variable <code>sc-name-filter-alist</code> is used
for this purpose. As implied by its name, this variable is an
association list, where each element is a cons cell of the
form:</p>
<pre class="example">
(<var>regexp</var> . <var>position</var>)
</pre>
<p class="noindent">where <var>regexp</var> is a regular
expression that is matched (using <code>string-match</code>)
against each element of the ‘<samp><span class=
"samp">From:</span></samp>’ field's author name.
<var>position</var> is a position indicator, starting at zero.
Thus to strip out all titles of “Dr.”,
“Mr.”, etc. from the name,
<code>sc-name-filter-alist</code> would have an entry such
as:</p>
<pre class="example">
("^\\(Mr\\|Mrs\\|Ms\\|Dr\\)[.]?$" . 0)
</pre>
<p class="noindent">which only removes them if they appear as the
first word in the name. The position indicator is an integer, or
one of the two special symbols <code>last</code> or
<code>any</code>. <code>last</code> always matches against the
last word in the name field, while <code>any</code> matches
against every word in the name field.</p>
</body>
</html>
|
gpl-3.0
|
tanghus/currency-converter-plasmoid
|
make_plasmoid_pkg.sh
|
136
|
#!/bin/bash
. PACKAGE
echo "Creating Plasmoid package: $NAME-$VERSION.plasmoid"
zip -r ../$NAME-$VERSION.plasmoid . -x@zip_excluded.lst
|
gpl-3.0
|
wangmu0701/ReverseAD
|
ReverseAD/src/algorithm/base_reverse_tensor.cpp
|
232
|
#include "reversead/algorithm/base_reverse_tensor.hpp"
#include "reversead/forwardtype/single_forward.hpp"
template class ReverseAD::BaseReverseTensor<double>;
template class ReverseAD::BaseReverseTensor<ReverseAD::SingleForward>;
|
gpl-3.0
|
suragch/aePronunciation
|
app/src/main/java/com/aepronunciation/ipa/SelectSoundDialogFragment.java
|
16390
|
package com.aepronunciation.ipa;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.fragment.app.DialogFragment;
import androidx.appcompat.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import java.util.ArrayList;
import static android.content.Context.MODE_PRIVATE;
import static com.aepronunciation.ipa.MainActivity.PRACTICE_MODE_IS_SINGLE_KEY;
import static com.aepronunciation.ipa.MainActivity.PREFS_NAME;
public class SelectSoundDialogFragment extends DialogFragment {
public interface SelectSoundDialogListener {
void onDialogPositiveClick(
SoundMode numberSounds,
ArrayList<String> chosenVowels,
ArrayList<String> chosenConsonants);
void onDialogNegativeClick(DialogFragment dialog);
}
static final String KEY_DIALOG_IS_SINGLE_MODE = "isSingleMode";
static final String KEY_DIALOG_VOWEL_LIST = "vowels";
static final String KEY_DIALOG_CONSONANT_LIST = "consonants";
private SelectSoundDialogListener mListener;
private RadioButton rbSingle;
private RadioButton rbDouble;
private CheckBox cbVowelsCategory;
private CheckBox cbConsonantsCategory;
private CheckBox[] checkBoxesVowels;
private CheckBox[] checkBoxesConsonants;
private CheckBox cbSchwa;
private CheckBox cbUnstressedEr;
private CheckBox cbGlottalStop;
private CheckBox cbFlapT;
private Button positiveButton;
private boolean listenerDisabled = false;
@Override
@NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.dialog_select_sound, null);
rbSingle = view.findViewById(R.id.radio_single);
rbDouble = view.findViewById(R.id.radio_double);
cbSchwa = view.findViewById(R.id.cb_shwua);
cbUnstressedEr = view.findViewById(R.id.cb_er_unstressed);
cbGlottalStop = view.findViewById(R.id.cb_glottal_stop);
cbFlapT = view.findViewById(R.id.cb_flap_t);
// get saved practice mode
SharedPreferences settings = getActivity().getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
boolean isSingle = settings.getBoolean(PRACTICE_MODE_IS_SINGLE_KEY, true);
if (isSingle) {
rbSingle.setChecked(true);
} else {
rbDouble.setChecked(true);
cbSchwa.setVisibility(View.GONE);
cbUnstressedEr.setVisibility(View.GONE);
cbGlottalStop.setVisibility(View.GONE);
cbFlapT.setVisibility(View.GONE);
}
initializeCheckBoxes(view);
final RadioGroup rg = view.findViewById(R.id.select_sounds_radio_group);
rg.setOnCheckedChangeListener(radioGroupListener);
// disable the OK button
view.post(new Runnable() {
@Override
public void run() {
AlertDialog dialog = (AlertDialog) getDialog();
positiveButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
}
});
// build the alert dialog
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme);
builder.setView(view)
.setTitle(getString(R.string.select_sounds_title))
.setPositiveButton(R.string.select_sounds_positive_button, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
SoundMode soundType = SoundMode.Double;
//RadioButton single = (RadioButton) rg.findViewById(R.id.radio_single);
if (rbSingle.isChecked()) {
soundType = SoundMode.Single;
}
// get all chosen sounds
ArrayList<String> chosenVowels = new ArrayList<>();
for (CheckBox cb : checkBoxesVowels) {
if (cb.isChecked() & cb.getVisibility() == View.VISIBLE) {
chosenVowels.add(cb.getText().toString());
}
}
ArrayList<String> chosenConsonants = new ArrayList<>();
for (CheckBox cb : checkBoxesConsonants) {
if (cb.isChecked() & cb.getVisibility() == View.VISIBLE) {
chosenConsonants.add(cb.getText().toString());
}
}
// TODO: save single/double state to user preferences
// report back to parent fragment
mListener.onDialogPositiveClick(soundType, chosenVowels, chosenConsonants);
}
})
.setNegativeButton(R.string.dialog_cancel_button, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
mListener.onDialogNegativeClick(SelectSoundDialogFragment.this);
}
});
return builder.create();
}
@Override
public void onResume() {
super.onResume();
final AlertDialog alertDialog = (AlertDialog) getDialog();
Button okButton = alertDialog.getButton(AlertDialog.BUTTON_POSITIVE);
okButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SoundMode soundType = SoundMode.Double;
RadioButton single = alertDialog.findViewById(R.id.radio_single);
if (single != null && single.isChecked()) {
soundType = SoundMode.Single;
}
// get all chosen sounds
ArrayList<String> chosenVowels = new ArrayList<>();
for (CheckBox cb : checkBoxesVowels) {
if (cb.isChecked() & cb.getVisibility() == View.VISIBLE) {
chosenVowels.add(cb.getText().toString());
}
}
ArrayList<String> chosenConsonants = new ArrayList<>();
for (CheckBox cb : checkBoxesConsonants) {
if (cb.isChecked() & cb.getVisibility() == View.VISIBLE) {
chosenConsonants.add(cb.getText().toString());
}
}
mListener.onDialogPositiveClick(soundType, chosenVowels, chosenConsonants);
dismiss();
}
});
}
private void initializeCheckBoxes(View layout) {
checkBoxesVowels = new CheckBox[]{
layout.findViewById(R.id.cb_i),
layout.findViewById(R.id.cb_i_short),
layout.findViewById(R.id.cb_e_short),
layout.findViewById(R.id.cb_ae),
layout.findViewById(R.id.cb_a),
layout.findViewById(R.id.cb_c_backwards),
layout.findViewById(R.id.cb_u_short),
layout.findViewById(R.id.cb_u),
layout.findViewById(R.id.cb_v_upsidedown),
cbSchwa,
layout.findViewById(R.id.cb_ei),
layout.findViewById(R.id.cb_ai),
layout.findViewById(R.id.cb_au),
layout.findViewById(R.id.cb_oi),
layout.findViewById(R.id.cb_ou),
layout.findViewById(R.id.cb_er_stressed),
cbUnstressedEr,
layout.findViewById(R.id.cb_ar),
layout.findViewById(R.id.cb_er),
layout.findViewById(R.id.cb_ir),
layout.findViewById(R.id.cb_or)
};
checkBoxesConsonants = new CheckBox[]{
layout.findViewById(R.id.cb_p),
layout.findViewById(R.id.cb_b),
layout.findViewById(R.id.cb_t),
layout.findViewById(R.id.cb_d),
layout.findViewById(R.id.cb_k),
layout.findViewById(R.id.cb_g),
layout.findViewById(R.id.cb_ch),
layout.findViewById(R.id.cb_dzh),
layout.findViewById(R.id.cb_f),
layout.findViewById(R.id.cb_v),
layout.findViewById(R.id.cb_th_voiceless),
layout.findViewById(R.id.cb_th_voiced),
layout.findViewById(R.id.cb_s),
layout.findViewById(R.id.cb_z),
layout.findViewById(R.id.cb_sh),
layout.findViewById(R.id.cb_zh),
layout.findViewById(R.id.cb_m),
layout.findViewById(R.id.cb_n),
layout.findViewById(R.id.cb_ng),
layout.findViewById(R.id.cb_l),
layout.findViewById(R.id.cb_w),
layout.findViewById(R.id.cb_j),
layout.findViewById(R.id.cb_h),
layout.findViewById(R.id.cb_r),
cbGlottalStop,
cbFlapT
};
if (checkBoxesConsonants.length != Ipa.NUMBER_OF_CONSONANTS ||
checkBoxesVowels.length != Ipa.NUMBER_OF_VOWELS) {
throw new RuntimeException("update number of checkboxes if vowels or consonant number changes");
}
cbVowelsCategory = layout.findViewById(R.id.cbVowels);
cbConsonantsCategory = layout.findViewById(R.id.cbConsonants);
// get saved settings
Bundle mArgs = getArguments();
// FIXME use getSerializable to pass SoundMode enum directly
boolean isSingleMode = mArgs.getBoolean(KEY_DIALOG_IS_SINGLE_MODE);
SoundMode mode = SoundMode.Double;
if (isSingleMode) {
mode = SoundMode.Single;
}
ArrayList<String> vowelSounds = mArgs.getStringArrayList(KEY_DIALOG_VOWEL_LIST);
ArrayList<String> consonantSounds = mArgs.getStringArrayList(KEY_DIALOG_CONSONANT_LIST);
updateCheckedState(mode, vowelSounds, consonantSounds);
// set listeners on the IPA checkboxes so that OK button can be disabled
for (CheckBox cb : checkBoxesVowels) {
cb.setOnCheckedChangeListener(checkBoxListener);
}
for (CheckBox cb : checkBoxesConsonants) {
cb.setOnCheckedChangeListener(checkBoxListener);
}
cbVowelsCategory.setOnCheckedChangeListener(checkBoxListener);
cbConsonantsCategory.setOnCheckedChangeListener(checkBoxListener);
}
// allow calling fragment to set state
private void updateCheckedState(SoundMode mode, ArrayList<String> vowelSounds, ArrayList<String> consonantSounds) {
if (mode == null || vowelSounds == null || consonantSounds == null) {
return;
}
// radio group
if (mode == SoundMode.Single) {
rbSingle.setChecked(true);
} else {
rbDouble.setChecked(true);
}
// uncheck the vowel/consonant boxes if some of the small boxes are unchecked
listenerDisabled = true;
cbVowelsCategory.setChecked(checkBoxesVowels.length == vowelSounds.size());
cbConsonantsCategory.setChecked(checkBoxesConsonants.length == consonantSounds.size());
listenerDisabled = false;
// check individual boxes
String currentCbString;
boolean found;
for (CheckBox cb : checkBoxesVowels) {
currentCbString = cb.getText().toString();
found = false;
for (String sound : vowelSounds) {
if (currentCbString.equals(sound)) {
found = true;
}
}
cb.setChecked(found);
}
for (CheckBox cb : checkBoxesConsonants) {
currentCbString = cb.getText().toString();
found = false;
for (String sound : consonantSounds) {
if (currentCbString.equals(sound)) {
found = true;
}
}
cb.setChecked(found);
}
}
@Override
public void onAttach(@NonNull Context context) {
super.onAttach(context);
// check if parent Fragment implements listener
if (getParentFragment() instanceof SelectSoundDialogListener) {
mListener = (SelectSoundDialogListener) getParentFragment();
} else {
throw new RuntimeException("Parent fragment must implement SelectSoundDialogListener");
}
}
private RadioGroup.OnCheckedChangeListener radioGroupListener = new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int checkedId) {
switch (checkedId) {
case R.id.radio_single:
// show optional sounds (unstressed er, shwua, glottal stop and flap t)
cbSchwa.setVisibility(View.VISIBLE);
cbUnstressedEr.setVisibility(View.VISIBLE);
cbGlottalStop.setVisibility(View.VISIBLE);
cbFlapT.setVisibility(View.VISIBLE);
break;
case R.id.radio_double:
// hide optional sounds
cbSchwa.setVisibility(View.GONE);
cbUnstressedEr.setVisibility(View.GONE);
cbGlottalStop.setVisibility(View.GONE);
cbFlapT.setVisibility(View.GONE);
break;
}
// disable/enable OK button if needed
boolean enabledState = getButtonShouldBeEnabledState();
if (positiveButton.isEnabled() != enabledState) {
positiveButton.setEnabled(enabledState);
}
}
};
private CompoundButton.OnCheckedChangeListener checkBoxListener = new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
if (listenerDisabled) {
return;
}
switch (compoundButton.getId()) {
case R.id.cbVowels:
for (CheckBox cb : checkBoxesVowels) {
cb.setChecked(isChecked);
}
break;
case R.id.cbConsonants:
for (CheckBox cb : checkBoxesConsonants) {
cb.setChecked(isChecked);
}
break;
default:
// all other check boxes are individual sounds
// set the enabled state of the OK button
boolean enabledState = getButtonShouldBeEnabledState();
if (positiveButton.isEnabled() != enabledState) {
positiveButton.setEnabled(enabledState);
}
break;
}
}
};
private boolean getButtonShouldBeEnabledState() {
// count the number of checked boxes for consonants and vowels
int vowelsChecked = 0;
for (CheckBox cb : checkBoxesVowels) {
if (cb.isChecked() && cb.getVisibility() == View.VISIBLE) {
vowelsChecked++;
if (vowelsChecked > 1) break;
}
}
int consonantsChecked = 0;
for (CheckBox cb : checkBoxesConsonants) {
if (cb.isChecked() && cb.getVisibility() == View.VISIBLE) {
consonantsChecked++;
if (consonantsChecked > 1) break;
}
}
// There must be at least two sounds for single or one for double
if (rbSingle.isChecked()) {
if (vowelsChecked + consonantsChecked <= 1) {
return false;
}
} else { // Double
if (vowelsChecked + consonantsChecked < 1) {
return false;
}
}
return true;
}
}
|
gpl-3.0
|
ihmc/nomads
|
aci/cpp/dspro2/win32/genproto.bat
|
545
|
@echo off
set PROTO_BIN="..\..\..\..\externals-win\protobuf\protobuf-3.1.0\bin"
set IMPORTS="..\..\..\..\externals-win\protobuf\protobuf-3.1.0\include"
set SRC_DIR="..\..\..\..\..\measure"
set DST_DIR="..\comm"
%PROTO_BIN%\protoc.exe --proto_path=%IMPORTS% -I=%SRC_DIR% --cpp_out=%DST_DIR% %SRC_DIR%\subject.proto
%PROTO_BIN%\protoc.exe --proto_path=%IMPORTS% -I=%SRC_DIR% --cpp_out=%DST_DIR% %SRC_DIR%\measure.proto
%PROTO_BIN%\protoc.exe --proto_path=%IMPORTS% -I=%SRC_DIR% --cpp_out=%DST_DIR% %SRC_DIR%\subjects\disservice\disservice.proto
|
gpl-3.0
|
ranseyer/blind-control
|
arduino/Wintergartensteuerung/lib/Wgs.cpp
|
3018
|
/*
Wgs.h - Custom library for wintergarden.
Created by Felix Neubauer, August 12, 2016.
*/
#include "Arduino.h"
#include "Wgs.h"
const int STATE_UNKNOWN = 0;
const int STATE_ENABLED = 1;
const int STATE_DISABLING = 2;
const int STATE_DISABLED = 3;
const int STATE_ENABLING = 4;
Wgs::Wgs(int pin_on, int pin_down, long duration)
{
//pinMode(pin, OUTPUT);
_pin_on = pin_on;
_pin_down = pin_down;
_duration = duration;
_disable = false;
}
void Wgs::loop(bool button_disable, bool button_enable)
{
//debug("Loop. Button enable: "+button_enable);
//debug("Button disable: "+button_disable);
//debug("State: "+_state);
if(_mute_time > millis()){
debug("Muted");
return;
}
if(_disable){
debug("Detected rain!!!!!!!!!!!!!!!!!!!!!!!!!!");
button_disable = true;
}
if(button_disable){
if(_state == STATE_DISABLED || _state == STATE_DISABLING){ //Already disabled/disabling
debug("Already disabling/disabled");
return;
}
if(_state == STATE_ENABLING){
debug("Stop enabling");
_mute_time = millis() + 400;
stopMovement(STATE_UNKNOWN);
return;
}
debug("Start disabling");
startMovement(STATE_DISABLING);
}else if(button_enable){
if(_state == STATE_ENABLED || _state == STATE_ENABLING){ //Already enabled/enabling
debug("Already enabling/enabled");
return;
}
if(_state == STATE_DISABLING){
debug("Stop disabling");
_mute_time = millis() + 400;
stopMovement(STATE_UNKNOWN);
return;
}
debug("Start enabling");
startMovement(STATE_ENABLING);
}
if (_finish_time <= millis() && _finish_time > 0) {
debug("reached finish time");
switch (_state) {
case STATE_DISABLING:
stopMovement(STATE_DISABLED);
break;
case STATE_ENABLING:
stopMovement(STATE_ENABLED);
break;
}
}
}
void Wgs::setDisable(boolean b)
{
_disable = b;
}
void Wgs::stopMovement(int state) {
_finish_time = 0; //Set destination time to 0 -> it's not active anymore
digitalWrite(_pin_on, HIGH);
delay(150);
digitalWrite(_pin_down, HIGH);
_state = state;
}
void Wgs::debug(String text) {
/*String prefix = String();
prefix = "["+ _pin_on;
prefix = prefix+" ";
prefix = prefix + _pin_down;
prefix = prefix +"] ";
String goal = String();
goal = prefix + text;*/
Serial.println(_pin_on + text);
}
void Wgs::startMovement(int state)
{
setState(state);
if(_state == STATE_DISABLING){
digitalWrite(_pin_down, HIGH);//Activate relais and make it ready to disable this component
}else if(_state == STATE_ENABLING){
digitalWrite(_pin_down, LOW); //Activate relais and make it ready to enable this component
}
delay(150);
digitalWrite(_pin_on, LOW); //Activate motor
_finish_time = millis() + _duration; //Set destination time
}
void Wgs::setState(int i) //-1 = unknown. 0 = enabled; 1 = move_disable; 2 = disabled; 3 = move_enable;
{
_state = i;
}
|
gpl-3.0
|
gallardo/alkacon-oamp
|
com.alkacon.opencms.v8.calendar/src/com/alkacon/opencms/v8/calendar/client/widget/css/widget.css
|
932
|
@external primary;
.serialDataWidget {
border: 1px solid #7788AA;
}
.emptyValue .serialDataWidget {
border: 1px solid value("constants.css.borderColor");
}
.emptyValue .serialDataWidget * {
color: value("constants.css.borderColor") !important;
font-style: italic !important;
border-color: value("constants.css.borderColor") !important;
}
div.patternRow > div {
display: inline-block;
margin: 2px 4px;
vertical-align: middle;
}
div.patternRow > div:first-child {
margin-left: 0px;
}
div.patternRow div {
font-weight: normal !important;
}
div.patternRow input.patternInput {
width: 50px;
text-align: right;
}
div.patternRadio div {
text-align: left !important;
}
.singleLine{}
.firstColumn{}
.defaultView{}
.secondColumn{}
.compactView
.widget{}
.dragHelper{}
.hasError{}
.hasWarning{}
.label{}
.inActive{}
.widgetHolder{}
.entity{}
.attributeValue{}
|
gpl-3.0
|
0x00ach/stuff
|
set_pte_wx.c
|
4491
|
// gets the PTE for the page using physical addresses (also implements the PFN db technique, but does not perform any modification),
// sets the +W bit and unsets the NX bit
NTSTATUS SetPTEWX(
PVOID page
)
{
PHYSICAL_ADDRESS pPage;
UCHAR debug_msg[DEBUG_MESSAGE_LENGTH];
ULONGLONG addr;
PMMPFN ppfn;
DbgPrint("\t[-] MMPFN -> PteLong update\r\n");
pPage = MmGetPhysicalAddress(page);
// convert to PFN
pPage.QuadPart = pPage.QuadPart >> 12;
if (NT_SUCCESS(RtlStringCbPrintfA((NTSTRSAFE_PSTR)debug_msg, DEBUG_MESSAGE_LENGTH, (NTSTRSAFE_PCSTR) "\t\tPFN: 0x%I64x\r\n", pPage.QuadPart))) {
DbgPrint(debug_msg);
}
// get the MMPFN entry ptr
addr = pPage.QuadPart + pPage.QuadPart + pPage.QuadPart;
addr = addr << 4;
addr = addr + 0xFFFFFA8000000000;
ppfn = (PMMPFN)addr;
if (NT_SUCCESS(RtlStringCbPrintfA((NTSTRSAFE_PSTR)debug_msg, DEBUG_MESSAGE_LENGTH, (NTSTRSAFE_PCSTR) "\t\tMMPFN addr: 0x%I64x\r\n", ppfn))) {
DbgPrint(debug_msg);
}
// display the MMPFN entry ptr
if (NT_SUCCESS(RtlStringCbPrintfA((NTSTRSAFE_PSTR)debug_msg, DEBUG_MESSAGE_LENGTH, (NTSTRSAFE_PCSTR) "\t\tMMPTE addr: 0x%I64x\r\n", (ULONGLONG)(ppfn->pMMPTE)))) {
DbgPrint(debug_msg);
}
if ((ULONGLONG)(ppfn->pMMPTE) != 0)
{
// display the PTE entry :]
if (NT_SUCCESS(RtlStringCbPrintfA((NTSTRSAFE_PSTR)debug_msg, DEBUG_MESSAGE_LENGTH, (NTSTRSAFE_PCSTR) "\t\tORIGINAL PTE DATA: 0x%I64x\r\n", *(PULONGLONG)(ppfn->pMMPTE)))) {
DbgPrint(debug_msg);
}
// DISABLED: the PFN db is not documented, and the direct PTE access is much more reliable, and I need to handle several corner cases within the MMPFN entries
/*
// let's set the +W bit
*(PULONGLONG)(ppfn->pMMPTE) = *(PULONGLONG)(ppfn->pMMPTE) | 2;
// and remove the NX bit
*(PULONGLONG)(ppfn->pMMPTE) = *(PULONGLONG)(ppfn->pMMPTE) & 0x7FFFFFFFFFFFFFFF;
*/
}
// now comes the "real" PTE part (I don't know why the PFN db one is not the same... anyway, let's patch it too)
DbgPrint("\t[-] 'Real' PTE update\r\n");
addr = __readcr3();
pPage.QuadPart = addr + (sizeof(ULONGLONG) * (((ULONGLONG)page >> 0x27) & 0x1FF));
if (NT_SUCCESS(RtlStringCbPrintfA((NTSTRSAFE_PSTR)debug_msg, DEBUG_MESSAGE_LENGTH, (NTSTRSAFE_PCSTR) "\t\tPML4E: %I64x\r\n", pPage.QuadPart))) {
DbgPrint(debug_msg);
}
addr = (ULONGLONG)MmMapIoSpace(pPage, sizeof(ULONGLONG), MmNonCached);
if (addr == 0)
{
DbgPrint("\t\tPHYSICAL READ ERROR\r\n");
return STATUS_INVALID_ADDRESS;
}
addr = *(PULONGLONG)addr & 0xFFFFFFFFFF000;
pPage.QuadPart = addr + (sizeof(ULONGLONG) * (((ULONGLONG)page >> 0x1E) & 0x1FF));
if (NT_SUCCESS(RtlStringCbPrintfA((NTSTRSAFE_PSTR)debug_msg, DEBUG_MESSAGE_LENGTH, (NTSTRSAFE_PCSTR) "\t\tPDPE: %I64x\r\n", pPage.QuadPart))) {
DbgPrint(debug_msg);
}
addr = (ULONGLONG)MmMapIoSpace(pPage, sizeof(ULONGLONG), MmNonCached);
if (addr == 0)
{
DbgPrint("\t\tPHYSICAL READ ERROR\r\n");
return STATUS_INVALID_ADDRESS;
}
addr = *(PULONGLONG)addr & 0xFFFFFFFFFF000;
pPage.QuadPart = addr + (sizeof(ULONGLONG) * (((ULONGLONG)page >> 0x15) & 0x1FF));
if (NT_SUCCESS(RtlStringCbPrintfA((NTSTRSAFE_PSTR)debug_msg, DEBUG_MESSAGE_LENGTH, (NTSTRSAFE_PCSTR) "\t\tPDE: %I64x\r\n", pPage.QuadPart))) {
DbgPrint(debug_msg);
}
addr = (ULONGLONG)MmMapIoSpace(pPage, sizeof(ULONGLONG), MmNonCached);
if (addr == 0)
{
DbgPrint("\t\tPHYSICAL READ ERROR\r\n");
return STATUS_INVALID_ADDRESS;
}
addr = *(PULONGLONG)addr & 0xFFFFFFFFFF000;
pPage.QuadPart = addr + (sizeof(ULONGLONG) * (((ULONGLONG)page >> 0xC) & 0x1FF));
if (NT_SUCCESS(RtlStringCbPrintfA((NTSTRSAFE_PSTR)debug_msg, DEBUG_MESSAGE_LENGTH, (NTSTRSAFE_PCSTR) "\t\tPTE: %I64x\r\n", pPage.QuadPart))) {
DbgPrint(debug_msg);
}
addr = (ULONGLONG)MmMapIoSpace(pPage, sizeof(ULONGLONG), MmNonCached);
if (addr == 0)
{
DbgPrint("\t\tPHYSICAL READ ERROR\r\n");
return STATUS_INVALID_ADDRESS;
}
// display the PTE entry before change :]
if (NT_SUCCESS(RtlStringCbPrintfA((NTSTRSAFE_PSTR)debug_msg, DEBUG_MESSAGE_LENGTH, (NTSTRSAFE_PCSTR) "\t\tORIGINAL PTE DATA: 0x%I64x\r\n", *(PULONGLONG)addr))) {
DbgPrint(debug_msg);
}
// let's set the +W bit
*(PULONGLONG)(addr) = *(PULONGLONG)(addr) | 2;
// and remove the NX bit
*(PULONGLONG)(addr) = *(PULONGLONG)(addr) & 0x7FFFFFFFFFFFFFFF;
// display the PTE entry before change :]
if (NT_SUCCESS(RtlStringCbPrintfA((NTSTRSAFE_PSTR)debug_msg, DEBUG_MESSAGE_LENGTH, (NTSTRSAFE_PCSTR) "\t\tNEW PTE DATA: 0x%I64x\r\n", *(PULONGLONG)addr))) {
DbgPrint(debug_msg);
}
return STATUS_SUCCESS;
}
|
gpl-3.0
|
Apaq/peers
|
peers-lib/src/main/java/dk/apaq/peers/sip/transactionuser/DialogManager.java
|
4300
|
/*
This file is part of Peers, a java SIP softphone.
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
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/>.
Copyright 2007, 2008, 2009, 2010 Yohann Martineau
*/
package dk.apaq.peers.sip.transactionuser;
import java.util.Collection;
import java.util.Hashtable;
import dk.apaq.peers.sip.RFC3261;
import dk.apaq.peers.sip.syntaxencoding.SipHeaderFieldName;
import dk.apaq.peers.sip.syntaxencoding.SipHeaderFieldValue;
import dk.apaq.peers.sip.syntaxencoding.SipHeaderParamName;
import dk.apaq.peers.sip.syntaxencoding.SipHeaders;
import dk.apaq.peers.sip.transport.SipMessage;
import dk.apaq.peers.sip.transport.SipResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DialogManager {
private static final Logger LOG = LoggerFactory.getLogger(DialogManager.class);
private Hashtable<String, Dialog> dialogs;
public DialogManager() {
dialogs = new Hashtable<String, Dialog>();
}
/**
* @param sipResponse sip response must contain a To tag, a
* From tag and a Call-ID
* @return the new Dialog created
*/
public synchronized Dialog createDialog(SipResponse sipResponse) {
SipHeaders sipHeaders = sipResponse.getSipHeaders();
String callID = sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_CALLID)).toString();
SipHeaderFieldValue from = sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_FROM));
SipHeaderFieldValue to = sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_TO));
String fromTag = from.getParam(new SipHeaderParamName(RFC3261.PARAM_TAG));
String toTag = to.getParam(new SipHeaderParamName(RFC3261.PARAM_TAG));
Dialog dialog;
if (sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_VIA)) == null) {
//createDialog is called from UAS side, in layer Transaction User
dialog = new Dialog(callID, toTag, fromTag);
} else {
//createDialog is called from UAC side, in syntax encoding layer
dialog = new Dialog(callID, fromTag, toTag);
}
dialogs.put(dialog.getId(), dialog);
return dialog;
}
public void removeDialog(String dialogId) {
dialogs.remove(dialogId);
}
public synchronized Dialog getDialog(SipMessage sipMessage) {
SipHeaders sipHeaders = sipMessage.getSipHeaders();
String callID = sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_CALLID)).toString();
SipHeaderFieldValue from = sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_FROM));
SipHeaderFieldValue to = sipHeaders.get(new SipHeaderFieldName(RFC3261.HDR_TO));
SipHeaderParamName tagName = new SipHeaderParamName(RFC3261.PARAM_TAG);
String fromTag = from.getParam(tagName);
String toTag = to.getParam(tagName);
Dialog dialog = dialogs.get(getDialogId(callID, fromTag, toTag));
if (dialog != null) {
return dialog;
}
return dialogs.get(getDialogId(callID, toTag, fromTag));
}
public synchronized Dialog getDialog(String callId) {
for (Dialog dialog : dialogs.values()) {
if (dialog.getCallId().equals(callId)) {
return dialog;
}
}
return null;
}
private String getDialogId(String callID, String localTag, String remoteTag) {
StringBuffer buf = new StringBuffer();
buf.append(callID);
buf.append(Dialog.ID_SEPARATOR);
buf.append(localTag);
buf.append(Dialog.ID_SEPARATOR);
buf.append(remoteTag);
return buf.toString();
}
public Collection<Dialog> getDialogCollection() {
return dialogs.values();
}
}
|
gpl-3.0
|
ihmc/nomads
|
misc/cpp/c45/RandomTestInfo.h
|
1764
|
/*
* RandomTestInfo.h
*
* This file is part of the IHMC C4.5 Decision Tree Library.
* Copyright (c) 2008-2016 IHMC.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 3 (GPLv3) as published by the Free Software Foundation.
*
* U.S. Government agencies and organizations may redistribute
* and/or modify this program under terms equivalent to
* "Government Purpose Rights" as defined by DFARS
* 252.227-7014(a)(12) (February 2014).
*
* Alternative licenses that allow for use within commercial products may be
* available. Contact Niranjan Suri at IHMC (nsuri@ihmc.us) for details.
*
* Author: Giacomo Benincasa (gbenincasa@ihmc.us)
* Created on November 23, 2011, 12:00 PM
*/
#ifndef INCL_RANDOMTESTINFO_H
#define INCL_RANDOMTESTINFO_H
#include "TestInfo.h"
#include <stddef.h>
namespace IHMC_C45
{
class RandomTestInfo : public TestInfo
{
public:
RandomTestInfo();
RandomTestInfo(int noErrors, int noItems, float percErrors, int * confusionMatrix, int confusionMatrixSize);
virtual ~RandomTestInfo();
int * getConfusionMatrix(void);
int getConfusionMatrixSize(void);
protected:
int * _pConfusionMatrix;
int _confusionMatrixSize;
};
inline RandomTestInfo::RandomTestInfo()
: TestInfo()
{
_pConfusionMatrix = NULL;
_confusionMatrixSize = 0;
}
inline int * RandomTestInfo::getConfusionMatrix(void)
{
return _pConfusionMatrix;
}
inline int RandomTestInfo::getConfusionMatrixSize(void)
{
return _confusionMatrixSize;
}
}
#endif // INCL_RANDOMTESTINFO_H
|
gpl-3.0
|
GardFar/ADS4
|
doc/overview-summary.html
|
3975
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="fr">
<head>
<!-- Generated by javadoc (version 1.7.0_79) on Thu Apr 30 18:55:34 CEST 2015 -->
<title>Overview</title>
<meta name="date" content="2015-04-30">
<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="Overview";
}
//-->
</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 class="navBarCell1Rev">Overview</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?overview-summary.html" target="_top">Frames</a></li>
<li><a href="overview-summary.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="contentContainer">
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Packages table, listing packages, and an explanation">
<caption><span>Packages</span><span class="tabEnd"> </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="compilateur/package-summary.html">compilateur</a></td>
<td class="colLast"> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="lexer/package-summary.html">lexer</a></td>
<td class="colLast"> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="vue/package-summary.html">vue</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</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 class="navBarCell1Rev">Overview</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?overview-summary.html" target="_top">Frames</a></li>
<li><a href="overview-summary.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>
|
gpl-3.0
|
tomas-duda/ddw
|
src/main/java/cz/cvut/fit/ddw/project/subprocess/RSSFetcher.java
|
2999
|
package cz.cvut.fit.ddw.project.subprocess;
import cz.cvut.fit.ddw.project.enums.News;
import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.io.FeedException;
import com.rometools.rome.io.SyndFeedInput;
import com.rometools.rome.io.XmlReader;
import cz.cvut.fit.ddw.project.entity.NewsArticle;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
/**
*
* @author Tomáš Duda <dudatom2@fit.cvut.cz>
*/
public class RSSFetcher {
private static final Logger logger = Logger.getLogger(RSSFetcher.class);
private final News news;
private final SyndFeedInput input;
private final SyndFeed feed;
public RSSFetcher(News news) throws IllegalArgumentException, FeedException, IOException {
logger.info("Inicializuji spojeni s " + news.name());
this.news = news;
this.input = new SyndFeedInput();
this.feed = input.build(new XmlReader(new URL(news.getUrl())));
}
public List<NewsArticle> getCurrentFeed() throws IOException {
List<NewsArticle> articles = new ArrayList<>();
// 3 pokusy na navazani spojeni
List<SyndEntry> entries = null;
for (int i = 0; i < 3; i++) {
try {
logger.info("Pokus " + (i + 1) + "/" + 3 + " navazat spojeni s " + news.name());
entries = feed.getEntries();
logger.info("Pokus uspesny.");
break;
} catch (Exception ste) {
logger.info("Pokus neuspesny.");
if (i == 2) {
return articles;
}
}
}
for (SyndEntry se : entries) {
String title = se.getTitle();
String link = se.getLink();
String content;
try {
logger.debug("Pokousim se ziskat obsah clanku ze zpravodajskeho webu.");
Document doc = Jsoup.connect(link).get();
Elements elements = doc.getElementsByClass(news.getClassContentName());
if (!elements.isEmpty()) {
content = elements.get(0).text();
} else {
content = "";
}
} catch (IOException ioe) {
logger.warn("Ziskani clanku z webu nebylo uspesne, preskakuji.", ioe);
continue;
}
if (!content.isEmpty()) {
NewsArticle na = new NewsArticle(news, link, title, content);
articles.add(na);
} else {
logger.info("Vyrazuji clanek bez textoveho obsahu (video, galerie, infografika, livefeed ...): " + link);
continue;
}
logger.debug("Clanek uspesne zpracovan.");
}
return articles;
}
}
|
gpl-3.0
|
ksenechal/BootstrapFX
|
src/main/java/com/ksenechal/javafx/bootstrapfx/skin/BootstrapMenuButtonSkinBase.java
|
1850
|
/*
* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.ksenechal.javafx.bootstrapfx.skin;
import com.sun.javafx.scene.control.behavior.MenuButtonBehaviorBase;
import com.sun.javafx.scene.control.skin.MenuButtonSkinBase;
import javafx.scene.control.MenuButton;
/**
* Base class for MenuButtonSkin and SplitMenuButtonSkin. It consists of the
* label, the arrowButton with its arrow shape, and the popup.
*/
public abstract class BootstrapMenuButtonSkinBase<C extends MenuButton, B extends MenuButtonBehaviorBase<C>> extends MenuButtonSkinBase<C, B> {
public BootstrapMenuButtonSkinBase(C c, B b) {
super(c, b);
popup.getStyleClass().add("bootstrap-context-menu");
}
}
|
gpl-3.0
|
fondazionebordoni/misurainternet-ui
|
src/Grafici.js
|
633
|
import React from 'react';
import Grafico from './Grafico';
class Grafici extends React.Component {
render() {
return (
<div>
<h5 className="mt-3">Grafici</h5>
<Grafico titolo="Latenza" xtitle="Misurazioni" ytitle="ms" label="Ping" data={this.props.dataPing} colors={["#ffc107"]}/>
<Grafico titolo="Download" xtitle="Misurazioni" ytitle="kb/s" label="Banda" data={this.props.dataDownload} colors={["#007bff"]}/>
<Grafico titolo="Upload" xtitle="Misurazioni" ytitle="kb/s" label="Banda" data={this.props.dataUpload} colors={["#28a745"]}/>
</div>
)
}
}
export default Grafici;
|
gpl-3.0
|
Fusion/focuswriter
|
src/preferences_dialog.h
|
3093
|
/***********************************************************************
*
* Copyright (C) 2008, 2009, 2010, 2011 Graeme Gott <graeme@gottcode.org>
*
* 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 PREFERENCES_DIALOG_H
#define PREFERENCES_DIALOG_H
class Preferences;
#include <QDialog>
class QCheckBox;
class QComboBox;
class QLineEdit;
class QListWidget;
class QPushButton;
class QRadioButton;
class QSpinBox;
class PreferencesDialog : public QDialog
{
Q_OBJECT
public:
PreferencesDialog(Preferences& preferences, QWidget* parent = 0);
~PreferencesDialog();
public slots:
virtual void accept();
virtual void reject();
private slots:
void moveActionUp();
void moveActionDown();
void addSeparatorAction();
void currentActionChanged(int action);
void addLanguage();
void removeLanguage();
void selectedLanguageChanged(int index);
void addWord();
void removeWord();
void selectedWordChanged();
void wordEdited();
private:
QWidget* initGeneralTab();
QWidget* initStatisticsTab();
QWidget* initToolbarTab();
QWidget* initSpellingTab();
private:
Preferences& m_preferences;
QRadioButton* m_option_none;
QRadioButton* m_option_time;
QRadioButton* m_option_wordcount;
QSpinBox* m_time;
QSpinBox* m_wordcount;
QCheckBox* m_always_center;
QCheckBox* m_block_cursor;
QCheckBox* m_rich_text;
QCheckBox* m_smooth_fonts;
QCheckBox* m_smart_quotes;
QComboBox* m_double_quotes;
QComboBox* m_single_quotes;
QCheckBox* m_typewriter_sounds;
QCheckBox* m_auto_save;
QCheckBox* m_save_positions;
QCheckBox* m_show_characters;
QCheckBox* m_show_pages;
QCheckBox* m_show_paragraphs;
QCheckBox* m_show_words;
QRadioButton* m_option_characters;
QRadioButton* m_option_paragraphs;
QRadioButton* m_option_words;
QSpinBox* m_page_characters;
QSpinBox* m_page_paragraphs;
QSpinBox* m_page_words;
QRadioButton* m_option_accurate_wordcount;
QRadioButton* m_option_estimate_wordcount;
QComboBox* m_toolbar_style;
QListWidget* m_toolbar_actions;
QPushButton* m_move_up_button;
QPushButton* m_move_down_button;
QCheckBox* m_highlight_misspelled;
QCheckBox* m_ignore_uppercase;
QCheckBox* m_ignore_numbers;
QComboBox* m_languages;
QLineEdit* m_word;
QListWidget* m_personal_dictionary;
QPushButton* m_add_language_button;
QPushButton* m_remove_language_button;
QPushButton* m_add_word_button;
QPushButton* m_remove_word_button;
QStringList m_uninstalled;
};
#endif
|
gpl-3.0
|
creativo/softmodii
|
Softmodii_VB/Wii/Wii/frmEnlaces.Designer.vb
|
12911
|
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmEnlaces
Inherits System.Windows.Forms.Form
'Form reemplaza a Dispose para limpiar la lista de componentes.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Requerido por el Diseñador de Windows Forms
Private components As System.ComponentModel.IContainer
'NOTA: el Diseñador de Windows Forms necesita el siguiente procedimiento
'Se puede modificar usando el Diseñador de Windows Forms.
'No lo modifique con el editor de código.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmEnlaces))
Me.LinkLabel1 = New System.Windows.Forms.LinkLabel
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.Label1 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.Button1 = New System.Windows.Forms.Button
Me.combo_exploits = New System.Windows.Forms.ComboBox
Me.Button2 = New System.Windows.Forms.Button
Me.combo_otros = New System.Windows.Forms.ComboBox
Me.Button3 = New System.Windows.Forms.Button
Me.combo_extras = New System.Windows.Forms.ComboBox
Me.btn_extras = New System.Windows.Forms.Button
Me.Label7 = New System.Windows.Forms.Label
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'LinkLabel1
'
Me.LinkLabel1.AutoSize = True
Me.LinkLabel1.Font = New System.Drawing.Font("Arial", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LinkLabel1.LinkColor = System.Drawing.Color.Black
Me.LinkLabel1.Location = New System.Drawing.Point(182, 45)
Me.LinkLabel1.Name = "LinkLabel1"
Me.LinkLabel1.Size = New System.Drawing.Size(117, 17)
Me.LinkLabel1.TabIndex = 40
Me.LinkLabel1.TabStop = True
Me.LinkLabel1.Text = "-HackMii Installer"
'
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Font = New System.Drawing.Font("Arial", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(347, 11)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(82, 22)
Me.Label2.TabIndex = 63
Me.Label2.Text = " Exploits"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Font = New System.Drawing.Font("Arial", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.Location = New System.Drawing.Point(200, 11)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(75, 22)
Me.Label3.TabIndex = 65
Me.Label3.Text = "HackMii"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Arial", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(200, 113)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(63, 22)
Me.Label4.TabIndex = 66
Me.Label4.Text = "Extras"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Font = New System.Drawing.Font("Arial", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.Location = New System.Drawing.Point(356, 113)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(57, 22)
Me.Label5.TabIndex = 67
Me.Label5.Text = "Otros"
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.ForeColor = System.Drawing.Color.Red
Me.Label1.Location = New System.Drawing.Point(29, 9)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(78, 24)
Me.Label1.TabIndex = 68
Me.Label1.Text = "Enlaces"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(15, 103)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(134, 91)
Me.Label6.TabIndex = 69
Me.Label6.Text = "Aquí encontraras las " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "descargas necesarias para" & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "poder seguir el tutorial." & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "La d" & _
"escarga de este " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "material es legal, ya que " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "es gratuíto y facilitado por " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "los" & _
" mismos autores."
'
'PictureBox1
'
Me.PictureBox1.Image = Global.ismaelWii.My.Resources.Resources.link
Me.PictureBox1.Location = New System.Drawing.Point(33, 36)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(60, 51)
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom
Me.PictureBox1.TabIndex = 71
Me.PictureBox1.TabStop = False
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(18, 210)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(116, 38)
Me.Button1.TabIndex = 72
Me.Button1.Text = "Cerrar"
Me.Button1.UseVisualStyleBackColor = True
'
'combo_exploits
'
Me.combo_exploits.BackColor = System.Drawing.Color.White
Me.combo_exploits.DisplayMember = "1"
Me.combo_exploits.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.combo_exploits.FormattingEnabled = True
Me.combo_exploits.ItemHeight = 13
Me.combo_exploits.Items.AddRange(New Object() {"LetterBomb", "BannerBomb", "-------------------", "Return of the Jodi", "BatHax (Batman)", "Yu-Gi-Owned!", "Indiana PWNS!", "Smash Stack USA", "Smash Stack EUR Save", "Smash Stack EUR No Save", "Yu-Gi-Vah! (USA)", "Exploit Tales of S. EUR", "Exploit Tales of S. USA"})
Me.combo_exploits.Location = New System.Drawing.Point(321, 41)
Me.combo_exploits.Name = "combo_exploits"
Me.combo_exploits.Size = New System.Drawing.Size(139, 21)
Me.combo_exploits.TabIndex = 75
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(332, 68)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(118, 28)
Me.Button2.TabIndex = 76
Me.Button2.Text = "Descargar"
Me.Button2.UseVisualStyleBackColor = True
'
'combo_otros
'
Me.combo_otros.BackColor = System.Drawing.Color.White
Me.combo_otros.DisplayMember = "1"
Me.combo_otros.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.combo_otros.FormattingEnabled = True
Me.combo_otros.ItemHeight = 13
Me.combo_otros.Items.AddRange(New Object() {"cIOS38 rev17", "cIOS d2x", "cIOS Hermes", "Wad Manager GUI", "Nus Downloader", "7ZIP (Descompresor)"})
Me.combo_otros.Location = New System.Drawing.Point(321, 138)
Me.combo_otros.Name = "combo_otros"
Me.combo_otros.Size = New System.Drawing.Size(139, 21)
Me.combo_otros.TabIndex = 77
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(332, 165)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(118, 28)
Me.Button3.TabIndex = 78
Me.Button3.Text = "Descargar"
Me.Button3.UseVisualStyleBackColor = True
'
'combo_extras
'
Me.combo_extras.BackColor = System.Drawing.Color.White
Me.combo_extras.DisplayMember = "1"
Me.combo_extras.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.combo_extras.FormattingEnabled = True
Me.combo_extras.ItemHeight = 13
Me.combo_extras.Items.AddRange(New Object() {"Priiloader", "Pimp My Wii", "Wii Backup Mngr.", "ImgBurn"})
Me.combo_extras.Location = New System.Drawing.Point(160, 138)
Me.combo_extras.Name = "combo_extras"
Me.combo_extras.Size = New System.Drawing.Size(139, 21)
Me.combo_extras.TabIndex = 79
'
'btn_extras
'
Me.btn_extras.Location = New System.Drawing.Point(169, 165)
Me.btn_extras.Name = "btn_extras"
Me.btn_extras.Size = New System.Drawing.Size(118, 28)
Me.btn_extras.TabIndex = 80
Me.btn_extras.Text = "Descargar"
Me.btn_extras.UseVisualStyleBackColor = True
'
'Label7
'
Me.Label7.AutoSize = True
Me.Label7.Location = New System.Drawing.Point(189, 223)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(261, 26)
Me.Label7.TabIndex = 81
Me.Label7.Text = "Para seleccionar un link, abre la lista correspondiente " & Global.Microsoft.VisualBasic.ChrW(13) & Global.Microsoft.VisualBasic.ChrW(10) & "y pulsa ""Descargar""."
'
'frmEnlaces
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.White
Me.ClientSize = New System.Drawing.Size(474, 256)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.btn_extras)
Me.Controls.Add(Me.combo_extras)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.combo_otros)
Me.Controls.Add(Me.Button2)
Me.Controls.Add(Me.combo_exploits)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.PictureBox1)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.LinkLabel1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.Name = "frmEnlaces"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Enlaces"
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents LinkLabel1 As System.Windows.Forms.LinkLabel
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents combo_exploits As System.Windows.Forms.ComboBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents combo_otros As System.Windows.Forms.ComboBox
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents combo_extras As System.Windows.Forms.ComboBox
Friend WithEvents btn_extras As System.Windows.Forms.Button
Friend WithEvents Label7 As System.Windows.Forms.Label
End Class
|
gpl-3.0
|
ihmc/nomads
|
util/java/us/ihmc/util/ThreadPool.java
|
5504
|
/*
* ThreadPool.java
*
* This file is part of the IHMC Util Library
* Copyright (c) 1993-2016 IHMC.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* version 3 (GPLv3) as published by the Free Software Foundation.
*
* U.S. Government agencies and organizations may redistribute
* and/or modify this program under terms equivalent to
* "Government Purpose Rights" as defined by DFARS
* 252.227-7014(a)(12) (February 2014).
*
* Alternative licenses that allow for use within commercial products may be
* available. Contact Niranjan Suri at IHMC (nsuri@ihmc.us) for details.
*/
/**
* ThreadPool
*
* @author Marco Arguedas <marguedas@ihmc.us>
*
* @version $Revision$
* $Date$
*/
package us.ihmc.util;
import java.util.ArrayList;
import java.util.List;
/**
*
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public class ThreadPool
{
public ThreadPool (int maxNumWorkers)
{
if (maxNumWorkers <= 0) {
throw new IllegalArgumentException ("maxNumWorker cannot be <= 0");
}
_maxNumWorkers = maxNumWorkers;
_workers = new ArrayList<ThreadPoolWorker>();
_tasks = new ArrayList<ThreadPoolTask>();
}
/**
*
*/
public void enqueue (Runnable runnable, ThreadPoolMonitor tpm)
{
ThreadPoolTask tpt = new ThreadPoolTask (runnable, tpm);
this.checkAndActivateThreads();
synchronized (_tasks) {
_tasks.add (tpt);
_tasks.notifyAll();
}
} //enqueue()
/**
*
*/
public void enqueue (Runnable runnable)
{
this.enqueue (runnable, null);
}
// /////////////////////////////////////////////////////////////////////////
// PRIVATE METHODS /////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
/**
*
*/
private ThreadPoolTask dequeueTask()
{
ThreadPoolTask task = null;
synchronized (_tasks) {
while (_tasks.isEmpty()) {
try {
_tasks.wait();
}
catch (Exception ex) {
ex.printStackTrace();
}
} //while()
task = _tasks.remove (0);
}
return task;
} //dequeueTask()
/**
*
*/
private void threadBusyStatusChanged (boolean threadIsBusy)
{
synchronized (this) {
if (threadIsBusy) {
_numBusyWorkers++;
}
else {
_numBusyWorkers--;
}
}
} //threadBusyStatusChanged()
/**
*
*/
private void checkAndActivateThreads()
{
int numWorkers = _workers.size();
if (numWorkers >= _maxNumWorkers) {
return;
}
synchronized (this) {
int numIdleWorkers = numWorkers - _numBusyWorkers;
if (numIdleWorkers == 0) {
ThreadPoolWorker tpt = new ThreadPoolWorker (this);
_workers.add (tpt);
tpt.start();
}
}
} //checkAndActivateThreads()
// /////////////////////////////////////////////////////////////////////////
// INTERNAL CLASSES ////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////
/**
*
*/
private class ThreadPoolTask
{
public ThreadPoolTask (Runnable r, ThreadPoolMonitor tpm)
{
runnable = r;
tpMon = tpm;
}
Runnable runnable = null;
ThreadPoolMonitor tpMon = null;
} //class ThreadPoolTask
/**
*
*/
private static class ThreadPoolWorker extends Thread
{
ThreadPoolWorker (ThreadPool tp)
{
setName ("ThreadPoolWorker" + (_tpwInstanceCounter++) + "-[" + getName() + "]");
_threadPool = tp;
}
/**
*
*/
public void run()
{
while (true) {
ThreadPoolTask tpt = _threadPool.dequeueTask();
Exception runnableEx = null;
_threadPool.threadBusyStatusChanged (true);
try {
tpt.runnable.run();
}
catch (Exception ex) {
runnableEx = ex;
}
if (tpt.tpMon != null) {
try {
tpt.tpMon.runFinished (tpt.runnable, runnableEx);
}
catch (Exception ex) {
} //intentionally left blank.
}
_threadPool.threadBusyStatusChanged (false);
}
} //run()
private ThreadPool _threadPool = null;
private static int _tpwInstanceCounter = 0;
} // class ThreadPoolWorker
/**
*
*/
public interface ThreadPoolMonitor
{
public void runFinished (Runnable runnable, Exception exception);
} //interface ThreadPoolMonitor
// /////////////////////////////////////////////////////////////////////////
private int _maxNumWorkers = 0;
private int _numBusyWorkers = 0;
private final List<ThreadPoolWorker> _workers;
private final List<ThreadPoolTask> _tasks;
} //class ThreadPool
|
gpl-3.0
|
markuspg/EcoLabLib
|
src/client/client.h
|
7008
|
/*
* Copyright 2015-2016 Markus Prasser
*
* This file is part of EcoLabLib.
*
* EcoLabLib 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.
*
* EcoLabLib 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 EcoLabLib. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CLIENT_H
#define CLIENT_H
#include <stdexcept>
#include "../ecolablib_global.h"
#include "../settingsstorage.h"
#include <QObject>
#include <QWebSocket>
enum class ellClientState_t : unsigned short int {
BOOTING,
CONNECTED,
DISCONNECTED,
SHUTTING_DOWN,
ZLEAF_RUNNING
};
//! Represents a client in the laboratory
/*!
This class represents a client in the laboratory. Each client has to be specified in 'EcoLabLib's settings file.
A client consists of its fixed attributes, its changing state and some executable functions
*/
class ECOLABLIBSHARED_EXPORT ellClient : public QObject
{
Q_OBJECT
public:
//! 'ellClient's constructor which will be called by 'ellClientManager'
/*!
The constructor initializes the 'ellClient's const attributes. The default state is 'disconnected'.
\param argHostName The hostname the client has
\param argIP Its IP address
\param argMAC Ist MAC address
\param argWebcamAvailable If a webcam is attached to the client
\param argXPosition The client's x coordinate in the laboratory
\param argYPosition The client's y coordinate in the laboratory
\param argSettingsStorage The 'ellSettingsStorage' containing all settings
\param argParent 'ellClient's parent object
*/
explicit ellClient( const QString &argHostName, const QString &argIP, const QString &argMAC,
const QString &argWebcamAvailable, const QString &argXPosition, const QString &argYPosition,
const ellSettingsStorage * const argSettingsStorage, QObject *argParent = nullptr );
ellClient( const ellClient &argClient ) = delete;
const QString hostName; //! The hostname of the client
const QString ip; //! Its IP address
const QString mac; //! Its MAC address
const bool webcamAvailable = 0; //! If a webcam is attached to the client
const unsigned int xPosition = 1; //! The client's x coordinate in the laboratory
const unsigned int yPosition = 1; //! The client's y coordinate in the laboratory
//! This functions beams the specified directory to the folder 'media4ztree' in the client experimenter user's home directory
/*!
* \param argDirectoryToBeam The directory which (including all its contents and even links) shall be beamed
*/
void BeamFile( const QString &argDirectoryToBeam ) const;
//! Tries to boot the client using wakeonlan
void Boot();
/*!
\brief This function gets frequently polled by Labcontrol to update the table view showing the clients
\return The client's current state
*/
ellClientState_t GetClientState() const { return state; }
/*!
\brief This function is used by 'Labcontrol' to add port information to the table views
\return A pointer to a QString containing the port of the session the client belongs to ('nullptr' if the client belongs to no session)
*/
const QString *GetSessionPort() const { return sessionPort.get(); }
//! Kills any z-Leaves on the clients
void KillzLeaf();
//! This command opens the client's file system in a file manager
/*!
* \param argAsRoot True, if the file system shall be opened with root rights; false, otherwise
*/
void OpenFileSystem( const bool &argAsRoot ) const;
//! This command opens a SSH session connected to the client in a terminal emulator on the server
/*!
* \param argCommand An optional command to be executed (pass an empty string, if no command shall be run)
* \param argOpenAsRoot True, if the command shall be run as root, otherwise false)
*/
void OpenTerminal( const QString &argCommand, const bool &argOpenAsRoot );
/*!
\brief This function updates the stored session port and is used by 'lcSessionStarter' or 'ellSession's destructor
\param argSessionPort The new 'ellSession' port or nothing, if the client shall be freed
*/
void SetSessionPort( QString * const argSessionPort = nullptr );
/*!
\brief This function updates the stored z-Leaf version and is used by 'lcMainWindow' and 'lcSessionStarter' or 'ellSession's destructor
\param argzLeafVersion The new 'ellSession' z-Leaf version or nothing, if the client shall be freed
*/
void SetzLeafVersion( QString * const argzLeafVersion = nullptr );
/*!
\brief This function gets called by 'ellClientManager' to update the socket of this client on new connection attempts
\param argSocket The new socket
*/
void SetWebSocket( QWebSocket *argWebSocket );
//! Shows locally the desktop of the client using a vnc viewer
void ShowDesktop();
//! Shuts down the client
void Shutdown();
/*!
* \brief This function starts a z-Leaf on the client
* \param fakeName An optional fake name, if the client shall not connect to z-Tree using its hostname
*/
void StartzLeaf( const QString * const fakeName = nullptr );
signals:
public slots:
//! This slot is called the first time a new client sends a text message. This message should contain the correct password, otherwise the connection will be closed.
void PasswordReceived( QString argMessage );
//! This slot gets called if the client's socket disconnected and cleans it up, also changing the client's status
void WebSocketDisconnected();
private:
std::unique_ptr < const QString > sessionPort = nullptr; //! The port the z-Leaf on this client uses (for the 'TVClients')
const ellSettingsStorage * const settingsStorage = nullptr; //! Contains all external settings
ellClientState_t state = ellClientState_t::DISCONNECTED; //! The client's state
QWebSocket *webSocket = nullptr; //! The websocket this client is currently connected on
std::unique_ptr < const QString > zleafVersion = nullptr; //! The z-Leaf version this client shall use
void SendMessage( const quint16 &argMessageID, QString *argMessage = nullptr );
private slots:
//! This slot is called on new text messages arriving at the websocket. It processes those and undertakes needed actions.
void TextMessageReceived( QString argMessage );
};
#endif // CLIENT_H
|
gpl-3.0
|
stxent/halm-examples
|
examples/lpc17xx_default/serial/main.c
|
2535
|
/*
* lpc17xx_default/serial/main.c
* Copyright (C) 2016 xent
* Project is distributed under the terms of the GNU General Public License v3.0
*/
#include <halm/pin.h>
#include <halm/platform/lpc/clocking.h>
#include <halm/platform/lpc/serial.h>
#include <assert.h>
/*----------------------------------------------------------------------------*/
#define BUFFER_LENGTH 64
#define LED_PIN PIN(1, 8)
/*----------------------------------------------------------------------------*/
static const struct SerialConfig serialConfig = {
.rxLength = BUFFER_LENGTH,
.txLength = BUFFER_LENGTH,
.rate = 19200,
.rx = PIN(0, 16),
.tx = PIN(0, 15),
.channel = 1
};
/*----------------------------------------------------------------------------*/
static const struct ExternalOscConfig extOscConfig = {
.frequency = 12000000
};
static const struct PllConfig sysPllConfig = {
.source = CLOCK_EXTERNAL,
.divisor = 16,
.multiplier = 32
};
static const struct GenericClockConfig mainClockConfig = {
.source = CLOCK_PLL
};
/*----------------------------------------------------------------------------*/
static void onSerialEvent(void *argument)
{
*(bool *)argument = true;
}
/*----------------------------------------------------------------------------*/
static void setupClock(void)
{
clockEnable(ExternalOsc, &extOscConfig);
while (!clockReady(ExternalOsc));
clockEnable(SystemPll, &sysPllConfig);
while (!clockReady(SystemPll));
clockEnable(MainClock, &mainClockConfig);
}
/*----------------------------------------------------------------------------*/
static void transferData(struct Interface *interface, struct Pin led)
{
size_t available = 0;
pinSet(led);
do
{
uint8_t buffer[BUFFER_LENGTH];
const size_t length = ifRead(interface, buffer, sizeof(buffer));
ifWrite(interface, buffer, length);
ifGetParam(interface, IF_RX_AVAILABLE, &available);
}
while (available > 0);
pinReset(led);
}
/*----------------------------------------------------------------------------*/
int main(void)
{
setupClock();
const struct Pin led = pinInit(LED_PIN);
pinOutput(led, false);
bool event = false;
struct Interface * const serial = init(Serial, &serialConfig);
assert(serial);
ifSetCallback(serial, onSerialEvent, &event);
while (1)
{
while (!event)
barrier();
event = false;
transferData(serial, led);
}
return 0;
}
|
gpl-3.0
|
fryntiz/preparar_entorno
|
Apps/pentesting.sh
|
1146
|
#!/usr/bin/env bash
# -*- ENCODING: UTF-8 -*-
##
## @author Raúl Caro Pastorino
## @copyright Copyright © 2019 Raúl Caro Pastorino
## @license https://wwww.gnu.org/licenses/gpl.txt
## @email raul@fryntiz.dev
## @web https://fryntiz.es
## @gitlab https://gitlab.com/fryntiz
## @github https://github.com/fryntiz
##
## Applied Style Guide:
## @style https://gitlab.com/fryntiz/bash-guide-style
############################
## INSTRUCTIONS ##
############################
##
###########################
## FUNCIONES ##
###########################
aplicaciones_pentesting() {
echo -e "$VE Aplicaciones Pentesting y Redes$CL"
actualizarRepositorios
repararGestorPaquetes
instalarSoftwareLista "$SOFTLIST/Pentesting/db.lst"
instalarSoftwareLista "$SOFTLIST/Pentesting/frameworks.lst"
instalarSoftwareLista "$SOFTLIST/Pentesting/redes.lst"
instalarSoftwareLista "$SOFTLIST/Pentesting/sistema.lst"
instalarSoftwareLista "$SOFTLIST/Pentesting/bluetooth.lst"
instalarSoftwareLista "$SOFTLIST/Pentesting/crackers.lst"
repararGestorPaquetes
}
|
gpl-3.0
|
Sliim/sleemacs
|
php-manual/function.ncurses-scrl.html
|
2822
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Scroll window content up or down without changing current position</title>
</head>
<body><div class="manualnavbar" style="text-align: center;">
<div class="prev" style="text-align: left; float: left;"><a href="function.ncurses-scr-set.html">ncurses_scr_set</a></div>
<div class="next" style="text-align: right; float: right;"><a href="function.ncurses-show-panel.html">ncurses_show_panel</a></div>
<div class="up"><a href="ref.ncurses.html">Ncurses Functions</a></div>
<div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.ncurses-scrl" class="refentry">
<div class="refnamediv">
<h1 class="refname">ncurses_scrl</h1>
<p class="verinfo">(PHP 4 >= 4.0.7, PHP 5 < 5.3.0, PECL ncurses >= 1.0.0)</p><p class="refpurpose"><span class="refname">ncurses_scrl</span> — <span class="dc-title">Scroll window content up or down without changing current position </span></p>
</div>
<div class="refsect1 description" id="refsect1-function.ncurses-scrl-description">
<h3 class="title">Description</h3>
<div class="methodsynopsis dc-description">
<span class="type">int</span> <span class="methodname"><strong>ncurses_scrl</strong></span>
( <span class="methodparam"><span class="type">int</span> <code class="parameter">$count</code></span>
)</div>
<div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function is
<em class="emphasis">EXPERIMENTAL</em>. The behaviour of this function, its name, and
surrounding documentation may change without notice in a future release of PHP.
This function should be used at your own risk.
</p></div>
<div class="warning"><strong class="warning">Warning</strong><p class="simpara">This function is
currently not documented; only its argument list is available.
</p></div>
</div>
<div class="refsect1 parameters" id="refsect1-function.ncurses-scrl-parameters">
<h3 class="title">Parameters</h3>
<p class="para">
<dl>
<dt>
<span class="term"><em><code class="parameter">count</code></em></span>
<dd>
<p class="para">
</p>
</dd>
</dt>
</dl>
</p>
</div>
</div><hr /><div class="manualnavbar" style="text-align: center;">
<div class="prev" style="text-align: left; float: left;"><a href="function.ncurses-scr-set.html">ncurses_scr_set</a></div>
<div class="next" style="text-align: right; float: right;"><a href="function.ncurses-show-panel.html">ncurses_show_panel</a></div>
<div class="up"><a href="ref.ncurses.html">Ncurses Functions</a></div>
<div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
|
gpl-3.0
|
MeteoricGames/pioneer
|
src/test_FileSystem.cpp
|
2833
|
// Copyright © 2008-2014 Pioneer Developers. See AUTHORS.txt for details
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
#include "FileSystem.h"
#include "FileSourceZip.h"
#include "utils.h"
#include <cstdio>
#include <stdexcept>
static const char *ftype_name(const FileSystem::FileInfo &info) {
if (info.IsDir()) { return "directory"; }
else if (info.IsFile()) { return "file"; }
else if (info.IsSpecial()) { return "special"; }
else { return "non-existent"; }
}
void test_normpath()
{
using namespace FileSystem;
const char *TEST_PATHS[] = {
"a/b/c",
"a/b/c/",
"/a/b/c",
"a/b/../c",
"..",
".",
"./",
"a/..",
"a/b/./.././c/../",
"a/b/c/d/../../../../",
"a/b/c/d/../../../../../",
"/a/b",
"/a/b/",
0
};
for (const char **path = TEST_PATHS; *path; ++path) {
try {
printf("'%s' -> '%s'\n", *path, NormalisePath(*path).c_str());
} catch (std::invalid_argument) {
printf("'%s' -> invalid\n", *path);
}
}
printf("'/' + '/a/b/' -> '%s'\n", JoinPathBelow("/", "/a/b/").c_str());
}
void test_sanitisename()
{
const char *TEST_NAMES[] = {
"",
".",
"..",
"hello",
"hello world",
"hello \"Bob\"",
"hello/world",
"hello\nworld",
0
};
printf("sanitise names:\n");
for (const char **name = TEST_NAMES; *name; ++name) {
const std::string x = FileSystem::SanitiseFileName(*name);
printf("'%s' -> '%s'\n", *name, x.c_str());
}
}
void test_enum_models(FileSystem::FileSource &fs)
{
using namespace FileSystem;
printf("enumerating models:\n");
FileEnumerator files(fs, FileEnumerator::Recurse | FileEnumerator::IncludeDirs);
files.AddSearchRoot("models");
while (!files.Finished()) {
const FileInfo &fi = files.Current();
if (fi.IsDir() || ends_with_ci(fi.GetPath(), ".model")) {
printf(" %s (%s) (%s)\n", fi.GetPath().c_str(), ftype_name(fi), fi.GetSource().GetRoot().c_str());
}
files.Next();
}
}
void test_filesystem()
{
using namespace FileSystem;
test_normpath();
test_sanitisename();
printf("data dir is '%s'\n", FileSystem::GetDataDir().c_str());
printf("user dir is '%s'\n", FileSystem::GetUserDir().c_str());
FileSourceFS fsAppData(FileSystem::GetDataDir());
FileSourceFS fsUserData(FileSystem::JoinPath(FileSystem::GetUserDir(), "data"));
//FileSourceZip fsZip("/home/jpab/.pioneer/mods/swapships.zip");
printf("data root is '%s'\n", fsAppData.GetRoot().c_str());
printf("user root is '%s'\n", fsUserData.GetRoot().c_str());
//printf("zip root is '%s'\n", fsZip.GetRoot().c_str());
FileSourceUnion fs;
//fs.AppendSource(&fsZip);
//printf("Just zip:\n");
//test_enum_models(fs);
fs.AppendSource(&fsUserData);
fs.AppendSource(&fsAppData);
//test_enum_models(fs);
//printf("With zip:\n");
//test_enum_models(fs);
//fs.RemoveSource(&fsZip);
//printf("Just data:\n");
//test_enum_models(fs);
}
|
gpl-3.0
|
ShapeChange/ShapeChange
|
src/test/java/de/interactive_instruments/ShapeChange/scxmltest/SCXMLTestResourceConverter.java
|
16951
|
/**
* ShapeChange - processing application schemas for geographic information
*
* This file is part of ShapeChange. ShapeChange takes a ISO 19109
* Application Schema from a UML model and translates it into a
* GML Application Schema or other implementation representations.
*
* Additional information about the software can be found at
* http://shapechange.net/
*
* (c) 2002-2019 interactive instruments GmbH, Bonn, Germany
*
* 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/>.
*
* Contact:
* interactive instruments GmbH
* Trierer Strasse 70-72
* 53115 Bonn
* Germany
*/
package de.interactive_instruments.ShapeChange.scxmltest;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map.Entry;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import de.interactive_instruments.ShapeChange.TestInstance;
import de.interactive_instruments.ShapeChange.Util.XMLUtil;
/**
* @author Johannes Echterhoff (echterhoff at interactive-instruments dot
* de)
*
*/
public class SCXMLTestResourceConverter {
/**
* Name of the VM argument / system property to indicate that unit tests shall
* be executed using the original configuration (by setting the value of the
* system property to 'true'), for unit tests with tag SCXML.
*/
public static final String RUN_ORIGINAL_CONFIGURATIONS_SYSTEM_PROPERTY_NAME = "runOriginalConfigurations";
/**
* Name of the VM argument / system property to indicate that the model
* resources and ShapeChange configuration of SCXML-tagged unit tests shall be
* updated (by setting the value of the system property to 'true') based upon
* the original model and configuration files - or created, if they do not exist
* yet. The only exception are tests which already solely rely on SCXML models.
*/
public static final String UPDATE_OR_CREATE_SCXML_RESOURCES_SYSTEM_PROPERTY_NAME = "updateOrCreateScxmlResources";
String suffix_configToExportModel = "_exportModel";
String suffix_configRunWithSCXML = "_runWithSCXML";
File tmpDir = new File("scxmlTmpDir");
public String updateSCXMLTestResources(String configPath) throws Exception {
if ("true".equalsIgnoreCase(System.getProperty(RUN_ORIGINAL_CONFIGURATIONS_SYSTEM_PROPERTY_NAME))) {
return configPath;
} else {
if (!tmpDir.exists()) {
tmpDir.mkdir();
}
// load original config, for creation of SCXML export configs
/*
* WARNING: The in-memory document will be updated if SCXML really is created!
* log, transformers, and targets from the original config will be removed, only
* the input will be kept and a new model export target section added.
*/
Document doc1 = XMLUtil.loadXml(configPath);
boolean notPureScxmlTest = hasModelTypeOtherThanSCXML(doc1);
if ("true".equalsIgnoreCase(System.getProperty(UPDATE_OR_CREATE_SCXML_RESOURCES_SYSTEM_PROPERTY_NAME))
&& notPureScxmlTest) {
// create SCXML based models
createScxml(doc1, configPath);
/*
* Load original config again (it would be incorrect to use doc1, because it may
* have been updated and used as export configuration).
*/
Document doc2 = XMLUtil.loadXml(configPath);
switchModelsToScxml(doc2, configPath);
}
String pathToRelevantConfig;
if (notPureScxmlTest) {
pathToRelevantConfig = getFileForScxmlBasedConfiguration(configPath).getPath();
System.out.println("Unit test execution uses SCXML based configuration " + pathToRelevantConfig);
} else {
pathToRelevantConfig = configPath;
System.out.println(
"Unit test execution uses (original) SCXML based configuration " + pathToRelevantConfig);
}
return pathToRelevantConfig;
}
}
private void switchModelsToScxml(Document configDoc, String configPath) throws Exception {
XPath xpath = XPathFactory.newInstance().newXPath();
NodeList modelTypeNodes = (NodeList) xpath.evaluate(
"//*[(@name = 'inputModelType' or @name = 'referenceModelType') and @value != 'SCXML']", configDoc,
XPathConstants.NODESET);
for (int idx = 0; idx < modelTypeNodes.getLength(); idx++) {
Node modelTypeNode = modelTypeNodes.item(idx);
// set the model type
modelTypeNode.getAttributes().getNamedItem("value").setTextContent("SCXML");
// now also get the node with the model file path
Node modelPathNode = getModelFilePathNode(modelTypeNode);
if (modelPathNode == null) {
System.out.println("Model path node not found!");
} else {
String modelFilePath = modelPathNode.getAttributes().getNamedItem("value").getTextContent();
String newModelFilePath = getScxmlFilePathForModel(modelFilePath);
modelPathNode.getAttributes().getNamedItem("value").setTextContent(newModelFilePath);
}
}
// store updated config
File updatedConfig = getFileForScxmlBasedConfiguration(configPath);
XMLUtil.writeXml(configDoc, updatedConfig);
System.out.println("SCXML based config created: " + updatedConfig.getPath());
}
private Node getModelFilePathNode(Node modelTypeNode) throws Exception {
XPath xpath = XPathFactory.newInstance().newXPath();
Node modelPathNode = (Node) xpath.evaluate(
"./preceding-sibling::*[@name = 'inputFile' or @name = 'repositoryFileNameOrConnectionString' or @name = 'referenceModelFileNameOrConnectionString']",
modelTypeNode, XPathConstants.NODE);
if (modelPathNode == null) {
modelPathNode = (Node) xpath.evaluate(
"./following-sibling::*[@name = 'inputFile' or @name = 'repositoryFileNameOrConnectionString' or @name = 'referenceModelFileNameOrConnectionString']",
modelTypeNode, XPathConstants.NODE);
}
return modelPathNode;
}
//
// private File getScxmlFileForModel(String modelFilePath) {
// return new File(getScxmlFilePathForModel(modelFilePath));
// }
private File getFileForScxmlBasedConfiguration(String configPath) {
return new File(FilenameUtils.getPath(configPath) + FilenameUtils.getBaseName(configPath)
+ suffix_configRunWithSCXML + ".xml");
}
private String getScxmlFilePathForModel(String modelFilePath) {
return modelFilePath.subSequence(0, modelFilePath.lastIndexOf(".")).toString() + ".zip";
}
private boolean hasModelTypeOtherThanSCXML(Document doc) throws Exception {
return !findNonScxmlModelOccurrences(doc).isEmpty();
}
/**
* @param configPath
* @throws Exception
*/
private void createScxml(Document doc, String configPath) throws Exception {
// identify all model files that need to be converted to SCXML; for each such
// file we also need to know the model type
/*
* key: model file path, value: model type
*/
SortedMap<String, String> nonScxmlModelMap = findNonScxmlModelOccurrences(doc);
/*
* now remove the log, transformation and target elements of the configuration
* document
*/
NodeList logNodes = doc.getElementsByTagName("log");
for (int idx = 0; idx < logNodes.getLength(); idx++) {
Node ln = logNodes.item(idx);
ln.getParentNode().removeChild(ln);
}
NodeList transformersNodes = doc.getElementsByTagName("transformers");
for (int idx = 0; idx < transformersNodes.getLength(); idx++) {
Node tn = transformersNodes.item(idx);
tn.getParentNode().removeChild(tn);
}
NodeList targetsNodes = doc.getElementsByTagName("targets");
for (int idx = 0; idx < targetsNodes.getLength(); idx++) {
Node tn = targetsNodes.item(idx);
tn.getParentNode().removeChild(tn);
}
// now add the model export target configuration
Node scConfigNode = doc.getElementsByTagName("ShapeChangeConfiguration").item(0);
String scNs = scConfigNode.getNamespaceURI();
String scNsPrefix = scConfigNode.getPrefix();
Node inputNode = doc.getElementsByTagName("input").item(0);
Node inputIdAttributeNode = inputNode.getAttributes().getNamedItem("id");
String inputIdAttribute = inputIdAttributeNode == null ? null : inputIdAttributeNode.getTextContent();
Element targetsE = doc.createElementNS(scNs, qname(scNsPrefix, "targets"));
scConfigNode.appendChild(targetsE);
Element targetE = doc.createElementNS(scNs, qname(scNsPrefix, "Target"));
targetsE.appendChild(targetE);
targetE.setAttribute("class", "de.interactive_instruments.ShapeChange.Target.ModelExport.ModelExport");
targetE.setAttribute("mode", "enabled");
if (inputIdAttribute != null) {
targetE.setAttribute("inputs", inputIdAttribute);
}
Element outputDirE = doc.createElementNS(scNs, qname(scNsPrefix, "targetParameter"));
targetE.appendChild(outputDirE);
outputDirE.setAttribute("name", "outputDirectory");
// value will be set per relevant non-scxml model
Element outputFilenameE = doc.createElementNS(scNs, qname(scNsPrefix, "targetParameter"));
targetE.appendChild(outputFilenameE);
outputFilenameE.setAttribute("name", "outputFilename");
// value will be set per relevant non-scxml model
Element sortedOutputE = doc.createElementNS(scNs, qname(scNsPrefix, "targetParameter"));
targetE.appendChild(sortedOutputE);
sortedOutputE.setAttribute("name", "sortedOutput");
sortedOutputE.setAttribute("value", "true");
Element exportProfilesFromWholeModelE = doc.createElementNS(scNs, qname(scNsPrefix, "targetParameter"));
targetE.appendChild(exportProfilesFromWholeModelE);
exportProfilesFromWholeModelE.setAttribute("name", "exportProfilesFromWholeModel");
exportProfilesFromWholeModelE.setAttribute("value", "true");
Element zipOutputE = doc.createElementNS(scNs, qname(scNsPrefix, "targetParameter"));
targetE.appendChild(zipOutputE);
zipOutputE.setAttribute("name", "zipOutput");
zipOutputE.setAttribute("value", "true");
Element ignoreTaggedValuesRegexE = doc.createElementNS(scNs, qname(scNsPrefix, "targetParameter"));
targetE.appendChild(ignoreTaggedValuesRegexE);
ignoreTaggedValuesRegexE.setAttribute("name", "ignoreTaggedValuesRegex");
ignoreTaggedValuesRegexE.setAttribute("value", "^$");
// TBD: maybe profilesInModelSetExplicitly needs to be configured per unit test
Element defaultEncodingRuleE = doc.createElementNS(scNs, qname(scNsPrefix, "targetParameter"));
targetE.appendChild(defaultEncodingRuleE);
defaultEncodingRuleE.setAttribute("name", "defaultEncodingRule");
defaultEncodingRuleE.setAttribute("value", "export");
Element rulesE = doc.createElementNS(scNs, qname(scNsPrefix, "rules"));
targetE.appendChild(rulesE);
Element encodingRuleE = doc.createElementNS(scNs, qname(scNsPrefix, "EncodingRule"));
rulesE.appendChild(encodingRuleE);
encodingRuleE.setAttribute("name", "export");
Element ruleE = doc.createElementNS(scNs, qname(scNsPrefix, "rule"));
encodingRuleE.appendChild(ruleE);
ruleE.setAttribute("name", "rule-exp-pkg-allPackagesAreEditable");
XPath xpath = XPathFactory.newInstance().newXPath();
Node inputModelTypeNode = (Node) xpath.evaluate(
"/*/*[local-name() = 'input']/*[local-name() = 'parameter' and @name = 'inputModelType']", doc,
XPathConstants.NODE);
Node inputFileNode = (Node) xpath.evaluate(
"/*/*[local-name() = 'input']/*[local-name() = 'parameter' and (@name = 'inputFile' or @name = 'repositoryFileNameOrConnectionString')]",
doc, XPathConstants.NODE);
// create SCXML for each non-scxml model
for (Entry<String, String> entry : nonScxmlModelMap.entrySet()) {
String modelType = entry.getValue();
String modelFilePath = entry.getKey();
((Element) inputModelTypeNode).setAttribute("value", modelType);
((Element) inputFileNode).setAttribute("value", modelFilePath);
File exportDirectory = new File(tmpDir, "export" + File.separator + FilenameUtils.getBaseName(configPath));
outputDirE.setAttribute("value", exportDirectory.getPath());
outputFilenameE.setAttribute("value", FilenameUtils.getBaseName(modelFilePath));
// config document in temporäres Verzeichnis speichern
File exportConfig = new File(tmpDir,
FilenameUtils.getBaseName(configPath) + suffix_configToExportModel + ".xml");
XMLUtil.writeXml(doc, exportConfig);
System.out.println("Export config created: " + exportConfig.getPath());
// execute export config
System.out.println("Running export config ...");
@SuppressWarnings("unused")
TestInstance test = new TestInstance(exportConfig.getPath());
System.out.println("... export done");
// get SCXML file that was produced
List<Path> scxmlFilePaths = null;
try (Stream<Path> files = Files.walk(Paths.get(exportDirectory.toURI()))) {
scxmlFilePaths = files.filter(
f -> f.getFileName().toString().equals(FilenameUtils.getBaseName(modelFilePath) + ".zip"))
.collect(Collectors.toList());
}
File scxmlFile = scxmlFilePaths.get(0).toFile();
FileUtils.copyFile(scxmlFile,
new File(FilenameUtils.getPath(modelFilePath) + FilenameUtils.getBaseName(modelFilePath) + ".zip"));
}
}
private String qname(String prefix, String name) {
return prefix == null ? name : prefix + ":" + name;
}
// /**
// * @param configDoc
// * @return can be empty but not <code>null</code>
// * @throws Exception
// */
// private SortedMap<String, String> findRelevantNonScxmlModelOccurrences(Document configDoc, String configPath)
// throws Exception {
//
// SortedMap<String, String> result = new TreeMap<>();
//
// SortedMap<String, String> modelTypeByFilePath = findNonScxmlModelOccurrences(configDoc);
//
// /*
// * Now determine which of these models has an SCXML file that is younger than
// * both the original model AND the ShapeChange configuration (because the
// * configuration influences the way that a model is loaded, and thus how the
// * exported SCXML looks like).
// */
//
// File configFile = new File(configPath);
//
// for (Entry<String, String> e : modelTypeByFilePath.entrySet()) {
//
// String modelFilePath = e.getKey();
// String modelType = e.getValue();
//
// File modelFile = new File(modelFilePath);
// File scxmlFile = getScxmlFileForModel(modelFilePath);
//
// if (!scxmlFile.exists() || FileUtils.isFileOlder(scxmlFile, modelFile)
// || FileUtils.isFileOlder(scxmlFile, configFile)) {
// result.put(modelFilePath, modelType);
// }
// }
//
// return result;
// }
/**
* @param configDoc
* @return map with model file path as key and model type as value; can be empty
* but not <code>null</code>
* @throws Exception
*/
private SortedMap<String, String> findNonScxmlModelOccurrences(Document configDoc) throws Exception {
SortedMap<String, String> modelTypeByFilePath = new TreeMap<>();
XPath xpath = XPathFactory.newInstance().newXPath();
NodeList modelTypeNodes = (NodeList) xpath.evaluate(
"//*[(@name = 'inputModelType' or @name = 'referenceModelType') and @value != 'SCXML']", configDoc,
XPathConstants.NODESET);
for (int idx = 0; idx < modelTypeNodes.getLength(); idx++) {
Node modelTypeNode = modelTypeNodes.item(idx);
// identify the model type
String modelType = modelTypeNode.getAttributes().getNamedItem("value").getTextContent();
// now also get the model file path
Node modelPathNode = (Node) xpath.evaluate(
"./preceding-sibling::*[@name = 'inputFile' or @name = 'repositoryFileNameOrConnectionString' or @name = 'referenceModelFileNameOrConnectionString']",
modelTypeNode, XPathConstants.NODE);
if (modelPathNode == null) {
modelPathNode = (Node) xpath.evaluate(
"./following-sibling::*[@name = 'inputFile' or @name = 'repositoryFileNameOrConnectionString' or @name = 'referenceModelFileNameOrConnectionString']",
modelTypeNode, XPathConstants.NODE);
}
if (modelPathNode == null) {
System.out.println("Model path node not found!");
} else {
String modelFilePath = modelPathNode.getAttributes().getNamedItem("value").getTextContent();
modelTypeByFilePath.put(modelFilePath, modelType);
}
}
return modelTypeByFilePath;
}
}
|
gpl-3.0
|
padertux/cantata
|
models/musiclibraryitemalbum.h
|
2574
|
/*
* Cantata
*
* Copyright (c) 2011-2017 Craig Drummond <craig.p.drummond@gmail.com>
*
*/
/*
* Copyright (c) 2008 Sander Knopper (sander AT knopper DOT tk) and
* Roeland Douma (roeland AT rullzer DOT com)
*
* This file is part of QtMPC.
*
* QtMPC 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.
*
* QtMPC 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 QtMPC. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MUSIC_LIBRARY_ITEM_ALBUM_H
#define MUSIC_LIBRARY_ITEM_ALBUM_H
#include <QList>
#include <QVariant>
#include <QSet>
#include "musiclibraryitem.h"
#include "mpd-interface/song.h"
class QPixmap;
class MusicLibraryItemArtist;
class MusicLibraryItemSong;
class MusicLibraryItemAlbum : public MusicLibraryItemContainer
{
public:
static void setSortByDate(bool sd);
static bool sortByDate();
static bool lessThan(const MusicLibraryItem *a, const MusicLibraryItem *b);
MusicLibraryItemAlbum(const Song &song, MusicLibraryItemContainer *parent);
virtual ~MusicLibraryItemAlbum();
QString displayData(bool full=false) const;
quint32 year() const { return m_year; }
quint32 totalTime();
quint32 trackCount();
void append(MusicLibraryItem *i);
void remove(int row);
void remove(MusicLibraryItemSong *i);
void removeAll(const QSet<QString> &fileNames);
QMap<QString, Song> getSongs(const QSet<QString> &fileNames) const;
Type itemType() const { return Type_Album; }
bool updateYear();
const QString & id() const { return m_id; }
const QString & albumId() const { return m_id.isEmpty() ? m_itemData : m_id; }
const QString & sortString() const { return m_sortString.isEmpty() ? m_itemData : m_sortString; }
bool hasSort() const { return !m_sortString.isEmpty(); }
Song coverSong() const;
private:
void setYear(const MusicLibraryItemSong *song);
void updateStats();
private:
quint16 m_year;
quint16 m_yearOfTrack;
quint16 m_yearOfDisc;
quint16 m_numTracks;
quint32 m_totalTime;
QString m_sortString;
QString m_id;
mutable Song m_coverSong;
};
#endif
|
gpl-3.0
|
whitelamer/android-bt-rc-car
|
src/com/lamer/rc_model_car/ArduinoModule.java
|
8713
|
package com.lamer.rc_model_car;
import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Method;
import java.util.Set;
import java.util.UUID;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothSocket;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.hardware.usb.UsbAccessory;
import android.hardware.usb.UsbManager;
import android.os.Handler;
import android.os.Message;
import android.os.ParcelFileDescriptor;
import android.os.ParcelUuid;
import android.util.Log;
import android.widget.Toast;
public class ArduinoModule implements Runnable {
//Context mComtext=null;
BluetoothAdapter mBluetoothAdapter;
BluetoothSocket mmSocket;
BluetoothDevice mmDevice;
OutputStream mmOutputStream;
InputStream mmInputStream;
byte[] readBuffer;
int readBufferPosition;
int counter;
volatile boolean stopWorker;
private Context mComtext;
public int create(Context context){
mComtext=context;
return 0;
}
private int findBT() {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if(mBluetoothAdapter == null) {
Log.v("Arduino BT","Bluetooth null !");
Toast.makeText(mComtext, "Bluetooth is not available", Toast.LENGTH_LONG).show();
return 0;
}
if(!mBluetoothAdapter.isEnabled()) {
Intent enableBluetooth = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
return 0;
//startActivityForResult(enableBluetooth, 0);
}
Set<BluetoothDevice> pairedDevices = mBluetoothAdapter.getBondedDevices();
if(pairedDevices.size() > 0) {
for(BluetoothDevice device : pairedDevices) {
if(device.getName().equals("HC-06")) {
mmDevice = device;
Log.v("Arduino BT","Bluetooth Device Found");
return 1;
}
}
}
return 0;
}
private int openBT() {
UUID uuid = UUID.fromString("00001101-0000-1000-8000-00805f9b34fb"); //Standard //SerialPortService ID
//final String PBAP_UUID = "0000112f-0000-1000-8000-00805f9b34fb"; //standard pbap uuid
//UUID uuid = UUID.fromString("8ce255c0-200a-11e0-ac64-0800200c9a66");
//mmSocket = mmDevice.createRfcommSocketToServiceRecord(uuid);
try {
mmSocket = mmDevice.createRfcommSocketToServiceRecord(uuid);
} catch (Exception e) {Log.e("Arduino BT","Error creating socket");}
try {
mmSocket.connect();
Log.e("Arduino BT","Connected");
} catch (IOException e) {
Log.e("Arduino BT",e.getMessage());
try {
Log.v("Arduino BT","trying fallback...");
//mmSocket =(BluetoothSocket) mmDevice.getClass().getMethod("createRfcommSocket", new Class[] {int.class}).invoke(mmDevice,uuid);
Method m = mmDevice.getClass().getMethod("createRfcommSocket", int.class);
mmSocket = (BluetoothSocket)m.invoke(mmDevice, 1);
mmSocket.connect();
Log.v("Arduino BT","Connected");
}
catch (Exception e2) {
e2.printStackTrace();
try {
mmSocket.close();
Log.v("Arduino BT","Couldn't establish Bluetooth connection! (1)");
} catch (IOException closeException) {
closeException.printStackTrace();
Log.v("Arduino BT","Couldn't establish Bluetooth connection! (2)");
}
return 0;
}
}
if(mmSocket==null)return 0;
//mmSocket.connect();
try{
mmOutputStream = mmSocket.getOutputStream();
mmInputStream = mmSocket.getInputStream();
beginListenForData();
connecting=false;
}catch (NullPointerException e){
connecting=false;
mmSocket=null;
mmOutputStream=null;
mmInputStream=null;
return 0;
} catch (IOException e) {
e.printStackTrace();
closeBT();
}
return 1;
}
void beginListenForData() {
//final Handler handler = new Handler();
final byte delimiter = 10; //This is the ASCII code for a newline character
stopWorker = false;
readBufferPosition = 0;
readBuffer = new byte[1024];
new Thread(this).start();
//workerThread.start();
}
boolean connecting=false;
public int tryConnect(){
if(connecting)return 2;
connecting=true;
if(findBT()>0){
int ret = openBT();
connecting=false;
return ret;
}
connecting=false;
return 0;
}
void sendData(String string){
try{
if(!stopWorker && mmOutputStream!=null && isConnected()) {
mmOutputStream.write(string.getBytes());
mmOutputStream.flush();
}else{
if(tryConnect()>0) {
mmOutputStream.write(string.getBytes());
mmOutputStream.flush();
}
}
} catch (IOException e) {
closeBT();
// TODO Auto-generated catch block
e.printStackTrace();
}
}
void closeBT(){
stopWorker = true;
try{
mmSocket.close();
mmSocket=null;
if(mmOutputStream!=null)
mmOutputStream.close();
if(mmInputStream!=null)
mmInputStream.close();
mmOutputStream=null;
mmInputStream=null;
mmDevice=null;
}catch(NullPointerException e){
Log.v("Arduino BT","Bluetooth Bad close");
mmSocket=null;
mmDevice=null;
mmOutputStream=null;
mmInputStream=null;
}catch (IOException e) {
Log.v("Arduino BT","Bluetooth IO Bad close");
mmSocket=null;
mmDevice=null;
mmOutputStream=null;
mmInputStream=null;
}
Log.v("Arduino BT","Bluetooth Closed");
}
public boolean isConnected(){
try{
boolean a=mmSocket.isConnected();
return a;
}catch (NullPointerException e){
return false;
}
//return mmOutputStream!=null;
}
@Override
public void run() {
// final Handler handler = new Handler();
final byte delimiter = 10; //This is the ASCII code for a newline character
stopWorker = false;
readBufferPosition = 0;
readBuffer = new byte[1024];
while(!Thread.currentThread().isInterrupted() && !stopWorker) {
try {
int bytesAvailable = mmInputStream.available();
if(bytesAvailable > 0) {
Log.v("Arduino BT","Bluetooth bytesAvailable:"+bytesAvailable);
byte[] packetBytes = new byte[bytesAvailable];
mmInputStream.read(packetBytes);
StringBuilder byStr = new StringBuilder();
for(int i=0;i<bytesAvailable;i++) {
byte b = packetBytes[i];
byStr.append( (char)b);
/*if(b == delimiter) {
byte[] encodedBytes = new byte[readBufferPosition];
System.arraycopy(readBuffer, 0, encodedBytes, 0, encodedBytes.length);
final String data = new String(encodedBytes, "US-ASCII");
readBufferPosition = 0;
/*handler.post(new Runnable() {
public void run() {
myLabel.setText(data);
}
});/
}
else {
readBuffer[readBufferPosition++] = b;
}*/
}
Log.v("Arduino BT","Bluetooth:"+byStr.toString());
}
}
catch (IOException ex) {
stopWorker = true;
}
try {
Thread.sleep(100);
} catch (InterruptedException e) {
stopWorker = true;
}
}
}
}
|
gpl-3.0
|
rpav/xleapmouse
|
src/util.cpp
|
931
|
/*
Copyright © 2014, Ryan Pavlik
This file is part of xleapmouse.
xleapmouse 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.
xleapmouse 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 xleapmouse. If not, see <http://www.gnu.org/licenses/>.
*/
void get_xy(Display *dpy, Window &root, int &x, int &y) {
Window r_root, r_child;
int winx, winy;
unsigned int mask;
XQueryPointer(dpy, root, &r_root, &r_child, &x, &y,
&winx, &winy, &mask);
}
|
gpl-3.0
|
cs-au-dk/Artemis
|
WebKit/Source/WebKit/chromium/src/WorkerAsyncFileWriterChromium.h
|
3063
|
/*
* Copyright (C) 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WorkerAsyncFileWriterChromium_h
#define WorkerAsyncFileWriterChromium_h
#if ENABLE(FILE_SYSTEM) && ENABLE(WORKERS)
#include "AsyncFileWriter.h"
#include <wtf/PassOwnPtr.h>
namespace WebKit {
class WebFileSystem;
class WebFileWriter;
class WebURL;
class WorkerFileWriterCallbacksBridge;
}
namespace WTF {
class String;
}
using WTF::String;
namespace WebCore {
class AsyncFileSystem;
class AsyncFileWriterClient;
class Blob;
class WorkerContext;
class WorkerAsyncFileWriterChromium : public AsyncFileWriter {
public:
enum WriterType {
Asynchronous,
Synchronous,
};
static PassOwnPtr<WorkerAsyncFileWriterChromium> create(WebKit::WebFileSystem* webFileSystem, const WebKit::WebURL& path, WorkerContext* workerContext, AsyncFileWriterClient* client, WriterType type)
{
return adoptPtr(new WorkerAsyncFileWriterChromium(webFileSystem, path, workerContext, client, type));
}
~WorkerAsyncFileWriterChromium();
bool waitForOperationToComplete();
// FileWriter
virtual void write(long long position, Blob* data);
virtual void truncate(long long length);
virtual void abort();
private:
WorkerAsyncFileWriterChromium(WebKit::WebFileSystem*, const WebKit::WebURL& path, WorkerContext*, AsyncFileWriterClient*, WriterType);
RefPtr<WebKit::WorkerFileWriterCallbacksBridge> m_bridge;
WriterType m_type;
};
} // namespace
#endif // ENABLE(FILE_SYSTEM)
#endif // AsyncFileWriterChromium_h
|
gpl-3.0
|
whav/hav
|
src/hav/apps/media/urls.py
|
130
|
from django.urls import path
from .views import redirect_to_archive
urlpatterns = [path("<str:media_id>/", redirect_to_archive)]
|
gpl-3.0
|
joaduo/mepinta
|
core/python_core/mepinta/testing/plugins_testing/TestDiscoveryManager.py
|
1427
|
# -*- coding: utf-8 -*-
'''
Mepinta
Copyright (c) 2011-2012, Joaquin G. Duo
This file is part of Mepinta.
Mepinta 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.
Mepinta 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 Mepinta. If not, see <http://www.gnu.org/licenses/>.
'''
from unittest import TestLoader
from unittest.runner import TextTestRunner
from common.abstract.FrameworkObject import FrameworkObject
class TestDiscoveryManager(FrameworkObject): # Cannot be FrameworkBase because contexts are init in tests
def __getPluginsTestDir(self):
import plugins_tests.python as package
return package.__path__[0]
def runAllTests(self):
test_suite = TestLoader().discover(start_dir=self.__getPluginsTestDir(),
pattern='*.py', top_level_dir=self.__getPluginsTestDir())
TextTestRunner().run(test_suite)
def testModule():
TestDiscoveryManager().runAllTests()
if __name__ == "__main__":
testModule()
|
gpl-3.0
|
Mrkwtkr/shinsei
|
src/main/java/com/megathirio/shinsei/item/powder/ItemBariumPowder.java
|
315
|
package com.megathirio.shinsei.item.powder;
import com.megathirio.shinsei.item.PowderShinsei;
import com.megathirio.shinsei.reference.Names;
public class ItemBariumPowder extends PowderShinsei {
public ItemBariumPowder(){
super();
this.setUnlocalizedName(Names.Powders.BARIUM_POWDER);
}
}
|
gpl-3.0
|
talanis85/rechord
|
src/Data/ChordPro.hs
|
1297
|
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE DeriveFunctor #-}
module Data.ChordPro
( Chunk (..), Music (..)
, Line, Paragraph, Markup (..)
, Layout
, bake
, prettyPrintChordPro
) where
import Data.Music.Scales
import Data.Music.Chords
import Data.Music.Tonal
-- File layout
type Layout a = [Paragraph a]
type Paragraph a = [Line a]
type Line a = [Chunk a]
data Chunk a = ChunkBoth (Music a) Markup
| ChunkMusic (Music a)
| ChunkMarkup Markup
| ChunkEmpty
deriving (Show, Functor)
data Music a = MusicChord a | MusicBar
deriving (Show, Functor)
data Markup = NormalMarkup String | TitleMarkup String
deriving (Show)
type Option = (String, String)
mapLayout :: (a -> b) -> Layout a -> Layout b
mapLayout = map . map . map . fmap
bake :: TonalScale -> Layout DegreeChord -> Layout TonalChord
bake scale = mapLayout $ bakeChord scale
prettyPrintChordPro :: (Show a) => Layout a -> IO ()
prettyPrintChordPro paras = mapM_ prettyPrintParagraph paras
where
prettyPrintParagraph p = do
putStrLn "PARAGRAPH"
mapM_ prettyPrintLine p
prettyPrintLine l = do
putStrLn " LINE"
mapM_ prettyPrintChunk l
prettyPrintChunk c = do
putStr " CHUNK: "
putStrLn (show c)
|
gpl-3.0
|
corps-g/flux_spectrum
|
flux_spectrum.py
|
3697
|
import numpy as np
from scipy import constants
from scipy.integrate import quad
# Boltzmann constant in eV/K
k = constants.value('Boltzmann constant in eV/K')
class Flux() :
"""
This class evaluates the neutron spectrum. The thermal cutoff is treated
as a variable parameter to ensure a specific fast-to-thermal ratio.
At thermal energy range (e < e1 eV), the flux is approximated by Maxwellian
distribution (D&H book Eq.(9-6)).
At fast energy range (e2 MeV < e < 20MeV), the flux is approximated by U-235
chi-spectrum (D&H book Eq.(2-112)).
At epithermal energies (e1 eV < e < e2 MeV), flux = 1/e
ratio : fast-to-thermal flux ratio
"""
def __init__(self, ratio = 2, thermal_temp = 600.0):
self.e2 = 1e6
self.thermal_temp = thermal_temp
# Maxwellian distribution, Eq.(9-6)
self.m = lambda x : x ** 0.5 * np.exp(-x/(k*self.thermal_temp))
# U235 chi distribution, Eq.(2-112)
self.chi = lambda x : np.exp(-1.036e-6*x)*np.sinh((2.29e-6 * x)**0.5)
# Middle energy range
self.f = lambda x : 1 / x
# Compute ratio as a function of thermal cutoff
E = np.logspace(-4, 0.1, 200)
R = np.array([self.compute_ratio(e1) for e1 in E])
# Compute thermal cutoff for given ratio
self.e1 = np.interp(1.0/ratio, R, E)
print 'Thermal cutoff is {} eV'.format(self.e1)
# Compute constants for each part of the spectrum
self.c1 = 1.0
self.c2 = self.m(self.e1) / self.f(self.e1)
self.c3 = self.c2 * self.f(self.e2) / self.chi(self.e2)
def compute_ratio(self, e1):
A = quad(self.m, 0, e1)[0]
C2 = self.m(e1) / self.f(e1)
C3 = self.f(self.e2) / self.chi(self.e2)
B = C2 * quad(self.f, e1, self.e2)[0]
C = C2 * C3 * quad(self.chi, self.e2, 2e7)[0]
r = A / (B + C)
return r
def evaluate(self, e):
# Evaluate flux at Energy e in eV
return (e<=self.e1) * self.c1*self.m(e) + \
(e>self.e1)*(e<=self.e2) * (self.c2 / e) + \
(e>self.e2) * self.c3*self.chi(e)
if __name__ == "__main__" :
import matplotlib.pyplot as plt
from multigroup_utilities import *
from nice_plots import init_nice_plots
init_nice_plots()
# PWR-like and TRIGA-like spectra
pwr = Flux(7.0, 600.0)
triga = Flux(1.0, 600.0)
# Evaluate the flux
E = np.logspace(-5, 7, 1000)
phi_pwr = pwr.evaluate(E)
phi_triga = triga.evaluate(E)
# Collapse the flux and flux per unit lethargy onto WIMS 69-group structure
bounds = energy_groups(structure='wims69')
pwr_mg = collapse(bounds, phi_pwr, E)
triga_mg = collapse(bounds, phi_triga, E)
phi_mg_pul = collapse(bounds, E*phi_pwr, E)
triga_mg_pul = collapse(bounds, E*phi_triga, E)
# Produce step-plot data for each spectrum
E_mg, phi_mg = plot_multigroup_data(bounds, pwr_mg)
_, triga_mg = plot_multigroup_data(bounds, triga_mg)
_, phi_mg_pul = plot_multigroup_data(bounds, phi_mg_pul)
_, triga_mg_pul = plot_multigroup_data(bounds, triga_mg_pul)
plt.figure(1)
plt.loglog(E, phi_pwr, 'k', E_mg, phi_mg, 'k--',
E, phi_triga, 'b', E_mg, triga_mg, 'b:')
plt.xlabel('$E$ (eV)')
plt.ylabel('$\phi(E)$')
plt.figure(2)
plt.loglog(E, E*phi_pwr, 'k', E_mg, phi_mg_pul, 'k--',
E, E*phi_triga, 'b', E_mg, triga_mg_pul, 'b:')
plt.xlabel('$E$ (eV)')
plt.ylabel('$E\phi(E)$')
plt.show()
|
gpl-3.0
|
bbmt-bbmt/MagretUtil
|
source/MagretUtil.py
|
9880
|
#! python3
# coding: utf-8
# todo
# multithreader par machine
# nettoyer le code
import os
import sys
import configparser
import logging
import re
import gc
import traceback
import getpass
from logging import FileHandler
from colorama import Fore
import colorama
colorama.init()
#logger = logging.getLogger('MagretUtil')
##logger_info = logging.getLogger('Info')
#logger.setLevel(logging.WARNING)
##logger_info.setLevel(logging.INFO)
#formatter = logging.Formatter('%(asctime)s :: %(name)s :: %(levelname)s\n' + '=' * 100 + '\n%(message)s' + '=' * 100)
## file_handler = RotatingFileHandler('error.log', mode='w', 1000000, 1)
#file_handler = FileHandler('error.log', 'w')
#file_handler.setLevel(logging.WARNING)
#file_handler.setFormatter(formatter)
#logger.addHandler(file_handler)
#stream_handler = logging.StreamHandler()
#stream_handler.setLevel(logging.INFO)
#logger_info.addHandler(stream_handler)
from Groupe import Groupe
from Salle import Salle
import commandes
import var_global
import Privilege
import AutoComplete
def _protect_quotes(text):
lst = text.split('"')
for i, item in enumerate(lst):
if i % 2:
lst[i] = re.sub(r'\s', "::", item)
return '"'.join(lst)
def _remove_protect_char(lst_str):
return [re.sub(r'::', ' ', s) for s in lst_str]
def lire_fichier_ini(fichier):
""" Retourne les variables necessaire pour le fonctionnement retourne un
dictionnaire {nom_groupe:nbre_poste}"""
try:
config = configparser.ConfigParser()
config.read(fichier, encoding="utf-8-sig")
except configparser.Error:
print(Fore.LIGHTRED_EX + "[!] Erreur lors de l'initialisation du fichier ini : " + Fore.RESET)
raise SystemExit(0)
groupes_dict = {}
groupes_dict['GroupesMagret'] = {}
groupes_dict['Groupes'] = {}
groupes_dict['GroupesFile'] = {}
domaine = {}
try:
try:
for groupe in config['GroupesMagret']:
num_poste = config['GroupesMagret'][groupe].split('-')[1]
try:
nbre_poste = int(num_poste[1:])
except ValueError:
nbre_poste = 0
if nbre_poste != 0:
groupes_dict['GroupesMagret'][groupe.upper()] = nbre_poste
except KeyError:
print(Fore.LIGHTMAGENTA_EX + "[!] Aucun groupe Magret" + Fore.RESET)
try:
for groupe in config['Groupes']:
groupes_dict['Groupes'][groupe.upper()] = config['Groupes'][groupe]
except KeyError:
print(Fore.LIGHTMAGENTA_EX + "[!] Aucun groupe non Magret" + Fore.RESET)
try:
groupes_dict['GroupesFile']['file'] = config['GroupesFile']['file']
except KeyError:
print(Fore.LIGHTMAGENTA_EX + "[!] Aucun fichier pour définir des groupes" + Fore.RESET)
except Exception as e:
print(Fore.LIGHTRED_EX + '[!] Erreur de lecture du fichier config' + Fore.RESET)
#logger.critical(e)
raise e
domaine['name'] = config.get('Domaine', 'domaine', fallback=None)
domaine['login'] = config.get('Domaine', 'login', fallback=None)
return groupes_dict, domaine
def erreur_final(e_type, e_value, e_tb):
if e_type == KeyboardInterrupt:
raise SystemExit(0)
print(Fore.LIGHTRED_EX + '[!] Erreur critique, voir le fichier de log' + Fore.RESET)
os.system("pause")
with open("error.log", "w") as f:
f.write(''.join(traceback.format_exception(e_type, e_value, e_tb)))
#logger.critical(''.join(traceback.format_exception(e_type, e_value, e_tb)))
# pdb.post_mortem(e_tb)
return
# def init_groupes_old(ini_groupes):
# global groupes, selected_groupes, machines_dict
#
# for ini_salle, nbre in ini_groupes['GroupesMagret'].items():
# groupes.append(Salle(ini_salle, nbre))
# for ini_groupe, list_machine in ini_groupes['Groupes'].items():
# list_machine = list_machine.split(',')
# groupes.append(Groupe(ini_groupe, list_machine))
# groupes.sort(key=lambda x: x.name)
#
# machines_dict.update({machine.name: machine for g in groupes for machine in g})
# return
def init_groupes(ini_groupes):
groupes_machines_names = {}
all_names_machines = []
# [GroupesMagret]
for ini_salle, nbre in ini_groupes['GroupesMagret'].items():
# on reécrit le nom des machines
num = len(str(nbre)) if nbre >= 10 else 2
str_template = '%s-P%0--i'.replace('--', str(num))
names_machines = [str_template % (ini_salle, i) for i in range(1, nbre + 1)]
# dict qui fait le lien nom groupe-noms de machines
groupes_machines_names[ini_salle] = names_machines
# on crée une salle vide qu'on remplire plus tard
# on l'ajoute aux groupes globaux
var_global.groupes.append(Salle(ini_salle, 0))
all_names_machines.extend(names_machines)
# [Groupes]
for ini_groupe, list_machines in ini_groupes['Groupes'].items():
list_machines = list_machines.split(',')
groupes_machines_names[ini_groupe] = list_machines
all_names_machines.extend(list_machines)
var_global.groupes.append(Groupe(ini_groupe, []))
# [GroupesFile]
try:
file = open(ini_groupes['GroupesFile']['file'], encoding="utf-8-sig", errors='replace')
for line in file:
list_name = line.strip(" \n,").split(',')
if list_name[1:]:
all_names_machines.extend(list_name[1:])
groupes_machines_names[list_name[0]] = list_name[1:]
var_global.groupes.append(Groupe(list_name[0], []))
except FileNotFoundError:
print(Fore.LIGHTRED_EX + "[!] Fichier csv introuvable" + Fore.RESET)
except KeyError:
pass
# code ansi pour remonter le curseur : c'est plus jolie
up = len(var_global.groupes) + 1
print('\x1b[%sA' % up)
# on crée un groupe avec toute les machines, ça permet de lancer
# une action en multithreadant sur toutes les machines
# on met à jour le dictionnaire des machines existantes
var_global.groupe_selected_machines = Groupe('en cours', all_names_machines)
var_global.machines_dict.update(var_global.groupe_selected_machines.dict_machines)
# on remplie les groupes avec les machines créés au dessus
for g in var_global.groupes:
machines = [i for k, i in var_global.machines_dict.items()
if k in groupes_machines_names[g.name]]
g.machines = machines
g.dict_machines = {m.name: m for m in machines}
g.machines.sort(key=lambda x: x.name)
var_global.groupes.sort(key=lambda x: x.name)
return
def main():
sys.excepthook = erreur_final
try:
if not os.path.isdir('mac'):
os.mkdir('mac')
except:
print(Fore.LIGHTRED_EX + "[!] Erreur lors de la création du répertoire mac" + Fore.RESET)
os.system("pause")
print(Fore.LIGHTGREEN_EX + '[+] Lecture de conf.ini' + Fore.RESET)
ini_groupes, dom = lire_fichier_ini('conf.ini')
# on initialise la variable domaine qui contient le login administrateur
# du domaine
var_global.domaine.update(dom)
# Si le login du fichier config est différent que celui avec lequel
# on est connecté, on lance la procédure délévation de privilège
if var_global.domaine['login'] is not None and getpass.getuser() != var_global.domaine['login']:
commandes.password([])
# Si une demande de bypasser l'uac est demandé, on lance la procédure
if sys.argv[1:] and sys.argv[1] == "pass_uac":
Privilege.pass_uac()
raise SystemExit(0)
#logger_info.info('Création des alias')
print(Fore.LIGHTGREEN_EX + '[+] Création des alias' + Fore.RESET)
alias_cmd = var_global.lire_alias_ini()
print(Fore.LIGHTGREEN_EX + '[+] Initialisation des salles :' + Fore.RESET)
init_groupes(ini_groupes)
AutoComplete.init_auto_complete()
# efface l'écran
print('\x1b[2J', end='')
commandes.select(['*'])
print('-' * (os.get_terminal_size().columns - 1))
print(Fore.LIGHTGREEN_EX + "Taper help ou la touche 'enter' pour obtenir de l'aide" + Fore.RESET)
print('-' * (os.get_terminal_size().columns - 1))
while True:
param = input('>>>')
param = _protect_quotes(param)
param = param.strip()
param = param.split(' ')
param = _remove_protect_char(param)
cmd = param[0]
if cmd in alias_cmd:
# permet de créer des alias avec un parametre
str_replace =""
if param[1:]:
str_replace = " ".join(param[1:])
param = _protect_quotes(alias_cmd[cmd].replace("$$",str_replace))
param = param.strip()
param = param.split(' ')
param = _remove_protect_char(param)
cmd = param[0]
param.remove(cmd)
cmd = cmd.lower()
cmd_funct = getattr(commandes, cmd, commandes.help)
try:
# on efface la dernière erreur avant de lancer
# la prochaine commande
if cmd != 'errors':
for m in var_global.groupe_selected_machines:
m.message_erreur = ''
cmd_funct(param)
# nettoie une partie de ceux qui a été laissé par les threads
# de la dernière commande
# contrôle l'augmentation de la mémoire pour le multithread
gc.collect()
# print('com-ref: ', pythoncom._GetInterfaceCount())
print('-' * (os.get_terminal_size().columns - 1))
except Warning:
cmd_funct(['help'])
gc.collect()
# print(pythoncom._GetInterfaceCount())
print('-' * (os.get_terminal_size().columns - 1))
if __name__ == '__main__':
main()
|
gpl-3.0
|
tonigallego/gamerland
|
application/views/criticas/index.php
|
5024
|
<script>
function puntuar(valor){
$(function(){
form = document.forms["form1"];
cr = form.elements["critica"].value;
ju = form.elements["juego"].value;
us = form.elements["usuario"].value;
destino = "<?= base_url('index.php/criticas/puntuar') ?>";
$.post(destino,{critica: cr, juego: ju, usuario: us, confirmar: valor},function(respuesta){
$("#contenido").html(respuesta);
});
});
}
</script>
<div id="contenido">
<?php if (isset($mensaje)): ?>
<div id="mensaje">
<p><?= $mensaje ?></p>
</div>
<?php endif; ?>
<?php if ($usuario == $this->session->userdata('id')): ?>
<h1>Crítica de <?= anchor('juegos/index/'.$juego, $nombrejuego) ?> por tí</h1>
<?php else: ?>
<h1>Crítica de <?= anchor('juegos/index/'.$juego, $nombrejuego) ?> por
<?= anchor("usuarios/index/".$usuario, $nombreusuario) ?></h1>
<?php endif;?>
<div class="capa">
<table>
<tr>
<td>
<?= anchor("usuarios/index/".$usuario, "<img class='avatar' src=".base_url('imagenes/'.$avatar)." />") ?>
</td>
<td class="celda_descripcion">
<h3 <?= ($karma < 0) ? "class='negativo'" : "class='positivo'" ?>>
Karma del autor: <?= $karma ?> punto<?php if ($karma != 1 && $karma != -1) echo "s"; ?>
</h3>
</td>
</tr>
<tr>
<td>
<?= anchor('juegos/index/'.$juego, "<img class='caratula_pequeña' src=".base_url('imagenes/'.$caratula)." />") ?>
</td>
<td class="celda_descripcion">
<h3 <?= ($media < 5) ? "class='negativo'" : "class='positivo'" ?>>
Nota media del juego: <?= $media ?>
</h3>
</td>
</tr>
</table>
</div>
<fieldset><legend>Contenido</legend>
<span id="capa_nota">
<h2 <?= ($nota < 5) ? "class='negativo'" : "class='positivo'" ?>>
Nota: <?= $nota ?>
</h2>
</span>
<br/><br/>
<div class="capa">
<?= $contenido ?>
</div>
<br/>
<div style="text-align: right;">
<em style="font-size: small;">Realizado el <?= date("d-m-Y", strtotime($fecha)) ?></em> <br/>
</div>
</fieldset>
<div class="capa">
<br/>
<div>
<?php if ($votos == 0): ?>
Aún no han valorado esta crítica
<?php else: ?>
<div class="caja_de_barra">
<div id="barra_positiva" style="width: <?= $positivos ?>%;"><?= $positivos ?>%</div>
Valoraciones positivas
</div>
<br/>
<div class="caja_de_barra">
<div id="barra_negativa" style="width: <?= (100 - $positivos) ?>%;"><?= (100 - $positivos) ?>%</div>
Valoraciones negativas
</div>
<br/>
<?php endif; ?>
</div>
<?php if ($this->session->userdata('id')): ?>
<?php if ($usuario != $this->session->userdata('id')): ?>
<div id="capa_valoracion">
<form name="form1" id="form1">
<?= form_hidden('critica', $id) ?>
<?= form_hidden('juego', $juego) ?>
<?= form_hidden('usuario', $usuario) ?>
<?php if (!isset($valoracion)): ?>
<input type="button" name="confirmar" class="boton" value="Dar punto positivo"
onClick="puntuar('Dar punto positivo');"/>
<input type="button" name="confirmar" class="boton" value="Dar punto negativo"
onClick="puntuar('Dar punto negativo');"/>
<?php elseif ($valoracion == 1): ?>
<em class="positivo">Has puntuado positivamente esta crítica</em>
<input type="button" name="confirmar" class="boton" value="Retirar punto"
onClick="puntuar('Retirar punto');"/>
<input type="button" name="confirmar" class="boton" value="Dar punto negativo"
onClick="puntuar('Dar punto negativo');"/>
<?php elseif ($valoracion == -1): ?>
<em class="negativo">Has puntuado negativamente esta crítica</em>
<input type="button" name="confirmar" class="boton" value="Retirar punto"
onClick="puntuar('Retirar punto');"/>
<input type="button" name="confirmar" class="boton" value="Dar punto positivo"
onClick="puntuar('Dar punto positivo');"/>
<?php endif; ?>
</form>
</div>
<?php else: ?>
<?= form_open('criticas/editar/'.$juego) ?>
<?= form_hidden('critica', $id) ?>
<?= form_submit('editar', 'Editar crítica', "class='boton'") ?>
<?= form_close() ?>
<?php endif; ?>
<br/>
<?php if ($votos == 0): ?>
<?php elseif ($votos == 1 && isset($valoracion)): ?>
Solamente tú has puntuado esta crítica
<?php elseif ($votos == 2 && isset($valoracion)): ?>
<?= anchor('usuarios/listar/critica/'.$id, 'Otra persona') ?> más ha puntuado esta crítica
<?php elseif ($votos == 1 && !isset($valoracion)): ?>
<?= anchor('usuarios/listar/critica/'.$id, 'Una persona') ?> ha puntuado esta crítica
<?php elseif ($votos > 1 && !isset($valoracion)): ?>
<?= anchor('usuarios/listar/critica/'.$id, "$votos personas") ?> puntuaron esta crítica
<?php else: ?>
<?= anchor('usuarios/listar/critica/'.$id, "Otras ".($votos-1)." personas") ?> más puntuaron esta crítica
<?php endif; ?>
<?php endif; ?>
</div>
</div>
|
gpl-3.0
|
infoburp/clicky
|
clicky.css
|
581
|
div {
border: 1px solid black;
border-radius: 5px;
width: 33%;
height: 20%;
margin-left:auto;
margin-right:auto;
}
*:focus {
outline: none;
}
#button, #autobutton, #perclickbutton, #armbombbutton, #bombupgradebutton, #upgbuttonrankbutton {
cursor: pointer;background-color:#adadad;
border:0px solid #dcdcdc;
}
.hidden {
visibility: hidden;
}
#game {
background-color: #adadad;
}
#right {
background-color: #b7b7b7;
}
#bombtickt {
width: 60%;
margin-left:auto;
margin-right:auto;
}
#currank {
width: 60%;
margin-left:auto;
margin-right:auto;
}
|
gpl-3.0
|
BetaCONCEPT/astroboa
|
astroboa-api/src/main/java/org/betaconceptframework/astroboa/api/model/io/ImportConfiguration.java
|
12356
|
/*
* Copyright (C) 2005-2012 BetaCONCEPT Limited.
*
* This file is part of Astroboa.
*
* Astroboa 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.
*
* Astroboa 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 Astroboa. If not, see <http://www.gnu.org/licenses/>.
*/
package org.betaconceptframework.astroboa.api.model.io;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.betaconceptframework.astroboa.api.model.ContentObject;
import org.betaconceptframework.astroboa.api.model.ValueType;
/**
* Contains configuration for import/deserialization process.
*
* <p>
* ImportConfiguration allows users to control how to import content
* to an Astroboa repository.
* </p>
*
* <p>
* In order to build a configuration, one must specify the type
* of the entity whose instances will be imported and then, she must
* use the available methods in order to provide values to one or more
* parameters. Finally, method <code>build</code> must be called to complete
* configuration creation.
*
* For example, configuration for importing objects can be declared like this:
*
* <pre>
* ImportConfiguration configuration = ImportConfiguration.object()
.persist(PersistMode.PERSIST_MAIN_ENTITY)
.version(false)
.updateLastModificationTime(false)
.build();
* </pre>
*
* </p>
*
*
* @author Gregory Chomatas (gchomatas@betaconcept.com)
* @author Savvas Triantafyllou (striantafyllou@betaconcept.com)
*
*/
public class ImportConfiguration implements Serializable{
/**
*
*/
private static final long serialVersionUID = -2785751336766426516L;
public enum PersistMode {
/**
* Import content to all
* corresponding entities but do not persist them.
*/
DO_NOT_PERSIST,
/**
* Import content to all
* corresponding entities and persist them.
*/
PERSIST_MAIN_ENTITY,
/**
* Import content to all corresponding entities
* and persist not only the main entity but the whole
* entity tree.
* Used mainly for Topic, Taxonomy and Space.
*/
PERSIST_ENTITY_TREE,
}
/**
* <code>true</code> to create a new version for content
* object, <code>false</code> otherwise.
* It is used only when <code>save</code> is <code>true</code>
* and imported entity is a {@link ContentObject}.
*/
private final boolean version;
/**
* Control whether to persist or not
* imported content
*/
private final PersistMode persistMode;
/**
* <code>true</code> to change last modification date of the imported entity,
* <code>false</code> otherwise.
* It is used only when <code>save</code> is <code>true</code>
* and imported entity is a {@link ContentObject}.
*/
private final boolean updateLastModificationTime;
/**
* Define the behavior of the import process when the values of one or more properties
* of the objects being imported, are references to other objects which do not exist in
* the repository.
*
* The default behavior is to stop the import process and to throw an exception, in order
* to notify the user for the non-existence of the objects.
*
* Set this flag to <code>true</code> in order to suppress this behavior and to allow
* the import process to continue. In this case, a warning is issued, the missing
* reference is saved as the value of the property as if the referred object exists and the
* import process smoothly continues.
*
*/
private final boolean saveMissingObjectReferences;
/**
* Map containing the binary content of one or more properties of type {@link ValueType#Binary}.
* The key of the map must match the value of the 'url' attribute of the property
* in the XML/JSON representation of the content.
* It is used only when imported entity is a {@link ContentObject}.
*/
private final Map<String, byte[]> binaryContent;
/**
* User credentials to be used when downloading binary content
* from a provided URL in order to save it to a repository.
* If any credentials are provided then an authorization header will be
* created and it will be used upon request.
*/
private final Credentials credentialsOfUserWhoHasAccessToBinaryContent;
public static class Configuration implements Serializable {
/**
*
*/
private static final long serialVersionUID = -8216577761965559480L;
protected PersistMode persistMode;
protected boolean version;
protected boolean updateLastModificationTime;
protected Map<String, byte[]> binaryContent;
protected boolean saveMissingObjectReferences;
protected Credentials credentialsOfUserWhoHasAccessToBinaryContent;
private Configuration(){
}
public ImportConfiguration build(){
return new ImportConfiguration(this);
}
}
public static class TaxonomyImportConfiguration extends Configuration{
/**
*
*/
private static final long serialVersionUID = 6987813675753693566L;
private TaxonomyImportConfiguration(){
super();
}
public TaxonomyImportConfiguration persist(PersistMode persistMode){
this.persistMode = persistMode;
return this;
}
}
public static class TopicImportConfiguration extends Configuration{
/**
*
*/
private static final long serialVersionUID = -8672051521906802611L;
private TopicImportConfiguration(){
super();
}
public TopicImportConfiguration persist(PersistMode persistMode){
this.persistMode = persistMode;
return this;
}
}
public static class RepositoryUserImportConfiguration extends Configuration{
/**
*
*/
private static final long serialVersionUID = -3327651249846102439L;
private RepositoryUserImportConfiguration(){
super();
}
public RepositoryUserImportConfiguration persist(PersistMode persistMode){
this.persistMode = persistMode;
return this;
}
}
public static class SpaceImportConfiguration extends Configuration{
/**
*
*/
private static final long serialVersionUID = -3119157151529381090L;
private SpaceImportConfiguration(){
super();
}
public SpaceImportConfiguration persist(PersistMode persistMode){
this.persistMode = persistMode;
return this;
}
}
public static class RepositoryImportConfiguration extends Configuration{
/**
*
*/
private static final long serialVersionUID = -717092049149850366L;
private RepositoryImportConfiguration(){
super();
this.persistMode = PersistMode.PERSIST_ENTITY_TREE;
this.saveMissingObjectReferences = false;
}
public RepositoryImportConfiguration version(boolean version){
this.version = version;
return this;
}
public RepositoryImportConfiguration updateLastModificationTime(boolean updateLastModificationTime){
this.updateLastModificationTime = updateLastModificationTime;
return this;
}
public RepositoryImportConfiguration addBinaryContent(String binaryContentId, byte[] binaryContent){
if (binaryContentId == null || binaryContentId.trim().length() == 0){
return this;
}
if (this.binaryContent == null){
this.binaryContent = new HashMap<String, byte[]>();
}
this.binaryContent.put(binaryContentId, binaryContent);
return this;
}
public RepositoryImportConfiguration addBinaryContent(Map<String, byte[]> binaryContent){
if (binaryContent == null || binaryContent.isEmpty()){
return this;
}
if (this.binaryContent == null){
this.binaryContent = new HashMap<String, byte[]>();
}
this.binaryContent.putAll(binaryContent);
return this;
}
public RepositoryImportConfiguration saveMissingObjectReferences(boolean saveMissingObjectReferences){
this.saveMissingObjectReferences = saveMissingObjectReferences;
return this;
}
public RepositoryImportConfiguration credentialsOfUserWithAccessToBinaryContent(String username, String password){
this.credentialsOfUserWhoHasAccessToBinaryContent = new Credentials(username, password);
return this;
}
}
public static class ObjectImportConfiguration extends Configuration {
/**
*
*/
private static final long serialVersionUID = -1749977202658061221L;
private ObjectImportConfiguration(){
super();
this.updateLastModificationTime = true; //Default value is true
}
public ObjectImportConfiguration version(boolean version){
this.version = version;
return this;
}
public ObjectImportConfiguration persist(PersistMode persistMode){
this.persistMode = persistMode;
return this;
}
public ObjectImportConfiguration updateLastModificationTime(boolean updateLastModificationTime){
this.updateLastModificationTime = updateLastModificationTime;
return this;
}
public ObjectImportConfiguration addBinaryContent(String binaryContentId, byte[] binaryContent){
if (binaryContentId == null || binaryContentId.trim().length() == 0){
return this;
}
if (this.binaryContent == null){
this.binaryContent = new HashMap<String, byte[]>();
}
this.binaryContent.put(binaryContentId, binaryContent);
return this;
}
public ObjectImportConfiguration addBinaryContent(Map<String, byte[]> binaryContent){
if (binaryContent == null || binaryContent.isEmpty()){
return this;
}
if (this.binaryContent == null){
this.binaryContent = new HashMap<String, byte[]>();
}
this.binaryContent.putAll(binaryContent);
return this;
}
public ObjectImportConfiguration saveMissingObjectReferences(boolean saveMissingObjectReferences){
this.saveMissingObjectReferences = saveMissingObjectReferences;
return this;
}
public ObjectImportConfiguration credentialsOfUserWithAccessToBinaryContent(String username, String password){
this.credentialsOfUserWhoHasAccessToBinaryContent = new Credentials(username, password);
return this;
}
}
private ImportConfiguration(Configuration builder) {
this.persistMode = builder.persistMode;
this.binaryContent = builder.binaryContent;
this.updateLastModificationTime = builder.updateLastModificationTime;
this.version = builder.version;
this.saveMissingObjectReferences = builder.saveMissingObjectReferences;
this.credentialsOfUserWhoHasAccessToBinaryContent = builder.credentialsOfUserWhoHasAccessToBinaryContent;
}
public static ObjectImportConfiguration object(){
return new ObjectImportConfiguration();
}
public static RepositoryImportConfiguration repository(){
return new RepositoryImportConfiguration();
}
public static RepositoryUserImportConfiguration repositoryUser(){
return new RepositoryUserImportConfiguration();
}
public static TaxonomyImportConfiguration taxonomy(){
return new TaxonomyImportConfiguration();
}
public static TopicImportConfiguration topic(){
return new TopicImportConfiguration();
}
public static SpaceImportConfiguration space(){
return new SpaceImportConfiguration();
}
public PersistMode getPersistMode() {
return persistMode;
}
public boolean isVersion() {
return version;
}
public boolean isUpdateLastModificationTime() {
return updateLastModificationTime;
}
public Map<String, byte[]> getBinaryContent() {
return binaryContent;
}
public boolean saveMissingObjectReferences() {
return saveMissingObjectReferences;
}
public Credentials credentialsOfUserWhoHasAccessToBinaryContent() {
return credentialsOfUserWhoHasAccessToBinaryContent;
}
public static class Credentials implements Serializable {
/**
*
*/
private static final long serialVersionUID = -2154087866791803405L;
private final String username;
private final String password;
private Credentials(String username,String password){
this.username = username;
this.password = password;
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
}
}
|
gpl-3.0
|
genomeartist/genomeartist
|
sources_java/Components/src/ro/genomeartist/components/utils/StringUtilities.java
|
2529
|
/*
*
* This file is part of Genome Artist.
*
* Genome Artist 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.
*
* Genome Artist 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 Genome Artist. If not, see <http://www.gnu.org/licenses/>.
*
*/
package ro.genomeartist.components.utils;
import java.util.Arrays;
/**
*
* @author iulian
*/
public class StringUtilities {
/** Test whether a given string is a valid Java identifier.
* @param id string which should be checked
* @return <code>true</code> if a valid identifier
*/
public static boolean isJavaIdentifier(String id) {
if (id == null) return false;
if (id.equals("")) return false; // NOI18N
if (!(java.lang.Character.isJavaIdentifierStart(id.charAt(0))) )
return false;
for (int i = 1; i < id.length(); i++) {
if (!(java.lang.Character.isJavaIdentifierPart(id.charAt(i))) )
return false;
}
return Arrays.binarySearch(keywords, id) < 0;
}
/**
* Vector cu identificatorii java
*/
private static final String[] keywords = new String[] {
//If adding to this, insert in alphabetical order!
"abstract","assert","boolean","break","byte","case", //NOI18N
"catch","char","class","const","continue","default", //NOI18N
"do","double","else","extends","false","final", //NOI18N
"finally","float","for","goto","if","implements", //NOI18N
"import","instanceof","int","interface","long", //NOI18N
"native","new","null","package","private", //NOI18N
"protected","public","return","short","static", //NOI18N
"strictfp","super","switch","synchronized","this", //NOI18N
"throw","throws","transient","true","try","void", //NOI18N
"volatile","while" //NOI18N
};
/**
* Fac escape la un string pentru a-l afisa in XML
* @param text
* @return
*/
public static String removeWindowsCarriageReturn(String text){
return text.replaceAll("\\r", "");
}
}
|
gpl-3.0
|
chrisburnell/chrisburnell.github.io
|
src/posts/likes/2019-11-15-1573813434.md
|
281
|
---
date: 2019-11-15T10:23:54+0000
like_of:
title: "Ditching Event Platforms for the IndieWeb"
url: https://www.jvt.me/posts/2019/11/14/ditch-event-platforms-indieweb/
authors:
- title: "Jamie Tanna"
url: https://www.jvt.me
posting_method: https://omnibear.com
---
|
gpl-3.0
|
lgss/MyCouncil
|
WEB-INF/classes/uk/gov/selfserve/LaganUpdateReceipt.java
|
3109
|
package uk.gov.selfserve;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
//import lagan.api.auth.*;
import lagan.api.main.*;
//import org.apache.axis.EngineConfiguration;
//import org.apache.axis.configuration.FileProvider;
import org.apache.axis.client.Stub;
import org.apache.axis.message.SOAPHeaderElement;
public class LaganUpdateReceipt extends HttpServlet
{
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException
{
//System.getProperties().put("http.proxyHost", "localhost");
//System.getProperties().put("http.proxyPort", "8888");
String laganSystem = getServletConfig().getInitParameter("laganSystem");
String errorEmailTo = getServletContext().getInitParameter("errorEmailTo");
String emailFrom = getServletContext().getInitParameter("emailFrom");
String smtpHost = getServletContext().getInitParameter("smtpHost");
String reference=request.getParameter("CallingApplicationTransactionReference");
String receipt=request.getParameter("IncomeManagementReceiptNumber");
String[] strErrorEmailTo = { errorEmailTo };
String[] strErrorEmailBCC = new String[0];
response.setContentType("text/html");
PrintWriter webPageOutput=null;
webPageOutput=response.getWriter();
LaganLogIn laganLogIn = new LaganLogIn();
LogIn objLogIn = laganLogIn.logIn(laganSystem,
getServletContext().getRealPath("/WEB-INF/mycouncil.wsdd"),
strErrorEmailTo,
strErrorEmailBCC,
emailFrom,
smtpHost);
if (objLogIn.getSuccess())
{
lagan.api.main.FLWebService webService = new lagan.api.main.FLWebServiceLocator(objLogIn.getConfig());
org.apache.axis.client.Stub webStub = null;
try
{
lagan.api.main.FLWebInterface webInterface = webService.getFL();
webStub = (Stub)webInterface;
SOAPHeaderElement[] respHdrs = objLogIn.getStub().getResponseHeaders();
for (int i = 0; i < respHdrs.length; i++)
{
webStub.setHeader(respHdrs[i]);
}
lagan.api.main.FWTCaseEventNew caseEvent = new lagan.api.main.FWTCaseEventNew(reference, "Payment Confirmation", "Receipt Number : " + receipt,"","");
webInterface.addCaseEvent(caseEvent);
}
catch (Exception e)
{
webPageOutput.println("*** Error updating Lagan");
webPageOutput.println("laganSystem=" + laganSystem + "<BR>");
webPageOutput.println("URL=" + request.getQueryString() + "<BR>");
webPageOutput.println("Reference=" + reference + "<BR>");
webPageOutput.println("Receipt=" + receipt);
webPageOutput.println(e.toString());
}
//// response.sendRedirect("http://selfserve.northampton.gov.uk/Ef3/nbcPayLinkReturn.jsp" + "?" + request.getQueryString());
// response.sendRedirect("http://fscrmtestw2k3:8080/Ef3/nbcPayLinkReturn.jsp" + "?" + request.getQueryString());
webPageOutput.close();
}
}
}
|
gpl-3.0
|
Invertika/data
|
scripts/maps/ow-n0001-n0025-o0000.lua
|
1399
|
----------------------------------------------------------------------------------
-- Map File --
-- --
-- In dieser Datei stehen die entsprechenden externen NPC's, Trigger und --
-- anderer Dinge. --
-- --
----------------------------------------------------------------------------------
-- Copyright 2010 The Invertika Development Team --
-- --
-- This file is part of Invertika. --
-- --
-- Invertika 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 any later version. --
----------------------------------------------------------------------------------
require "scripts/lua/npclib"
require "scripts/libs/warp"
atinit(function()
create_inter_map_warp_trigger(140, 1361, 0, 181) --- Intermap warp
end)
|
gpl-3.0
|
damien-cremilleux/SmallWorld
|
Documentation/html/search/functions_61.js
|
1198
|
var searchData=
[
['ajoutercarte',['ajouterCarte',['../interface_small_world_1_1_inter_monteur_partie.html#a473c91ad26ee485f07261df1fcae0e8b',1,'SmallWorld.InterMonteurPartie.ajouterCarte()'],['../class_small_world_1_1_monteur_partie.html#ad8cedb326193c0f0ff5f2d6705867156',1,'SmallWorld.MonteurPartie.ajouterCarte()']]],
['ajouterjoueur',['ajouterJoueur',['../interface_small_world_1_1_inter_monteur_partie.html#ae52498262dd36230b0c0d090cb59ff07',1,'SmallWorld.InterMonteurPartie.ajouterJoueur()'],['../class_small_world_1_1_monteur_partie.html#ac1e20f04d1ca796c1aa0ab504ecb1d2a',1,'SmallWorld.MonteurPartie.ajouterJoueur()']]],
['ajoutjoueur',['ajoutJoueur',['../interface_small_world_1_1_inter_createur_partie.html#af3fa5aaff01c6709b99eff93b6252da5',1,'SmallWorld.InterCreateurPartie.ajoutJoueur()'],['../class_small_world_1_1_createur_partie.html#a1388144440304d2d82879a15e0e58e1f',1,'SmallWorld.CreateurPartie.ajoutJoueur()']]],
['attaquer',['attaquer',['../interface_small_world_1_1_inter_unite.html#a9bce76356ba4531ed90ca35cc659af5f',1,'SmallWorld.InterUnite.attaquer()'],['../class_small_world_1_1_unite.html#af370920ab6c2b9478f0c12d7f1d22638',1,'SmallWorld.Unite.attaquer()']]]
];
|
gpl-3.0
|
nerai/Nibbler
|
src/Nibbler.Core.Simple/Run/TmConfiguration.cs
|
1447
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nibbler.Core.Simple;
using Nibbler.Core.Simple.Definition;
using Nibbler.Core.Simple.Tapes;
namespace Nibbler.Core.Simple.Run
{
public class TmConfiguration<TTape>
where TTape : class, ITape
{
public readonly State Q;
public readonly TTape T;
public TmConfiguration (State q, TTape t)
{
if (q == null)
throw new ArgumentNullException ();
if (t == null)
throw new ArgumentNullException ();
Q = q;
T = t;
}
public override string ToString ()
{
return T.ToString (Q.ToString ());
}
public TmConfiguration<TTape> Clone ()
{
var c = T as ICloneable;
if (c != null) {
return new TmConfiguration<TTape> (Q, c.Clone () as TTape);
}
else {
throw new InvalidOperationException ("This tape does not support cloning.");
}
}
public override int GetHashCode ()
{
unchecked {
return (int.MaxValue - Q.Id) ^ (int) T.TotalTapeLength;
}
}
public override bool Equals (object obj)
{
if (obj == null || obj.GetType () != GetType ()) {
return false;
}
return Equals (obj as TmConfiguration<TTape>);
}
public bool Equals (TmConfiguration<TTape> c)
{
if (c == null) {
return false;
}
if (Q != c.Q) {
return false;
}
return T.CompleteContentEquals (c.T);
}
}
}
|
mpl-2.0
|