code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
/* * SonarQube * Copyright (C) 2009-2016 SonarSource SA * mailto:contact AT sonarsource DOT com * * This program 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. * * 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package it.duplication; import com.sonar.orchestrator.Orchestrator; import com.sonar.orchestrator.locator.FileLocation; import com.sonar.orchestrator.selenium.Selenese; import it.Category4Suite; import org.apache.commons.io.IOUtils; import org.junit.BeforeClass; import org.junit.ClassRule; import org.junit.Test; import org.sonar.wsclient.services.ResourceQuery; import util.selenium.SeleneseTest; import static org.assertj.core.api.Assertions.assertThat; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; import static util.ItUtils.runProjectAnalysis; public class CrossProjectDuplicationsOnRemoveFileTest { static final String ORIGIN_PROJECT = "origin-project"; static final String DUPLICATE_PROJECT = "duplicate-project"; static final String DUPLICATE_FILE = DUPLICATE_PROJECT + ":src/main/xoo/sample/File1.xoo"; @ClassRule public static Orchestrator orchestrator = Category4Suite.ORCHESTRATOR; @BeforeClass public static void analyzeProjects() { orchestrator.resetData(); orchestrator.getServer().restoreProfile(FileLocation.ofClasspath("/duplication/xoo-duplication-profile.xml")); analyzeProject(ORIGIN_PROJECT, "duplications/cross-project/origin"); analyzeProject(DUPLICATE_PROJECT, "duplications/cross-project/duplicate"); // Remove origin project orchestrator.getServer().adminWsClient().post("api/projects/bulk_delete", "keys", ORIGIN_PROJECT); assertThat(orchestrator.getServer().getAdminWsClient().find(ResourceQuery.create(ORIGIN_PROJECT))).isNull(); } @Test public void duplications_show_ws_does_not_contain_key_of_deleted_file() throws Exception { String duplication = orchestrator.getServer().adminWsClient().get("api/duplications/show", "key", DUPLICATE_FILE); assertEquals(IOUtils.toString(CrossProjectDuplicationsTest.class.getResourceAsStream( "/duplication/CrossProjectDuplicationsOnRemoveFileTest/duplications_on_removed_file-expected.json"), "UTF-8"), duplication, false); // Only one file should be reference, so the reference 2 on origin-project must not exist assertThat(duplication).doesNotContain("\"2\""); assertThat(duplication).doesNotContain("origin-project"); } /** * SONAR-3277 */ @Test public void display_message_in_viewer_when_duplications_with_deleted_files_are_found() throws Exception { // TODO stas, please replace this IT by a medium test new SeleneseTest( Selenese.builder().setHtmlTestsInClasspath("duplications-on-deleted-project", "/duplication/CrossProjectDuplicationsOnRemoveFileTest/duplications-with-deleted-project.html") .build()) .runOn(orchestrator); } private static void analyzeProject(String projectKey, String path) { orchestrator.getServer().provisionProject(projectKey, projectKey); orchestrator.getServer().associateProjectToQualityProfile(projectKey, "xoo", "xoo-duplication-profile"); runProjectAnalysis(orchestrator, path, "sonar.cpd.cross_project", "true", "sonar.projectKey", projectKey, "sonar.projectName", projectKey); } }
joansmith/sonarqube
it/it-tests/src/test/java/it/duplication/CrossProjectDuplicationsOnRemoveFileTest.java
Java
lgpl-3.0
3,936
package brandon.tsai.travelledger; import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.database.Cursor; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.EditText; import android.widget.ImageView; import android.widget.TextView; import com.daimajia.swipe.adapters.CursorSwipeAdapter; /** * Created by ty on 2016/5/25. * refer https://github.com/daimajia/AndroidSwipeLayout */ public class SheetListAdapter extends CursorSwipeAdapter { private static final String TAG="SwipeAdapter"; protected SheetListAdapter(Context context, Cursor c, boolean autoRequery) { super(context, c, autoRequery); } @Override public View newView(Context context, Cursor cursor, ViewGroup parent) { return LayoutInflater.from(context).inflate(R.layout.adapter_swipe_list, parent, false); } @Override public void bindView(View view, final Context context, Cursor cursor) { TextView sheet = (TextView) view.findViewById(R.id.textView_sheet_name); final int sheetId = cursor.getInt(0); final String sheetName = cursor.getString(1); if (sheetName != null && !sheetName.isEmpty()) { Log.d(TAG, "sheet:(" +sheetId + ")" + sheetName); sheet.setText(sheetName); } sheet.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Log.d(TAG, "click sheet:" + sheetName); Intent intent = new Intent(); intent.setClass(context, NewSheetActivity.class); intent.putExtra("sheetId", sheetId); intent.putExtra("sheetName", sheetName); context.startActivity(intent); } }); ImageView deleteSheet = (ImageView) view.findViewById(R.id.ImageView_delete_sheet); deleteSheet.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DB.deleteSheet(sheetId); Cursor newCursor = DB.getSheets(); changeCursor(newCursor); notifyDataSetChanged(); closeAllItems(); } }); ImageView renameSheet = (ImageView) view.findViewById(R.id.ImageView_rename_sheet); renameSheet.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final EditText mEditText = new EditText(context); mEditText.setText(sheetName); new AlertDialog.Builder(context).setTitle("Rename Sheet") .setIcon(android.R.drawable.ic_dialog_info) .setView(mEditText) .setPositiveButton("Save", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String newName = mEditText.getText().toString(); Log.d(TAG, "rename sheet " + sheetName + "to:" + newName); DB.updateSheetName(sheetId,newName); Cursor newCursor = DB.getSheets(); changeCursor(newCursor); notifyDataSetChanged(); closeAllItems(); } }) .setNegativeButton("Cancel", null).show(); } }); } @Override public int getSwipeLayoutResourceId(int position) { return R.id.SwipeLayout; } @Override public void closeAllItems() { for (int i = 0; i< DB.getSheets().getCount();i++){ closeItem(i); } } }
BrandonTsai/TravelLedger
app/src/main/java/brandon/tsai/travelledger/SheetListAdapter.java
Java
lgpl-3.0
4,007
/* * SonarQube, open source software quality management tool. * Copyright (C) 2008-2014 SonarSource * mailto:contact AT sonarsource DOT com * * SonarQube 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. * * SonarQube 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 this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.core.config; import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; import java.util.Arrays; import java.util.List; import org.sonar.api.CoreProperties; import org.sonar.api.PropertyType; import org.sonar.api.config.PropertyDefinition; import org.sonar.api.resources.Qualifiers; import org.sonar.core.computation.dbcleaner.DataCleanerProperties; public class CorePropertyDefinitions { private CorePropertyDefinitions() { // only static stuff } public static List<PropertyDefinition> all() { List<PropertyDefinition> defs = Lists.newArrayList(); defs.addAll(IssueExclusionProperties.all()); defs.addAll(ExclusionProperties.all()); defs.addAll(SecurityProperties.all()); defs.addAll(DebtProperties.all()); defs.addAll(DataCleanerProperties.all()); defs.addAll(ImmutableList.of( PropertyDefinition.builder(CoreProperties.SERVER_BASE_URL) .name("Server base URL") .description("HTTP URL of this SonarQube server, such as <i>http://yourhost.yourdomain/sonar</i>. This value is used i.e. to create links in emails.") .category(CoreProperties.CATEGORY_GENERAL) .defaultValue(CoreProperties.SERVER_BASE_URL_DEFAULT_VALUE) .build(), PropertyDefinition.builder(CoreProperties.LINKS_HOME_PAGE) .name("Project Home Page") .description("HTTP URL of the home page of the project.") .hidden() .build(), PropertyDefinition.builder(CoreProperties.LINKS_CI) .name("CI server") .description("HTTP URL of the continuous integration server.") .category(CoreProperties.CATEGORY_GENERAL) .build(), PropertyDefinition.builder(CoreProperties.LINKS_ISSUE_TRACKER) .name("Issue Tracker") .description("HTTP URL of the issue tracker.") .category(CoreProperties.CATEGORY_GENERAL) .hidden() .build(), PropertyDefinition.builder(CoreProperties.LINKS_SOURCES) .name("SCM server") .description("HTTP URL of the server which hosts the sources of the project.") .category(CoreProperties.CATEGORY_GENERAL) .build(), PropertyDefinition.builder(CoreProperties.LINKS_SOURCES_DEV) .name("SCM connection for developers") .description("HTTP URL used by developers to connect to the SCM server for the project.") .category(CoreProperties.CATEGORY_GENERAL) .hidden() .build(), PropertyDefinition.builder(CoreProperties.ANALYSIS_MODE) .name("Analysis mode") .type(PropertyType.SINGLE_SELECT_LIST) .options(Arrays.asList(CoreProperties.ANALYSIS_MODE_ANALYSIS, CoreProperties.ANALYSIS_MODE_PREVIEW, CoreProperties.ANALYSIS_MODE_INCREMENTAL)) .category(CoreProperties.CATEGORY_GENERAL) .defaultValue(CoreProperties.ANALYSIS_MODE_ANALYSIS) .hidden() .build(), PropertyDefinition.builder(CoreProperties.PREVIEW_INCLUDE_PLUGINS) .deprecatedKey(CoreProperties.DRY_RUN_INCLUDE_PLUGINS) .name("Plugins accepted for Preview and Incremental modes") .description("Comma-separated list of plugin keys. Those plugins will be used during preview or incremental analyses.") .category(CoreProperties.CATEGORY_GENERAL) .defaultValue(CoreProperties.PREVIEW_INCLUDE_PLUGINS_DEFAULT_VALUE) .build(), PropertyDefinition.builder(CoreProperties.PREVIEW_EXCLUDE_PLUGINS) .deprecatedKey(CoreProperties.DRY_RUN_EXCLUDE_PLUGINS) .name("Plugins excluded for Preview and Incremental modes") .description("Comma-separated list of plugin keys. Those plugins will not be used during preview or incremental analyses.") .category(CoreProperties.CATEGORY_GENERAL) .defaultValue(CoreProperties.PREVIEW_EXCLUDE_PLUGINS_DEFAULT_VALUE) .build(), PropertyDefinition.builder(CoreProperties.CORE_AUTHENTICATOR_REALM) .name("Security Realm") .hidden() .build(), PropertyDefinition.builder("sonar.security.savePassword") .name("Save external password") .hidden() .build(), PropertyDefinition.builder("sonar.authenticator.downcase") .name("Downcase login") .description("Downcase login during user authentication, typically for Active Directory") .type(PropertyType.BOOLEAN) .defaultValue(String.valueOf(false)) .hidden() .build(), PropertyDefinition.builder(CoreProperties.CORE_AUTHENTICATOR_CREATE_USERS) .name("Create user accounts") .description("Create accounts when authenticating users via an external system") .type(PropertyType.BOOLEAN) .defaultValue(String.valueOf(true)) .hidden() .build(), PropertyDefinition.builder(CoreProperties.CORE_AUTHENTICATOR_UPDATE_USER_ATTRIBUTES) .name("Update user attributes") .description("When using the LDAP or OpenID plugin, at each login, the user attributes (name, email, ...) are re-synchronized") .hidden() .type(PropertyType.BOOLEAN) .defaultValue(String.valueOf(true)) .build(), PropertyDefinition.builder(CoreProperties.CORE_AUTHENTICATOR_IGNORE_STARTUP_FAILURE) .name("Ignore failures during authenticator startup") .type(PropertyType.BOOLEAN) .defaultValue(String.valueOf(false)) .hidden() .build(), PropertyDefinition.builder("sonar.enableFileVariation") .name("Enable file variation") .hidden() .type(PropertyType.BOOLEAN) .defaultValue(String.valueOf(false)) .build(), PropertyDefinition.builder(CoreProperties.CORE_AUTHENTICATOR_LOCAL_USERS) .name("Local/technical users") .description("Comma separated list of user logins that will always be authenticated using SonarQube database. " + "When using the LDAP plugin, for these accounts, the user attributes (name, email, ...) are not re-synchronized") .type(PropertyType.STRING) .multiValues(true) .defaultValue("admin") .build(), PropertyDefinition.builder(CoreProperties.SCM_DISABLED_KEY) .name("Disable the SCM Sensor") .description("Disable the retrieval of blame information from Source Control Manager") .category(CoreProperties.CATEGORY_SCM) .type(PropertyType.BOOLEAN) .onQualifiers(Qualifiers.PROJECT) .defaultValue(String.valueOf(false)) .build(), PropertyDefinition.builder(CoreProperties.SCM_PROVIDER_KEY) .name("Key of the SCM provider for this project") .description("Force the provider to be used to get SCM information for this project. By default auto-detection is done. Example: svn, git.") .category(CoreProperties.CATEGORY_SCM) .onlyOnQualifiers(Qualifiers.PROJECT) .build(), // WEB LOOK&FEEL PropertyDefinition.builder("sonar.lf.logoUrl") .deprecatedKey("sonar.branding.image") .name("Logo URL") .description("URL to logo image. Any standard format is accepted.") .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL) .build(), PropertyDefinition.builder("sonar.lf.logoWidthPx") .deprecatedKey("sonar.branding.image.width") .name("Width of image in pixels") .description("Width in pixels, given that the height of the the image is constrained to 30px") .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL) .build(), PropertyDefinition.builder("sonar.lf.enableGravatar") .name("Enable support of gravatars") .description("Gravatars are profile pictures of users based on their email.") .type(PropertyType.BOOLEAN) .defaultValue(String.valueOf(true)) .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL) .build(), PropertyDefinition.builder("sonar.lf.gravatarServerUrl") .name("Gravatar URL") .description("Optional URL of custom Gravatar service. Accepted variables are {EMAIL_MD5} for MD5 hash of email and {SIZE} for the picture size in pixels.") .defaultValue("https://secure.gravatar.com/avatar/{EMAIL_MD5}.jpg?s={SIZE}&d=identicon") .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_LOOKNFEEL) .build(), // ISSUES PropertyDefinition.builder(CoreProperties.DEFAULT_ISSUE_ASSIGNEE) .name("Default Assignee") .description("New issues will be assigned to this user each time it is not possible to determine the user who is the author of the issue.") .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_ISSUES) .onQualifiers(Qualifiers.PROJECT) .type(PropertyType.USER_LOGIN) .build(), // BATCH PropertyDefinition.builder(CoreProperties.CORE_VIOLATION_LOCALE_PROPERTY) .defaultValue("en") .name("Locale used for issue messages") .description("Deprecated property. Keep default value for backward compatibility.") .hidden() .build(), PropertyDefinition.builder(CoreProperties.TIMEMACHINE_PERIOD_PREFIX + 1) .name("Period 1") .description("Period used to compare measures and track new issues. Values are : <ul class='bullet'><li>Number of days before " + "analysis, for example 5.</li><li>A custom date. Format is yyyy-MM-dd, for example 2010-12-25</li><li>'previous_analysis' to " + "compare to previous analysis</li><li>'previous_version' to compare to the previous version in the project history</li></ul>" + "<p>When specifying a number of days or a date, the snapshot selected for comparison is " + " the first one available inside the corresponding time range. </p>" + "<p>Changing this property only takes effect after subsequent project inspections.<p/>") .defaultValue(CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_1) .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_DIFFERENTIAL_VIEWS) .build(), PropertyDefinition.builder(CoreProperties.TIMEMACHINE_PERIOD_PREFIX + 2) .name("Period 2") .description("See the property 'Period 1'") .defaultValue(CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_2) .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_DIFFERENTIAL_VIEWS) .build(), PropertyDefinition.builder(CoreProperties.TIMEMACHINE_PERIOD_PREFIX + 3) .name("Period 3") .description("See the property 'Period 1'") .defaultValue(CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_3) .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_DIFFERENTIAL_VIEWS) .build(), PropertyDefinition.builder(CoreProperties.TIMEMACHINE_PERIOD_PREFIX + 4) .name("Period 4") .description("Period used to compare measures and track new issues. This property is specific to the project. Values are : " + "<ul class='bullet'><li>Number of days before analysis, for example 5.</li><li>A custom date. Format is yyyy-MM-dd, " + "for example 2010-12-25</li><li>'previous_analysis' to compare to previous analysis</li>" + "<li>'previous_version' to compare to the previous version in the project history</li><li>A version, for example 1.2</li></ul>" + "<p>When specifying a number of days or a date, the snapshot selected for comparison is the first one available inside the corresponding time range. </p>" + "<p>Changing this property only takes effect after subsequent project inspections.<p/>") .defaultValue(CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_4) .onlyOnQualifiers(Qualifiers.PROJECT) .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_DIFFERENTIAL_VIEWS) .build(), PropertyDefinition.builder(CoreProperties.TIMEMACHINE_PERIOD_PREFIX + 5) .name("Period 5") .description("See the property 'Period 4'") .defaultValue(CoreProperties.TIMEMACHINE_DEFAULT_PERIOD_5) .onlyOnQualifiers(Qualifiers.PROJECT) .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_DIFFERENTIAL_VIEWS) .build(), // CPD PropertyDefinition.builder(CoreProperties.CPD_CROSS_PROJECT) .defaultValue(CoreProperties.CPD_CROSS_RPOJECT_DEFAULT_VALUE + "") .name("Cross project duplication detection") .description("By default, SonarQube detects duplications at sub-project level. This means that a block " + "duplicated on two sub-projects of the same project won't be reported. Setting this parameter to \"true\" " + "allows to detect duplicates across sub-projects and more generally across projects. Note that activating " + "this property will slightly increase each SonarQube analysis time.") .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE) .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS) .type(PropertyType.BOOLEAN) .build(), PropertyDefinition.builder(CoreProperties.CPD_SKIP_PROPERTY) .defaultValue(String.valueOf(false)) .name("Skip") .description("Disable detection of duplications") .hidden() .category(CoreProperties.CATEGORY_GENERAL) .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS) .type(PropertyType.BOOLEAN) .build(), PropertyDefinition.builder(CoreProperties.CPD_EXCLUSIONS) .defaultValue("") .name("Duplication Exclusions") .description("Patterns used to exclude some source files from the duplication detection mechanism. " + "See below to know how to use wildcards to specify this property.") .onQualifiers(Qualifiers.PROJECT, Qualifiers.MODULE) .category(CoreProperties.CATEGORY_EXCLUSIONS) .subCategory(CoreProperties.SUBCATEGORY_DUPLICATIONS_EXCLUSIONS) .multiValues(true) .build() )); return defs; } }
jblievremont/sonarqube
sonar-core/src/main/java/org/sonar/core/config/CorePropertyDefinitions.java
Java
lgpl-3.0
15,305
package org.tasclin1.mopet1.model; import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.tasclin1.mopet1.domain.Drug; import org.tasclin1.mopet1.domain.Folder; import org.tasclin1.mopet1.domain.MObject; import org.tasclin1.mopet1.domain.Protocol; import org.tasclin1.mopet1.domain.Tree; import org.tasclin1.mopet1.util.FormUtil; public class ExplorerMtl extends TreeManager implements Serializable { private static final long serialVersionUID = 1L; protected final Log log = LogFactory.getLog(getClass()); void runRule() { } private List<Map<String, Object>> folderContent; private DBTableEnum dbTableEnum; //for use of table enumeration in jsp // private boolean isPatient=true; private Folder folderDoc; private Integer currentFolderId; private List<Folder> treeBreadcrumb; public List<Folder> getTreeBreadcrumb() { return treeBreadcrumb; } public void setTreeBreadcrumb(List<Folder> treeBreadcrumb) { this.treeBreadcrumb = treeBreadcrumb; } public Integer getCurrentFolderId() { return currentFolderId; } public void setCurrentFolderId(Integer currentFolderId) { this.currentFolderId = currentFolderId; } /** * for use in new therapy schema button */ Protocol newProtocol=null; public Protocol getNewProtocol() { if(newProtocol==null) newProtocol=new Protocol(); return newProtocol; } public ExplorerMtl(String folderType) { super(null); this.folderType = folderType; } private List<Map<String, Object>> patientMoveList; public List<Map<String, Object>> getPatientMoveList() {return patientMoveList;} public void setPatientMoveList(List<Map<String, Object>> patientMoveList) { this.patientMoveList=patientMoveList; } public void setFolderContent(List<Map<String, Object>> patientList) { this.folderContent = patientList; } public List<Map<String, Object>> getFolderContent() { return folderContent; } private String folderType; public void setFolderType(String folderType){this.folderType = folderType;} public String getFolderType(){return folderType;} public void setDbTableEnum(DBTableEnum dbTableEnum) { this.dbTableEnum = dbTableEnum; } public DBTableEnum getDbTableEnum() { return dbTableEnum; } public boolean getIsPatientFolder() { return (folderType.equals(DBTableEnum.patient.getTableName())); } public boolean getIsDrugFolder() { return (folderType.equals(DBTableEnum.drug.getTableName())); } public boolean getIsConceptFolder() { return (folderType.equals(DBTableEnum.concept.getTableName())); } public boolean getIsLaborFolder() { return (folderType.equals(DBTableEnum.labor.getTableName())); } public boolean getIsFindingFolder() { return (folderType.equals(DBTableEnum.finding.getTableName())); } public boolean getIsDiagnoseFolder() { return (folderType.equals(DBTableEnum.diagnose.getTableName())); } public boolean getIsSchemaFolder() { return (folderType.equals(DBTableEnum.schema.getTableName())); } public boolean getIsValidPath() { //security! //iterate through our table enumeration //forbid execution for unknown tableNames DBTableEnum[] n = DBTableEnum.values(); for (DBTableEnum e : n) { if(e.getTableName().equals(this.folderType)) return true; } return false; } public Integer getDir(){ int dir = 0; // for(Folder f1:folderDoc.getChildFs()){ // if(f1.getFolder().equals(path)) // dir=f1.getId(); // } return dir; } public void setFolderDoc(Folder fd) { folderDoc = fd; } @Override void addMtlMap(MObject mtlC) { } /* @Override void addTreePaar_depr(Tree tree) { } */ @Override void add1ClassObj_depr(Tree tree,MObject classM) { } @Override void addTreeClassObj_depr(MObject objM, Tree tree) { } @Override boolean isThisDocumentTag(Tree tree) { return false; } private List<Drug> drugs; public List<Drug> getDrugs() {return drugs;} public void setDrugs(List<Drug> tL) {this.drugs=tL;} private int drugsSize; public int getDrugsSize() {return drugsSize;} public void setDrugsSize(int n) {this.drugsSize=n;} private Map<Integer, Map<String,Object>> prTaSt,taStMap; private List<Integer> prIdList; private String inPvid; public String getInPvid() {return inPvid;} public List<Integer> getPrIdList() {return prIdList;} public Map<Integer, Map<String, Object>> getPrTaSt() {return prTaSt;} public Map<Integer, Map<String, Object>> getTaStMap() {return taStMap;} public void setPrTaSt(List<Map<String, Object>> folderContentFromDBJDBC) { prIdList=new ArrayList<Integer>(); prTaSt=new HashMap<Integer, Map<String,Object>>(); taStMap=new HashMap<Integer, Map<String,Object>>(); inPvid=""; protocolCnt=0; schemaCnt=0; for (Map<String, Object> map : folderContentFromDBJDBC) { Integer idPr = (Integer) map.get("idprotocol"); Map<String, Object> prMap = prTaSt.get(idPr); if(prMap==null){ prIdList.add(idPr); prTaSt.put(idPr, map); map.put("taskIdList", new ArrayList<Integer>()); prMap=map; protocolCnt++; } Integer idTask = (Integer) map.get("idtask"); Map<String, Object> taMap = (Map<String, Object>) taStMap.get(idTask); if(taMap==null){ ((List<Integer>) prMap.get("taskIdList")).add(idTask); taStMap.put(idTask, map); schemaCnt++; } Integer pvid=(Integer) map.get("pvTaskid"); if(pvid!=null) inPvid+=","+pvid; pvid=(Integer) map.get("pvPrid"); if(pvid!=null) inPvid+=","+pvid; } } private Integer protocolCnt,schemaCnt; public Integer getSchemaCnt() {return schemaCnt;} public Integer getProtocolCnt() {return protocolCnt;} public void setProtocolCnt(Integer protocolCnt) { this.protocolCnt=protocolCnt; } HashMap<Integer, Map<String, Object>> docStateMap; public void setDocStateMap(HashMap<Integer, Map<String, Object>> docStateMap) { this.docStateMap = docStateMap; } public HashMap<Integer, Map<String, Object>> getDocStateMap() { return docStateMap; } // public void setDocStatus(ExplorerMtl e, List<Map<String, Object>> res) { public void setDocStatus( List<Map<String, Object>> res) { for (Map<String, Object> map : res){ Integer taskId = (Integer) map.get("ref"); Map<String, Object> taskAuthorStatusMap = getTaStMap().get(taskId); List<String> authorsList = (List<String>) taskAuthorStatusMap.get("authorsList"); if(authorsList==null){ authorsList=new ArrayList<String>(); taskAuthorStatusMap.put("authorsList", authorsList); taskAuthorStatusMap.put("authorsMap", map); } Map<String,Map<String,Object>> authorsMap = (Map<String,Map<String,Object>>) taskAuthorStatusMap.get("authorsMap"); String author=(String) map.get("owuser"); Map<String, Object> authorMap = authorsMap.get(author); if(authorMap==null){ authorMap=map; authorMap.put("statusIdList", new ArrayList<Integer>()); authorMap.put("statusenMap", new HashMap<Integer,Map<String,Object>>()); authorsMap.put(author, authorMap); authorsList.add(author); } HashMap<Integer,Map<String,Object>> statusenMap = (HashMap<Integer,Map<String,Object>>) authorMap.get("statusenMap"); Integer statusId=(Integer) map.get("id"); statusenMap.put(statusId, map); List<Integer> statusIdList=(List<Integer>) authorMap.get("statusIdList"); statusIdList.add(statusId); } } Folder folderO; public Folder getFolderO() {return folderO;} public void setFolderO(Folder f) {this.folderO=f;} public String getFolderTypeName(){ Folder f=folderO; while (!"folder".equals(f.getParentF().getFolder())) f=f.getParentF(); return f.getFolder(); } @Override public void paste() { // TODO Auto-generated method stub } public String getAction() { String ac = super.getAction(); if(null==ac) ac=OwsSession.getRequest().getParameter("a"); return ac; } Drug editDrugC; public Drug getEditDrugC() { if(null==editDrugC) editDrugC=new Drug(); return editDrugC; } String intention; public String getIntention() {return intention;} public void setIntention(String intention) {this.intention = intention;} private FormUtil formUtil; public FormUtil getFormUtil() {return formUtil;} public void setFormUtil(FormUtil formUtil) { this.formUtil=formUtil; } }
romanm/tcmopet1
src/main/java/org/tasclin1/mopet1/model/ExplorerMtl.java
Java
lgpl-3.0
8,679
<?php namespace Phabricator\Endpoints\Defaults; use Phabricator\Endpoints\BaseEndpoint; use Phabricator\Endpoints\EndpointInterface; /** * Phame Default Endpoint Handler * * Phabricator PHP API * * @author Zoltán Borsos <zolli07@gmail.com> * @package Phabricator * @subpackage Endpoints\Defaults * * @copyright Copyright 2016, Zoltán Borsos. * @license https://github.com/Zolli/Phabricator-PHP-API/blob/master/LICENSE.md * @link https://github.com/Zolli/Phabricator-PHP-API */ class Phame extends BaseEndpoint implements EndpointInterface { }
Zolli/Phabricator-PHP-API
src/Endpoints/Defaults/Phame.php
PHP
lgpl-3.0
576
import {Inject, Injectable} from 'app/app'; import {RestClient} from 'services/rest-client'; import {PromiseAdapter} from 'adapters/angular/promise-adapter'; import data from 'sandbox/services/rest/object-browser-service.data.json!'; @Injectable() @Inject(RestClient, PromiseAdapter) export class ObjectBrowserRestService { constructor(restClient, promiseAdapter) { this.restClient = restClient; this.promiseAdapter = promiseAdapter; } getChildNodes(id, params) { var result = data[id]; if (!result) { result = data[params.rootId]; } if (!result) { result = [] } return this.promiseAdapter.resolve(result); } }
SirmaITT/conservation-space-1.7.0
docker/sep-ui/sandbox/services/rest/object-browser-service.stub.js
JavaScript
lgpl-3.0
667
TARGET = sensor_parameter get_distance get_distance_intensity get_multiecho get_multiecho_intensity sync_time_stamp calculate_xy find_port URG_LIB = ../../src/liburg_c.a include ../../build_rule.mk CFLAGS = -O2 $(INCLUDES) -I../../include/c LDLIBS = -lm `/bin/sh ld_wsock.sh` `/bin/sh ld_setupapi.sh` all : $(TARGET) clean : $(RM) *.o $(TARGET) *.exe $(TARGET) : open_urg_sensor.o $(URG_LIB) $(URG_LIB) : cd $(@D)/ && $(MAKE) $(@F)
gMitchell09/Rise
urg_library-1.1.8/samples/c/Makefile
Makefile
lgpl-3.0
441
/** * Optimus, framework for Model Transformation * * Copyright (C) 2013 Worldline or third-party contributors as * indicated by the @author tags or express copyright attribution * statements applied by the authors. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License. * * 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package net.atos.optimus.m2m.javaxmi.operation.accesses; import java.util.Iterator; import net.atos.optimus.m2m.javaxmi.operation.annotations.builders.AnnotationTypeDeclarationBuilder; import net.atos.optimus.m2m.javaxmi.operation.annotations.builders.UnresolvedAnnotationDeclarationBuilder; import net.atos.optimus.m2m.javaxmi.operation.classes.UnresolvedClassDeclarationBuilder; import net.atos.optimus.m2m.javaxmi.operation.elements.Element; import net.atos.optimus.m2m.javaxmi.operation.interfaces.UnresolvedInterfaceDeclarationBuilder; import net.atos.optimus.m2m.javaxmi.operation.packages.JavaPackage; import net.atos.optimus.m2m.javaxmi.operation.packages.PackageHelper; import net.atos.optimus.m2m.javaxmi.operation.types.ArrayTypeBuilder; import net.atos.optimus.m2m.javaxmi.operation.types.PrimitiveTypeBuilder; import net.atos.optimus.m2m.javaxmi.operation.types.UnresolvedTypeBuilder; import net.atos.optimus.m2m.javaxmi.operation.types.WildCardTypeBuilder; import net.atos.optimus.m2m.javaxmi.operation.util.ASTElementFinder; import org.eclipse.emf.common.util.EList; import org.eclipse.gmt.modisco.java.AbstractTypeDeclaration; import org.eclipse.gmt.modisco.java.AnnotationTypeDeclaration; import org.eclipse.gmt.modisco.java.Model; import org.eclipse.gmt.modisco.java.ParameterizedType; import org.eclipse.gmt.modisco.java.Type; import org.eclipse.gmt.modisco.java.TypeAccess; import org.eclipse.gmt.modisco.java.UnresolvedAnnotationDeclaration; /** * The purpose of such class is to help with the creation of type accesses * * @author tnachtergaele <nachtergaele.thomas@gmail.com> * * */ public class TypeAccessHelper { /** String constant : entry character of an array */ public static final String ARRAY_ENTRY = "["; /** String constant : exit character of an array */ public static final String ARRAY_EXIT = "]"; /** String constant : entry character of a parameterized type */ public static final String PARAMETRIZED_ENTRY = "<"; /** String constant : separator of a parameterized type */ public static final String PARAMETRIZED_SEPARATOR = ","; /** String constant : the wild card character */ public static final String WILD_CARD = "?"; /** The Java keyword for class extension */ public static final String EXTENSION = "extends"; /** The Java keyword for generalization */ public static final String GENERALIZATION = "super"; /** String constant : separator of package chunks */ public static final String PACKAGE_SEPARATOR = "."; /** * Private constructor * */ private TypeAccessHelper() { } /** * Create a type access associated to a class * * @param className * the class name which we want a type access. * @return the created type access associated to the specified class name. */ public static TypeAccess createClassTypeAccess(String className) { if (className.contains(TypeAccessHelper.PARAMETRIZED_ENTRY)) { return TypeAccessHelper.createParameterizedType( TypeAccessHelper.createClassTypeAccess(className.substring(0, className.indexOf(TypeAccessHelper.PARAMETRIZED_ENTRY))), className); } return TypeAccessBuilder.builder() .setType(UnresolvedClassDeclarationBuilder.builder().setName(className).build()).build(); } /** * Create a type access associated to an interface * * @param interfaceName * the interface name which we want a type access. * @return the created type access associated to the specified interface * name. */ public static TypeAccess createInterfaceTypeAccess(String interfaceName) { if (interfaceName.contains(TypeAccessHelper.PARAMETRIZED_ENTRY)) { return TypeAccessHelper.createParameterizedType( TypeAccessHelper.createInterfaceTypeAccess(interfaceName.substring(0, interfaceName.indexOf(TypeAccessHelper.PARAMETRIZED_ENTRY))), interfaceName); } return TypeAccessBuilder.builder() .setType(UnresolvedInterfaceDeclarationBuilder.builder().setName(interfaceName).build()).build(); } /** * Create a type access associated to an exception * * @param exceptionName * the exception name which we want a type access. * @return the created type access associated to the specified exception * name. */ public static TypeAccess createExceptionTypeAccess(String exceptionName) { if (exceptionName.contains(TypeAccessHelper.PARAMETRIZED_ENTRY)) { return TypeAccessHelper.createParameterizedType( TypeAccessHelper.createExceptionTypeAccess(exceptionName.substring(0, exceptionName.indexOf(TypeAccessHelper.PARAMETRIZED_ENTRY))), exceptionName); } return TypeAccessBuilder.builder().setType(PrimitiveTypeBuilder.builder().setName(exceptionName).build()) .build(); } /** * Create a type access associated to an annotation * * @param element * the element which we associate the annotation. * @param packageName * the name of the package of the element. * @param annotationName * the name of the annotation. * @return the created type access associated to the specified annotation * name. */ public static TypeAccess createAnnotationTypeAccess(Element<?> element, String packageName, String annotationName) { Model model = ASTElementFinder.findModel(element.getDelegate()); JavaPackage javaPackage = PackageHelper.createPackage(model, packageName); AnnotationTypeDeclaration generatedAnnotation = null; Iterator<AbstractTypeDeclaration> declarationIterator = javaPackage.getDelegate().getOwnedElements().iterator(); while (declarationIterator.hasNext() && generatedAnnotation == null) { AbstractTypeDeclaration next = declarationIterator.next(); if (next instanceof AnnotationTypeDeclaration && annotationName.equals(next.getName())) { generatedAnnotation = (AnnotationTypeDeclaration) next; } } if (generatedAnnotation == null) { return TypeAccessBuilder .builder() .setType( AnnotationTypeDeclarationBuilder.builder().setName(annotationName) .setPackage(javaPackage.getDelegate()).setProxy(true).build()).build(); } return TypeAccessBuilder.builder().setType(generatedAnnotation).build(); } /** * Create a type access associated to an orphan annotation * * @param element * the element which we associate the orphan annotation. * @param fullyQualifiedName * the full qualified name of the orphan annotation. * @return the created type access associated to the specified orphan * annotation name. */ public static TypeAccess createOrphanAnnotationTypeAccess(Element<?> element, String fullyQualifiedName) { Model model = element == null ? null : ASTElementFinder.findModel(element.getDelegate()); UnresolvedAnnotationDeclaration annotation = null; if (model != null) { Iterator<Type> iterator = model.getOrphanTypes().iterator(); while (iterator.hasNext() && annotation == null) { Type orphanType = iterator.next(); if (orphanType instanceof UnresolvedAnnotationDeclaration && fullyQualifiedName.equals(orphanType.getName())) { annotation = (UnresolvedAnnotationDeclaration) orphanType; } } } if (annotation == null) { annotation = UnresolvedAnnotationDeclarationBuilder.builder().setName(fullyQualifiedName).build(); if (model != null) { model.getOrphanTypes().add(annotation); } } return TypeAccessBuilder.builder().setType(annotation).build(); } /** * Create a type associated to a class or an interface * * @param typeName * the type name which we want a type access. * @return the created type access associated to the specified type name. */ public static TypeAccess createTypeAccess(String typeName) { typeName = typeName.trim(); if (typeName.contains(TypeAccessHelper.ARRAY_ENTRY)) { return TypeAccessHelper.createArrayType( TypeAccessHelper.createTypeAccess(typeName.substring(0, typeName.indexOf(TypeAccessHelper.ARRAY_ENTRY))), typeName); } if (typeName.contains(TypeAccessHelper.PARAMETRIZED_ENTRY)) { return TypeAccessHelper.createParameterizedType( TypeAccessHelper.createTypeAccess(typeName.substring(0, typeName.indexOf(TypeAccessHelper.PARAMETRIZED_ENTRY))), typeName); } if (Character.isLowerCase(typeName.charAt(0)) && !typeName.contains(TypeAccessHelper.PACKAGE_SEPARATOR)) { return TypeAccessBuilder.builder().setType(PrimitiveTypeBuilder.builder().setName(typeName).build()) .build(); } return TypeAccessBuilder.builder().setType(UnresolvedTypeBuilder.builder().setName(typeName).build()).build(); } /** * Create an array type * * @param mainType * the main type of the array type. * @param name * the name of the array type. * @return the created type access associated to the specified array type. */ protected static TypeAccess createArrayType(TypeAccess mainType, String name) { int dimensions = 0; int index = 0; while ((index = name.indexOf(TypeAccessHelper.ARRAY_EXIT, index + 1)) != -1) { dimensions++; } return TypeAccessBuilder.builder() .setType(ArrayTypeBuilder.builder().setDimensions(dimensions).setElementType(mainType).build()).build(); } /** * Create a parameterized type * * @param mainType * the main type of the parameterized type. * @param name * the name of the parameterized type. * @return the created type access associated to the specified parameterized * type. */ protected static TypeAccess createParameterizedType(TypeAccess mainType, String name) { String[] arguments = name.substring(name.indexOf(TypeAccessHelper.PARAMETRIZED_ENTRY) + 1, name.length() - 1) .split(TypeAccessHelper.PARAMETRIZED_SEPARATOR); ParameterizedType parameterizedType = ParameterizedTypeBuilder.builder().setType(mainType).setName(name) .build(); EList<TypeAccess> argumentsList = parameterizedType.getTypeArguments(); for (String argument : arguments) { argumentsList.add(TypeAccessHelper.createTypeParametrizedArgument(argument)); } return TypeAccessBuilder.builder().setType(parameterizedType).build(); } /** * Create type for an argument of a parameterized type * * @param argument * the argument of the parameterized type in one string. * @return the created type for the specified argument of a parameterized * type. */ protected static TypeAccess createTypeParametrizedArgument(String argument) { String[] argumentParts = argument.trim().split("\\s+"); if (argumentParts.length >= 3) { if (TypeAccessHelper.WILD_CARD.equals(argumentParts[0])) { return TypeAccessBuilder .builder() .setType( WildCardTypeBuilder.builder() .setUpperBound(TypeAccessHelper.EXTENSION.equals(argumentParts[1])) .setBound(TypeAccessHelper.createClassTypeAccess(argumentParts[2])).build()) .build(); } return TypeAccessHelper.createClassTypeAccess(argumentParts[0]); } if (TypeAccessHelper.WILD_CARD.equals(argumentParts[0])) { TypeAccessBuilder.builder().setType(WildCardTypeBuilder.builder().build()).build(); } return TypeAccessHelper.createClassTypeAccess(argumentParts[0]); } }
awltech/eclipse-optimus
net.atos.optimus.m2m.javaxmi.parent/net.atos.optimus.m2m.javaxmi.operation/src/main/java/net/atos/optimus/m2m/javaxmi/operation/accesses/TypeAccessHelper.java
Java
lgpl-3.0
12,166
<!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_71) on Sun Nov 22 20:58:12 CET 2015 --> <meta http-equiv="Content-Type" content="text/html" charset="UTF-8"> <title>Serialized Form (ConcurrentMultiMap JavaDoc)</title> <meta name="date" content="2015-11-22"> <link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Serialized Form (ConcurrentMultiMap JavaDoc)"; } //--> </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="fr/nemolovich/apps/concurrentmultimap/package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li><a href="fr/nemolovich/apps/concurrentmultimap/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?serialized-form.html" target="_top">Frames</a></li> <li><a href="serialized-form.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 title="Serialized Form" class="title">Serialized Form</h1> </div> <div class="serializedFormContainer"> <ul class="blockList"> <li class="blockList"> <h2 title="Package">Package&nbsp;fr.nemolovich.apps.concurrentmultimap</h2> <ul class="blockList"> <li class="blockList"><a name="fr.nemolovich.apps.concurrentmultimap.ConcurrentMultiMap"> <!-- --> </a> <h3>Class <a href="fr/nemolovich/apps/concurrentmultimap/ConcurrentMultiMap.html" title="class in fr.nemolovich.apps.concurrentmultimap">fr.nemolovich.apps.concurrentmultimap.ConcurrentMultiMap</a> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1952840811318580407L</dd> </dl> <ul class="blockList"> <li class="blockList"><a name="serializedForm"> <!-- --> </a> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>keys</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true" title="class or interface in java.util.concurrent">ConcurrentHashMap</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true" title="class or interface in java.util.concurrent">K</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true" title="class or interface in java.util.concurrent">V</a>&gt; keys</pre> </li> <li class="blockListLast"> <h4>values</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true" title="class or interface in java.util.concurrent">ConcurrentHashMap</a>&lt;<a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true" title="class or interface in java.util.concurrent">K</a>,<a href="http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html?is-external=true" title="class or interface in java.util.concurrent">V</a>&gt; values</pre> </li> </ul> </li> </ul> </li> <li class="blockList"><a name="fr.nemolovich.apps.concurrentmultimap.ImmutableMultiMapEntry"> <!-- --> </a> <h3>Class <a href="fr/nemolovich/apps/concurrentmultimap/ImmutableMultiMapEntry.html" title="class in fr.nemolovich.apps.concurrentmultimap">fr.nemolovich.apps.concurrentmultimap.ImmutableMultiMapEntry</a> extends <a href="fr/nemolovich/apps/concurrentmultimap/MultiMapEntry.html" title="class in fr.nemolovich.apps.concurrentmultimap">MultiMapEntry</a>&lt;<a href="fr/nemolovich/apps/concurrentmultimap/ImmutableMultiMapEntry.html" title="type parameter in ImmutableMultiMapEntry">K</a>,<a href="fr/nemolovich/apps/concurrentmultimap/ImmutableMultiMapEntry.html" title="type parameter in ImmutableMultiMapEntry">V</a>&gt; implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>3910883128162245898L</dd> </dl> </li> <li class="blockList"><a name="fr.nemolovich.apps.concurrentmultimap.MultiMapEntry"> <!-- --> </a> <h3>Class <a href="fr/nemolovich/apps/concurrentmultimap/MultiMapEntry.html" title="class in fr.nemolovich.apps.concurrentmultimap">fr.nemolovich.apps.concurrentmultimap.MultiMapEntry</a> extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> implements Serializable</h3> <dl class="nameValue"> <dt>serialVersionUID:</dt> <dd>1503845102686034755L</dd> </dl> <ul class="blockList"> <li class="blockList"><a name="serializedForm"> <!-- --> </a> <h3>Serialized Fields</h3> <ul class="blockList"> <li class="blockList"> <h4>key</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> key</pre> </li> <li class="blockListLast"> <h4>value</h4> <pre><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value</pre> </li> </ul> </li> </ul> </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="fr/nemolovich/apps/concurrentmultimap/package-summary.html">Package</a></li> <li>Class</li> <li>Use</li> <li><a href="fr/nemolovich/apps/concurrentmultimap/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?serialized-form.html" target="_top">Frames</a></li> <li><a href="serialized-form.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2015. All rights reserved.</small></p> </body> </html>
nemolovich/CommonUtils
site/concurrent-multi-map/apidocs/serialized-form.html
HTML
lgpl-3.0
7,893
/* * SonarLint for Visual Studio * Copyright (C) 2016-2022 SonarSource SA * mailto:info AT sonarsource DOT com * * This program 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. * * 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ using System; using System.Collections.Generic; using System.ComponentModel.Composition; using System.Linq; using SonarLint.VisualStudio.IssueVisualization.Models; using SonarLint.VisualStudio.IssueVisualization.Security.Hotspots.Models; using SonarLint.VisualStudio.IssueVisualization.Security.IssuesStore; namespace SonarLint.VisualStudio.IssueVisualization.Security.Hotspots { internal interface IHotspotsStore : IIssuesStore { /// <summary> /// Adds a given visualization to the list if it does not already exist. /// Returns the given visualization, or the existing visualization with the same hotspot key. /// </summary> IAnalysisIssueVisualization GetOrAdd(IAnalysisIssueVisualization hotspotViz); void Remove(IAnalysisIssueVisualization hotspotViz); } [Export(typeof(IHotspotsStore))] [Export(typeof(IIssuesStore))] [PartCreationPolicy(CreationPolicy.Shared)] internal sealed class HotspotsStore : IHotspotsStore { private readonly List<IAnalysisIssueVisualization> hotspots = new List<IAnalysisIssueVisualization>(); public IReadOnlyCollection<IAnalysisIssueVisualization> GetAll() => hotspots; public event EventHandler<IssuesChangedEventArgs> IssuesChanged; public IAnalysisIssueVisualization GetOrAdd(IAnalysisIssueVisualization hotspotViz) { var existingHotspot = FindExisting(hotspotViz); if (existingHotspot != null) { return existingHotspot; } hotspots.Add(hotspotViz); NotifyIssuesChanged(new IssuesChangedEventArgs( Array.Empty<IAnalysisIssueVisualization>(), new[] {hotspotViz})); return hotspotViz; } public void Remove(IAnalysisIssueVisualization hotspotViz) { hotspots.Remove(hotspotViz); NotifyIssuesChanged(new IssuesChangedEventArgs( new[] {hotspotViz}, Array.Empty<IAnalysisIssueVisualization>())); } private IAnalysisIssueVisualization FindExisting(IAnalysisIssueVisualization hotspotViz) { var key = ((IHotspot)hotspotViz.Issue).HotspotKey; return hotspots.FirstOrDefault(x => ((IHotspot)x.Issue).HotspotKey == key); } private void NotifyIssuesChanged(IssuesChangedEventArgs args) { IssuesChanged?.Invoke(this, args); } } }
SonarSource/sonarlint-visualstudio
src/IssueViz.Security/Hotspots/HotspotsStore.cs
C#
lgpl-3.0
3,360
#include "opp-transport.hpp" #include "daemon/face/face.hpp" #include "daemon/face/transport.hpp" #include "ndn-cxx/util/face-uri.hpp" #include "ndn-cxx/encoding/tlv.hpp" namespace nfd { namespace face { NFD_LOG_INIT("OppTransport"); OppTransport::OppTransport(const FaceUri& uri) : Transport() { this->setLocalUri(uri); this->setRemoteUri(uri); this->setState(nfd::face::TransportState::DOWN); this->setScope(ndn::nfd::FACE_SCOPE_NON_LOCAL); this->setPersistency(ndn::nfd::FacePersistency::FACE_PERSISTENCY_PERMANENT); this->setLinkType(ndn::nfd::LINK_TYPE_POINT_TO_POINT); this->setMtu(MTU_UNLIMITED); } // Used to change the state of this OppTransport. When the state changes to UP, we need to start // the process of sending out the packets that are currently queued. void OppTransport::commuteState(TransportState newState) { NFD_LOG_DEBUG("Commuting state."); this->setState(newState); if(newState == TransportState::UP) sendNextPacket(); } // When the OppTransport closes. Part of the Transport interface. void OppTransport::doClose() { // This is the result of an explicit close. Allow current packet transmission to complete ? // Disallow new sends to occur through this Face but empty the queue if possible. this->close(); } // Initiates the sending of the next pending packet. void OppTransport::sendNextPacket() { if(!m_sendQueue.empty()) performSend(this->getFace()->getId(), m_sendQueue.front().packet); else NFD_LOG_DEBUG("Queue empty."); } void OppTransport::removePacket(uint32_t nonce) { std::deque<Packet>::iterator it = find_if(m_sendQueue.begin(), m_sendQueue.end(), [&nonce] (const Packet &current) { // Only Interest packets have a Nonce. Ignore Data packets. if(current.packet.type() != ndn::tlv::Interest) return false; uint32_t currentNonce; Block encodedNonce = current.packet.get(ndn::tlv::Nonce); if (encodedNonce.value_size() == sizeof(uint32_t)) currentNonce = *reinterpret_cast<const uint32_t*>(encodedNonce.value()); else { currentNonce = readNonNegativeInteger(encodedNonce); } NFD_LOG_DEBUG("Packet with Nonce " << currentNonce << " " << nonce); return (nonce == currentNonce); }); if(it != m_sendQueue.end()) { NFD_LOG_INFO("Found pending packet in " << getFace()->getId()); m_sendQueue.erase(it); } } int OppTransport::getQueueSize() { return m_sendQueue.size(); } void OppTransport::onSendComplete(bool succeeded) { NFD_LOG_INFO("onSendComplete. Succeeded ? " << succeeded); if(succeeded) { m_sendQueue.pop_front(); sendNextPacket(); } else NFD_LOG_DEBUG("Packet sending failed."); } void OppTransport::doSend(Packet&& packet) { NFD_LOG_INFO("doSend " << getFace()->getId()); //if(packet.packet.type() == ndn::tlv::Interest) m_sendQueue.push_back(packet); //else if (packet.packet.type() == ndn::tlv::Data) // m_dataQueue.push_back(packet); TransportState currently = this->getState(); if(currently == TransportState::UP && m_sendQueue.size() == 1) { NFD_LOG_INFO("Transport is UP. Sending."); sendNextPacket(); } else if(currently == TransportState::DOWN) NFD_LOG_INFO("Transport is DOWN. Queuing."); } void OppTransport::handleReceive(const uint8_t *buffer, size_t buf_size) { NFD_LOG_DEBUG("Received: " << buf_size << " bytes"); bool isOk = true; Block element(buffer, buf_size); NFD_LOG_DEBUG("Performing actual receive of a Block of " << element.size() << " bytes"); this->receive(Transport::Packet(std::move(element))); } void OppTransport::afterChangePersistency(ndn::nfd::FacePersistency oldP) { NFD_LOG_INFO("AfterChangePersistency ignored."); } } // namespace face } // namespace nfd
COPELABS-SITI/nfd-android
app/src/main/jni/android/ndn-fwd/daemon/face/opp-transport.cpp
C++
lgpl-3.0
3,901
<!doctype html> <html lang="en"> <head> <title>jQuery UI Sortable - Connect lists</title> <link type="text/css" href="../../themes/base/ui.all.css" rel="stylesheet"/> <script type="text/javascript" src="../../jquery-1.3.2.js"></script> <script type="text/javascript" src="../../ui/ui.core.js"></script> <script type="text/javascript" src="../../ui/ui.sortable.js"></script> <link type="text/css" href="../demos.css" rel="stylesheet"/> <style type="text/css"> #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; } #sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 120px; } </style> <script type="text/javascript"> $(function () { $("#sortable1, #sortable2").sortable({ connectWith: '.connectedSortable' }).disableSelection(); }); </script> </head> <body> <div class="demo"> <ul id="sortable1" class="connectedSortable"> <li class="ui-state-default">Item 1</li> <li class="ui-state-default">Item 2</li> <li class="ui-state-default">Item 3</li> <li class="ui-state-default">Item 4</li> <li class="ui-state-default">Item 5</li> </ul> <ul id="sortable2" class="connectedSortable"> <li class="ui-state-highlight">Item 1</li> <li class="ui-state-highlight">Item 2</li> <li class="ui-state-highlight">Item 3</li> <li class="ui-state-highlight">Item 4</li> <li class="ui-state-highlight">Item 5</li> </ul> </div> <!-- End demo --> <div class="demo-description"> <p> Sort items from one list into another and vice versa, by passing a selector into the <code>connectWith</code> option. The simplest way to do this is to group all related lists with a CSS class, and then pass that class into the sortable function (i.e., <code>connectWith: '.myclass'</code>). </p> </div> <!-- End demo-description --> </body> </html>
wgq91here/Fab-2
protected/modules/fab/assets/ui/development-bundle/demos/sortable/connect-lists.html
HTML
lgpl-3.0
2,182
package com.app.wms.web.controller; import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.mvc.multiaction.MultiActionController; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.math.*; import java.util.Date; import java.util.HashMap; import java.util.List; import com.app.web.engine.search.WarehouseSearch; import com.app.wms.engine.db.dao.*; import com.app.wms.engine.db.dto.*; import com.app.wms.engine.db.dto.map.LoginUser; import com.app.wms.engine.db.factory.*; import com.app.wms.engine.util.DroplistModel; import com.app.wms.web.util.AppConstant; public class WhController extends MultiActionController { /** * Method 'findByPrimaryKey' * * @param request * @param response * @throws Exception * @return ModelAndView */ public ModelAndView findByPrimaryKey(HttpServletRequest request, HttpServletResponse response) throws Exception { try { HashMap m = null; final String mode = request.getParameter("mode"); if (mode != null && mode.equals("edit")) { m = this.getModelByPrimaryKey(request); m.put("mode", "edit"); System.out.println("m ="+m); return new ModelAndView("1_setup/WarehouseEdit", "model", m); } else { m = this.searchAndPaging(request, response); return new ModelAndView("1_setup/WarehouseList", "model", m); } } catch (Throwable e) { e.printStackTrace(); return new ModelAndView( "Error", "th", e ); } } private HashMap searchAndPaging(HttpServletRequest request, HttpServletResponse response) throws Exception { try { HashMap m = new HashMap(); Integer page = null; Integer paging = null; if (request.getParameter("page") != null) { page = Integer.parseInt(request.getParameter("page")); } if (request.getParameter("paging") != null) { paging = Integer.parseInt(request.getParameter("paging")); } if (page == null) { page = 1; } if (paging == null) { paging = 10; } int start = (page - 1) * paging + 1; int end = start + paging - 1; /* WarehouseSearch c = null; if (request.getParameter("btnViewAll") != null) { request.getSession().setAttribute("WarehouseSearch", null); } else if (request.getParameter("btnSearch") != null) { System.out.println("create new search session"); c = new WarehouseSearch(); c.setWhCode(request.getParameter("whCode")); c.setName(request.getParameter("name")); request.getSession().setAttribute("WarehouseSearch", c); } else if (request.getSession().getAttribute("WarehouseSearch") != null) { System.out.println("use previous search session"); c = (WarehouseSearch) request.getSession().getAttribute("WarehouseSearch"); } else { // no criteria } */ WarehouseSearch c = new WarehouseSearch(); c = new WarehouseSearch(); c.setWhCode(request.getParameter("whCode")); c.setName(request.getParameter("name")); request.getSession().setAttribute("WarehouseSearch", c); WhDao dao = DaoFactory.createWhDao(); List<Wh> listSearchPage = dao.findWhPaging(c,page); int total = 2000; m.put("wh", listSearchPage); m.put("totalRows", total); m.put("page", page); m.put("paging", paging); return m; } catch (Exception e) { throw e; } } private HashMap getModelByPrimaryKey(HttpServletRequest request) throws Exception { try { LoginUser lu = (LoginUser) request.getSession().getAttribute("user"); String whCode = request.getParameter("whCode"); WhDao dao = DaoFactory.createWhDao(); Wh dto = null; String mode = request.getParameter("mode"); if (mode != null && mode.equals("edit")) { dto = dao.findByPrimaryKey(whCode); } if (dto == null) { dto = new Wh(); dto.setCorpId(""); dto.setCode(""); dto.setName(""); dto.setRegion(""); dto.setIsActive(request.getParameter("isActive")); dto.setIsDelete("N"); } CorporateDao corporateDao = DaoFactory.createCorporateDao(); List<Corporate> corporates = corporateDao.findAll(); CityDao cdao = DaoFactory.createCityDao(); List<City> city = cdao.findAll(); HashMap m = new HashMap(); m.put("city", city); m.put("corporates", corporates); m.put("dto", dto); return m; } catch (Exception e) { throw e; } } public ModelAndView inactivate(HttpServletRequest request, HttpServletResponse response) throws Exception { java.lang.String whCode = request.getParameter("whCode"); LoginUser lu = (LoginUser) request.getSession().getAttribute("user"); String pcreatedBy = (String)lu.getUserId(); WhDao dao = DaoFactory.createWhDao(); Wh dto = dao.findByPrimaryKey(whCode); if (dto != null) { dto.setIsActive(AppConstant.STATUS_FALSE); dto.setUpdatedBy(pcreatedBy); dto.setUpdatedDate(new java.util.Date()); dao.update(dto.createPk(), dto); } HashMap m = this.searchAndPaging(request, response); return new ModelAndView("1_setup/WarehouseList", "model", m); } /** * Method 'findAll' * * @param request * @param response * @throws Exception * @return ModelAndView */ public ModelAndView findAll(HttpServletRequest request, HttpServletResponse response) throws Exception { try { WhDao dao = DaoFactory.createWhDao(); List<Wh> dto = dao.findAll(); return new ModelAndView( "1_setup/WarehouseList", "result", dto ); } catch (Throwable e) { e.printStackTrace(); return new ModelAndView( "Error", "th", e ); } } /** * Method 'findWhereWhCodeEquals' * * @param request * @param response * @throws Exception * @return ModelAndView */ public ModelAndView findWhereWhCodeEquals(HttpServletRequest request, HttpServletResponse response) throws Exception { try { // parse parameters java.lang.String pwhCode = request.getParameter("whCode"); // create the DAO class WhDao dao = DaoFactory.createWhDao(); // execute the finder List<Wh> dto = dao.findWhereWhCodeEquals(pwhCode); return new ModelAndView( "1_setup/WarehouseList", "result", dto ); } catch (Throwable e) { e.printStackTrace(); return new ModelAndView( "Error", "th", e ); } } /** * Method 'findWhereNameEquals' * * @param request * @param response * @throws Exception * @return ModelAndView */ public ModelAndView findWhereNameEquals(HttpServletRequest request, HttpServletResponse response) throws Exception { try { // parse parameters java.lang.String pname = request.getParameter("name"); // create the DAO class WhDao dao = DaoFactory.createWhDao(); // execute the finder List<Wh> dto = dao.findWhereNameEquals(pname); return new ModelAndView( "1_setup/WarehouseList", "result", dto ); } catch (Throwable e) { e.printStackTrace(); return new ModelAndView( "Error", "th", e ); } } /** * Method 'create' * * @param request * @param response * @throws Exception * @return ModelAndView */ public ModelAndView create(HttpServletRequest request, HttpServletResponse response) throws Exception { HashMap m = this.getModelByPrimaryKey(request); m = this.getModelByPrimaryKey(request); CorporateDao corporateDao = DaoFactory.createCorporateDao(); List<Corporate> corporates = corporateDao.findAll(); CityDao dao = DaoFactory.createCityDao(); List<City> city = dao.findAll(); m.put("city", city); m.put("corporates", corporates); m.put("mode", "create"); return new ModelAndView( "1_setup/WarehouseAdd", "model", m); } /** * Method 'save' * * @param request * @param response * @throws Exception * @return ModelAndView */ public ModelAndView save(HttpServletRequest request, HttpServletResponse response) throws Exception { boolean isCreate = true; String strError = ""; Date now = new Date(); java.lang.String mode = request.getParameter("mode"); Wh dto = null; try { if (mode.equalsIgnoreCase("create")) { isCreate = true; } else { isCreate = false; } String whCode = request.getParameter("whCode"); WhDao dao = DaoFactory.createWhDao(); if (isCreate) { dto = new Wh(); } else { dto = dao.findByPrimaryKey(whCode); } /* String code = request.getParameter("code"); if (code.trim().isEmpty()) { strError += "Warehouse Code Cannot be Empty!" + AppConstant.EOL; } List<Wh> tmpWh = dao.findWhereCodeEquals(code); if ((isCreate && tmpWh != null && tmpWh.size() > 0) || (!isCreate && tmpWh != null && tmpWh.size() > 0 && !tmpWh.get(0).getWhCode().equals(whCode))) { strError += "Warehouse Code Already Existed!" + AppConstant.EOL; } */ java.lang.String pname = request.getParameter("name"); if (pname.trim().isEmpty()) { strError += "Name Cannot be Empty!" + AppConstant.EOL; } java.lang.String region = request.getParameter("region"); /* if (region.trim().isEmpty()) { strError += "Region Cannot be Empty!" + AppConstant.EOL; } */ String corpId = request.getParameter("corpId"); java.lang.String pisActive = request.getParameter("isActive"); LoginUser lu = (LoginUser) request.getSession().getAttribute("user"); String userId = (String)lu.getUserId(); if (isCreate) { dto.setCreatedBy(userId); dto.setCreatedDate(now); } dto.setCode(""); dto.setName(pname); dto.setRegion(region); dto.setCorpId(corpId); dto.setIsActive(pisActive); dto.setIsDelete("N"); dto.setUpdatedBy(userId); dto.setUpdatedDate(now); if (strError.length() > 0) { throw new Exception(strError); } if (isCreate) { // dto.setWhCode(code); dao.insert(dto); } else { //dto.setIsActive(pisActive); dto.setUpdatedBy(userId); dto.setUpdatedDate(new java.util.Date()); dao.update(dto.createPk(), dto); } // System.out.println("dto ="+dto); return new ModelAndView("1_setup/WarehouseView", "dto", dto); /* } catch (org.springframework.dao.DataIntegrityViolationException e) { String errorMsg = "Unique Key Constraint [Code, Name]!" + AppConstant.EOL; HashMap m = this.getModelByPrimaryKey(request); m.put("dto", dto); m.put("mode", mode); m.put("msg", errorMsg); System.out.println(errorMsg); if (isCreate) { return new ModelAndView("1_setup/WarehouseAdd", "model", m); } else { return new ModelAndView("1_setup/WarehouseEdit", "model", m); } */ } catch (Exception e) { e.printStackTrace(); String errorMsg = e.getMessage(); HashMap m = this.getModelByPrimaryKey(request); m.put("mode", mode); m.put("msg", errorMsg); if (isCreate) { return new ModelAndView("1_setup/WarehouseAdd", "model", m); } else { return new ModelAndView("1_setup/WarehouseEdit", "model", m); } } } }
rmage/gnvc-ims
src/java/com/app/wms/web/controller/WhController.java
Java
lgpl-3.0
12,592
/** * Copyright (C) 2005-2015 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco 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. * * Alfresco 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 Alfresco. If not, see <http://www.gnu.org/licenses/>. */ /** * @module alfresco/forms/controls/NumberSpinner * @extends module:alfresco/forms/controls/BaseFormControl * @author Dave Draper */ define(["alfresco/forms/controls/BaseFormControl", "alfresco/forms/controls/utilities/TextBoxValueChangeMixin", "dojo/_base/declare", "dojo/_base/lang", "dijit/form/NumberSpinner", "alfresco/core/ObjectTypeUtils"], function(BaseFormControl, TextBoxValueChangeMixin, declare, lang, NumberSpinner, ObjectTypeUtils) { return declare([BaseFormControl, TextBoxValueChangeMixin], { /** * This is the amount the value will be changed when using the "spin" controls * * @instance * @type {number} * @default 1 */ delta: 1, /** * This is the minimum allowed number * * @instance * @type {number} * @default */ min: null, /** * This is the maximum allowed number * * @instance * @type {number} * @default */ max: null, /** * By default, this control can only be valid when it contains a numerical value. If this configuration * property is set to true, then it will be possible to submit a form without any value in this control, * at which point its value will be submitted as null. * * @instance * @type {boolean} * @default */ permitEmpty: false, /** * Returns the configuration for the widget ensuring that it is valid, in that * [min]{@link module:alfresco/forms/controls/NumberSpinner#min} and * [max]{@link module:alfresco/forms/controls/NumberSpinner#max} but both be numerical values and * that [min]{@link module:alfresco/forms/controls/NumberSpinner#min} cannot be greater * than [max]{@link module:alfresco/forms/controls/NumberSpinner#max}. * * @instance */ getWidgetConfig: function alfresco_forms_controls_NumberSpinner__getWidgetConfig() { if (isNaN(this.min)) { this.min = null; } if (isNaN(this.max)) { this.max = null; } if ((this.min || this.min === 0) && (this.max || this.max === 0) && (this.max < this.min)) { this.alfLog("warn", "The minimum allowed value is larger than the maxium allowed value, so constraints will be ignored", this); this.max = null; this.min = null; } this.configureValidation(); return { id : this.generateUuid(), intermediateChanges: true, name: this.name, smallDelta: this.delta, constraints: { min: this.min, max: this.max, places: 0 } }; }, /** * This validator checks that the value provided is a number * * @instance * @param {object} validationConfig The configuration for this validator */ isNumberValidator: function alfresco_forms_controls_FormControlValidationMixin__isNumberValidator(validationConfig) { try { // See AKU-341 for details of why we handle commas and spaces... var value = this.wrappedWidget.textbox.value.replace(",","").replace(" ",""); var parsedValue = parseFloat(value); var isValid = !isNaN(parsedValue) || (this.permitEmpty && lang.trim(value) === ""); this.reportValidationResult(validationConfig, isValid); } catch(e) { this.reportValidationResult(validationConfig, false); } }, /** * This function is used to set or update the validationConfig as required based on the * [min]{@link module:alfresco/forms/controls/NumberSpinner#min} and * [max]{@link module:alfresco/forms/controls/NumberSpinner#max} configuration. * * @instance */ configureValidation: function alfresco_forms_controls_NumberSpinner__configureValidation() { if (!this.validationConfig || ObjectTypeUtils.isObject(this.validationConfig)) { this.validationConfig = []; } this.validationConfig.push({ validation: "isNumberValidator", errorMessage: this.message("formValidation.numerical.error") }); if (this.min || this.min === 0 || this.max || this.max === 0) { var errorMessage; if (!this.max && this.max !== 0) { errorMessage = this.message("formValidation.numericalRange.min.error", { 0: this.min }); } else if (!this.min && this.min !== 0) { errorMessage = this.message("formValidation.numericalRange.max.error", { 0: this.max }); } else { errorMessage = this.message("formValidation.numericalRange.error", { 0: this.min, 1: this.max }); } this.validationConfig.push({ validation: "numericalRange", min: this.min, max: this.max, errorMessage: errorMessage }); } }, /** * Creates a new instance of a dijit/form/NumberSpinner as the wrapped form control. * * @instance */ createFormControl: function alfresco_forms_controls_NumberSpinner__createFormControl(config, /*jshint unused:false*/ domNode) { var ns = new NumberSpinner(config); // We'll take care of the validation thanks very much! ns.isValid = function() { return true; }; ns.onChange = lang.hitch(this, this.validate); return ns; }, /** * Extends the [inherited function]{@link module:alfresco/forms/controls/BaseFormControl#setValue} to ensure * that only valid values can be set. Values must be numbers and must not be less than the minimum allowed * value nor greater than the maximum allowed value. * * @instance * @param {object} value The value to set. */ setValue: function alfresco_forms_controls_NumberSpinner__setValue(value) { if (isNaN(value)) { value = 0; } if ((this.min || this.min === 0) && value < this.min) { value = this.min; } if ((this.max || this.max === 0) && value > this.max) { value = this.max; } this.inherited(arguments); } }); });
viqsoft/Aikau
aikau/src/main/resources/alfresco/forms/controls/NumberSpinner.js
JavaScript
lgpl-3.0
7,431
/******************************************************************************* * Copyright (C) 2014 Stefan Schroeder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ package jsprit.core.algorithm.io; import jsprit.core.algorithm.*; import jsprit.core.algorithm.acceptor.*; import jsprit.core.algorithm.io.VehicleRoutingAlgorithms.TypedMap.*; import jsprit.core.algorithm.listener.AlgorithmEndsListener; import jsprit.core.algorithm.listener.VehicleRoutingAlgorithmListeners.PrioritizedVRAListener; import jsprit.core.algorithm.listener.VehicleRoutingAlgorithmListeners.Priority; import jsprit.core.algorithm.module.RuinAndRecreateModule; import jsprit.core.algorithm.recreate.InsertionStrategy; import jsprit.core.algorithm.recreate.listener.InsertionListener; import jsprit.core.algorithm.ruin.RadialRuinStrategyFactory; import jsprit.core.algorithm.ruin.RandomRuinStrategyFactory; import jsprit.core.algorithm.ruin.RuinStrategy; import jsprit.core.algorithm.ruin.distance.AvgServiceAndShipmentDistance; import jsprit.core.algorithm.ruin.distance.JobDistance; import jsprit.core.algorithm.selector.SelectBest; import jsprit.core.algorithm.selector.SelectRandomly; import jsprit.core.algorithm.selector.SolutionSelector; import jsprit.core.algorithm.state.*; import jsprit.core.algorithm.termination.IterationWithoutImprovementTermination; import jsprit.core.algorithm.termination.PrematureAlgorithmTermination; import jsprit.core.algorithm.termination.TimeTermination; import jsprit.core.algorithm.termination.VariationCoefficientTermination; import jsprit.core.problem.VehicleRoutingProblem; import jsprit.core.problem.VehicleRoutingProblem.FleetSize; import jsprit.core.problem.constraint.ConstraintManager; import jsprit.core.problem.solution.SolutionCostCalculator; import jsprit.core.problem.solution.VehicleRoutingProblemSolution; import jsprit.core.problem.solution.route.VehicleRoute; import jsprit.core.problem.solution.route.activity.End; import jsprit.core.problem.solution.route.activity.ReverseActivityVisitor; import jsprit.core.problem.solution.route.activity.TourActivity; import jsprit.core.problem.vehicle.*; import jsprit.core.util.ActivityTimeTracker; import org.apache.commons.configuration.HierarchicalConfiguration; import org.apache.commons.configuration.XMLConfiguration; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import java.lang.Thread.UncaughtExceptionHandler; import java.net.URL; import java.util.*; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class VehicleRoutingAlgorithms { static class TypedMap { static interface AbstractKey<K> { Class<K> getType(); } static class AcceptorKey implements AbstractKey<SolutionAcceptor> { private ModKey modKey; public AcceptorKey(ModKey modKey) { super(); this.modKey = modKey; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((modKey == null) ? 0 : modKey.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (!(obj instanceof AcceptorKey)) return false; AcceptorKey other = (AcceptorKey) obj; if (modKey == null) { if (other.modKey != null) return false; } else if (!modKey.equals(other.modKey)) return false; return true; } @Override public Class<SolutionAcceptor> getType() { return SolutionAcceptor.class; } } static class SelectorKey implements AbstractKey<SolutionSelector> { private ModKey modKey; public SelectorKey(ModKey modKey) { super(); this.modKey = modKey; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((modKey == null) ? 0 : modKey.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SelectorKey other = (SelectorKey) obj; if (modKey == null) { if (other.modKey != null) return false; } else if (!modKey.equals(other.modKey)) return false; return true; } @Override public Class<SolutionSelector> getType() { return SolutionSelector.class; } } static class StrategyModuleKey implements AbstractKey<SearchStrategyModule> { private ModKey modKey; public StrategyModuleKey(ModKey modKey) { super(); this.modKey = modKey; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((modKey == null) ? 0 : modKey.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; StrategyModuleKey other = (StrategyModuleKey) obj; if (modKey == null) { if (other.modKey != null) return false; } else if (!modKey.equals(other.modKey)) return false; return true; } @Override public Class<SearchStrategyModule> getType() { return SearchStrategyModule.class; } } static class RuinStrategyKey implements AbstractKey<RuinStrategy> { private ModKey modKey; public RuinStrategyKey(ModKey modKey) { super(); this.modKey = modKey; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((modKey == null) ? 0 : modKey.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; RuinStrategyKey other = (RuinStrategyKey) obj; if (modKey == null) { if (other.modKey != null) return false; } else if (!modKey.equals(other.modKey)) return false; return true; } @Override public Class<RuinStrategy> getType() { return RuinStrategy.class; } } static class InsertionStrategyKey implements AbstractKey<InsertionStrategy> { private ModKey modKey; public InsertionStrategyKey(ModKey modKey) { super(); this.modKey = modKey; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((modKey == null) ? 0 : modKey.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; InsertionStrategyKey other = (InsertionStrategyKey) obj; if (modKey == null) { if (other.modKey != null) return false; } else if (!modKey.equals(other.modKey)) return false; return true; } @Override public Class<InsertionStrategy> getType() { return InsertionStrategy.class; } } private Map<AbstractKey<?>, Object> map = new HashMap<AbstractKey<?>, Object>(); public <T> T get(AbstractKey<T> key) { if (map.get(key) == null) return null; return key.getType().cast(map.get(key)); } public <T> T put(AbstractKey<T> key, T value) { return key.getType().cast(map.put(key, key.getType().cast(value))); } public Set<AbstractKey<?>> keySet() { return map.keySet(); } } static class ModKey { private String name; private String id; public ModKey(String name, String id) { super(); this.name = name; this.id = id; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; ModKey other = (ModKey) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (name == null) { if (other.name != null) return false; } else if (!name.equals(other.name)) return false; return true; } } private static Logger log = LogManager.getLogger(VehicleRoutingAlgorithms.class.getName()); private VehicleRoutingAlgorithms() { } /** * Creates a {@link jsprit.core.algorithm.VehicleRoutingAlgorithm} from a AlgorithConfig based on the input vrp. * * @param vrp the routing problem * @param algorithmConfig the algorithm config * @return {@link jsprit.core.algorithm.VehicleRoutingAlgorithm} */ public static VehicleRoutingAlgorithm createAlgorithm(final VehicleRoutingProblem vrp, final AlgorithmConfig algorithmConfig) { return createAlgo(vrp, algorithmConfig.getXMLConfiguration(), 0, null); } public static VehicleRoutingAlgorithm createAlgorithm(final VehicleRoutingProblem vrp, int nThreads, final AlgorithmConfig algorithmConfig) { return createAlgo(vrp, algorithmConfig.getXMLConfiguration(), nThreads, null); } /** * Read and creates a {@link VehicleRoutingAlgorithm} from an url. * * @param vrp the routing problem * @param configURL config url * @return {@link jsprit.core.algorithm.VehicleRoutingAlgorithm} */ public static VehicleRoutingAlgorithm readAndCreateAlgorithm(final VehicleRoutingProblem vrp, final URL configURL) { AlgorithmConfig algorithmConfig = new AlgorithmConfig(); AlgorithmConfigXmlReader xmlReader = new AlgorithmConfigXmlReader(algorithmConfig); xmlReader.read(configURL); return createAlgo(vrp, algorithmConfig.getXMLConfiguration(), 0, null); } public static VehicleRoutingAlgorithm readAndCreateAlgorithm(final VehicleRoutingProblem vrp, int nThreads, final URL configURL) { AlgorithmConfig algorithmConfig = new AlgorithmConfig(); AlgorithmConfigXmlReader xmlReader = new AlgorithmConfigXmlReader(algorithmConfig); xmlReader.read(configURL); return createAlgo(vrp, algorithmConfig.getXMLConfiguration(), nThreads, null); } /** * Read and creates {@link jsprit.core.problem.VehicleRoutingProblem} from config-file. * * @param vrp the routing problem * @param configFileName the config filename (and location) * @return {@link jsprit.core.algorithm.VehicleRoutingAlgorithm} */ public static VehicleRoutingAlgorithm readAndCreateAlgorithm(final VehicleRoutingProblem vrp, final String configFileName) { AlgorithmConfig algorithmConfig = new AlgorithmConfig(); AlgorithmConfigXmlReader xmlReader = new AlgorithmConfigXmlReader(algorithmConfig); xmlReader.read(configFileName); return createAlgo(vrp, algorithmConfig.getXMLConfiguration(), 0, null); } public static VehicleRoutingAlgorithm readAndCreateAlgorithm(final VehicleRoutingProblem vrp, final String configFileName, StateManager stateManager) { AlgorithmConfig algorithmConfig = new AlgorithmConfig(); AlgorithmConfigXmlReader xmlReader = new AlgorithmConfigXmlReader(algorithmConfig); xmlReader.read(configFileName); return createAlgo(vrp, algorithmConfig.getXMLConfiguration(), 0, stateManager); } public static VehicleRoutingAlgorithm readAndCreateAlgorithm(final VehicleRoutingProblem vrp, int nThreads, final String configFileName, StateManager stateManager) { AlgorithmConfig algorithmConfig = new AlgorithmConfig(); AlgorithmConfigXmlReader xmlReader = new AlgorithmConfigXmlReader(algorithmConfig); xmlReader.read(configFileName); return createAlgo(vrp, algorithmConfig.getXMLConfiguration(), nThreads, stateManager); } public static VehicleRoutingAlgorithm readAndCreateAlgorithm(VehicleRoutingProblem vrp, int nThreads, String configFileName) { AlgorithmConfig algorithmConfig = new AlgorithmConfig(); AlgorithmConfigXmlReader xmlReader = new AlgorithmConfigXmlReader(algorithmConfig); xmlReader.read(configFileName); return createAlgo(vrp, algorithmConfig.getXMLConfiguration(), nThreads, null); } private static class OpenRouteStateVerifier implements StateUpdater, ReverseActivityVisitor { private End end; private boolean firstAct = true; private Vehicle vehicle; @Override public void begin(VehicleRoute route) { end = route.getEnd(); vehicle = route.getVehicle(); } @Override public void visit(TourActivity activity) { if (firstAct) { firstAct = false; if (!vehicle.isReturnToDepot()) { assert activity.getLocation().getId().equals(end.getLocation().getId()) : "route end and last activity are not equal even route is open. this should not be."; } } } @Override public void finish() { firstAct = true; } } private static VehicleRoutingAlgorithm createAlgo(final VehicleRoutingProblem vrp, XMLConfiguration config, int nuOfThreads, StateManager stateMan) { //create state-manager final StateManager stateManager; if (stateMan != null) { stateManager = stateMan; } else { stateManager = new StateManager(vrp); } stateManager.updateLoadStates(); stateManager.updateTimeWindowStates(); stateManager.updateSkillStates(); stateManager.addStateUpdater(new UpdateEndLocationIfRouteIsOpen()); stateManager.addStateUpdater(new OpenRouteStateVerifier()); // stateManager.addStateUpdater(new UpdateActivityTimes(vrp.getTransportCosts())); // stateManager.addStateUpdater(new UpdateVariableCosts(vrp.getActivityCosts(), vrp.getTransportCosts(), stateManager)); /* * define constraints */ //constraint manager ConstraintManager constraintManager = new ConstraintManager(vrp, stateManager); constraintManager.addTimeWindowConstraint(); constraintManager.addLoadConstraint(); constraintManager.addSkillsConstraint(); return readAndCreateAlgorithm(vrp, config, nuOfThreads, null, stateManager, constraintManager, true); } public static VehicleRoutingAlgorithm readAndCreateAlgorithm(final VehicleRoutingProblem vrp, AlgorithmConfig config, int nuOfThreads, SolutionCostCalculator solutionCostCalculator, final StateManager stateManager, ConstraintManager constraintManager, boolean addDefaultCostCalculators) { return readAndCreateAlgorithm(vrp, config.getXMLConfiguration(), nuOfThreads, solutionCostCalculator, stateManager, constraintManager, addDefaultCostCalculators); } private static VehicleRoutingAlgorithm readAndCreateAlgorithm(final VehicleRoutingProblem vrp, XMLConfiguration config, int nuOfThreads, final SolutionCostCalculator solutionCostCalculator, final StateManager stateManager, ConstraintManager constraintManager, boolean addDefaultCostCalculators) { // map to store constructed modules TypedMap definedClasses = new TypedMap(); // algorithm listeners Set<PrioritizedVRAListener> algorithmListeners = new HashSet<PrioritizedVRAListener>(); // insertion listeners List<InsertionListener> insertionListeners = new ArrayList<InsertionListener>(); //threading final ExecutorService executorService; if (nuOfThreads > 0) { log.debug("setup executor-service with " + nuOfThreads + " threads"); executorService = Executors.newFixedThreadPool(nuOfThreads); algorithmListeners.add(new PrioritizedVRAListener(Priority.LOW, new AlgorithmEndsListener() { @Override public void informAlgorithmEnds(VehicleRoutingProblem problem, Collection<VehicleRoutingProblemSolution> solutions) { log.debug("shutdown executor-service"); executorService.shutdown(); } })); Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler() { @Override public void uncaughtException(Thread arg0, Throwable arg1) { System.err.println(arg1.toString()); System.exit(0); } }); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { if (!executorService.isShutdown()) { System.err.println("shutdowHook shuts down executorService"); executorService.shutdown(); } } }); } else executorService = null; //create fleetmanager final VehicleFleetManager vehicleFleetManager = createFleetManager(vrp); String switchString = config.getString("construction.insertion.allowVehicleSwitch"); final boolean switchAllowed; if (switchString != null) { switchAllowed = Boolean.parseBoolean(switchString); } else switchAllowed = true; ActivityTimeTracker.ActivityPolicy activityPolicy; if (stateManager.timeWindowUpdateIsActivated()) { UpdateVehicleDependentPracticalTimeWindows timeWindowUpdater = new UpdateVehicleDependentPracticalTimeWindows(stateManager, vrp.getTransportCosts()); timeWindowUpdater.setVehiclesToUpdate(new UpdateVehicleDependentPracticalTimeWindows.VehiclesToUpdate() { Map<VehicleTypeKey, Vehicle> uniqueTypes = new HashMap<VehicleTypeKey, Vehicle>(); @Override public Collection<Vehicle> get(VehicleRoute vehicleRoute) { if (uniqueTypes.isEmpty()) { for (Vehicle v : vrp.getVehicles()) { if (!uniqueTypes.containsKey(v.getVehicleTypeIdentifier())) { uniqueTypes.put(v.getVehicleTypeIdentifier(), v); } } } Collection<Vehicle> vehicles = new ArrayList<Vehicle>(); vehicles.addAll(uniqueTypes.values()); return vehicles; } }); stateManager.addStateUpdater(timeWindowUpdater); activityPolicy = ActivityTimeTracker.ActivityPolicy.AS_SOON_AS_TIME_WINDOW_OPENS; } else { activityPolicy = ActivityTimeTracker.ActivityPolicy.AS_SOON_AS_ARRIVED; } stateManager.addStateUpdater(new UpdateActivityTimes(vrp.getTransportCosts(), activityPolicy)); stateManager.addStateUpdater(new UpdateVariableCosts(vrp.getActivityCosts(), vrp.getTransportCosts(), stateManager, activityPolicy)); final SolutionCostCalculator costCalculator; if (solutionCostCalculator == null) costCalculator = getDefaultCostCalculator(stateManager); else costCalculator = solutionCostCalculator; PrettyAlgorithmBuilder prettyAlgorithmBuilder = PrettyAlgorithmBuilder.newInstance(vrp, vehicleFleetManager, stateManager, constraintManager); //construct initial solution creator final InsertionStrategy initialInsertionStrategy = createInitialSolution(config, vrp, vehicleFleetManager, stateManager, algorithmListeners, definedClasses, executorService, nuOfThreads, costCalculator, constraintManager, addDefaultCostCalculators); if (initialInsertionStrategy != null) prettyAlgorithmBuilder.constructInitialSolutionWith(initialInsertionStrategy, costCalculator); //construct algorithm, i.e. search-strategies and its modules int solutionMemory = config.getInt("strategy.memory"); List<HierarchicalConfiguration> strategyConfigs = config.configurationsAt("strategy.searchStrategies.searchStrategy"); for (HierarchicalConfiguration strategyConfig : strategyConfigs) { String name = getName(strategyConfig); SolutionAcceptor acceptor = getAcceptor(strategyConfig, vrp, algorithmListeners, definedClasses, solutionMemory); SolutionSelector selector = getSelector(strategyConfig, vrp, algorithmListeners, definedClasses); SearchStrategy strategy = new SearchStrategy(name, selector, acceptor, costCalculator); strategy.setName(name); List<HierarchicalConfiguration> modulesConfig = strategyConfig.configurationsAt("modules.module"); for (HierarchicalConfiguration moduleConfig : modulesConfig) { SearchStrategyModule module = buildModule(moduleConfig, vrp, vehicleFleetManager, stateManager, algorithmListeners, definedClasses, executorService, nuOfThreads, constraintManager, addDefaultCostCalculators); strategy.addModule(module); } prettyAlgorithmBuilder.withStrategy(strategy, strategyConfig.getDouble("probability")); } //construct algorithm VehicleRoutingAlgorithm metaAlgorithm = prettyAlgorithmBuilder.build(); int maxIterations = getMaxIterations(config); if (maxIterations > -1) metaAlgorithm.setMaxIterations(maxIterations); //define prematureBreak PrematureAlgorithmTermination prematureAlgorithmTermination = getPrematureTermination(config, algorithmListeners); if (prematureAlgorithmTermination != null) metaAlgorithm.setPrematureAlgorithmTermination(prematureAlgorithmTermination); else { List<HierarchicalConfiguration> terminationCriteria = config.configurationsAt("terminationCriteria.termination"); for (HierarchicalConfiguration terminationConfig : terminationCriteria) { PrematureAlgorithmTermination termination = getTerminationCriterion(terminationConfig, algorithmListeners); if (termination != null) metaAlgorithm.addTerminationCriterion(termination); } } for (PrioritizedVRAListener l : algorithmListeners) { metaAlgorithm.getAlgorithmListeners().add(l); } return metaAlgorithm; } private static int getMaxIterations(XMLConfiguration config) { String maxIterationsString = config.getString("iterations"); if (maxIterationsString == null) maxIterationsString = config.getString("maxIterations"); if (maxIterationsString != null) return (Integer.parseInt(maxIterationsString)); return -1; } private static SolutionCostCalculator getDefaultCostCalculator(final StateManager stateManager) { return new VariablePlusFixedSolutionCostCalculatorFactory(stateManager).createCalculator(); } private static VehicleFleetManager createFleetManager(final VehicleRoutingProblem vrp) { if (vrp.getFleetSize().equals(FleetSize.INFINITE)) { return new InfiniteFleetManagerFactory(vrp.getVehicles()).createFleetManager(); } else if (vrp.getFleetSize().equals(FleetSize.FINITE)) { return new FiniteFleetManagerFactory(vrp.getVehicles()).createFleetManager(); } throw new IllegalStateException("fleet size can only be infinite or finite. " + "makes sure your config file contains one of these options"); } private static PrematureAlgorithmTermination getTerminationCriterion(HierarchicalConfiguration config, Set<PrioritizedVRAListener> algorithmListeners) { String basedOn = config.getString("[@basedOn]"); if (basedOn == null) { log.debug("set default prematureBreak, i.e. no premature break at all."); return null; } if (basedOn.equals("iterations")) { log.debug("set prematureBreak based on iterations"); String iter = config.getString("iterations"); if (iter == null) throw new IllegalStateException("iterations is missing"); int iterations = Integer.valueOf(iter); return new IterationWithoutImprovementTermination(iterations); } if (basedOn.equals("time")) { log.debug("set prematureBreak based on time"); String timeString = config.getString("time"); if (timeString == null) throw new IllegalStateException("time is missing"); long time = Long.parseLong(timeString); TimeTermination timeBreaker = new TimeTermination(time); algorithmListeners.add(new PrioritizedVRAListener(Priority.LOW, timeBreaker)); return timeBreaker; } if (basedOn.equals("variationCoefficient")) { log.debug("set prematureBreak based on variation coefficient"); String thresholdString = config.getString("threshold"); String iterationsString = config.getString("iterations"); if (thresholdString == null) throw new IllegalStateException("threshold is missing"); if (iterationsString == null) throw new IllegalStateException("iterations is missing"); double threshold = Double.valueOf(thresholdString); int iterations = Integer.valueOf(iterationsString); VariationCoefficientTermination variationCoefficientBreaker = new VariationCoefficientTermination(iterations, threshold); algorithmListeners.add(new PrioritizedVRAListener(Priority.LOW, variationCoefficientBreaker)); return variationCoefficientBreaker; } throw new IllegalStateException("prematureBreak basedOn " + basedOn + " is not defined"); } private static PrematureAlgorithmTermination getPrematureTermination(XMLConfiguration config, Set<PrioritizedVRAListener> algorithmListeners) { String basedOn = config.getString("prematureBreak[@basedOn]"); if (basedOn == null) { log.debug("set default prematureBreak, i.e. no premature break at all."); return null; } if (basedOn.equals("iterations")) { log.debug("set prematureBreak based on iterations"); String iter = config.getString("prematureBreak.iterations"); if (iter == null) throw new IllegalStateException("prematureBreak.iterations is missing"); int iterations = Integer.valueOf(iter); return new IterationWithoutImprovementTermination(iterations); } if (basedOn.equals("time")) { log.debug("set prematureBreak based on time"); String timeString = config.getString("prematureBreak.time"); if (timeString == null) throw new IllegalStateException("prematureBreak.time is missing"); long time = Long.parseLong(timeString); TimeTermination timeBreaker = new TimeTermination(time); algorithmListeners.add(new PrioritizedVRAListener(Priority.LOW, timeBreaker)); return timeBreaker; } if (basedOn.equals("variationCoefficient")) { log.debug("set prematureBreak based on variation coefficient"); String thresholdString = config.getString("prematureBreak.threshold"); String iterationsString = config.getString("prematureBreak.iterations"); if (thresholdString == null) throw new IllegalStateException("prematureBreak.threshold is missing"); if (iterationsString == null) throw new IllegalStateException("prematureBreak.iterations is missing"); double threshold = Double.valueOf(thresholdString); int iterations = Integer.valueOf(iterationsString); VariationCoefficientTermination variationCoefficientBreaker = new VariationCoefficientTermination(iterations, threshold); algorithmListeners.add(new PrioritizedVRAListener(Priority.LOW, variationCoefficientBreaker)); return variationCoefficientBreaker; } throw new IllegalStateException("prematureBreak basedOn " + basedOn + " is not defined"); } private static String getName(HierarchicalConfiguration strategyConfig) { if (strategyConfig.containsKey("[@name]")) { return strategyConfig.getString("[@name]"); } return ""; } private static InsertionStrategy createInitialSolution(XMLConfiguration config, final VehicleRoutingProblem vrp, VehicleFleetManager vehicleFleetManager, final StateManager routeStates, Set<PrioritizedVRAListener> algorithmListeners, TypedMap definedClasses, ExecutorService executorService, int nuOfThreads, final SolutionCostCalculator solutionCostCalculator, ConstraintManager constraintManager, boolean addDefaultCostCalculators) { List<HierarchicalConfiguration> modConfigs = config.configurationsAt("construction.insertion"); if (modConfigs == null) return null; if (modConfigs.isEmpty()) return null; if (modConfigs.size() != 1) throw new IllegalStateException("#construction.modules != 1. 1 expected"); HierarchicalConfiguration modConfig = modConfigs.get(0); String insertionName = modConfig.getString("[@name]"); if (insertionName == null) throw new IllegalStateException("insertion[@name] is missing."); String insertionId = modConfig.getString("[@id]"); if (insertionId == null) insertionId = "noId"; ModKey modKey = makeKey(insertionName, insertionId); InsertionStrategyKey insertionStrategyKey = new InsertionStrategyKey(modKey); InsertionStrategy insertionStrategy = definedClasses.get(insertionStrategyKey); if (insertionStrategy == null) { List<PrioritizedVRAListener> prioListeners = new ArrayList<PrioritizedVRAListener>(); insertionStrategy = createInsertionStrategy(modConfig, vrp, vehicleFleetManager, routeStates, prioListeners, executorService, nuOfThreads, constraintManager, addDefaultCostCalculators); algorithmListeners.addAll(prioListeners); definedClasses.put(insertionStrategyKey, insertionStrategy); } return insertionStrategy; } private static SolutionSelector getSelector(HierarchicalConfiguration strategyConfig, VehicleRoutingProblem vrp, Set<PrioritizedVRAListener> algorithmListeners, TypedMap definedSelectors) { String selectorName = strategyConfig.getString("selector[@name]"); if (selectorName == null) throw new IllegalStateException("no solutionSelector defined. define either \"selectRandomly\" or \"selectBest\""); String selectorId = strategyConfig.getString("selector[@id]"); if (selectorId == null) selectorId = "noId"; ModKey modKey = makeKey(selectorName, selectorId); SelectorKey selectorKey = new SelectorKey(modKey); SolutionSelector definedSelector = definedSelectors.get(selectorKey); if (definedSelector != null) { return definedSelector; } if (selectorName.equals("selectRandomly")) { SelectRandomly selector = SelectRandomly.getInstance(); definedSelectors.put(selectorKey, selector); return selector; } if (selectorName.equals("selectBest")) { SelectBest selector = SelectBest.getInstance(); definedSelectors.put(selectorKey, selector); return selector; } throw new IllegalStateException("solutionSelector is not know. Currently, it only knows \"selectRandomly\" and \"selectBest\""); } private static ModKey makeKey(String name, String id) { return new ModKey(name, id); } private static SolutionAcceptor getAcceptor(HierarchicalConfiguration strategyConfig, VehicleRoutingProblem vrp, Set<PrioritizedVRAListener> algorithmListeners, TypedMap typedMap, int solutionMemory) { String acceptorName = strategyConfig.getString("acceptor[@name]"); if (acceptorName == null) throw new IllegalStateException("no solution acceptor is defined"); String acceptorId = strategyConfig.getString("acceptor[@id]"); if (acceptorId == null) acceptorId = "noId"; AcceptorKey acceptorKey = new AcceptorKey(makeKey(acceptorName, acceptorId)); SolutionAcceptor definedAcceptor = typedMap.get(acceptorKey); if (definedAcceptor != null) return definedAcceptor; if (acceptorName.equals("acceptNewRemoveWorst")) { GreedyAcceptance acceptor = new GreedyAcceptance(solutionMemory); typedMap.put(acceptorKey, acceptor); return acceptor; } if (acceptorName.equals("acceptNewRemoveFirst")) { AcceptNewRemoveFirst acceptor = new AcceptNewRemoveFirst(solutionMemory); typedMap.put(acceptorKey, acceptor); return acceptor; } if (acceptorName.equals("greedyAcceptance")) { GreedyAcceptance acceptor = new GreedyAcceptance(solutionMemory); typedMap.put(acceptorKey, acceptor); return acceptor; } if (acceptorName.equals("greedyAcceptance_minVehFirst")) { GreedyAcceptance_minVehFirst acceptor = new GreedyAcceptance_minVehFirst(solutionMemory); typedMap.put(acceptorKey, acceptor); return acceptor; } if (acceptorName.equals("schrimpfAcceptance")) { String nuWarmupIterations = strategyConfig.getString("acceptor.warmup"); double alpha = strategyConfig.getDouble("acceptor.alpha"); SchrimpfAcceptance schrimpf = new SchrimpfAcceptance(solutionMemory, alpha); if (nuWarmupIterations != null) { SchrimpfInitialThresholdGenerator iniThresholdGenerator = new SchrimpfInitialThresholdGenerator(schrimpf, Integer.parseInt(nuWarmupIterations)); algorithmListeners.add(new PrioritizedVRAListener(Priority.LOW, iniThresholdGenerator)); } else { double threshold = strategyConfig.getDouble("acceptor.initialThreshold"); schrimpf.setInitialThreshold(threshold); } algorithmListeners.add(new PrioritizedVRAListener(Priority.LOW, schrimpf)); typedMap.put(acceptorKey, schrimpf); return schrimpf; } if (acceptorName.equals("experimentalSchrimpfAcceptance")) { int iterOfSchrimpf = strategyConfig.getInt("acceptor.warmup"); double alpha = strategyConfig.getDouble("acceptor.alpha"); ExperimentalSchrimpfAcceptance schrimpf = new ExperimentalSchrimpfAcceptance(solutionMemory, alpha, iterOfSchrimpf); algorithmListeners.add(new PrioritizedVRAListener(Priority.LOW, schrimpf)); typedMap.put(acceptorKey, schrimpf); return schrimpf; } else { throw new IllegalStateException("solution acceptor " + acceptorName + " is not known"); } } private static SearchStrategyModule buildModule(HierarchicalConfiguration moduleConfig, final VehicleRoutingProblem vrp, VehicleFleetManager vehicleFleetManager, final StateManager routeStates, Set<PrioritizedVRAListener> algorithmListeners, TypedMap definedClasses, ExecutorService executorService, int nuOfThreads, ConstraintManager constraintManager, boolean addDefaultCostCalculators) { String moduleName = moduleConfig.getString("[@name]"); if (moduleName == null) throw new IllegalStateException("module(-name) is missing."); String moduleId = moduleConfig.getString("[@id]"); if (moduleId == null) moduleId = "noId"; ModKey modKey = makeKey(moduleName, moduleId); StrategyModuleKey strategyModuleKey = new StrategyModuleKey(modKey); SearchStrategyModule definedModule = definedClasses.get(strategyModuleKey); if (definedModule != null) return definedModule; if (moduleName.equals("ruin_and_recreate")) { String ruin_name = moduleConfig.getString("ruin[@name]"); if (ruin_name == null) throw new IllegalStateException("module.ruin[@name] is missing."); String ruin_id = moduleConfig.getString("ruin[@id]"); if (ruin_id == null) ruin_id = "noId"; String shareToRuinString = moduleConfig.getString("ruin.share"); if (shareToRuinString == null) throw new IllegalStateException("module.ruin.share is missing."); double shareToRuin = Double.valueOf(shareToRuinString); final RuinStrategy ruin; ModKey ruinKey = makeKey(ruin_name, ruin_id); if (ruin_name.equals("randomRuin")) { ruin = getRandomRuin(vrp, routeStates, definedClasses, ruinKey, shareToRuin); } else if (ruin_name.equals("radialRuin")) { JobDistance jobDistance = new AvgServiceAndShipmentDistance(vrp.getTransportCosts()); ruin = getRadialRuin(vrp, routeStates, definedClasses, ruinKey, shareToRuin, jobDistance); } else throw new IllegalStateException("ruin[@name] " + ruin_name + " is not known. Use either randomRuin or radialRuin."); String insertionName = moduleConfig.getString("insertion[@name]"); if (insertionName == null) throw new IllegalStateException("module.insertion[@name] is missing. set it to \"regretInsertion\" or \"bestInsertion\""); String insertionId = moduleConfig.getString("insertion[@id]"); if (insertionId == null) insertionId = "noId"; ModKey insertionKey = makeKey(insertionName, insertionId); InsertionStrategyKey insertionStrategyKey = new InsertionStrategyKey(insertionKey); InsertionStrategy insertion = definedClasses.get(insertionStrategyKey); if (insertion == null) { List<HierarchicalConfiguration> insertionConfigs = moduleConfig.configurationsAt("insertion"); if (insertionConfigs.size() != 1) throw new IllegalStateException("this should be 1"); List<PrioritizedVRAListener> prioListeners = new ArrayList<PrioritizedVRAListener>(); insertion = createInsertionStrategy(insertionConfigs.get(0), vrp, vehicleFleetManager, routeStates, prioListeners, executorService, nuOfThreads, constraintManager, addDefaultCostCalculators); algorithmListeners.addAll(prioListeners); } final InsertionStrategy final_insertion = insertion; RuinAndRecreateModule rrModule = new RuinAndRecreateModule("ruin_and_recreate", final_insertion, ruin); return rrModule; } throw new NullPointerException("no module found with moduleName=" + moduleName + "\n\tcheck config whether the correct names are used" + "\n\tcurrently there are following modules available: " + "\n\tbestInsertion" + "\n\trandomRuin" + "\n\tradialRuin"); } private static RuinStrategy getRadialRuin(final VehicleRoutingProblem vrp, final StateManager routeStates, TypedMap definedClasses, ModKey modKey, double shareToRuin, JobDistance jobDistance) { RuinStrategyKey stratKey = new RuinStrategyKey(modKey); RuinStrategy ruin = definedClasses.get(stratKey); if (ruin == null) { ruin = new RadialRuinStrategyFactory(shareToRuin, jobDistance).createStrategy(vrp); definedClasses.put(stratKey, ruin); } return ruin; } private static RuinStrategy getRandomRuin(final VehicleRoutingProblem vrp, final StateManager routeStates, TypedMap definedClasses, ModKey modKey, double shareToRuin) { RuinStrategyKey stratKey = new RuinStrategyKey(modKey); RuinStrategy ruin = definedClasses.get(stratKey); if (ruin == null) { ruin = new RandomRuinStrategyFactory(shareToRuin).createStrategy(vrp); definedClasses.put(stratKey, ruin); } return ruin; } private static InsertionStrategy createInsertionStrategy(HierarchicalConfiguration moduleConfig, VehicleRoutingProblem vrp, VehicleFleetManager vehicleFleetManager, StateManager routeStates, List<PrioritizedVRAListener> algorithmListeners, ExecutorService executorService, int nuOfThreads, ConstraintManager constraintManager, boolean addDefaultCostCalculators) { return InsertionFactory.createInsertion(vrp, moduleConfig, vehicleFleetManager, routeStates, algorithmListeners, executorService, nuOfThreads, constraintManager, addDefaultCostCalculators); } }
jjc616/jsprit
jsprit-core/src/main/java/jsprit/core/algorithm/io/VehicleRoutingAlgorithms.java
Java
lgpl-3.0
44,019
## VbGcp VB6 Google Cloud Print proxy VbGcp is a set of classes that support printing documents (PDF, TXT, JPG, GIF, PNG, DOC, XLS and more) through [Google Cloud Print](http://www.google.com/cloudprint/learn/) devices from VB6 projects. GCP is available as a REST service on `www.google.com/cloudprint` address. There are two parts of the printing process: submitting jobs by client applications (this proxy) and receiving jobs by registered printers (firmware or software proxies). GCP documentation used to develop VbGcp is available on [Submitting Print Jobs](https://developers.google.com/cloud-print/docs/sendJobs) on Google Developers. You can check out the [Google Cloud Print API Simulation](http://www.google.com/cloudprint/simulate.html) page too. The easiest way to test GCP service is to [enable the Google Cloud Print connector in Google Chrome](http://support.google.com/cloudprint/bin/answer.py?&answer=1686197) which will register all your local printers as cloud printers. This works both with Windows printers and with CUPS printers on Linux. ### Sample included The [sample application](https://github.com/wqweto/VbGcp/raw/master/Sample/GCPSample.exe) exercises the classes by rendering a prototype of GCP settings dialog (OAuth2 login and consent), print dialog (select printer, copies, collation, etc.) and printer properties dialog (more printer settings). ![Login and Print dialog](https://github.com/wqweto/VbGcp/raw/master/Doc/ss_gcp_1.png) ![Printer Setup dialog](https://github.com/wqweto/VbGcp/raw/master/Doc/ss_gcp_2.png) The sample can submit a file to GCP service and tracks its print job progress as GCP service processes the file. This is done by continually listing current printer jobs by status. All of the operations are implemented in async mode. ### Using the classes `cGcpService` is the main class that supports calling methods on the GCP service and parsing JSON response. When `ASYNC_SUPPORT` is set to `False` the class can be used as a standalone class. Class methods map to service calls as follows: - `PrintDocument` calls [/submit](https://developers.google.com/cloud-print/docs/appInterfaces#submit) method - `GetJobs` calls [/jobs](https://developers.google.com/cloud-print/docs/appInterfaces#jobs) method - `DeleteJob` calls [/deletejob](https://developers.google.com/cloud-print/docs/appInterfaces#deletejob) method - `GetPrinterInfo` calls [/printer](https://developers.google.com/cloud-print/docs/appInterfaces#printer) method - `GetPrinters` calls [/search](https://developers.google.com/cloud-print/docs/appInterfaces#search) method For asynchronous service requests leave `ASYNC_SUPPORT` set to `True` and include in your project `cGcpCallback` class too. `cGcpPrinterCaps` is a helper class for easier setting of job capabilities -- number of copies, paper size, page orientation, etc. Print job settings are submitted to GCP service in JSON format and can be constructed manually. This wrapper class just parses printer capabilities as returned by the GCP service (both XPS and PPD formats) and exposes these in a consistent way as settable properties. (This is a work in progress from Google, results are not very consistent at present.) Finally `cGcpOAuth` is a helper class for OAuth2 user authentication in [Installed Application](https://developers.google.com/accounts/docs/OAuth2#installed) mode. It uses Google Accounts to validate user login and to acquire user consent on accessing GCP service. Then it retrieves OAuth2 `refresh_token` from `accounts.google.com/o/oauth2/token` service which can be stored and later used to retrieve OAuth `access_token` for GCP service without showing another login screen. ## [API](https://github.com/wqweto/VbGcp/blob/master/Doc/API.md)
wqweto/VbGcp
README.md
Markdown
lgpl-3.0
3,800
/*************************************************** * * cismet GmbH, Saarbruecken, Germany * * ... and it just works. * ****************************************************/ package de.cismet.cids.custom.sudplan.airquality; import org.openide.util.NbBundle; import org.openide.util.WeakListeners; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import de.cismet.cids.custom.sudplan.SMSUtils; import de.cismet.cismap.commons.features.Feature; import de.cismet.cismap.commons.gui.MappingComponent; import de.cismet.cismap.commons.interaction.CismapBroker; /** * DOCUMENT ME! * * @author mscholl * @version $Revision$, $Date$ */ public class AirqualityDownscalingInputManagerUI extends javax.swing.JPanel { //~ Instance fields -------------------------------------------------------- private final transient AirqualityDownscalingInput model; private final transient ActionListener showBoundingBox; private transient Feature grid; // Variables declaration - do not modify//GEN-BEGIN:variables private final transient javax.swing.JButton btnShowBoundingBox = new javax.swing.JButton(); private final transient javax.swing.JLabel lblCreated = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblCreatedBy = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblCreatedByValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblCreatedValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblDatabase = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblDatabaseValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblDescription = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblDescriptionValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblEndDate = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblEndDateValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblGridcellSize = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblGridcellSizeValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblLowerleft = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblLowerleftValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblName = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblNameValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblScenario = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblScenarioValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblSrs = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblSrsValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblStartDate = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblStartDateValue = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblUpperright = new javax.swing.JLabel(); private final transient javax.swing.JLabel lblUpperrightValue = new javax.swing.JLabel(); // End of variables declaration//GEN-END:variables //~ Constructors ----------------------------------------------------------- /** * Creates new form AirqualityDownscalingInputManagerUI. * * @param model DOCUMENT ME! */ public AirqualityDownscalingInputManagerUI(final AirqualityDownscalingInput model) { this.model = model; this.showBoundingBox = new ShowBoundingBox(); initComponents(); init(); btnShowBoundingBox.addActionListener(WeakListeners.create( ActionListener.class, showBoundingBox, btnShowBoundingBox)); } //~ Methods ---------------------------------------------------------------- /** * DOCUMENT ME! */ private void init() { lblNameValue.setText(model.getName()); lblCreatedValue.setText(model.getCreated().toString()); lblCreatedByValue.setText(model.getCreatedBy()); lblLowerleftValue.setText(model.getLowerleft().toString()); lblUpperrightValue.setText(model.getUpperright().toString()); lblGridcellSizeValue.setText(String.valueOf(model.getGridcellSize()) + NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblGridSizeValue.text.appendix")); // NOI18N lblScenarioValue.setText(model.getScenario()); lblStartDateValue.setText(model.getStartDate().toString()); lblEndDateValue.setText(model.getEndDate().toString()); lblDatabaseValue.setText(model.getDatabase()); lblDescriptionValue.setText(model.getDescription()); lblSrsValue.setText(model.getSrs()); grid = new GridFeature(model.getGridcellCountX(), model.getGridcellCountY(), model.getGridcellSize(), model.getLowerleft(), model.getUpperright(), Integer.parseInt(model.getSrs().substring(5))); } /** * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The * content of this method is always regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { java.awt.GridBagConstraints gridBagConstraints; setOpaque(false); setLayout(new java.awt.GridBagLayout()); lblName.setLabelFor(lblNameValue); lblName.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblName.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblName, gridBagConstraints); lblCreated.setLabelFor(lblCreatedValue); lblCreated.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblCreated.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblCreated, gridBagConstraints); lblCreatedValue.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblCreatedValue.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblCreatedValue, gridBagConstraints); lblNameValue.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblNameValue.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblNameValue, gridBagConstraints); lblCreatedBy.setLabelFor(lblCreatedByValue); lblCreatedBy.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblCreatedBy.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblCreatedBy, gridBagConstraints); lblCreatedByValue.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblCreatedByValue.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 1; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblCreatedByValue, gridBagConstraints); lblScenario.setLabelFor(lblScenarioValue); lblScenario.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblScenario.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblScenario, gridBagConstraints); lblScenarioValue.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblScenarioValue.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 4; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblScenarioValue, gridBagConstraints); lblStartDate.setLabelFor(lblStartDateValue); lblStartDate.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblStartDate.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblStartDate, gridBagConstraints); lblStartDateValue.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblStartDateValue.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblStartDateValue, gridBagConstraints); lblEndDate.setLabelFor(lblEndDateValue); lblEndDate.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblEndDate.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblEndDate, gridBagConstraints); lblEndDateValue.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblEndDateValue.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 5; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblEndDateValue, gridBagConstraints); lblLowerleft.setLabelFor(lblLowerleftValue); lblLowerleft.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblLowerleft.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblLowerleft, gridBagConstraints); lblUpperright.setLabelFor(lblUpperrightValue); lblUpperright.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblUpperright.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblUpperright, gridBagConstraints); lblLowerleftValue.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblLowerleftValue.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblLowerleftValue, gridBagConstraints); lblUpperrightValue.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblUpperrightValue.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblUpperrightValue, gridBagConstraints); lblGridcellSize.setLabelFor(lblGridcellSizeValue); lblGridcellSize.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblGridcellSize.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblGridcellSize, gridBagConstraints); lblGridcellSizeValue.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblGridcellSizeValue.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblGridcellSizeValue, gridBagConstraints); lblDatabase.setLabelFor(lblDatabaseValue); lblDatabase.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblDatabase.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 6; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblDatabase, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 6; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblDatabaseValue, gridBagConstraints); lblDescription.setLabelFor(lblDescriptionValue); lblDescription.setText(org.openide.util.NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblDescription.text")); // NOI18N lblDescription.setVerticalAlignment(javax.swing.SwingConstants.TOP); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 7; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblDescription, gridBagConstraints); lblDescriptionValue.setVerticalAlignment(javax.swing.SwingConstants.TOP); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 7; gridBagConstraints.gridwidth = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.weightx = 0.1; gridBagConstraints.weighty = 0.1; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblDescriptionValue, gridBagConstraints); btnShowBoundingBox.setText(NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.btnShowBoundingBox.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.gridwidth = 2; gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL; gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(btnShowBoundingBox, gridBagConstraints); lblSrs.setLabelFor(lblSrsValue); lblSrs.setText(org.openide.util.NbBundle.getMessage( AirqualityDownscalingInputManagerUI.class, "AirqualityDownscalingInputManagerUI.lblSrs.text")); // NOI18N gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblSrs, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 3; gridBagConstraints.gridy = 3; gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; gridBagConstraints.anchor = java.awt.GridBagConstraints.FIRST_LINE_START; gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5); add(lblSrsValue, gridBagConstraints); } // </editor-fold>//GEN-END:initComponents //~ Inner Classes ---------------------------------------------------------- /** * DOCUMENT ME! * * @version $Revision$, $Date$ */ private final class ShowBoundingBox implements ActionListener { //~ Methods ------------------------------------------------------------ @Override public void actionPerformed(final ActionEvent e) { final MappingComponent mc = CismapBroker.getInstance().getMappingComponent(); // TODO: collection will not add the feature if it is already present mc.getFeatureCollection().addFeature(grid); SMSUtils.showMappingComponent(); } } }
cismet/cids-custom-sudplan
src/main/java/de/cismet/cids/custom/sudplan/airquality/AirqualityDownscalingInputManagerUI.java
Java
lgpl-3.0
22,354
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_PUTBUCKETENCRYPTIONREQUEST_P_H #define QTAWS_PUTBUCKETENCRYPTIONREQUEST_P_H #include "s3request_p.h" #include "putbucketencryptionrequest.h" namespace QtAws { namespace S3 { class PutBucketEncryptionRequest; class PutBucketEncryptionRequestPrivate : public S3RequestPrivate { public: PutBucketEncryptionRequestPrivate(const S3Request::Action action, PutBucketEncryptionRequest * const q); PutBucketEncryptionRequestPrivate(const PutBucketEncryptionRequestPrivate &other, PutBucketEncryptionRequest * const q); private: Q_DECLARE_PUBLIC(PutBucketEncryptionRequest) }; } // namespace S3 } // namespace QtAws #endif
pcolby/libqtaws
src/s3/putbucketencryptionrequest_p.h
C
lgpl-3.0
1,450
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_DESCRIBEJOBSRESPONSE_H #define QTAWS_DESCRIBEJOBSRESPONSE_H #include "mgnresponse.h" #include "describejobsrequest.h" namespace QtAws { namespace mgn { class DescribeJobsResponsePrivate; class QTAWSMGN_EXPORT DescribeJobsResponse : public mgnResponse { Q_OBJECT public: DescribeJobsResponse(const DescribeJobsRequest &request, QNetworkReply * const reply, QObject * const parent = 0); virtual const DescribeJobsRequest * request() const Q_DECL_OVERRIDE; protected slots: virtual void parseSuccess(QIODevice &response) Q_DECL_OVERRIDE; private: Q_DECLARE_PRIVATE(DescribeJobsResponse) Q_DISABLE_COPY(DescribeJobsResponse) }; } // namespace mgn } // namespace QtAws #endif
pcolby/libqtaws
src/mgn/describejobsresponse.h
C
lgpl-3.0
1,452
// Created file "Lib\src\Uuid\X64\guids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(WPD_CONTENT_TYPE_DOCUMENT, 0x680adf52, 0x950a, 0x4041, 0x9b, 0x41, 0x65, 0xe3, 0x93, 0x64, 0x81, 0x55);
Frankie-PellesC/fSDK
Lib/src/Uuid/X64/guids00000092.c
C
lgpl-3.0
459
<!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' lang='he' dir='rtl'> <head> <meta http-equiv='Content-Type' content='text/html; charset=windows-1255' /> <meta charset='windows-1255' /> <meta http-equiv='Content-Script-Type' content='text/javascript' /> <meta http-equiv='revisit-after' content='15 days' /> <title>îàáåú òã áðé áðéí</title> <link rel='stylesheet' type='text/css' href='../../../_script/klli.css' /> <link rel='stylesheet' type='text/css' href='../../../tnk1/_themes/klli.css' /> <meta property='og:url' content='https://tora.us.fm/tnk1/nvia/yrmyhu/yr-02-0409.html'/> <meta name='author' content="àøàì" /> <meta name='receiver' content="" /> <meta name='jmQovc' content="tnk1/nvia/yrmyhu/yr-02-0409.html" /> <meta name='tvnit' content="" /> <link rel='canonical' href='https://tora.us.fm/tnk1/nvia/yrmyhu/yr-02-0409.html' /> </head> <!-- PHP Programming by Erel Segal-Halevi --> <body lang='he' dir='rtl' id = 'tnk1_nvia_yrmyhu_yr_02_0409' class='mbnh1 '> <div class='pnim'> <script type='text/javascript' src='../../../_script/vars.js'></script> <!--NiwutElyon0--> <div class='NiwutElyon'> <div class='NiwutElyon'><a class='link_to_homepage' href='../../../tnk1/index.html'>øàùé</a>&gt;<a href='../../../tnk1/sig/how.html'>îáðä</a>&gt;<a href='../../../tnk1/sig/mvned.html'>îáðéí äãøâúééí</a>&gt;</div> <div class='NiwutElyon'><a class='link_to_homepage' href='../../../tnk1/index.html'>øàùé</a>&gt;<a href='../../../tnk1/msr/3.html'>áéï àãí ìçáøå</a>&gt;<a href='../../../tnk1/msr/2mjpxa.html'>áéï äåøéí ìéìãéí</a>&gt;<a href='../../../tnk1/msr/cdqmjpxa.html'>öã÷ ìãåøåú</a>&gt;</div> <div class='NiwutElyon'><a class='link_to_homepage' href='../../../tnk1/index.html'>øàùé</a>&gt;<a href='../../../tnk1/msr/1.html'>áéï ä' ìàãí</a>&gt;<a href='../../../tnk1/msr/cdq.html'>öã÷ åâîåì</a>&gt;<a href='../../../tnk1/msr/cdqprtkll.html'>öã÷ ôøè åëìì</a>&gt;</div> </div> <!--NiwutElyon1--> <h1 id='h1'>îàáåú òã áðé áðéí</h1> <div id='idfields'> <p>÷åã: áéàåø:éøîéäå á4 áúð"ê</p> <p>ñåâ: îáðä1</p> <p>îàú: àøàì</p> <p>àì: </p> </div> <script type='text/javascript'>kotrt()</script> <div id='tokn'> <!-- -END OF HEADER--> <script language="JavaScript" src="http://kodesh.snunit.k12.il/i/t/js/t1102.js"></script> ÷ùøéí îùôçúééí, áéï àáåú ìáðéí åìáðé-áðéí, îäåéí âåøí çùåá áäòøëú äúøáåú - ìèåá àå ìøò. äðáéà éøîéäå îúééçñ ì÷ùøéí àìä áàçú îðáåàåúéå äøàùåðåú (<span id="s1" class="psk">éøîéäå á 4-9): <p></span> ôñå÷ 4: <q class="psuq">ùÑÄîÀòåÌ ãÀáÇø-ä', <b>áÌÅéú</b> éÇòÂ÷Éá, åÀëÈì- <b>îÄùÑÀôÌÀçåÉú</b>, áÌÅéú éÄùÒÀøÈàÅì</q>: <br /> <ul> <li>ôñå÷ 5-6:&nbsp; <q class="psuq">ëÌÉä àÈîÇø ä': îÇä-îÌÈöÀàåÌ <b>àÂáåÉúÅéëÆí</b> áÌÄé òÈåÆì--ëÌÄé øÈçÂ÷åÌ, îÅòÈìÈé; åÇéÌÅìÀëåÌ àÇçÂøÅé äÇäÆáÆì, åÇéÌÆäÀáÌÈìåÌ?! åÀìÉà àÈîÀøåÌ 'àÇéÌÅä ä', äÇîÌÇòÂìÆä àÉúÈðåÌ îÅàÆøÆõ îÄöÀøÈéÄí; äÇîÌåÉìÄéêÀ àÉúÈðåÌ áÌÇîÌÄãÀáÌÈø, áÌÀàÆøÆõ òÂøÈáÈä åÀùÑåÌçÈä áÌÀàÆøÆõ öÄéÌÈä åÀöÇìÀîÈåÆú--áÌÀàÆøÆõ ìÉà-òÈáÇø áÌÈäÌ àÄéùÑ, åÀìÉà-éÈùÑÇá àÈãÈí ùÑÈí?!'</q></li> <li>ôñå÷ <a name="7">7-8</a>: <q class="psuq">åÈàÈáÄéà <b>àÆúÀëÆí</b> àÆì-àÆøÆõ äÇëÌÇøÀîÆì, ìÆàÁëÉì ôÌÄøÀéÈäÌ åÀèåÌáÈäÌ; åÇúÌÈáÉàåÌ åÇúÌÀèÇîÌÀàåÌ àÆú-àÇøÀöÄé, åÀðÇçÂìÈúÄé ùÒÇîÀúÌÆí ìÀúåÉòÅáÈä. äÇëÌÉäÂðÄéí, ìÉà àÈîÀøåÌ àÇéÌÅä ä', åÀúÉôÀùÒÅé äÇúÌåÉøÈä ìÉà éÀãÈòåÌðÄé, åÀäÈøÉòÄéí ôÌÈùÑÀòåÌ áÄé; åÀäÇðÌÀáÄàÄéí ðÄáÌÀàåÌ áÇáÌÇòÇì, åÀàÇçÂøÅé ìÉà-éåÉòÄìåÌ äÈìÈëåÌ.</q></li> <li>ôñå÷ 9: <q class="psuq">ìÈëÅï, òÉã àÈøÄéá <b>àÄúÌÀëÆí</b>, ðÀàËí-ä'; åÀàÆú <b>áÌÀðÅé áÀðÅéëÆí</b> àÈøÄéá.</q></li> </ul> äðáåàä îúçéìä áôðéä ééçåãéú - ìà ñúí àì "áðé éùøàì" àìà àì " <span style="font-weight: bold;">áéú éò÷á</span>" (= îùôçú éò÷á), åàì " <span style="font-weight: bold;">ëì îùôçåú áéú éùøàì</span>" - äôðéä îãâéùä àú çùéáåú äîùôçä áðáåàä. <p> <h3>äãåø ä÷åãí</h3> ôñå÷éí 5-6 îúééçñéí ìãåø ä÷åãí - ãåø äàáåú: éøîéäå îñôø ìáðé éùøàì òì äòáéøåú ùì äãåø ä÷åãí, ëé âí äí òöîí òáøå òáéøåú ãåîåú, ëîå ùäåà éñáéø áäîùê. <p> <h3>äãåø äðåëçé </h3> ôñå÷éí 7-8 îúééçñéí ìãåø äðåëçé; ìà ø÷ àáåúéëí &ndash; âí àúí, äãåø äðåëçé, çåèàéí áàåúí çèàéí: <q class="psuq">åàáéà <b>àúëí</b></q> î"àøõ ìà æøåòä"<q class="psuq">àì <b>àøõ äëøîì</b>, ìàëåì ôøééä åèåáä&nbsp;</q> åáëì æàú ìà äîùëúí ììëú àçøéé ëîå ùòùéúí áîãáø, àìà <q class="psuq">åúáåàå åúèîàå àú àøöé, åðçìúé ùîúí ìúåòáä!</q> <small>(<q class="psuq"> ôøééä</q> äâùîé å <q class="psuq"> èåáä</q> äøåçðé; <q class="psuq"> àøöé</q> äâùîéú å <q class="psuq"> ðçìúé</q> äøåçðéú; øàå îìáé"í)</small>. <p> <p>ëîå ùàáåúéëí "ìà àîøå 'àéä ä'...?'" ëê âí àöìëí: <q class="psuq">äëåäðéí ìà àîøå 'àéä ä'?'</q>. ëîå ùàáåúéëí "øç÷å îòìéé" ëê âí àöìëí: <q class="psuq">åúåôùé äúåøä ìà éãòåðé, åäøåòéí ôùòå áé;</q> åëîå ùàáåúéëí "åééìëå àçøé ääáì åéäáìå" ëê âí àöìëí: <q class="psuq">åäðáéàéí ðéáàå ááòì, <b>åàçøé ìà éåòéìå äìëå</b></q>. <br /> <h3>äãåøåú äáàéí</h3> åôñå÷éí 9 åäìàä (òã ôñå÷ 13, ùìà öéèèðå ëàï) îúééçñéí ìùðé äãåøåú äáàéí - òã ãåø äðëãéí: îëéååï ùàúí ëáø äãåø äùðé áøöéôåú ùòåáã ò"æ &ndash; <q class="psuq">òåã àøéá</q> (àúååëç) <q class="psuq">àúëí, ðàåí ä', åàú áðé áðéëí àøéá</q> &ndash; ìà àùîéã àúëí îééã àìà ÷åãí àúååëç àúëí, åàðñä ìäøàåú ìëí ùàúí èåòéí, åâí òí äáðéí åäðëãéí ùìëí àúååëç, åø÷ àæ àáéà òìéëí ôåøòðåú. <p>ìîä ãåå÷à òã "áðé áðéëí"? &ndash; ðàîø áòùøú äãéáøåú, áàéñåø ìòáåã òáåãä æøä: "<q class="psuq">ëé àðåëé ä' à-ìäéê àì ÷ðà, ôå÷ã òååï àáåú òì áðéí òì ùéìùéí åòì øéáòéí ìùåðàé</q>", ëìåîø: ëùãåø àçã îúçéì ìòáåã ò"æ &ndash; ä' ìà îëìä àåúå îééã, àìà ðåúï àôùøåú ìãåøåú äáàéí ìú÷ï àú äòååï. ø÷ ëùéù 4 ãåøåú øöåôéí ùì "<q class="psuq">ùåðàé</q>" ùòåáãéí ò"æ åìà çåæøéí áúùåáä &ndash; ä' îùîéã àåúí. <p>äãåø ùáå äúçéì éøîéäå ìäúðáà äéä äãåø äùðé ùì òåáãé ò"æ &ndash; àçøé ù"<q class="psuq"><b> àáåúéëí</b></q> <q class="psuq">... øç÷å îòìéé</q>". ìëï ðùàøå ìáðé éùøàì òåã ùðé ãåøåú &ndash; åòì æä àîø éøîéäå "<q class="psuq">ìëï òåã àøéá àúëí, ðàåí ä', åàú <b>áðé áðéëí</b> àøéá</q>". æä îñáéø ìîä äéä çùåá ìäâéã ìáð"é ùàáåúéäí çèàå: äåà øöä ùééãòå ùéù ìäí ø÷ òåã ùðé ãåøåú ìçæåø áúùåáä. åàëï, éøîéäå äúçéì ìäúðáà áùðú 13 ìéàùéäå, åìôé çùáåï äùðéí éåöà ùäåà ðéáà áãéå÷ 40 ùðä òã äçåøáï - åæä áòøê ùðé ãåøåú. <br /> <div class="advanced"> <h2>ìòéåï ðåñó</h2> <p> <a title="" name="_ftn7" href="/tnk1/nvia/yrmyhu/yr-02.html#_ftnref7"><!--[if!supportFootnotes]--></a> <ul> <li> áôñå÷éí äáàéí - ôñå÷éí 10-13 îúåàø ä"øéá" (äåéëåç) ùäúååëç éøîéäå òí áð"é - øàå <a href="/tnk1/nvia/yrmyhu/yr-02.html">îáðä äôø÷</a>. </li> <li>òåã ôñå÷éí òì òåðù ùðîùê ìãåøåú - øàå <a href="/tnk1/kma/qjrim1/cdqrgjot.html">øâùåú ðùàøéí ìãåøåú äáàéí</a>.</li></ul> </div> <br /> <p> </div><!--tokn--> <h2 id='tguvot'>úâåáåú</h2> <ul id='ultguvot'> <li></li> </ul><!--end--> <script type='text/javascript'>tguva(); txtit()</script> </div><!--pnim--> </body> </html>
erelsgl/erel-sites
tnk1/nvia/yrmyhu/yr-02-0409.html
HTML
lgpl-3.0
6,927
<?php namespace app\models; use Yii; /** * This is the model class for table "user". * * @property integer $idAutenticacion * @property string $username * @property string $password * @property string $Mail * @property string $Authkey * @property string $Token * @property integer $RRHH_idRRHH * @property integer $tiporrhh_idTipoRRHH * @property string $Fecha * @property string $Hora * @property integer $activate * * @property Rrhh $rRHHIdRRHH * @property Tiporrhh $tiporrhhIdTipoRRHH */ class User extends \yii\db\ActiveRecord { /** * @inheritdoc */ public static function tableName() { return 'user'; } /** * @inheritdoc */ public function rules() { return [ [['username', 'password', 'Mail', 'RRHH_idRRHH', 'tiporrhh_idTipoRRHH'], 'required'], [['RRHH_idRRHH', 'tiporrhh_idTipoRRHH', 'activate'], 'integer'], [['Fecha', 'Hora'], 'safe'], [['username', 'Mail'], 'string', 'max' => 45], [['password', 'Authkey', 'Token'], 'string', 'max' => 250] ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'idAutenticacion' => 'Id Autenticacion', 'username' => 'Username', 'password' => 'Password', 'Mail' => 'Mail', 'Authkey' => 'Authkey', 'Token' => 'Token', 'RRHH_idRRHH' => 'Rrhh Id Rrhh', 'tiporrhh_idTipoRRHH' => 'Tiporrhh Id Tipo Rrhh', 'Fecha' => 'Fecha', 'Hora' => 'Hora', 'activate' => 'Activate', ]; } /** * @return \yii\db\ActiveQuery */ public function getRRHHIdRRHH() { return $this->hasOne(Rrhh::className(), ['idRRHH' => 'RRHH_idRRHH']); } /** * @return \yii\db\ActiveQuery */ public function getTiporrhhIdTipoRRHH() { return $this->hasOne(Tiporrhh::className(), ['idTipoRRHH' => 'tiporrhh_idTipoRRHH']); } }
MatiasBartoluche/isunaji2014
basic/models/User.php
PHP
lgpl-3.0
2,042
/* GuiList.cpp * * Copyright (C) 1993-2011,2012,2013 Paul Boersma, 2013 Tom Naughton * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * pb 2007/12/26 abstraction from Motif * pb 2009/01/31 NUMlvector_free has to be followed by assigning a NULL * fb 2010/02/23 GTK * pb 2010/06/14 HandleControlClick * pb 2010/07/05 blockSelectionChangedCallback * pb 2010/11/28 removed Motif * pb 2011/04/06 C++ */ #include "GuiP.h" #include "NUM.h" Thing_implement (GuiList, GuiControl, 0); #undef iam #define iam(x) x me = (x) void_me #if win || mac #define iam_list \ Melder_assert (widget -> widgetClass == xmListWidgetClass); \ GuiList me = (GuiList) widget -> userData #else #define iam_list \ GuiList me = (GuiList) _GuiObject_getUserData (widget) #endif #if win #define CELL_HEIGHT 15 #elif mac #define CELL_HEIGHT 18 #endif #if gtk static void _GuiGtkList_destroyCallback (gpointer void_me) { iam (GuiList); forget (me); } static void _GuiGtkList_selectionChangedCallback (GtkTreeSelection *sel, gpointer void_me) { iam (GuiList); if (my d_selectionChangedCallback != NULL && ! my d_blockValueChangedCallbacks) { //Melder_casual ("Selection changed."); struct structGuiListEvent event = { me }; my d_selectionChangedCallback (my d_selectionChangedBoss, & event); } } #elif cocoa @implementation GuiCocoaList { GuiList d_userData; } /* * Override NSObject methods. */ - (void) dealloc { [_contents release]; GuiThing me = d_userData; forget (me); Melder_casual ("deleting a list"); [super dealloc]; } /* * Override NSView methods. */ - (id) initWithFrame: (NSRect) frameRect { self = [super initWithFrame: frameRect]; if (self) { _tableView = [[NSTableView alloc] initWithFrame: frameRect]; Melder_assert ([_tableView retainCount] == 1); // this asserts that ARC is off (if ARC were on, the retain count would be 2, because tableView is a retain property) NSTableColumn *tc = [[NSTableColumn alloc] initWithIdentifier: @"list"]; tc.width = frameRect. size. width; [tc setEditable: NO]; [_tableView addTableColumn: tc]; _tableView. delegate = self; _tableView. dataSource = self; _tableView. allowsEmptySelection = YES; _tableView. headerView = nil; _tableView. target = self; _tableView. action = @selector (_GuiCocoaList_clicked:); NSScrollView *sv = [[NSScrollView alloc] initWithFrame: frameRect]; [sv setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable]; [sv setBorderType: NSGrooveBorder]; [sv setDocumentView: _tableView]; // this retains the table view [sv setHasVerticalScroller: YES]; //[sv setHasHorizontalScroller: YES]; [self addSubview: sv]; // this retains the scroll view //Melder_assert ([sv retainCount] == 2); // not always true on 10.6 [sv release]; Melder_assert ([_tableView retainCount] == 2); [_tableView release]; _contents = [[NSMutableArray alloc] init]; } return self; } /* * Implement GuiCocoaAny protocol. */ - (GuiThing) userData { return d_userData; } - (void) setUserData: (GuiThing) userData { Melder_assert (userData == NULL || Thing_member (userData, classGuiList)); d_userData = static_cast <GuiList> (userData); } /* * Implement GuiCocoaList methods. */ - (IBAction) _GuiCocoaList_clicked: (id) sender { /* * This method probably shouldn't do anything, * because tableViewSelectionDidChange will already have been called at this point. */ (void) sender; trace ("enter"); GuiList me = d_userData; if (me && my d_selectionChangedCallback) { struct structGuiListEvent event = { me }; //my d_selectionChangedCallback (my d_selectionChangedBoss, & event); } } /* * Override TableViewDataSource methods. */ - (NSInteger) numberOfRowsInTableView: (NSTableView *) tableView { (void) tableView; return [_contents count]; } - (id) tableView: (NSTableView *) tableView objectValueForTableColumn: (NSTableColumn *) tableColumn row: (NSInteger) row { (void) tableColumn; (void) tableView; return [_contents objectAtIndex: row]; } /* * Override TableViewDelegate methods. */ - (void) tableViewSelectionDidChange: (NSNotification *) notification { /* * This is invoked when the user clicks in the table or uses the arrow keys. */ (void) notification; trace ("enter"); GuiList me = d_userData; if (me && my d_selectionChangedCallback && ! my d_blockValueChangedCallbacks) { struct structGuiListEvent event = { me }; my d_selectionChangedCallback (my d_selectionChangedBoss, & event); } } @end #elif win void _GuiWinList_destroy (GuiObject widget) { iam_list; DestroyWindow (widget -> window); forget (me); // NOTE: my widget is not destroyed here } void _GuiWinList_map (GuiObject widget) { iam_list; ShowWindow (widget -> window, SW_SHOW); } void _GuiWinList_handleClick (GuiObject widget) { iam_list; if (my d_selectionChangedCallback != NULL) { struct structGuiListEvent event = { me }; my d_selectionChangedCallback (my d_selectionChangedBoss, & event); } } #elif mac void _GuiMacList_destroy (GuiObject widget) { iam_list; _GuiMac_clipOnParent (widget); if (widget -> isControl) { DisposeControl (widget -> nat.control.handle); } else { LDispose (my d_macListHandle); } GuiMac_clipOff (); forget (me); // NOTE: my widget is not destroyed here } void _GuiMacList_map (GuiObject widget) { iam_list; if (widget -> isControl) { _GuiNativeControl_show (widget); Melder_casual ("showing a list"); //_GuiMac_clipOnParent (widget); //LSetDrawingMode (true, my macListHandle); //_GuiMac_clipOffInvalid (widget); } else { _GuiMac_clipOnParent (widget); LSetDrawingMode (true, my d_macListHandle); _GuiMac_clipOffInvalid (widget); } } void _GuiMacList_activate (GuiObject widget, bool activate) { iam_list; _GuiMac_clipOnParent (widget); LActivate (activate, my d_macListHandle); GuiMac_clipOff (); } void _GuiMacList_handleControlClick (GuiObject widget, EventRecord *macEvent) { iam_list; _GuiMac_clipOnParent (widget); bool pushed = HandleControlClick (widget -> nat.control.handle, macEvent -> where, macEvent -> modifiers, NULL); GuiMac_clipOff (); if (pushed && my d_selectionChangedCallback) { struct structGuiListEvent event = { me }; my d_selectionChangedCallback (my d_selectionChangedBoss, & event); } } void _GuiMacList_handleClick (GuiObject widget, EventRecord *macEvent) { iam_list; _GuiMac_clipOnParent (widget); bool doubleClick = LClick (macEvent -> where, macEvent -> modifiers, my d_macListHandle); GuiMac_clipOff (); if (my d_selectionChangedCallback) { struct structGuiListEvent event = { me }; my d_selectionChangedCallback (my d_selectionChangedBoss, & event); } if (doubleClick && my d_doubleClickCallback) { struct structGuiListEvent event = { me }; my d_doubleClickCallback (my d_doubleClickBoss, & event); } } void _GuiMacList_move (GuiObject widget) { iam_list; (** my d_macListHandle). rView = widget -> rect; } void _GuiMacList_resize (GuiObject widget) { iam_list; (** my d_macListHandle). rView = widget -> rect; SetPortWindowPort (widget -> macWindow); (** my d_macListHandle). cellSize. h = widget -> width; if (widget -> parent -> widgetClass == xmScrolledWindowWidgetClass) _Gui_manageScrolledWindow (widget -> parent); } void _GuiMacList_shellResize (GuiObject widget) { iam_list; (** my d_macListHandle). rView = widget -> rect; (** my d_macListHandle). cellSize. h = widget -> width; } void _GuiMacList_update (GuiObject widget, RgnHandle visRgn) { iam_list; _GuiMac_clipOnParent (widget); if (widget -> isControl) { Draw1Control (widget -> nat.control.handle); } else { LUpdate (visRgn, my d_macListHandle); } GuiMac_clipOff (); } #endif #if mac && useCarbon static pascal void mac_listDefinition (short message, Boolean select, Rect *rect, Cell cell, short dataOffset, short dataLength, ListHandle handle) { GuiObject widget = (GuiObject) GetListRefCon (handle); (void) cell; switch (message) { case lDrawMsg: case lHiliteMsg: // We redraw everything, even when just highlighting. The reason is anti-aliasing. Melder_assert (widget != NULL); SetPortWindowPort (widget -> macWindow); _GuiMac_clipOnParent (widget); /* * In order that highlighting (which by default turns only the white pixels into pink) * does not leave light-grey specks around the glyphs (in the anti-aliasing regions), * we simply draw the glyphs on a pink background if the item is selected. */ /* * Erase the background. */ static RGBColor whiteColour = { 0xFFFF, 0xFFFF, 0xFFFF }, blackColour = { 0, 0, 0 }; RGBForeColor (& whiteColour); PaintRect (rect); RGBForeColor (& blackColour); /* * Pink (or any other colour the user prefers) if the item is selected. */ if (select) { LMSetHiliteMode (LMGetHiliteMode () & ~ 128L); InvertRect (rect); } /* * Draw the text on top of this. */ CGContextRef macGraphicsContext; QDBeginCGContext (GetWindowPort (widget -> macWindow), & macGraphicsContext); int shellHeight = GuiMac_clipOn_graphicsContext (widget, macGraphicsContext); static ATSUFontFallbacks fontFallbacks = NULL; if (fontFallbacks == NULL) { ATSUCreateFontFallbacks (& fontFallbacks); ATSUSetObjFontFallbacks (fontFallbacks, 0, NULL, kATSUDefaultFontFallbacks); } char *text_utf8 = (char *) *(*handle) -> cells + dataOffset; strncpy (Melder_buffer1, text_utf8, dataLength); Melder_buffer1 [dataLength] = '\0'; wchar_t *text_wcs = Melder_peekUtf8ToWcs (Melder_buffer1); const MelderUtf16 *text_utf16 = Melder_peekWcsToUtf16 (text_wcs); UniCharCount runLength = wcslen (text_wcs); // BUG ATSUTextLayout textLayout; ATSUStyle style; ATSUCreateStyle (& style); Fixed fontSize = 13 << 16; Boolean boldStyle = 0; Boolean italicStyle = 0; ATSUAttributeTag styleAttributeTags [] = { kATSUSizeTag, kATSUQDBoldfaceTag, kATSUQDItalicTag }; ByteCount styleValueSizes [] = { sizeof (Fixed), sizeof (Boolean), sizeof (Boolean) }; ATSUAttributeValuePtr styleValues [] = { & fontSize, & boldStyle, & italicStyle }; ATSUSetAttributes (style, 3, styleAttributeTags, styleValueSizes, styleValues); OSStatus err = ATSUCreateTextLayoutWithTextPtr (text_utf16, kATSUFromTextBeginning, kATSUToTextEnd, runLength, 1, & runLength, & style, & textLayout); Melder_assert (err == 0); ATSUAttributeTag attributeTags [] = { kATSUCGContextTag, kATSULineFontFallbacksTag }; ByteCount valueSizes [] = { sizeof (CGContextRef), sizeof (ATSUFontFallbacks) }; ATSUAttributeValuePtr values [] = { & macGraphicsContext, & fontFallbacks }; ATSUSetLayoutControls (textLayout, 2, attributeTags, valueSizes, values); ATSUSetTransientFontMatching (textLayout, true); CGContextTranslateCTM (macGraphicsContext, rect -> left, shellHeight - rect -> bottom + 4); err = ATSUDrawText (textLayout, kATSUFromTextBeginning, kATSUToTextEnd, 0 /*xDC << 16*/, 0 /*(shellHeight - yDC) << 16*/); Melder_assert (err == 0); CGContextSynchronize (macGraphicsContext); ATSUDisposeTextLayout (textLayout); ATSUDisposeStyle (style); QDEndCGContext (GetWindowPort (widget -> macWindow), & macGraphicsContext); GuiMac_clipOff (); break; /* case lHiliteMsg: Melder_assert (me != NULL); SetPortWindowPort (my macWindow); _GuiMac_clipOnParent (me); LMSetHiliteMode (LMGetHiliteMode () & ~ 128L); InvertRect (rect); GuiMac_clipOff (); break;*/ } } #endif #if gtk enum { COLUMN_STRING, N_COLUMNS }; #endif GuiList GuiList_create (GuiForm parent, int left, int right, int top, int bottom, bool allowMultipleSelection, const wchar_t *header) { GuiList me = Thing_new (GuiList); my d_shell = parent -> d_shell; my d_parent = parent; my d_allowMultipleSelection = allowMultipleSelection; #if gtk GtkCellRenderer *renderer = NULL; GtkTreeViewColumn *col = NULL; GtkTreeSelection *sel = NULL; GtkListStore *liststore = NULL; liststore = gtk_list_store_new (1, G_TYPE_STRING); // 1 column, of type String (this is a vararg list) GuiObject scrolled = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); my d_widget = gtk_tree_view_new_with_model (GTK_TREE_MODEL (liststore)); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (my d_widget), FALSE); gtk_container_add (GTK_CONTAINER (scrolled), GTK_WIDGET (my d_widget)); gtk_widget_show (GTK_WIDGET (scrolled)); // BUG gtk_tree_view_set_rubber_banding (GTK_TREE_VIEW (my d_widget), allowMultipleSelection ? GTK_SELECTION_MULTIPLE : GTK_SELECTION_SINGLE); g_object_unref (liststore); // Destroys the widget after the list is destroyed _GuiObject_setUserData (my d_widget, me); _GuiObject_setUserData (scrolled, me); // for resizing renderer = gtk_cell_renderer_text_new (); col = gtk_tree_view_column_new (); gtk_tree_view_column_pack_start (col, renderer, TRUE); gtk_tree_view_column_add_attribute (col, renderer, "text", 0); // zeroeth column if (header != NULL) { //gtk_tree_view_column_set_title (col, Melder_peekWcsToUtf8 (header)); } gtk_tree_view_append_column (GTK_TREE_VIEW (my d_widget), col); g_object_set_data_full (G_OBJECT (my d_widget), "guiList", me, (GDestroyNotify) _GuiGtkList_destroyCallback); /* GtkCellRenderer *renderer; GtkTreeViewColumn *col; my widget = gtk_tree_view_new_with_model (GTK_TREE_MODEL (liststore)); renderer = gtk_cell_renderer_text_new (); col = gtk_tree_view_column_new (); gtk_tree_view_column_pack_start (col, renderer, TRUE); gtk_tree_view_column_add_attribute (col, renderer, "text", COL_ID); gtk_tree_view_column_set_title (col, " ID "); gtk_tree_view_append_column (GTK_TREE_VIEW (view), col); renderer = gtk_cell_renderer_text_new (); col = gtk_tree_view_column_new (); gtk_tree_view_column_pack_start (col, renderer, TRUE); gtk_tree_view_column_add_attribute (col, renderer, "text", COL_TYPE); gtk_tree_view_column_set_title (col, " Type "); gtk_tree_view_append_column (GTK_TREE_VIEW (view), col); renderer = gtk_cell_renderer_text_new (); col = gtk_tree_view_column_new (); gtk_tree_view_column_pack_start (col, renderer, TRUE); gtk_tree_view_column_add_attribute (col, renderer, "text", COL_NAME); gtk_tree_view_column_set_title (col, " Name "); gtk_tree_view_append_column (GTK_TREE_VIEW (view), col); */ sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (my d_widget)); if (allowMultipleSelection) { gtk_tree_selection_set_mode (sel, GTK_SELECTION_MULTIPLE); } else { gtk_tree_selection_set_mode (sel, GTK_SELECTION_SINGLE); } my v_positionInForm (scrolled, left, right, top, bottom, parent); g_signal_connect (sel, "changed", G_CALLBACK (_GuiGtkList_selectionChangedCallback), me); #elif cocoa GuiCocoaList *list = [[GuiCocoaList alloc] init]; my d_widget = (GuiObject) list; my v_positionInForm (my d_widget, left, right, top, bottom, parent); [[list tableView] setAllowsMultipleSelection: allowMultipleSelection]; [list setUserData:me]; #elif win my d_widget = _Gui_initializeWidget (xmListWidgetClass, parent -> d_widget, L"list"); _GuiObject_setUserData (my d_widget, me); my d_widget -> window = CreateWindowEx (0, L"listbox", L"list", WS_CHILD | WS_BORDER | WS_VSCROLL | LBS_NOTIFY | WS_CLIPSIBLINGS | ( allowMultipleSelection ? LBS_EXTENDEDSEL : 0 ), my d_widget -> x, my d_widget -> y, my d_widget -> width, my d_widget -> height, my d_widget -> parent -> window, NULL, theGui.instance, NULL); SetWindowLongPtr (my d_widget -> window, GWLP_USERDATA, (LONG_PTR) my d_widget); SetWindowFont (my d_widget -> window, GetStockFont (ANSI_VAR_FONT), FALSE); /*if (MEMBER (my parent, ScrolledWindow)) { XtDestroyWidget (my d_widget -> parent -> motiff.scrolledWindow.horizontalBar); my d_widget -> parent -> motiff.scrolledWindow.horizontalBar = NULL; XtDestroyWidget (my d_widget -> parent -> motiff.scrolledWindow.verticalBar); my d_widget -> parent -> motiff.scrolledWindow.verticalBar = NULL; }*/ my v_positionInForm (my d_widget, left, right, top, bottom, parent); #elif mac my d_xmScrolled = XmCreateScrolledWindow (parent -> d_widget, "scrolled", NULL, 0); my v_positionInForm (my d_xmScrolled, left, right, top, bottom, parent); my d_xmList = my d_widget = _Gui_initializeWidget (xmListWidgetClass, my d_xmScrolled, L"list"); _GuiObject_setUserData (my d_xmScrolled, me); _GuiObject_setUserData (my d_xmList, me); Rect dataBounds = { 0, 0, 0, 1 }; Point cSize; SetPt (& cSize, my d_xmList -> rect.right - my d_xmList -> rect.left + 1, CELL_HEIGHT); static ListDefSpec listDefSpec; if (listDefSpec. u. userProc == NULL) { listDefSpec. defType = kListDefUserProcType; listDefSpec. u. userProc = mac_listDefinition; } CreateCustomList (& my d_xmList -> rect, & dataBounds, cSize, & listDefSpec, my d_xmList -> macWindow, false, false, false, false, & my d_macListHandle); SetListRefCon (my d_macListHandle, (long) my d_xmList); if (allowMultipleSelection) SetListSelectionFlags (my d_macListHandle, lExtendDrag | lNoRect); XtVaSetValues (my d_xmList, XmNwidth, right > 0 ? right - left + 100 : 530, NULL); #endif return me; } GuiList GuiList_createShown (GuiForm parent, int left, int right, int top, int bottom, bool allowMultipleSelection, const wchar_t *header) { GuiList me = GuiList_create (parent, left, right, top, bottom, allowMultipleSelection, header); my f_show (); return me; } void structGuiList :: f_deleteAllItems () { GuiControlBlockValueChangedCallbacks block (this); #if gtk GtkListStore *list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget))); gtk_list_store_clear (list_store); #elif cocoa GuiCocoaList *list = (GuiCocoaList *) d_widget; [list.contents removeAllObjects]; [list.tableView reloadData]; #elif win ListBox_ResetContent (d_widget -> window); #elif mac _GuiMac_clipOnParent (d_widget); LDelRow (0, 0, d_macListHandle); GuiMac_clipOff (); #endif } void structGuiList :: f_deleteItem (long position) { GuiControlBlockValueChangedCallbacks block (this); #if gtk GtkTreeIter iter; GtkTreeModel *tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget)); if (gtk_tree_model_iter_nth_child (tree_model, & iter, NULL, (gint) (position - 1))) { gtk_list_store_remove (GTK_LIST_STORE (tree_model), & iter); } #elif cocoa GuiCocoaList *list = (GuiCocoaList *) d_widget; [list. contents removeObjectAtIndex: position - 1]; [list. tableView reloadData]; #elif win ListBox_DeleteString (d_widget -> window, position - 1); #elif mac _GuiMac_clipOnParent (d_widget); LDelRow (1, position - 1, d_macListHandle); GuiMac_clipOff (); long n = (** d_macListHandle). dataBounds. bottom; XtVaSetValues (d_widget, XmNheight, n * CELL_HEIGHT, NULL); #endif } void structGuiList :: f_deselectAllItems () { GuiControlBlockValueChangedCallbacks block (this); #if gtk GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (d_widget)); gtk_tree_selection_unselect_all (selection); #elif cocoa GuiCocoaList *list = (GuiCocoaList *) d_widget; [list.tableView deselectAll:nil]; #elif win ListBox_SetSel (d_widget -> window, False, -1); #elif mac long n = (** d_macListHandle). dataBounds. bottom; Cell cell; cell.h = 0; _GuiMac_clipOnParent (d_widget); for (long i = 0; i < n; i ++) { cell.v = i; LSetSelect (false, cell, d_macListHandle); } GuiMac_clipOff (); #endif } void structGuiList :: f_deselectItem (long position) { GuiControlBlockValueChangedCallbacks block (this); #if gtk GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (d_widget)); /* GtkListStore *list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget))); GtkTreePath *path = gtk_tree_path_new_from_indices ((gint) position);*/ GtkTreeIter iter; // gtk_tree_model_get_iter (GTK_TREE_MODEL (list_store), & iter, path); // gtk_tree_path_free (path); GtkTreeModel *tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget)); if (gtk_tree_model_iter_nth_child (tree_model, & iter, NULL, (gint) (position - 1))) { gtk_tree_selection_unselect_iter (selection, & iter); } #elif cocoa GuiCocoaList *list = (GuiCocoaList *) d_widget; [list. tableView deselectRow: position - 1]; #elif win ListBox_SetSel (d_widget -> window, False, position - 1); #elif mac Cell cell; cell. h = 0; cell. v = position - 1; _GuiMac_clipOnParent (d_widget); LSetSelect (false, cell, d_macListHandle); GuiMac_clipOff (); #endif } long * structGuiList :: f_getSelectedPositions (long *numberOfSelectedPositions) { *numberOfSelectedPositions = 0; long *selectedPositions = NULL; #if gtk GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (d_widget)); GtkListStore *list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget))); int n = gtk_tree_selection_count_selected_rows (selection); if (n > 0) { GList *list = gtk_tree_selection_get_selected_rows (selection, (GtkTreeModel **) & list_store); long ipos = 1; *numberOfSelectedPositions = n; selectedPositions = NUMvector <long> (1, *numberOfSelectedPositions); Melder_assert (selectedPositions != NULL); for (GList *l = g_list_first (list); l != NULL; l = g_list_next (l)) { gint *index = gtk_tree_path_get_indices ((GtkTreePath *) l -> data); selectedPositions [ipos] = index [0] + 1; ipos ++; } g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); g_list_free (list); } return selectedPositions; #elif cocoa GuiCocoaList *list = (GuiCocoaList *) d_widget; NSIndexSet *indexSet = [list. tableView selectedRowIndexes]; *numberOfSelectedPositions = 0; selectedPositions = NUMvector <long> (1, [indexSet count]); NSUInteger currentIndex = [indexSet firstIndex]; while (currentIndex != NSNotFound) { selectedPositions [++ *numberOfSelectedPositions] = currentIndex + 1; currentIndex = [indexSet indexGreaterThanIndex: currentIndex]; } #elif win int n = ListBox_GetSelCount (d_widget -> window), *indices; if (n == 0) { return selectedPositions; } if (n == -1) { // single selection int selection = ListBox_GetCurSel (d_widget -> window); if (selection == -1) return False; n = 1; indices = Melder_calloc_f (int, n); indices [0] = selection; } else { indices = Melder_calloc_f (int, n); ListBox_GetSelItems (d_widget -> window, n, indices); } *numberOfSelectedPositions = n; selectedPositions = NUMvector <long> (1, *numberOfSelectedPositions); Melder_assert (selectedPositions != NULL); for (long ipos = 1; ipos <= *numberOfSelectedPositions; ipos ++) { selectedPositions [ipos] = indices [ipos - 1] + 1; // convert from zero-based list of zero-based indices } Melder_free (indices); #elif mac long n = (** d_macListHandle). dataBounds. bottom; Cell cell; cell.h = 0; if (n < 1) { return selectedPositions; } selectedPositions = NUMvector <long> (1, n); // probably too big (ergo, probably reallocable), but the caller will throw it away anyway for (long i = 1; i <= n; i ++) { cell. v = i - 1; if (LGetSelect (false, & cell, d_macListHandle)) { selectedPositions [++ *numberOfSelectedPositions] = i; } } if (*numberOfSelectedPositions == 0) { NUMvector_free (selectedPositions, 1); selectedPositions = NULL; } #endif return selectedPositions; } long structGuiList :: f_getBottomPosition () { #if gtk // TODO return 1; #elif cocoa return 1; // TODO #elif win long bottom = ListBox_GetTopIndex (d_widget -> window) + d_widget -> height / ListBox_GetItemHeight (d_widget -> window, 0); if (bottom < 1) bottom = 1; long n = ListBox_GetCount (d_widget -> window); if (bottom > n) bottom = n; return bottom; #elif mac Melder_assert (d_widget -> parent -> widgetClass == xmScrolledWindowWidgetClass); GuiObject clipWindow = d_widget -> parent -> motiff.scrolledWindow.clipWindow; GuiObject workWindow = d_widget -> parent -> motiff.scrolledWindow.workWindow; long top = (clipWindow -> rect.top - workWindow -> rect.top + 5) / CELL_HEIGHT + 1; long visible = (clipWindow -> rect.bottom - clipWindow -> rect.top - 5) / CELL_HEIGHT + 1; long n = (** d_macListHandle). dataBounds. bottom; if (visible > n) visible = n; long bottom = top + visible - 1; if (bottom < 1) bottom = 1; if (bottom > n) bottom = n; return bottom; #endif } long structGuiList :: f_getNumberOfItems () { long numberOfItems = 0; #if gtk GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget)); numberOfItems = gtk_tree_model_iter_n_children (model, NULL); #elif cocoa GuiCocoaList *list = (GuiCocoaList *) d_widget; numberOfItems = [[list contents] count]; #elif win numberOfItems = ListBox_GetCount (d_widget -> window); #elif mac numberOfItems = (** d_macListHandle). dataBounds. bottom; #endif return numberOfItems; } long structGuiList :: f_getTopPosition () { #if gtk // TODO return 1; #elif cocoa return 1; // TODO #elif win long top = ListBox_GetTopIndex (d_widget -> window); if (top < 1) top = 1; long n = ListBox_GetCount (d_widget -> window); if (top > n) top = 0; return top; #elif mac Melder_assert (d_widget -> parent -> widgetClass == xmScrolledWindowWidgetClass); GuiObject clipWindow = d_widget -> parent -> motiff.scrolledWindow.clipWindow; GuiObject workWindow = d_widget -> parent -> motiff.scrolledWindow.workWindow; long top = (clipWindow -> rect.top - workWindow -> rect.top + 5) / CELL_HEIGHT + 1; if (top < 1) top = 1; long n = (** d_macListHandle). dataBounds. bottom; if (top > n) top = 0; return top; #endif } void structGuiList :: f_insertItem (const wchar_t *itemText, long position) { GuiControlBlockValueChangedCallbacks block (this); /* * 'position' is the position of the new item in the list after insertion: * a value of 1 therefore puts the new item at the top of the list; * a value of 0 is special: the item is put at the bottom of the list. */ #if gtk GtkListStore *list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget))); gtk_list_store_insert_with_values (list_store, NULL, (gint) position - 1, COLUMN_STRING, Melder_peekWcsToUtf8 (itemText), -1); // TODO: Tekst opsplitsen // does GTK know the '0' trick? // it does know about NULL, to append in another function #elif cocoa GuiCocoaList *list = (GuiCocoaList *) d_widget; NSString *nsString = [[NSString alloc] initWithUTF8String: Melder_peekWcsToUtf8 (itemText)]; if (position) [[list contents] insertObject: nsString atIndex: position - 1]; // cocoa lists start with item 0 else [[list contents] addObject: nsString]; // insert at end //Melder_assert ([nsString retainCount] == 2); [nsString release]; [[list tableView] reloadData]; #elif win if (position) ListBox_InsertString (d_widget -> window, position - 1, itemText); // win lists start with item 0 else ListBox_AddString (d_widget -> window, itemText); // insert at end #elif mac long n = (** d_macListHandle). dataBounds. bottom; if (position == 0) position = n + 1; // insert at end Cell cell; cell.h = 0; cell. v = position - 1; // mac lists start with item 0 _GuiMac_clipOnParent (d_widget); LAddRow (1, position - 1, d_macListHandle); const char *itemText_utf8 = Melder_peekWcsToUtf8 (itemText); // although defProc will convert again... LSetCell (itemText_utf8, (short) strlen (itemText_utf8), cell, d_macListHandle); (** d_macListHandle). visible. bottom = n + 1; _GuiMac_clipOffInvalid (d_widget); XtVaSetValues (d_widget, XmNheight, (n + 1) * CELL_HEIGHT, NULL); #endif } void structGuiList :: f_replaceItem (const wchar_t *itemText, long position) { GuiControlBlockValueChangedCallbacks block (this); #if gtk GtkTreeIter iter; GtkTreeModel *tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget)); if (gtk_tree_model_iter_nth_child (tree_model, & iter, NULL, (gint) (position - 1))) { gtk_list_store_set (GTK_LIST_STORE (tree_model), & iter, COLUMN_STRING, Melder_peekWcsToUtf8 (itemText), -1); } /* GtkTreePath *path = gtk_tree_path_new_from_indices ((gint) position); GtkTreeIter iter; GtkListStore *list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget))); gtk_tree_model_get_iter (GTK_TREE_MODEL (list_store), & iter, path); gtk_tree_path_free (path);*/ // gtk_list_store_set (list_store, & iter, 0, Melder_peekWcsToUtf8 (itemText), -1); // TODO: Tekst opsplitsen #elif cocoa GuiCocoaList *list = (GuiCocoaList *) d_widget; NSString *nsString = [[NSString alloc] initWithUTF8String: Melder_peekWcsToUtf8 (itemText)]; [[list contents] replaceObjectAtIndex: position - 1 withObject: nsString]; Melder_assert ([nsString retainCount] == 2); [nsString release]; [[list tableView] reloadData]; #elif win long nativePosition = position - 1; // convert from 1-based to zero-based ListBox_DeleteString (d_widget -> window, nativePosition); ListBox_InsertString (d_widget -> window, nativePosition, itemText); #elif mac _GuiMac_clipOnParent (d_widget); Cell cell; cell.h = 0; cell.v = position - 1; const char *itemText_utf8 = Melder_peekWcsToUtf8 (itemText); LSetCell (itemText_utf8, strlen (itemText_utf8), cell, d_macListHandle); LDraw (cell, d_macListHandle); GuiMac_clipOff (); #endif } void structGuiList :: f_selectItem (long position) { GuiControlBlockValueChangedCallbacks block (this); #if gtk GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (d_widget)); GtkTreePath *path = gtk_tree_path_new_from_indices ((gint) position - 1, -1); gtk_tree_selection_select_path (selection, path); gtk_tree_path_free (path); // TODO: check of het bovenstaande werkt, dan kan dit weg // GtkListStore *list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget))); // GtkTreePath *path = gtk_tree_path_new_from_indices ((gint) position); // GtkTreeIter iter; // gtk_tree_model_get_iter (GTK_TREE_MODEL (list_store), & iter, path); // gtk_tree_selection_select_iter (selection, & iter); #elif cocoa NSIndexSet *indexSet = [[NSIndexSet alloc] initWithIndex: position - 1]; GuiCocoaList *list = (GuiCocoaList *) d_widget; [[list tableView] selectRowIndexes: indexSet byExtendingSelection: d_allowMultipleSelection]; [indexSet release]; #elif win if (! d_allowMultipleSelection) { ListBox_SetCurSel (d_widget -> window, position - 1); } else { ListBox_SetSel (d_widget -> window, True, position - 1); } #elif mac Cell cell; cell.h = 0; _GuiMac_clipOnParent (d_widget); if (! d_allowMultipleSelection) { long n = (** d_macListHandle). dataBounds. bottom; for (long i = 0; i < n; i ++) if (i != position - 1) { cell.v = i; LSetSelect (false, cell, d_macListHandle); } } cell.v = position - 1; LSetSelect (true, cell, d_macListHandle); GuiMac_clipOff (); #endif } void structGuiList :: f_setDoubleClickCallback (void (*callback) (void *boss, GuiListEvent event), void *boss) { d_doubleClickCallback = callback; d_doubleClickBoss = boss; } void structGuiList :: f_setSelectionChangedCallback (void (*callback) (void *boss, GuiListEvent event), void *boss) { d_selectionChangedCallback = callback; d_selectionChangedBoss = boss; } void structGuiList :: f_setTopPosition (long topPosition) { //Melder_casual ("Set top position %ld", topPosition); #if gtk // GtkListStore *list_store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (d_widget))); GtkTreePath *path = gtk_tree_path_new_from_indices ((gint) topPosition); gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (d_widget), path, NULL, FALSE, 0.0, 0.0); gtk_tree_path_free (path); #elif cocoa // TODO: implement #elif win ListBox_SetTopIndex (d_widget -> window, topPosition - 1); #elif mac //_GuiMac_clipOnParent (d_widget); //LScroll (0, topPosition - (** d_macListHandle). visible. top - 1, d_macListHandle); // TODO: implement //GuiMac_clipOff (); //my d_scrolled -> motiff.scrolledWindow.verticalBar; // TODO: implement XtVaSetValues (d_widget, XmNy, - (topPosition - 1) * CELL_HEIGHT, NULL); #endif } /* End of file GuiList.cpp */
PeterWolf-tw/NeoPraat
sources_5401/sys/GuiList.cpp
C++
lgpl-3.0
33,358
/** * Copyright (C) 2010-2017 Gordon Fraser, Andrea Arcuri and EvoSuite * contributors * * This file is part of EvoSuite. * * EvoSuite 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.0 of the License, or * (at your option) any later version. * * EvoSuite 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 Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with EvoSuite. If not, see <http://www.gnu.org/licenses/>. */ package org.evosuite.rmi; import java.rmi.NoSuchObjectException; import java.rmi.registry.LocateRegistry; import java.rmi.registry.Registry; import java.rmi.server.UnicastRemoteObject; import org.evosuite.Properties; import org.evosuite.rmi.service.ClientNodeImpl; import org.evosuite.rmi.service.ClientNodeLocal; import org.evosuite.rmi.service.ClientNodeRemote; import org.evosuite.rmi.service.DummyClientNodeImpl; import org.evosuite.statistics.RuntimeVariable; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * This class should be used only in the Client processes, not the master. * Used to initialize and store all the RMI services in the clients * * @author arcuri * */ public class ClientServices { private static Logger logger = LoggerFactory.getLogger(ClientServices.class); private static ClientServices instance = new ClientServices(); private volatile ClientNodeImpl clientNode = new DummyClientNodeImpl(); protected ClientServices(){ } public static ClientServices getInstance(){ return instance; } public boolean registerServices() { UtilsRMI.ensureRegistryOnLoopbackAddress(); try{ int port = Properties.PROCESS_COMMUNICATION_PORT; Registry registry = LocateRegistry.getRegistry(port); clientNode = new ClientNodeImpl(registry); ClientNodeRemote stub = (ClientNodeRemote) UtilsRMI.exportObject(clientNode); registry.rebind(clientNode.getClientRmiIdentifier(), stub); return clientNode.init(); } catch(Exception e){ logger.error("Failed to register client services",e); return false; } } public ClientNodeLocal getClientNode() { return clientNode; } public void stopServices(){ if(clientNode!=null){ clientNode.stop(); int i = 0; final int tries = 10; boolean done = false; try { while(!done){ /* * A call from Master could still be active on this node. so we cannot * forcely stop the client, we need to wait */ done = UnicastRemoteObject.unexportObject(clientNode, false); try { Thread.sleep(1000); } catch (InterruptedException e) { break; } i++; if(i>=tries){ logger.error("Tried "+tries+" times to stop RMI ClientNode, giving up"); break; } } } catch (NoSuchObjectException e) { //this could happen if Master has removed the registry logger.debug("Failed to delete ClientNode RMI instance",e); } clientNode = new DummyClientNodeImpl(); } } /** * Shorthand for the commonly used trackOutputVariable method * * @param outputVariable The runtime variable to track * @param value The value of the runtime variable */ public static void track(RuntimeVariable outputVariable, Object value) { ClientServices.getInstance().getClientNode().trackOutputVariable(outputVariable, value); } }
sefaakca/EvoSuite-Sefa
client/src/main/java/org/evosuite/rmi/ClientServices.java
Java
lgpl-3.0
3,614
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #include "disassociateawsaccountfrompartneraccountresponse.h" #include "disassociateawsaccountfrompartneraccountresponse_p.h" #include <QDebug> #include <QNetworkReply> #include <QXmlStreamReader> namespace QtAws { namespace IoTWireless { /*! * \class QtAws::IoTWireless::DisassociateAwsAccountFromPartnerAccountResponse * \brief The DisassociateAwsAccountFromPartnerAccountResponse class provides an interace for IoTWireless DisassociateAwsAccountFromPartnerAccount responses. * * \inmodule QtAwsIoTWireless * * AWS IoT Wireless API * * \sa IoTWirelessClient::disassociateAwsAccountFromPartnerAccount */ /*! * Constructs a DisassociateAwsAccountFromPartnerAccountResponse object for \a reply to \a request, with parent \a parent. */ DisassociateAwsAccountFromPartnerAccountResponse::DisassociateAwsAccountFromPartnerAccountResponse( const DisassociateAwsAccountFromPartnerAccountRequest &request, QNetworkReply * const reply, QObject * const parent) : IoTWirelessResponse(new DisassociateAwsAccountFromPartnerAccountResponsePrivate(this), parent) { setRequest(new DisassociateAwsAccountFromPartnerAccountRequest(request)); setReply(reply); } /*! * \reimp */ const DisassociateAwsAccountFromPartnerAccountRequest * DisassociateAwsAccountFromPartnerAccountResponse::request() const { Q_D(const DisassociateAwsAccountFromPartnerAccountResponse); return static_cast<const DisassociateAwsAccountFromPartnerAccountRequest *>(d->request); } /*! * \reimp * Parses a successful IoTWireless DisassociateAwsAccountFromPartnerAccount \a response. */ void DisassociateAwsAccountFromPartnerAccountResponse::parseSuccess(QIODevice &response) { //Q_D(DisassociateAwsAccountFromPartnerAccountResponse); QXmlStreamReader xml(&response); /// @todo } /*! * \class QtAws::IoTWireless::DisassociateAwsAccountFromPartnerAccountResponsePrivate * \brief The DisassociateAwsAccountFromPartnerAccountResponsePrivate class provides private implementation for DisassociateAwsAccountFromPartnerAccountResponse. * \internal * * \inmodule QtAwsIoTWireless */ /*! * Constructs a DisassociateAwsAccountFromPartnerAccountResponsePrivate object with public implementation \a q. */ DisassociateAwsAccountFromPartnerAccountResponsePrivate::DisassociateAwsAccountFromPartnerAccountResponsePrivate( DisassociateAwsAccountFromPartnerAccountResponse * const q) : IoTWirelessResponsePrivate(q) { } /*! * Parses a IoTWireless DisassociateAwsAccountFromPartnerAccount response element from \a xml. */ void DisassociateAwsAccountFromPartnerAccountResponsePrivate::parseDisassociateAwsAccountFromPartnerAccountResponse(QXmlStreamReader &xml) { Q_ASSERT(xml.name() == QLatin1String("DisassociateAwsAccountFromPartnerAccountResponse")); Q_UNUSED(xml) ///< @todo } } // namespace IoTWireless } // namespace QtAws
pcolby/libqtaws
src/iotwireless/disassociateawsaccountfrompartneraccountresponse.cpp
C++
lgpl-3.0
3,602
--Copyright (C) 2009 <SWGEmu> --This File is part of Core3. --This program 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 2 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 Lesser General Public License for --more details. --You should have received a copy of the GNU Lesser General --Public License along with this program; if not, write to --the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA --Linking Engine3 statically or dynamically with other modules --is making a combined work based on Engine3. --Thus, the terms and conditions of the GNU Lesser General Public License --cover the whole combination. --In addition, as a special exception, the copyright holders of Engine3 --give you permission to combine Engine3 program with free software --programs or libraries that are released under the GNU LGPL and with --code included in the standard release of Core3 under the GNU LGPL --license (or modified versions of such code, with unchanged license). --You may copy and distribute such a system following the terms of the --GNU LGPL for Engine3 and the licenses of the other code concerned, --provided that you include the source code of that other code when --and as the GNU LGPL requires distribution of source code. --Note that people who make modified versions of Engine3 are not obligated --to grant this special exception for their modified versions; --it is their choice whether to do so. The GNU Lesser General Public License --gives permission to release a modified version without this exception; --this exception also makes it possible to release a modified version --which carries forward this exception. object_installation_mining_organic_shared_mining_organic_creature_farm = SharedInstallationObjectTemplate:new { appearanceFilename = "appearance/ins_all_creature_farm_s01_u0.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 15, clientDataFile = "clientdata/installation/client_shared_mining_organic_creature_farm.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "", gameObjectType = 4099, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@installation_n:creature_farm", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "footprint/installation/mining_organic/shared_mining_organic_creature_farm.sfp", surfaceType = 1, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_installation_mining_organic_shared_mining_organic_creature_farm, 3544083954) object_installation_mining_organic_shared_mining_organic_flora_farm = SharedInstallationObjectTemplate:new { appearanceFilename = "appearance/ins_all_flora_small.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 15, clientDataFile = "", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "", gameObjectType = 4099, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@installation_n:flora_farm_small", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "footprint/installation/mining_organic/shared_mining_organic_flora_farm.sfp", surfaceType = 1, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_installation_mining_organic_shared_mining_organic_flora_farm, 3438944708) object_installation_mining_organic_shared_mining_organic_flora_farm_heavy = SharedInstallationObjectTemplate:new { appearanceFilename = "appearance/ins_all_photo_bio_u0.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 15, clientDataFile = "clientdata/installation/client_shared_power_generator_photo_bio_style_1.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "", gameObjectType = 4099, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@installation_n:flora_farm_heavy", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "footprint/installation/mining_organic/shared_mining_organic_flora_farm_heavy.sfp", surfaceType = 1, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_installation_mining_organic_shared_mining_organic_flora_farm_heavy, 880917767) object_installation_mining_organic_shared_mining_organic_flora_farm_medium = SharedInstallationObjectTemplate:new { appearanceFilename = "appearance/ins_all_flora_farm_base_s01_u0.apt", arrangementDescriptorFilename = "", certificationsRequired = {}, clearFloraRadius = 15, clientDataFile = "clientdata/installation/client_shared_mining_organic_flora_farm.cdf", collisionActionBlockFlags = 0, collisionActionFlags = 51, collisionActionPassFlags = 1, collisionMaterialBlockFlags = 0, collisionMaterialFlags = 1, collisionMaterialPassFlags = 0, containerType = 0, containerVolumeLimit = 1, customizationVariableMapping = {}, detailedDescription = "", gameObjectType = 4099, locationReservationRadius = 0, lookAtText = "", noBuildRadius = 0, objectName = "@installation_n:flora_farm", onlyVisibleInTools = 0, paletteColorCustomizationVariables = {}, portalLayoutFilename = "", rangedIntCustomizationVariables = {}, scale = 1, scaleThresholdBeforeExtentTest = 0.5, sendToClient = 1, slotDescriptorFilename = "abstract/slot/descriptor/tangible.iff", snapToTerrain = 1, socketDestinations = {}, structureFootprintFileName = "footprint/installation/mining_organic/shared_mining_organic_flora_farm_medium.sfp", surfaceType = 1, targetable = 1, useStructureFootprintOutline = 0 } ObjectTemplates:addTemplate(object_installation_mining_organic_shared_mining_organic_flora_farm_medium, 681856626)
TheAnswer/FirstTest
bin/scripts/object/installation/mining_organic/objects.lua
Lua
lgpl-3.0
7,892
package ch.loway.oss.ari4java.generated; // ---------------------------------------------------- // THIS CLASS WAS GENERATED AUTOMATICALLY // PLEASE DO NOT EDIT // Generated on: Sat Sep 19 08:50:54 CEST 2015 // ---------------------------------------------------- import java.util.Date; import java.util.List; import java.util.Map; import java.util.ArrayList; import ch.loway.oss.ari4java.tools.RestException; import ch.loway.oss.ari4java.tools.AriCallback; import ch.loway.oss.ari4java.tools.tags.*; /********************************************************** * * Generated by: JavaInterface *********************************************************/ public interface StasisStart { // void setReplace_channel Channel /********************************************************** * * * @since ari_1_5_0 *********************************************************/ public void setReplace_channel(Channel val ); // Channel getReplace_channel /********************************************************** * * * @since ari_1_5_0 *********************************************************/ public Channel getReplace_channel(); // Channel getChannel /********************************************************** * * * @since ari_0_0_1 *********************************************************/ public Channel getChannel(); // void setArgs List<String> /********************************************************** * Arguments to the application * * @since ari_0_0_1 *********************************************************/ public void setArgs(List<String> val ); // List<String> getArgs /********************************************************** * Arguments to the application * * @since ari_0_0_1 *********************************************************/ public List<String> getArgs(); // void setChannel Channel /********************************************************** * * * @since ari_0_0_1 *********************************************************/ public void setChannel(Channel val ); } ;
korvus81/ari4java
classes/ch/loway/oss/ari4java/generated/StasisStart.java
Java
lgpl-3.0
2,103
<?php /** * @file This file is part of the PdfParser library. * * @author Konrad Abicht <k.abicht@gmail.com> * @date 2020-06-01 * * @author Sébastien MALOT <sebastien@malot.fr> * @date 2017-01-03 * * @license LGPLv3 * @url <https://github.com/smalot/pdfparser> * * PdfParser is a pdf library written in PHP, extraction oriented. * Copyright (C) 2017 - Sébastien MALOT <sebastien@malot.fr> * * This program 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. * * 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. * If not, see <http://www.pdfparser.org/sites/default/LICENSE.txt>. */ namespace Tests\Smalot\PdfParser\Integration; use Smalot\PdfParser\Config; use Smalot\PdfParser\Document; use Smalot\PdfParser\Element; use Smalot\PdfParser\Encoding; use Smalot\PdfParser\Font; use Smalot\PdfParser\Header; use Smalot\PdfParser\PDFObject; use Tests\Smalot\PdfParser\TestCase; class FontTest extends TestCase { public function testGetName(): void { $filename = $this->rootDir.'/samples/Document1_pdfcreator_nocompressed.pdf'; $parser = $this->getParserInstance(); $document = $parser->parseFile($filename); $fonts = $document->getFonts(); $font = reset($fonts); $this->assertEquals('OJHCYD+Cambria,Bold', $font->getName()); } public function testGetType(): void { $filename = $this->rootDir.'/samples/Document1_pdfcreator_nocompressed.pdf'; $parser = $this->getParserInstance(); $document = $parser->parseFile($filename); $fonts = $document->getFonts(); $font = reset($fonts); $this->assertEquals('TrueType', $font->getType()); } public function testGetDetails(): void { $filename = $this->rootDir.'/samples/Document1_pdfcreator_nocompressed.pdf'; $parser = $this->getParserInstance(); $document = $parser->parseFile($filename); $fonts = $document->getFonts(); $font = reset($fonts); $reference = [ 'Name' => 'OJHCYD+Cambria,Bold', 'Type' => 'TrueType', 'Encoding' => 'Ansi', 'BaseFont' => 'OJHCYD+Cambria,Bold', 'FontDescriptor' => [ 'Type' => 'FontDescriptor', 'FontName' => 'OJHCYD+Cambria,Bold', 'Flags' => 4, 'Ascent' => 699, 'CapHeight' => 699, 'Descent' => -7, 'ItalicAngle' => 0, 'StemV' => 128, 'MissingWidth' => 658, ], 'ToUnicode' => [ 'Filter' => 'FlateDecode', 'Length' => 219, ], 'FirstChar' => 1, 'LastChar' => 11, 'Widths' => [ 0 => 705, 1 => 569, 2 => 469, 3 => 597, 4 => 890, 5 => 531, 6 => 604, 7 => 365, 8 => 220, 9 => 314, 10 => 308, ], 'Subtype' => 'TrueType', ]; $this->assertEquals($reference, $font->getDetails()); } public function testTranslateChar(): void { $filename = $this->rootDir.'/samples/Document1_pdfcreator_nocompressed.pdf'; $parser = $this->getParserInstance(); $document = $parser->parseFile($filename); $fonts = $document->getFonts(); $font = reset($fonts); $this->assertEquals('D', $font->translateChar("\x01")); $this->assertEquals('o', $font->translateChar("\x02")); $this->assertEquals('c', $font->translateChar("\x03")); $this->assertEquals('u', $font->translateChar("\x04")); $this->assertEquals(Font::MISSING, $font->translateChar("\x99")); } /** * Tests buggy behavior of #364. * * In some cases Front::translateChar calls Encoding::__toString, which doesn't exist. * * Resulting error: Call to undefined method Smalot\PdfParser\Encoding::__toString() * * @see https://github.com/smalot/pdfparser/issues/364 */ public function testTranslateCharIssue364(): void { /* * Approach: we provoke the __toString call with a minimal set of input data. */ $doc = new Document(); $header = new Header(['BaseEncoding' => new Element('StandardEncoding')]); $encoding = new Encoding($doc, $header); $encoding->init(); $font = new Font($doc, new Header(['Encoding' => $encoding])); $font->init(); // without the fix from #378, calling translateChar would raise "undefined method" error $this->assertEquals('?', $font->translateChar('t')); } public function testLoadTranslateTable(): void { $document = new Document(); $content = '<</Type/Font /Subtype /Type0 /ToUnicode 2 0 R>>'; $header = Header::parse($content, $document); $font = new Font($document, $header); $content = '/CIDInit /ProcSet findresource begin 14 dict begin begincmap /CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def /CMapName /Adobe-Identity-UCS def /CMapType 2 def 1 begincodespacerange <0000> <FFFF> endcodespacerange 3 beginbfchar <0003> <0020> <000F> <002C> <0011> <002E> endbfchar 2 beginbfrange <0013> <0016> <0030> <0018> <001C> <0035> endbfrange 7 beginbfchar <0023> <0040> <0026> <0043> <0028> <0045> <0030> <004D> <0033> <0050> <0035> <0052> <0039> <0056> endbfchar 4 beginbfrange <0044> <004C> <0061> <004F> <0052> <006C> <0054> <0059> <0071> <005B> <005C> <0078> endbfrange 4 beginbfchar <0070> <00E9> <00AB> <2026> <00B0> <0153> <00B6> <2019> endbfchar 1 beginbfrange <0084> <0086> [<0061> <0071> <0081>] endbfrange endcmap CMapName currentdict /CMap defineresource pop end end'; $unicode = new PDFObject($document, null, $content); $document->setObjects(['1_0' => $font, '2_0' => $unicode]); $font->init(); // Test reload $table = $font->loadTranslateTable(); $this->assertEquals(47, \count($table)); // Test chars $this->assertEquals(' ', $table[3]); $this->assertEquals(',', $table[15]); $this->assertEquals('.', $table[17]); $this->assertEquals('@', $table[35]); $this->assertEquals('V', $table[57]); // Test ranges $this->assertEquals('r', $table[85]); $this->assertEquals('y', $table[92]); } public function testDecodeHexadecimal(): void { $hexa = '<322041>'; $this->assertEquals('2 A', Font::decodeHexadecimal($hexa)); $this->assertEquals('2 A', Font::decodeHexadecimal($hexa, false)); $this->assertEquals('(2 A)', Font::decodeHexadecimal($hexa, true)); $hexa = '<003200200041>'; $this->assertEquals("\x002\x00 \x00A", Font::decodeHexadecimal($hexa)); $this->assertEquals("\x002\x00 \x00A", Font::decodeHexadecimal($hexa, false)); $this->assertEquals("(\x002\x00 \x00A)", Font::decodeHexadecimal($hexa, true)); $hexa = '<00320020> 8 <0041>'; $this->assertEquals("\x002\x00 8 \x00A", Font::decodeHexadecimal($hexa)); $this->assertEquals("\x002\x00 8 \x00A", Font::decodeHexadecimal($hexa, false)); $this->assertEquals("(\x002\x00 ) 8 (\x00A)", Font::decodeHexadecimal($hexa, true)); $hexa = '<3220> 8 <41>'; $this->assertEquals('2 8 A', Font::decodeHexadecimal($hexa)); $this->assertEquals('2 8 A', Font::decodeHexadecimal($hexa, false)); $this->assertEquals('(2 ) 8 (A)', Font::decodeHexadecimal($hexa, true)); $hexa = '<00320020005C>-10<0041>'; $this->assertEquals("\x002\x00 \x00\\-10\x00A", Font::decodeHexadecimal($hexa)); $this->assertEquals("\x002\x00 \x00\\-10\x00A", Font::decodeHexadecimal($hexa, false)); $this->assertEquals("(\x002\x00 \x00\\\\)-10(\x00A)", Font::decodeHexadecimal($hexa, true)); // If it contents XML, the function need to return the same value. $hexa = '<?xml version="1.0"?><body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="Acrobat:19.10.0" xfa:spec="2.0.2" style="font-size:12.0pt;text-align:left;color:0000;font-weight:normal;font-style:norm\ al;font-family:Helvetica,sans-serif;font-stretch:normal"><p><span style="font-family:Helvetica">Example</span></p></body>'; $this->assertEquals($hexa, Font::decodeHexadecimal($hexa)); // hexadecimal string with a line break should not return the input string // addressing issue #273: https://github.com/smalot/pdfparser/issues/273 $hexa = "<0027004c0056005300520051004c0045004c004f004c005d0044006f006d0052001d000300560048005b00570044001000490048004c00550044000f0003001400170003004700480003004900480059004800550048004c00550052000300470048000300\n15001300150013>"; $this->assertEquals("\x0\x27\x0\x4c\x0\x56\x0\x53\x0\x52\x0\x51\x0\x4c\x0\x45\x0\x4c\x0\x4f\x0\x4c\x0\x5d\x0\x44\x0\x6f\x0\x6d\x0\x52\x0\x1d\x0\x3\x0\x56\x0\x48\x0\x5b\x0\x57\x0\x44\x0\x10\x0\x49\x0\x48\x0\x4c\x0\x55\x0\x44\x0\xf\x0\x3\x0\x14\x0\x17\x0\x3\x0\x47\x0\x48\x0\x3\x0\x49\x0\x48\x0\x59\x0\x48\x0\x55\x0\x48\x0\x4c\x0\x55\x0\x52\x0\x3\x0\x47\x0\x48\x0\x3\x0\x15\x0\x13\x0\x15\x0\x13", Font::decodeHexadecimal($hexa)); } public function testDecodeOctal(): void { $this->assertEquals('AB C', Font::decodeOctal('\\101\\102\\040\\103')); $this->assertEquals('AB CD', Font::decodeOctal('\\101\\102\\040\\103D')); $this->assertEquals('AB \199', Font::decodeOctal('\\101\\102\\040\\199')); } public function testDecodeEntities(): void { $this->assertEquals('File Type', Font::decodeEntities('File#20Type')); $this->assertEquals('File# Ty#pe', Font::decodeEntities('File##20Ty#pe')); } public function testDecodeUnicode(): void { $this->assertEquals('AB', Font::decodeUnicode("\xFE\xFF\x00A\x00B")); } public function testDecodeText(): void { $filename = $this->rootDir.'/samples/Document1_pdfcreator_nocompressed.pdf'; $parser = $this->getParserInstance(); $document = $parser->parseFile($filename); $fonts = $document->getFonts(); // Cambria font $font = reset($fonts); $commands = [ [ 't' => '', 'c' => "\x01\x02", ], [ 't' => 'n', 'c' => -10, ], [ 't' => '', 'c' => "\x03", ], [ 't' => '', 'c' => "\x04", ], [ 't' => 'n', 'c' => -100, ], [ 't' => '<', 'c' => '01020304', ], ]; $this->assertEquals('Docu Docu', $font->decodeText($commands)); //Check if ANSI/Unicode detection is working properly $filename = $this->rootDir.'/samples/bugs/Issue95_ANSI.pdf'; $parser = $this->getParserInstance(); $document = $parser->parseFile($filename); $fonts = $document->getFonts(); $font = reset($fonts); $commands = [ [ 't' => '<', 'c' => 'E6F6FC', //ANSI encoded string ], ]; $this->assertEquals('æöü', $font->decodeText($commands)); } /** * Font could have indirect encoding without `/Type /Encoding` * which would be instance of PDFObject class (but not Encoding or ElementString). * * @see https://github.com/smalot/pdfparser/pull/500 */ public function testDecodeTextForFontWithIndirectEncodingWithoutTypeEncoding(): void { $filename = $this->rootDir.'/samples/bugs/PullRequest500.pdf'; $parser = $this->getParserInstance(); $document = $parser->parseFile($filename); $pages = $document->getPages(); $page1 = reset($pages); $page1Text = $page1->getText(); $expectedText = <<<TEXT Export\u{a0}transakční\u{a0}historie Typ\u{a0}produktu:\u{a0}Podnikatelský\u{a0}účet\u{a0}Maxi Číslo\u{a0}účtu:\u{a0}0000000000/0000 Počáteční\u{a0}zůstatek: 000\u{a0}000,00\u{a0}Kč Konečný\u{a0}zůstatek: 000\u{a0}000,00\u{a0}Kč Cena\u{a0}za\u{a0}služby TEXT; $this->assertEquals($expectedText, trim($page1Text)); } /** * Tests buggy behavior which lead to: * * Call to a member function getFontSpaceLimit() on null * * @see https://github.com/smalot/pdfparser/pull/403 * * @doesNotPerformAssertions */ public function testTriggerGetFontSpaceLimitOnNull(): void { // error is triggered, if we set the fourth parameter to null $font = new Font(new Document(), null, null, new Config()); // both functions can trigger the error $font->decodeText([]); $font->getTextArray(); } public function testXmlContent(): void { $filename = $this->rootDir.'/samples/bugs/Issue18.pdf'; $parser = $this->getParserInstance(); $document = $parser->parseFile($filename); $pages = $document->getPages(); $text = trim($pages[0]->getText()); $this->assertEquals('Example PDF', $text); } /** * Create an instance of Header containing an instance of Encoding that doesn't have a BaseEncoding. * Test if the Font won't raise a exception because Encoding don't have BaseEncoding. */ public function testEncodingWithoutBaseEncoding(): void { $document = new Document(); $header = new Header(['Encoding' => new Encoding($document)]); $font = new Font(new Document(), $header); $font->setTable([]); $this->assertEquals('?', $font->translateChar('a')); } }
smalot/pdfparser
tests/Integration/FontTest.php
PHP
lgpl-3.0
14,478
/**** * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development. * Created 2015 by Skurydin Alexey * http://github.com/SmingHub/Sming * All files of the Sming Core are provided under the LGPL v3 license. * * os_timer.cpp * * @author: 13 August 2018 - mikee47 <mike@sillyhouse.net> * * An alternative method for setting software timers based on the tick count. * * Technical notes * --------------- * * This information was obtained by examining the SDK timer function assembly code * from SDK versions 1.5.4, 2.2 and 3.0. * * Software timers for the ESP8266 are defined by an `os_timer_t` structure. * When armed, the structure is contained in a queue ordered by expiry time. * Thus, the first timer is the next one to expire and the expiry time is programmed * into the Timer2 alarm register (counter compare). The timer alarm interrupt simply * queues a task to handle the event. * * The timer task dequeues the timer (setting `timer_next` to -1) and invokes the * user-provided callback routine. If it is a repeating timer then it is re-queued. * The queue is implemented as a linked list so adding and removing items is very efficient * and requires no additional memory allocation. * * Because the Sming Clock API handles all time/tick conversions, a new `os_timer_arm_ticks()` * function is used which replaces the existing `ets_timer_arm_new()` function. This makes * timer operation more transparent, faster. * * `ets_timer_arm_new` * ------------------- * * This is the SDK function which implements `os_timer_arm_us` and `os_timer_arm`. * * With ms_flag = false, the maximum value for `time` is 428496729us. The SDK documentation * for `os_timer_arm_us` states a maximum value of 0x0FFFFFFF, which is incorrect; it probably * applies to earlier SDK releases. * * Note: If `system_timer_reinit()` hasn't been called then calling with `ms_flag = false` will fail. * * This figure can be derived as follows, where 0x7FFFFFFF is the maximum tick range * (signed comparison) and 5000000 is the Timer2 frequency with /16 prescale: * * 0x7FFFFFFF / 5000000 = 429496729.4us = 0' 7" 9.5s * * With ms_flag = true, the limit is 428496ms which agrees with the value stated in the SDK documentation. * * Timer2 frequencies for two prescaler settings are: * Prescale Frequency Period Range (0x7FFFFFFF ticks) * -------- --------- ------ ------------------------- * - /1 80000000 12.5ns 0' 0" 26.84s * - /16 5000000 200ns 0' 7" 9.5s * - /256 312500 3.2us 1' 54" 31.95s * * @see See also `drivers/hw_timer.h` * */ #include "include/driver/os_timer.h" #include <driver/hw_timer.h> /* * This variable points to the first timer in the queue. * It's a global variable defined in the Espressif SDK. */ extern "C" os_timer_t* timer_list; /** * @brief Insert a timer into the queue * @param ptimer The timer to insert * @param expire The Timer2 tick value when this timer is due * @note Timer is inserted into queue according to its expiry time, and _after_ any * existing timers with the same expiry time. If it's inserted at the head of the * queue (i.e. it's the new value for `timer_list`) then the Timer2 alarm register * is updated. */ static void IRAM_ATTR timer_insert(os_timer_t* ptimer, uint32_t expire) { os_timer_t* t_prev = nullptr; auto t = timer_list; while(t != nullptr) { if(int(t->timer_expire - expire) > 0) { break; } t_prev = t; t = t->timer_next; } if(t_prev == nullptr) { timer_list = ptimer; hw_timer2_set_alarm(expire); } else { t_prev->timer_next = ptimer; } ptimer->timer_next = t; ptimer->timer_expire = expire; } void os_timer_arm_ticks(os_timer_t* ptimer, uint32_t ticks, bool repeat_flag) { os_timer_disarm(ptimer); ptimer->timer_period = repeat_flag ? ticks : 0; ets_intr_lock(); timer_insert(ptimer, hw_timer2_read() + ticks); ets_intr_unlock(); }
anakod/Sming
Sming/Arch/Esp8266/Components/driver/os_timer.cpp
C++
lgpl-3.0
3,955
define( [], function newItemController() { return function newItemController($log, $scope, $state) { $log.debug('newItemController'); $scope.title = 'Nowa pozycja'; $scope.itemTypes = [ { view : 'sg.new.newPlace', label: 'Nowe miejsce' } ]; $scope.selectedItem = undefined; $scope.$watch('selectedItem', function (newVal, oldVal) { if (newVal === oldVal) { return; } $state.go(newVal); }) } } );
kornicameister/Pebudzenie
www/js/view/home/newItem/newItemController.js
JavaScript
lgpl-3.0
649
#!/usr/bin/env python ''' Created on Jan 6, 2018 @author: consultit ''' from panda3d.core import Filename import sys, os from subprocess import call ### NOTE: currently this script works only on GNU/Linux currdir = os.path.abspath(sys.path[0]) builddir = Filename.from_os_specific(os.path.join(currdir, '/ely/')).get_fullpath() elydir = Filename.fromOsSpecific(os.path.join(currdir, '/ely/')).getFullpath() lpref = '' mpref = '' lsuff = '.so' ### tools = 'libtools' modules = ['ai', 'audio', 'control', 'physics'] if __name__ == '__main__': # cwd os.chdir(currdir + builddir) # build 'tools' libtools = lpref + tools + lsuff print('building "' + libtools + '" ...') toolsdir = '..' + elydir + tools args = ['build.py', '--dir', toolsdir, '--clean'] call(['/usr/bin/python'] + args) #print('installing "' + libtools + '" ...') #args = [libtools, toolsdir] #call(['/usr/bin/install'] + args) # build modules for module in modules: modulelib = mpref + module + lsuff print('building "' + modulelib + '" ...') moduledir = '..' + elydir + module args = ['build.py', '--dir', moduledir, '--libs', libtools, '--libs_src', toolsdir, '--clean'] call(['/usr/bin/python'] + args) #print('installing "' + modulelib + '" ...') #args = [modulelib, moduledir] #call(['/usr/bin/install'] + args)
consultit/Ely
setup.py
Python
lgpl-3.0
1,423
// Created file "Lib\src\strmiids\X64\strmiids" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(CLSID_DirectDrawClipper, 0x593817a0, 0x7db3, 0x11cf, 0xa2, 0xde, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56);
Frankie-PellesC/fSDK
Lib/src/strmiids/X64/strmiids0000010F.c
C
lgpl-3.0
464
package ca.uberifix.functionalaesthetics.common.crafting; import ca.uberifix.functionalaesthetics.common.item.ModItems; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.ShapelessOreRecipe; /** * Created by uberifix */ public class ModCrafting { public static IRecipe bowDrillRecipe = new ShapelessOreRecipe(new ItemStack(ModItems.bowDrillItem), new ItemStack(Items.STICK), new ItemStack(Items.BOW)); public static void init() { GameRegistry.addRecipe(bowDrillRecipe); } }
uberifix/functional-aesthetics
src/main/java/ca/uberifix/functionalaesthetics/common/crafting/ModCrafting.java
Java
lgpl-3.0
680
/* Galois, a framework to exploit amorphous data-parallelism in irregular programs. Copyright (C) 2010, The University of Texas at Austin. All rights reserved. UNIVERSITY EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES CONCERNING THIS SOFTWARE AND DOCUMENTATION, INCLUDING ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR ANY PARTICULAR PURPOSE, NON-INFRINGEMENT AND WARRANTIES OF PERFORMANCE, AND ANY WARRANTY THAT MIGHT OTHERWISE ARISE FROM COURSE OF DEALING OR USAGE OF TRADE. NO WARRANTY IS EITHER EXPRESS OR IMPLIED WITH RESPECT TO THE USE OF THE SOFTWARE OR DOCUMENTATION. Under no circumstances shall University be liable for incidental, special, indirect, direct or consequential damages or loss of profits, interruption of business, or related expenses which may arise from use of Software or Documentation, including but not limited to those resulting from defects in Software and/or Documentation, or loss or inaccuracy of data of any kind. */ package galois.runtime; import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; /** * Represents data accessed during an iteration by a thread. Each iteration * is accessed by at most one thread so no need to synchronize here either. */ class OrderedIteration<T> extends Iteration { /** * retired means the iteration has either aborted (ABORT_DONE) or committed (COMMIT_DONE) */ private boolean retired; private Lock retiredLock; private Condition retiredCond; private AtomicReference<Status> status; /** * The object from the collection associated with this iteration */ private T iterationObject; public OrderedIteration(int id) { super(id); status = new AtomicReference<Status>(Status.UNSCHEDULED); retired = false; // XXX Not recycling lock and cond var so as to avoid potential problems...Might do it in the future... retiredLock = new ReentrantLock(); retiredCond = retiredLock.newCondition(); } public final Condition getRetiredCond() { return retiredCond; } public final Lock getRetiredLock() { return retiredLock; } public final boolean hasRetired() { return retired; } public void setIterationObject(T obj) { this.iterationObject = obj; } public T getIterationObject() { return iterationObject; } /** * Called to abort an iteration. This unwinds the undo log, clears conflict * logs and releases all held partitions */ @Override public int performAbort() { if (getStatus() == Status.ABORT_DONE || getStatus() == Status.COMMIT_DONE) { return 0; } if (getStatus() != Status.ABORTING) { throw new RuntimeException("wrong status in performAbort " + getStatus()); } int r = super.performAbort(); setStatus(Status.ABORT_DONE); wakeupConflicters(); return r; } void wakeupConflicters() { retiredLock.lock(); try { retired = true; retiredCond.signalAll(); } finally { retiredLock.unlock(); } } /** * Commit iteration. This clears the conflict logs and releases any held * partitions, and performs any commit actions */ @Override public int performCommit(boolean releaseLocks) { if (getStatus() == Status.ABORT_DONE || getStatus() == Status.COMMIT_DONE) { return 0; } if (getStatus() != Status.COMMITTING) { throw new RuntimeException("wrong status in performCommit " + this); } int r = super.performCommit(releaseLocks); setStatus(Status.COMMIT_DONE); wakeupConflicters(); return r; } @Override protected void reset() { super.clearLogs(true); setStatus(Status.UNSCHEDULED); // setIterationObject(null); commenting due to null ptr exception in ROBComparator } /** * Create a new iteration that reuses as much storage from this finished * iteration as it can to reduce the need for garbage collection. Returns * the new Iteration */ @Override public Iteration recycle() { reset(); return this; } /** * @return value returned by getStatus() may become stale due to concurrent modifications, therefore should not be cached * in a local variable */ Status getStatus() { return status.get(); } public boolean hasStatus(Status expected) { return getStatus() == expected; } public void setStatus(Status status) { this.status.set(status); } public boolean casStatus(Status expect, Status update) { return this.status.compareAndSet(expect, update); } @Override public String toString() { if (iterationObject != null) { return String.format("(it=%d,%s,%s)", this.getId(), status.get(), iterationObject); } else { return String.format("(it=%d,null,%s)", this.getId(), status.get()); } } public enum Status { UNSCHEDULED, // this iteration is born new but hasn't been assigned an element SCHEDULED, // this iteration is assigned an active element to work on READY_TO_COMMIT, // this iteration has completed and is ready to commit given it's highest priority COMMITTING, // performing or going to perform commit actions COMMIT_DONE, // done performing commit actions ABORT_SELF, // this conflicted with some other high priority iteration 'that', that signalled this to abort it self // this is still running and perhaps modifying the data structure, therefore, that cannot call abort on this, so that // signal this to abort itself, and that sleeps waiting for this to do so ABORTING, // performing or going to perform abort/undo actions ABORT_DONE // done performing undo actions // possible transitions are: // UNSCHEDULED -> SCHEDULED // 'this' iteration is assigned a non-null active element and starts running // and 'this' is added to the rob // // SCHEDULED -> READY_TO_COMMIT // this has completed running and can commit as soon as it becomes the highest priority iteration // // SCHEDULED -> ABORTING // 'this' raises a conflict with 'that' and loses the conflict because 'that' has higher priority // // SCHEDULED -> ABORT_SELF // some higher priority iteration 'that' raises a conflict with this, and puts 'this' in ABORT_SELF so // that 'this' can abort itself at its own convenience (Note: 'this' could be in the middle of modifying a data structure) // // READY_TO_COMMIT -> COMMITTING // 'this' is the highest priority iteration in the system (i.e. among all completed and running iterations and // the pending active elements in the worklist) and is at the head of the rob // // READY_TO_COMMIT -> ABORTING // 'that' raised a conflict with 'this' after this has completed, 'that' calls abort on 'this' // // ABORTING -> ABORT_DONE // ABORTING means the 'this' is going to perform its abort actions and release locks; after having performed the abort actions // this goes into ABORT_DONE, but 'this' hasn't been removed from the rob yet // // COMMITTING -> COMMIT_DONE // 'this' is going to perform its commit actions and release locks. 'this' has been removed from the // rob at this point // // an iteration is running (i.e. has a thread associated with it and could be performing modifications // to the data structures) if it is in following states: // SCHEDULED // ABORT_SELF // Note: UNSCHEDULED doesn't have an active element assigned to it, but can be considered running. } }
chmaruni/SCJ
Shared/libs_src/Galois-2.0/src/galois/runtime/OrderedIteration.java
Java
lgpl-3.0
7,555
package nl.gmt.data.migrate; import nl.gmt.data.schema.*; public class DataSchemaExecutor { private final DataSchemaExecutorConfiguration configuration; private final SchemaCallback callback; private SchemaRules rules; public DataSchemaExecutor(DataSchemaExecutorConfiguration configuration, SchemaCallback callback) { this.configuration = configuration; this.callback = callback; } public DataSchemaExecutorConfiguration getConfiguration() { return configuration; } public SchemaCallback getCallback() { return callback; } public SchemaRules getRules() { return rules; } public void execute() throws SchemaMigrateException { SchemaParserExecutor parserExecutor = new SchemaParserExecutor(callback); try { execute(parserExecutor.parse(configuration.getSchemaFileName(), getRules())); } catch (SchemaException e) { throw new SchemaMigrateException("Cannot execute migration", e); } } public DatabaseSchema execute(Schema schema) throws SchemaMigrateException { rules = configuration.getDatabaseDriver().createSchemaRules(); return new DatabaseSchema(schema, this); } }
gmt-europe/gmtdata
gmtdata/src/main/java/nl/gmt/data/migrate/DataSchemaExecutor.java
Java
lgpl-3.0
1,250
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="de"> <head> <meta http-equiv="Content-Type" content="text/html" charset="iso-8859-1"> <title>org.apache.commons.dbutils.wrappers Class Hierarchy (Apache Commons DbUtils 1.6 API)</title> <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="org.apache.commons.dbutils.wrappers Class Hierarchy (Apache Commons DbUtils 1.6 API)"; } //--> </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>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</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><a href="../../../../../org/apache/commons/dbutils/handlers/package-tree.html">Prev</a></li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/commons/dbutils/wrappers/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip-navbar_top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h1 class="title">Hierarchy For Package org.apache.commons.dbutils.wrappers</h1> <span class="strong">Package Hierarchies:</span> <ul class="horizontal"> <li><a href="../../../../../overview-tree.html">All Packages</a></li> </ul> </div> <div class="contentContainer"> <h2 title="Class Hierarchy">Class Hierarchy</h2> <ul> <li type="circle">java.lang.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang"><span class="strong">Object</span></a> <ul> <li type="circle">org.apache.commons.dbutils.wrappers.<a href="../../../../../org/apache/commons/dbutils/wrappers/SqlNullCheckedResultSet.html" title="class in org.apache.commons.dbutils.wrappers"><span class="strong">SqlNullCheckedResultSet</span></a> (implements java.lang.reflect.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationHandler.html?is-external=true" title="class or interface in java.lang.reflect">InvocationHandler</a>)</li> <li type="circle">org.apache.commons.dbutils.wrappers.<a href="../../../../../org/apache/commons/dbutils/wrappers/StringTrimmedResultSet.html" title="class in org.apache.commons.dbutils.wrappers"><span class="strong">StringTrimmedResultSet</span></a> (implements java.lang.reflect.<a href="http://docs.oracle.com/javase/6/docs/api/java/lang/reflect/InvocationHandler.html?is-external=true" title="class or interface in java.lang.reflect">InvocationHandler</a>)</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>Class</li> <li>Use</li> <li class="navBarCell1Rev">Tree</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><a href="../../../../../org/apache/commons/dbutils/handlers/package-tree.html">Prev</a></li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/apache/commons/dbutils/wrappers/package-tree.html" target="_top">Frames</a></li> <li><a href="package-tree.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>Copyright &#169; 2002&#x2013;2014 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> </body> </html>
DeanAaron/Projects
ExtendPackageTest/lib/commons-dbutils-1.6/apidocs/org/apache/commons/dbutils/wrappers/package-tree.html
HTML
lgpl-3.0
5,430
/* $Id$ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * =========================================================================== * * File Description: * This code was generated by application DATATOOL * using the following specifications: * 'seqsplit.asn'. * * ATTENTION: * Don't edit or commit this file into CVS as this file will * be overridden (by DATATOOL) without warning! * =========================================================================== */ // standard includes #include <ncbi_pch.hpp> #include <serial/serialimpl.hpp> // generated includes #include <objects/seqsplit/ID2S_Bioseq_set_Ids.hpp> BEGIN_NCBI_SCOPE BEGIN_objects_SCOPE // namespace ncbi::objects:: // generated classes void CID2S_Bioseq_set_Ids_Base::Reset(void) { m_data.clear(); m_set_State[0] &= ~0x3; } BEGIN_NAMED_BASE_IMPLICIT_CLASS_INFO("ID2S-Bioseq-set-Ids", CID2S_Bioseq_set_Ids) { SET_CLASS_MODULE("NCBI-Seq-split"); ADD_NAMED_MEMBER("", m_data, STL_list_set, (STD, (int)))->SetSetFlag(MEMBER_PTR(m_set_State[0])); info->RandomOrder(); info->CodeVersion(21600); } END_CLASS_INFO // constructor CID2S_Bioseq_set_Ids_Base::CID2S_Bioseq_set_Ids_Base(void) { memset(m_set_State,0,sizeof(m_set_State)); } // destructor CID2S_Bioseq_set_Ids_Base::~CID2S_Bioseq_set_Ids_Base(void) { } END_objects_SCOPE // namespace ncbi::objects:: END_NCBI_SCOPE
kyungtaekLIM/PSI-BLASTexB
src/ncbi-blast-2.5.0+/c++/src/objects/seqsplit/ID2S_Bioseq_set_Ids_.cpp
C++
lgpl-3.0
2,528
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #include "groundstationresponse.h" #include "groundstationresponse_p.h" #include <QDebug> #include <QXmlStreamReader> namespace QtAws { namespace GroundStation { /*! * \class QtAws::GroundStation::GroundStationResponse * \brief The GroundStationResponse class provides an interface for GroundStation responses. * * \inmodule QtAwsGroundStation */ /*! * Constructs a GroundStationResponse object with parent \a parent. */ GroundStationResponse::GroundStationResponse(QObject * const parent) : QtAws::Core::AwsAbstractResponse(new GroundStationResponsePrivate(this), parent) { } /*! * \internal * Constructs a GroundStationResponse object with private implementation \a d, * and parent \a parent. * * This overload allows derived classes to provide their own private class * implementation that inherits from GroundStationResponsePrivate. */ GroundStationResponse::GroundStationResponse(GroundStationResponsePrivate * const d, QObject * const parent) : QtAws::Core::AwsAbstractResponse(d, parent) { } /*! * \reimp */ void GroundStationResponse::parseFailure(QIODevice &response) { //Q_D(GroundStationResponse); Q_UNUSED(response); /*QXmlStreamReader xml(&response); if (xml.readNextStartElement()) { if (xml.name() == QLatin1String("ErrorResponse")) { d->parseErrorResponse(xml); } else { qWarning() << "ignoring" << xml.name(); xml.skipCurrentElement(); } } setXmlError(xml);*/ } /*! * \class QtAws::GroundStation::GroundStationResponsePrivate * \brief The GroundStationResponsePrivate class provides private implementation for GroundStationResponse. * \internal * * \inmodule QtAwsGroundStation */ /*! * Constructs a GroundStationResponsePrivate object with public implementation \a q. */ GroundStationResponsePrivate::GroundStationResponsePrivate( GroundStationResponse * const q) : QtAws::Core::AwsAbstractResponsePrivate(q) { } } // namespace GroundStation } // namespace QtAws
pcolby/libqtaws
src/groundstation/groundstationresponse.cpp
C++
lgpl-3.0
2,745
<?php /* * RakLib network library * * * This project is not affiliated with Jenkins Software LLC nor RakNet. * * 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. * */ namespace raklib\protocol; use raklib\Binary; abstract class AcknowledgePacket extends Packet{ /** @var int[] */ public $packets = []; public function encode(){ parent::encode(); $payload = ""; sort($this->packets, SORT_NUMERIC); $count = count($this->packets); $records = 0; if($count > 0){ $pointer = 1; $start = $this->packets[0]; $last = $this->packets[0]; while($pointer < $count){ $current = $this->packets[$pointer++]; $diff = $current - $last; if($diff === 1){ $last = $current; }elseif($diff > 1){ //Forget about duplicated packets (bad queues?) if($start === $last){ $payload .= "\x01"; $payload .= substr(pack("V", $start), 0, -1); $start = $last = $current; }else{ $payload .= "\x00"; $payload .= substr(pack("V", $start), 0, -1); $payload .= substr(pack("V", $last), 0, -1); $start = $last = $current; } ++$records; } } if($start === $last){ $payload .= "\x01"; $payload .= substr(pack("V", $start), 0, -1); }else{ $payload .= "\x00"; $payload .= substr(pack("V", $start), 0, -1); $payload .= substr(pack("V", $last), 0, -1); } ++$records; } $this->buffer .= pack("n", $records); $this->buffer .= $payload; } public function decode(){ parent::decode(); $count = unpack("n", $this->get(2))[1]; $this->packets = []; $cnt = 0; for($i = 0; $i < $count and !$this->feof() and $cnt < 4096; ++$i){ if(ord($this->get(1)) === 0){ $start = unpack("V", $this->get(3) . "\x00")[1]; $end = unpack("V", $this->get(3) . "\x00")[1]; if(($end - $start) > 512){ $end = $start + 512; } for($c = $start; $c <= $end; ++$c){ $this->packets[$cnt++] = $c; } }else{ $this->packets[$cnt++] = unpack("V", $this->get(3) . "\x00")[1]; } } } public function clean(){ $this->packets = []; return parent::clean(); } }
TylerAndrew/ImagicalMine
src/raklib/protocol/AcknowledgePacket.php
PHP
lgpl-3.0
2,968
<?php /** * This file is part of P4A - PHP For Applications. * * P4A 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. * * P4A 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 P4A. If not, see <http://www.gnu.org/licenses/lgpl.html>. * * To contact the authors write to: <br /> * Fabrizio Balliano <fabrizio@fabrizioballiano.it> <br /> * Andrea Giardina <andrea.giardina@crealabs.it> * * @author Fabrizio Balliano <fabrizio@fabrizioballiano.it> * @author Andrea Giardina <andrea.giardina@crealabs.it> * @copyright Copyright (c) 2003-2010 Fabrizio Balliano, Andrea Giardina * @link http://p4a.sourceforge.net * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License * @package p4a */ // Select application's locale define("P4A_LOCALE", 'en_US'); define("P4A_DSN", 'mysql://root:@localhost/p4a_products_catalogue'); // define("P4A_DSN", 'pgsql://postgres:postgres@localhost/p4a_products_catalogue'); // define("P4A_DSN", 'oci://p4a:p4a@localhost/xe'); // define("P4A_DSN", 'sqlite:/p4a_products_catalogue'); // define("P4A_DSN", 'mssql-dblib://user:password@localhost/p4a_products_catalogue'); // Enable logging and profiling of all DB actions // define("P4A_DB_PROFILE", true); // Enable more error details // define("P4A_EXTENDED_ERRORS", true); // Disable AJAX during the development phase, it will allows you // a faster debug, enable it on the production server // define("P4A_AJAX_ENABLED", false); // Path (on server) where P4A will write all code transferred via AJAX // define("P4A_AJAX_DEBUG", "/tmp/p4a_ajax_debug.txt"); require_once dirname(__FILE__) . '/../../p4a.php'; // Check Installation and configuration. // This lines should be removed after the first run. $check = p4a_check_configuration(); // Here we go if (is_string($check)) { print $check; } else { $p4a = p4a::singleton("products_catalogue"); $p4a->main(); }
fballiano/p4a
applications/products_catalogue/index.php
PHP
lgpl-3.0
2,422
package repack.org.bouncycastle.crypto.generators; import repack.org.bouncycastle.crypto.AsymmetricCipherKeyPair; import repack.org.bouncycastle.crypto.AsymmetricCipherKeyPairGenerator; import repack.org.bouncycastle.crypto.KeyGenerationParameters; import repack.org.bouncycastle.crypto.params.GOST3410KeyGenerationParameters; import repack.org.bouncycastle.crypto.params.GOST3410Parameters; import repack.org.bouncycastle.crypto.params.GOST3410PrivateKeyParameters; import repack.org.bouncycastle.crypto.params.GOST3410PublicKeyParameters; import java.math.BigInteger; import java.security.SecureRandom; /** * a GOST3410 key pair generator. * This generates GOST3410 keys in line with the method described * in GOST R 34.10-94. */ public class GOST3410KeyPairGenerator implements AsymmetricCipherKeyPairGenerator { private static final BigInteger ZERO = BigInteger.valueOf(0); private GOST3410KeyGenerationParameters param; public void init( KeyGenerationParameters param) { this.param = (GOST3410KeyGenerationParameters) param; } public AsymmetricCipherKeyPair generateKeyPair() { BigInteger p, q, a, x, y; GOST3410Parameters GOST3410Params = param.getParameters(); SecureRandom random = param.getRandom(); q = GOST3410Params.getQ(); p = GOST3410Params.getP(); a = GOST3410Params.getA(); do { x = new BigInteger(256, random); } while(x.equals(ZERO) || x.compareTo(q) >= 0); // // calculate the public key. // y = a.modPow(x, p); return new AsymmetricCipherKeyPair( new GOST3410PublicKeyParameters(y, GOST3410Params), new GOST3410PrivateKeyParameters(x, GOST3410Params)); } }
SafetyCulture/DroidText
app/src/main/java/bouncycastle/repack/org/bouncycastle/crypto/generators/GOST3410KeyPairGenerator.java
Java
lgpl-3.0
1,647
/* * SonarQube, open source software quality management tool. * Copyright (C) 2008-2014 SonarSource * mailto:contact AT sonarsource DOT com * * SonarQube 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. * * SonarQube 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 this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.sonar.server.activity; import java.util.List; import java.util.Map; import org.assertj.core.data.MapEntry; import org.junit.Before; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; import org.sonar.api.config.Settings; import org.sonar.api.utils.System2; import org.sonar.core.persistence.DbTester; import org.sonar.server.activity.db.ActivityDao; import org.sonar.server.activity.index.ActivityDoc; import org.sonar.server.activity.index.ActivityIndexDefinition; import org.sonar.server.activity.index.ActivityIndexer; import org.sonar.server.db.DbClient; import org.sonar.server.es.EsTester; import org.sonar.server.issue.db.IssueDao; import org.sonar.server.tester.UserSessionRule; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class ActivityServiceTest { @ClassRule public static DbTester db = new DbTester(); @ClassRule public static EsTester es = new EsTester().addDefinitions(new ActivityIndexDefinition(new Settings())); @Rule public UserSessionRule userSession = UserSessionRule.standalone().login(); System2 system = mock(System2.class); ActivityService service; @Before public void before() { ActivityDao activityDao = new ActivityDao(db.myBatis(), system); IssueDao issueDao = new IssueDao(db.myBatis()); DbClient dbClient = new DbClient(db.database(), db.myBatis(), issueDao, activityDao); ActivityIndexer indexer = new ActivityIndexer(dbClient, es.client()); // indexers are disabled by default indexer.setEnabled(true); service = new ActivityService(dbClient, indexer, userSession); } @Test public void insert_and_index() { when(system.now()).thenReturn(1_500_000_000_000L); Activity activity = new Activity(); activity.setType(Activity.Type.ANALYSIS_REPORT); activity.setAction("THE_ACTION"); activity.setMessage("THE_MSG"); activity.setData("foo", "bar"); service.save(activity); Map<String, Object> dbMap = db.selectFirst("select log_type as \"type\", log_action as \"action\", log_message as \"msg\", data_field as \"data\" from activities"); assertThat(dbMap).containsEntry("type", "ANALYSIS_REPORT"); assertThat(dbMap).containsEntry("action", "THE_ACTION"); assertThat(dbMap).containsEntry("msg", "THE_MSG"); assertThat(dbMap.get("data")).isEqualTo("foo=bar"); List<ActivityDoc> docs = es.getDocuments("activities", "activity", ActivityDoc.class); assertThat(docs).hasSize(1); assertThat(docs.get(0).getKey()).isNotEmpty(); assertThat(docs.get(0).getAction()).isEqualTo("THE_ACTION"); assertThat(docs.get(0).getMessage()).isEqualTo("THE_MSG"); assertThat(docs.get(0).getDetails()).containsOnly(MapEntry.entry("foo", "bar")); } }
jblievremont/sonarqube
server/sonar-server/src/test/java/org/sonar/server/activity/ActivityServiceTest.java
Java
lgpl-3.0
3,709
package aps.livro; public class Main { public static void main (String[] args) { Bolsa bolsa = new Bolsa(10); bolsa.adiciona("C#", "Java", "Python", "Ruby"); for (Object o : bolsa) { System.out.println(o); } } }
marciojrtorres/livro-aps
zoi/src/main/java/aps/livro/Main.java
Java
lgpl-3.0
234
<?php interface ISession { /** * Returns the anti-CSRF token. * * @return string */ public function get_csrf_token(); /** * Set data to session. * * @param string $key * @param mixed $value */ public function set_data($key, $value); /** * Returns true if the data exists. * * The data must have been previously set with set_data(). * * @param string $key * @return bool True if the data exists. */ public function has_data($key); /** * Get data from session. * * The data must have been previously set with set_data(). * * @param string $key * @return mixed */ public function get_data($key); /** * Returns all data from session as an associative array. * * @return array */ public function get_all_data(); /** * Returns the session ID. * * @return string The session ID */ public function get_session_id(); /** * Destroy the current session. */ public function logout(); /** * Start a new session. * * @return bool True on success */ public function login(); }
MatiasLarssonFI/lupa
classes/isession.class.php
PHP
lgpl-3.0
1,285
<!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' lang='he' dir='rtl'> <head> <meta http-equiv='Content-Type' content='text/html; charset=windows-1255' /> <meta charset='windows-1255' /> <meta http-equiv='Content-Script-Type' content='text/javascript' /> <meta http-equiv='revisit-after' content='15 days' /> <title>úéòåã îàâøé äðúåðéí áàúø äðéååè áúð&quot;ê</title> <link rel='stylesheet' type='text/css' href='../_script/klli.css' /> <link rel='stylesheet' type='text/css' href='../tnk1/_themes/klli.css' /> <meta property='og:url' content='https://tora.us.fm/tnk1/magrim_teud.html'/> <meta name='author' content="àøàì" /> <meta name='receiver' content="" /> <meta name='jmQovc' content="tnk1/magrim_teud.html" /> <meta name='tvnit' content="" /> <link rel='canonical' href='https://tora.us.fm/tnk1/magrim_teud.html' /> </head> <!-- PHP Programming by Erel Segal-Halevi --> <body lang='he' dir='rtl' id = 'tnk1_magrim_teud' class='mamr '> <div class='pnim'> <script type='text/javascript' src='../_script/vars.js'></script> <!--NiwutElyon0--> <div class='NiwutElyon'> <div class='NiwutElyon'><a class='link_to_homepage' href='../tnk1/index.html'>øàùé</a>&gt;<a href='../tnk1/odot.html'>àåãåú äàúø</a>&gt;<a href='../tnk1/magrim0.html'>îàâøé äðúåðéí</a>&gt;</div> </div> <!--NiwutElyon1--> <h1 id='h1'>úéòåã îàâøé äðúåðéí áàúø äðéååè áúð"ê</h1> <div id='idfields'> <p>÷åã: úéòåã îàâøé äðúåðéí áúð"ê</p> <p>ñåâ: îàîø</p> <p>îàú: àøàì</p> <p>àì: </p> </div> <script type='text/javascript'>kotrt()</script> <div id='tokn'> <p> úîéã ëùàðé îâéò ìàúø ùéù áå äøáä èáìàåú åàéðã÷ñéí, àðé àåîø ìòöîé "çáì ùäí ìà ðåúðéí ìäåøéã àú ä÷áöéí ùì îàâøé äðúåðéí ùìäí - äééúé éëåì ìòùåú çéôåùéí äøáä éåúø îùåëììéí îîä ùäí ðåúðéí ìòùåú áàúø". <p>àæ äàúø ùì ðç"ú äåà ìà ëîå ëåìí: áàúø äæä àôùø ìäåøéã àú ëì îàâøé äðúåðéí åìäùúîù áäí áàåôï çåôùé, òì-ôé úðàé <a href="../rjyon.html">øùéåï ìùéîåù çåôùé á÷áöéí </a>. <p> <p>ä÷áöéí ùùîí îñúééí áñéåîú.mdb äí îàâøé-ðúåðéí ùì úåëðú âéùä ä'úù"ñ (Microsoft Access 2000), ùäéà çì÷ îçáéìú îùøã ä'úù"ñ (Microsoft Office 2000). ëãé ìôúåç àú ä÷áöéí åìäùúîù áäí, öøéê ìäú÷éï àú äúåëðä. <p>éù âí ÷áöé è÷ñè-îåôøã-áèàáéí, ùàåúí ðéúï ìòøåê áëì òåøê-è÷ñè (áúðàé ùäåà îñåâì ìòáåã òí ÷áöéí âãåìéí î-64 ÷"á), àå áòæøú úåëðú "äöèééðåú" (Microsoft Excel). <p>&nbsp; <p> <q class='mfrj'>äòøä: äúéòåã çì÷é áìáã. æä éåúø èåá îëìåí (àðé î÷ååä). úéòåã îìà ééëúá ëù... éäéä æîï.</q> <h2> 1. ôøèéí å÷ùøéí </h2> <p> äðúåðéí áàúø æä ðçì÷éí ìùðé ñåâéí: <q class='psuq'>ôøèéí </q> (prtim) å- <q class='psuq'>÷ùøéí </q> (qjrim). <q class='psuq'>ôøèéí </q> äí òöîéí äòåîãåú áôðé òöîí, <q class='psuq'>å÷ùøéí </q> î÷ùøéí áéï ùðé ôøèéí. <p> <p> ãåâîàåú ìôøèéí: <ul type='disc'> <li> îàîø î÷åîé - îàîø ùðîöà òì äùøú ùìðå <li> àåñó ùì îàîøéí <li> àúø çéöåðé <li> ãîåú úð"ëéú <li> îéìä áìùåï äî÷øà <li> àéæåø âéàåâøôé áúð"ê </ul> <p> <p> úëåðåú ùì ôøèéí éëåìåú ìäéåú çì÷ îäúëåðåú äáàåú (ìà ìëì ôøè éù àú ëåìï): <ul type='disc'> <li> qod - ÷åã (ùí ÷öø) - îùîù ëîôúç øàùé áèáìä, î÷ùø áéï ôøèéí áèáìàåú ùåðåú, åîåöâ âí áñøâìé-ðéååè. <li> kotrt - ëåúøú (ùí àøåê) - îåöâ áøàù äîàîø (àí äôøè äåà îàîø î÷åîé), åâí áøùéîåú áúåê àåñôéí ùì îàîøéí. <li> sug - ñåâ äôøè (îàîø, àúø åëå'). ìùãä æä éëåìéí ìäéåú ùðé ùéîåùéí: <ol> <li>ñéãåø äôøèéí áúåê îñîëé-àåñó ùîëéìéí àåúí, áòæøú äúáðéú (ìîùì, àôùø ìáðåú úáðéú ùáä ëì äîàîøéí îåöâéí áöã éîéï, åëì äàúøéí áöã ùîàì). <li>ùìéèä áöåøú ääöâä ùì äôøè. ìîùì, àí äñåâ äåà "äôåê", àðçðå øåöéí ìäöéâ àú ùí äîàîø áàãåí, åàú äîàîø ëåìå áúåê îñâøú àãåîä, ëãé ìäæäéø àú äöéáåø. äîçøåæú áùãä æä (îúåøâîú ìàåúéåú ìèéðéåú) îåöáú ë-class ùì ä-body ùì äîàîø. ìîùì, àí äñåâ äåà "äôåê", éåôéò áøàù äîàîø äúâ: &lt;body class='hpwk'&gt;. áãó-äñâðåï (<span dir='ltr'>_themes/klli.css </span>), ðéúï ì÷áåò, ùëì äãôéí îñåâ æä éåöâå áúåê îñâøú àãåîä (ìôøèéí éù ììîåã CSS). </ol> <li> tvnit - úáðéú ùîùîùú ìéöéøä àåèåîèéú ùì äôøè (øìáðèé ø÷ òáåø àåñôéí ùì îàîøéí, ùðåöøéí áàåôï àåèåîèé). äîçøåæú áùãä æä äéà ìîòùä ùí ùì ÷åáõ (ììà ñéåîú), ùðîöà áúú-îãåø <span dir='ltr'>_tvnit </span>, úçú äùåøù ùì äàúø. ìîùì, äúáðéú "osf" ðîöàú á÷åáõ <span dir='ltr'>_tvnit/osf.html </span>. <li> ktovt - ëúåáú - ÷éùåø éçñé ìîàîø î÷åîé, àå ÷éùåø îåçìè ìàúø çéöåðé. äëúåáú éëåìä ìäéåú øé÷ä, ìîùì - ìøåá äîéìéí áìùåï äî÷øà àéï ëúåáú, ëé îéìä îåôéòä ø÷ áúåê äãó ùì äùåøù ùìä - àéï ìä ãó áôðé-òöîä. áî÷øä ëæä, äëåúøú ùì äôøè úåôéò áëì àåñó ùîëéì àú äôøè, àê ììà ÷éùåø. <li> m - îçáø <li> l - ðîòï (àí æä îëúá), àå î÷åí ôøñåí (àí æä îàîø ùäúôøñí). ùí äîçáø åùí äðîòï éåôéòå îúçú ìëåúøú áôøè òöîå, åìéã äëåúøú áàåñôéí ùîëéìéí àú äôøè. <li> tarik_hosfa - úàøéê äåñôä - äúàøéê ùáå ðåñó äôøè ìèáìä ùáä äåà îåôéò. îàôùø ìæäåú á÷ìåú àú äôøèéí äçãùéí (ò"é îéåï äèáìä ìôé ùãä æä). </ul> <p> <p> <q class='psuq'> ÷ùøéí </q> îöééðéí éçñ ùì äëìä áéï ùðé ôøèéí. ìëì ÷ùø éù ëéååï: äôøè äîåëì ð÷øà ä"áï" (bn), åäôøè äîëéì ð÷øà ä"àá" (av). ëì ôøè éëåì ìäéåú ÷ùåø áîñôø áìúé-îåâáì ùì ÷ùøéí, äï ëàá åäï ëáï. <p> ãåâîàåú ì÷ùøéí: <ul type='disc'> <li> ÷ùø áéï îàîø ìáéï àåñó-îàîøéí ùîëéì àåúå, ìîùì äîàîø "ìëå ðøððä ìä'" äåà áï ùì äàåñó "îáðä2" (àåñó ùì îàîøéí ùòåñ÷éí áîáðéí ùì ôøùåú). <li> ÷ùø áéï àåñó ìáéï àåñó áøîä âáåää éåúø, ìîùì äàåñó "îáðä2" äåà áï ùì äàåñó "îàîøéí òì î÷åí àçã", ùäåà áúåøå áï ùì äàåñó "ä÷ùø ìôøùä" (îàîøéí îîåééðéí ìôé ä÷ùø áéðí ìáéï äôøùä ùäí áàéí ìäñáéø), ùäåà áúåøå áï ùì äàåñó "0", ùäåà äàåñó äøàùé (äãó äøàùé ùì äàúø). <li> ÷ùø áéï îàîø ìáéï ãîåú ùäîàîø îúééçñ àìéä, ìîùì äîàîø "æéäåé äãîåéåú áîâéìú àñúø" äåà áï ùì äãîåéåú - "îøãëé", "àñúø", "åùúé", åëå'. <li> ÷ùø áéï îàîø ìáéï îéìä áìùåï äî÷øà ùäîàîø îúééçñ àìéä, ìîùì äîàîø "ìëå ðøððä ìä'" äåà áï ùì äîéìä "ðéñä" åùì äîéìä "áçï". </ul> <p> <p> úëåðåú ùì ÷ùøéí éëåìåú ìäéåú: <ul type='disc'> <li> av - ä÷åã ùì äàá <li> bn - ä÷åã ùì äáï <li> sdr_bn - îñôø áéï 0 ì-100; îñôø ñéãåøé ùì äáï áîñîê äàá. îñôø æä ÷åáò àú äñãø ùáå éåôéòå îàîøéí áúåê àåñôé-îàîøéí (äîàîøéí òí ñãø-áï ÷èï éåúø éåôéòå ÷åãí). àí éù ëîä îàîøéí òí àåúå îñôø ñéãåøé, äí éåôéòå ìôé ñãø àìôáéúé. <li> sdr_av - îñôø ñéãåøé ùì äàá áîñîê äáï. îñôø æä ÷åáò àú äñãø ùáå éåôéòå îàîøéí áñøâìé-ðéååè. <li> kotrt - ëåúøú çìåôéú òáåø äáï. áøéøú äîçãì äéà, ùëàùø éåöøéí àåñó ùì îàîøéí - äëåúøú ùì ëì ÷éùåø ìîàîø äéà äëåúøú ùì äîàîø. àáì àôùø ìäâãéø ëåúøú çìåôéú òáåø äáï, ùúäéä ú÷ôä ø÷ òáåø àá àçã îñåééí. ãåâîä: äîàîø "âáøéí åðùéí îñåëðéí áñôø îùìé" äåà áï ùì äàåñó "îùìé". äëåúøú ùìå áàåñó æä äéà ÷öøä éåúø - "âáøéí åðùéí îñåëðéí". áùãä æä ðéúï ìäëðéñ âí úîåðåú (ò"é äúâ img), ùéåôéòå áñîåê ìëåúøú ùì äáï áîñîê äàá. <li> sug - ñåâ çìåôé òáåø äáï (áã"ë ùãä æä ðùàø øé÷, åàæ áøéøú-äîçãì äéà ìäùúîù áñåâ ùì äáï). </ul> <p> <p> ùéèú "äôøèéí åä÷ùøéí" îàôùøú ìáöò ùðé ñåâéí ùì ôòåìåú áàåôï àåèåîèé: <ul type='disc'> <li> ìééöø àåñó ùì îàîøéí, ò"é éöéøú ÷éùåøéí ìëì äîàîøéí ùîåâãøéí ë"áðéí" ùìå. <li> ìééöø, áøàù îàîø, ñøâìé-ðéååè, ò"é éöéøú ÷éùåøéí ìëì äîàîøéí ùîåâãøéí ë"àáåú" ùìå. </ul> <p> <p> áàúøéí àçøéí (ìîùì "äîãøéê äôúåç" -- <a href="http://dmoz.org/">http://dmoz.org </a>), ìëì áï éù ø÷ àá àçã: ëì ôøè öøéê ìäéåú ùééê ìðåùà àçã áìáã. ëìåîø, äîéãò îéåöâ áîáðä ùì òõ. <p> áùéèú "äôøèéí åä÷ùøéí" àéï îâáìä òì îñôø äàáåú åòì îñôø äáðéí: ëì ôøè éëåì ìäùúééê ìëîä ðåùàéí ùåðéí. ëìåîø, äîéãò îéåöâ áîáðä ùì âøó ëììé (ìéúø ãéå÷: âøó îëååï çñø îòâìéí - "ãàâ"). ùéèä æå, ìãòúé, îúàéîä éåúø ìöåøú äîçùáä äàðåùéú. <p> &nbsp; <p> ãåâîàåú ìîàâøé-ðúåðéí ðéúï ìîöåà <a href="magrim0.html">áøùéîú îàâøé äðúåðéí äúð"ëééí </a>. <p> &nbsp; <p> <p> <p> <h2> 2. äåñôú îàîø çãù ìîàâøé äðúåðéí </h2> <p> ëãé ìäåñéó îàîø çãù ìîàâøé äðúåðéí, îñôé÷ ìôúåç àú äîàâø äøàùé - tnk1.mdb. áîàâø æä éù ÷éùåøéí ìèáìàåú äøìáðèéåú áùàø äîàâøéí. <p> <p> äùìá äøàùåï äåà ìäåñéó àú äîàîø ìèáìä äøàùéú hkl. <p> <p> ìàçø îëï éù ì÷ùø àåúå ìàåñó àçã àå éåúø. áúåëðú access 2000, ðéúï ìòùåú æàú ò"é ìçéöä òì ñéîï ä+ ùìéã ùåøú äîàîø. <ul type='disc'> <li> ðéúï ì÷ùø àú äîàîø äçãù ìàåñó ùîãáø òì ä÷ùø áéï äîàîø ìáéï äôøùä ùàåúä äåà áà ìôøù. ìîùì, àí äîàîø áà ìôøù îáðä ùì ôøùä îñåééîú, ðéúï ì÷ùø àåúå ìàåñó "îáðä2". àåñôéí ùåðéí îñåâ æä ðéúï ìîöåà áàúø, ò"é ëðéñä ì÷éùåø "ñâðåðåú" àå "ä÷ùø ìôøùä". <li> ðéúï ì÷ùø àú äîàîø äçãù ìàåñó ùîãáø òì äîñø ùì äîàîø ìéîéðå. ìîùì, àí äîàîø îãáø òì úôéìåú, ðéúï ì÷ùø àåúå ìàåñó "úôéìä ìä'". îñøéí ùåðéí ðéúï ìîöåà áàúø, ò"é ëðéñä ì÷éùåø "îñøéí". <li> àí äîàîø îãáø òì ñôø ùìí îñôøé äúð"ê, ðéúï ì÷ùø àåúå ìñôø äîúàéí. ìîùì "îáåà ìñôø îùìé" ðéúï ì÷ùø ì"îùìé". <li> ðéúï, ëîåáï, ì÷ùø àú äîàîø âí ìàåñôéí àçøéí ùäåà îúàéí ìäí, ìôé äòðééï. </ul> <p> <p> úåê ëãé äåñôú ÷ùøéí áéï äîàîø çãù ìáéï äàåñôéí ä÷ééîéí, àðçðå òùåééí ìäâéò ìîñ÷ðä ùäàåñôéí ä÷ééîéí âãåìéí îãé, åéù ìôöì àåúí ìàåñôéí ÷èðéí åñôöéôééí éåúø. ðéúï ìòùåú æàú ò"é ëðéñä ìèáìä qjrim åùéðåé äùåøåú äøìáðèéåú. <p> æåäé, áòéðé, àçú äôòåìåú äîòðééðåú áðéäåì äàúø. áàîöòåú äñéååâ åäôéöåì ùì ðåùàéí ìúú-ðåùàéí, æåëéí ìøîä çãùä åâáåää éåúø ùì äáðä - ãáø ù÷ùä ìäùéâ áìéîåã øâéì. <p> <p> ìàçø îëï, éù ìòáåø ìãó äùàéìúåú; éù ùí ëîä ùàéìúåú ùîàôùøåú ìäåñéó ÷ùøéí: <ul type='disc'> <li> ÷ùøéí ìôñå÷éí: áùàéìúä æå ðéúï ìäåñéó ÷ùøéí áéï äîàîø ìáéï äôø÷éí åäôñå÷éí ùîåñáøéí áå; ëì ôø÷ àå ôñå÷ ùîåñáøéí áîàîø éäéå áùåøä ðôøãú. ìà öøéê ìùéí ùí àú ëì äôñå÷éí ùðæëøéí áîàîø, àìà ø÷ àú àìä ùîåñáøéí áå, ëê ùäîàîø úåøí úøåîä îùîòåúéú ìäáðúí. <li> ÷ùøéí ìãîåéåú: áùàéìúä æå ðéúï ìäåñéó ÷ùøéí áéï äîàîø ìáéï äãîåéåú ùäîàîø îñáéø òìéäï (àí éù). <li> ÷ùøéí ìàéæåøéí âéàåâøôééí <li> ÷ùøéí ìîéìéí åáéèåééí áìùåï äî÷øà <li> ÷ùøéí ìîöååú - ðåòã òáåø îàîøéí ùîñáéøéí <q class='psuq'>èòí </q> ùì îöååä îñåééîú, àå <q class='psuq'>äâãøä </q> ùì îöååä îñåééîú. <li> ÷ùøéí ìîàîøé îöååú - ðåòã òáåø îàîøéí ùîúééçñéí ìðåùà ëììé éåúø ù÷ùåø ìîöååú (ìîùì îàîøéí òì äéçñ ìàåéáéí áæîï îìçîä åëã'). </ul> <p> <h3> àåîðåú ä÷éùåø </h3> <p> ÷éùåø ùì îàîø çãù ìàåñôéí àå ìîåùâéí ÷ééîéí äåà ìà úäìéê èëðé áìáã, àìà úäìéê ùãåøù äøáä îçùáä åäáðä. ìôðé ùîåñéôéí ÷éùåø çãù, öøéê ìòééï áàåñó ëôé ùäåà òëùéå, ì÷øåà àú äîàîøéí ùéù áå, åìøàåú äàí äîàîø äçãù îùúìá éôä áàåñó æä. <p> ëîå ëï, éù ì÷áåò àú "ñãø äáï" (äîñôø äñéãåøé ùì äîàîø ùàðçðå îåñéôéí, áéçñ ìùàø äîàîøéí ùî÷åùøéí ìàåúå àåñó) ëê ùééååöø øöó äâéåðé ùì îàîøéí áàåñó, ëê ùîé ùðëðñ ìãó ùì äàåñó - éåëì ì÷øåà àú äîàîøéí ìôé äñãø åì÷áì úîåðä äâéåðéú ùì äîåùâ äîúàéí. <p> ÷ùä ìäñáéø àú æä áëúá - öøéê ìäúðñåú ëãé ìäøâéù: äàåîðåú ùì éöéøú ä÷éùåøéí äéà îîù ñåâ çãù ùì ìéîåã úð"ê. <p> &nbsp; <p> <h2> 3. éöéøä àå òãëåï ùì àåñôéí åùì ñøâìé ðéååè </h2> <p> ìàçø ùîáöòéí ùéðåééí áîàâøé äðúåðéí, àôùø ìòãëï àú äàåñôéí åñøâìé-äðéååè ùäùúðå. <p> ìùí ëê éù ìôúåç àú îàâø äéöéøä - ycira.mdb. îàâø æä ìà îëéì ùåí èáìàåú, àìà ø÷ îåãåìéí ùì ôåð÷öéåú á Visual Basic, ùîàôùøåú ìéöåø áàåôï àåèåîèé àú àåñôé-äîàîøéí åàú ñøâìé-äðéååè. <p> éù ìòáåø ìèáìú äîåãåìéí, åìäøéõ àú äîåãåì äøöåé, ìîùì "òãëåï îàîøéí áúð"ê". <p> ðéúï âí ìäøéõ éùéøåú îñáéáú Visual Basic: éù ìôúåç àú ñáéáú Visual Basic ò"é ìçéöä òì Alt-F11. äîåãåì äøàùé äåà Cor, ùí ðîöàåú ëì ôåð÷öéåú äòãëåï äøàùéåú. </div><!--tokn--> <h2 id='tguvot'>úâåáåú</h2> <ul id='ultguvot'> </ul><!--end--> <script type='text/javascript'>tguva(); txtit()</script> </div><!--pnim--> </body> </html>
erelsgl/erel-sites
tnk1/magrim_teud.html
HTML
lgpl-3.0
11,006
<?php namespace Net\Bazzline\Framework\Authentication; /** * @author stev leibelt * @since 2013-03-16 */ interface CredentialAwareInterface { /** * @author stev leibelt * @param \Net\Bazzline\Framework\Authentication\CredentialInterface $credential * @since 2013-03-16 */ public function setCredential(CredentialInterface $credential); /** * @author stev leibelt * @return \Net\Bazzline\Framework\Authentication\CredentialInterface $credential * @since 2013-03-16 */ public function getCredential(); }
stevleibelt/archive
php/bazzlineFramework/src/Net/Bazzline/Framework/Authentication/CredentialAwareInterface.php
PHP
lgpl-3.0
563
using System; using System.Linq; using System.Reflection; using System.Collections.Generic; using System.Reflection.Emit; using System.Linq.Expressions; namespace Xdr.EmitContexts { public class OrderModel { public List<FieldDesc> Fields {get; private set;} public Delegate BuildReader(Type targetType) { ParameterExpression pReader = Expression.Parameter(typeof(Reader)); List<ParameterExpression> variables = new List<ParameterExpression>(); List<Expression> body = new List<Expression>(); ParameterExpression resultVar = Expression.Variable(targetType, "result"); variables.Add(resultVar); BinaryExpression assign = Expression.Assign(resultVar, Expression.New(targetType)); body.Add(assign); foreach (var fieldDesc in Fields) { body.Add(fieldDesc.BuildAssign(fieldDesc.BuildRead(pReader), resultVar)); } body.Add(resultVar); BlockExpression block = Expression.Block(variables, body); return Expression .Lambda(typeof(ReadOneDelegate<>).MakeGenericType(targetType), block, pReader) .Compile(); } public Delegate BuildWriter(Type targetType) { ParameterExpression pWriter = Expression.Parameter(typeof(Writer)); ParameterExpression pItem = Expression.Parameter(targetType); List<ParameterExpression> variables = new List<ParameterExpression>(); List<Expression> body = new List<Expression>(); foreach (var fieldDesc in Fields) body.Add(fieldDesc.BuildWrite(pWriter, pItem)); BlockExpression block = Expression.Block(variables, body); return Expression .Lambda(typeof(WriteOneDelegate<>).MakeGenericType(targetType), block, pWriter, pItem) .Compile(); } public static OrderModel Create(Type t) { SortedList<uint, FieldDesc> fields = new SortedList<uint, FieldDesc>(); foreach(var fi in t.GetFields().Where((fi) => fi.IsPublic && !fi.IsStatic)) AppendField(fields, fi); foreach (var pi in t.GetProperties().Where((pi) => pi.CanWrite && pi.CanRead)) AppendField(fields, pi); if(fields.Count == 0) return null; OrderModel result = new OrderModel(); result.Fields = fields.Values.ToList(); return result; } private static void AppendField(SortedList<uint, FieldDesc> fields, MemberInfo mi) { OrderAttribute fAttr = mi.GetAttr<OrderAttribute>(); if (fAttr == null) return; if (fields.ContainsKey(fAttr.Order)) throw new InvalidOperationException("duplicate order " + fAttr.Order); fields.Add(fAttr.Order, new FieldDesc(mi)); } } }
ExM/OncRpc
Xdr/EmitContexts/OrderModel.cs
C#
lgpl-3.0
2,529
function MbaSelfAccessor(){ } MbaSelfAccessor.prototype = new MbaAccessor(); MbaSelfAccessor.prototype.constructor = MbaSelfAccessor; MbaSelfAccessor.prototype.getModelValue = function(model){ return model; }; MbaSelfAccessor.prototype.setModelValue = function(model, value){ throw new Error('setModelValue not allowed on MbaSelfAccessor');//TODO faire deux classes MbaReadAccessor et MbaReadWriteAccessor }; MbaSelfAccessor.prototype.toString = function(){ return 'model'; };
amoissant/mambajs
Mamba/js/MbaSelfAccessor.js
JavaScript
lgpl-3.0
491
using UnityEngine; using System.Collections; [DisallowMultipleComponent] [AddComponentMenu("RVP/C#/Drivetrain/Transmission/Continuous Transmission", 1)] //Transmission subclass for continuously variable transmission public class ContinuousTransmission : Transmission { [Tooltip("Lerp value between min ratio and max ratio")] [RangeAttribute(0,1)] public float targetRatio; public float minRatio; public float maxRatio; [System.NonSerialized] public float currentRatio; public bool canReverse; [System.NonSerialized] public bool reversing; [Tooltip("How quickly the target ratio changes with manual shifting")] public float manualShiftRate = 0.5f; void FixedUpdate() { health = Mathf.Clamp01(health); //Set max RPM possible if (maxRPM == -1) { maxRPM = targetDrive.curve.keys[targetDrive.curve.length - 1].time * 1000; } if (health > 0) { if (automatic && vp.groundedWheels > 0) { //Automatically set the target ratio targetRatio = (1 - vp.burnout) * Mathf.Clamp01(Mathf.Abs(targetDrive.feedbackRPM) / Mathf.Max(0.01f, maxRPM * Mathf.Abs(currentRatio))); } else if (!automatic) { //Manually set the target ratio targetRatio = Mathf.Clamp01(targetRatio + (vp.upshiftHold - vp.downshiftHold) * manualShiftRate * Time.deltaTime); } } reversing = canReverse && vp.burnout == 0 && vp.localVelocity.z < 1 && (vp.accelInput < 0 || (vp.brakeIsReverse && vp.brakeInput > 0)); currentRatio = Mathf.Lerp(minRatio, maxRatio, targetRatio) * (reversing ? -1 : 1); newDrive.curve = targetDrive.curve; newDrive.rpm = targetDrive.rpm / currentRatio; newDrive.torque = Mathf.Abs(currentRatio) * targetDrive.torque; SetOutputDrives(currentRatio); } }
TK-97/MT
MT_v0.7/Assets/ExternalAssets/Randomation Vehicle Physics 2.0/Scripts/C#/ContinuousTransmission.cs
C#
lgpl-3.0
1,722
mkdir build32 & pushd build32 cmake -G "Visual Studio 15 2017" .. popd mkdir build64 & pushd build64 cmake -G "Visual Studio 15 2017 Win64" .. popd cmake --build build32 --config Release cmake --build build64 --config Release build32\FilterAPITest\Release\FilterAPITest.exe build64\FilterAPITest\Release\FilterAPITest.exe pause :: References: :: [How to build x86 and/or x64 on Windows from command line with CMAKE?](https://stackoverflow.com/questions/28350214/how-to-build-x86-and-or-x64-on-windows-from-command-line-with-cmake?rq=1)
myd7349/Ongoing-Study
c#/Console/PInvoke/FilterAPITest/build.bat
Batchfile
lgpl-3.0
537
//============================================================================== // Brief : MIHF ID // Authors : Simao Reis <sreis@av.it.pt> //------------------------------------------------------------------------------ // ODTONE - Open Dot Twenty One // // Copyright (C) 2009-2012 Universidade Aveiro // Copyright (C) 2009-2012 Instituto de Telecomunicações - Pólo Aveiro // // This software is distributed under a license. The full license // agreement can be found in the file LICENSE in this distribution. // This software may not be copied, modified, sold or distributed // other than expressed in the named license agreement. // // This software is distributed without any warranty. //============================================================================== /////////////////////////////////////////////////////////////////////////////// #include "mihfid.hpp" /////////////////////////////////////////////////////////////////////////////// namespace odtone { namespace mihf { mih::id *mihfid_t::ptr_instance = NULL; /** * Constructor of the MIHF MIH Identifier. */ mihfid_t::mihfid_t() { } /** * Destructor of the MIHF MIH Identifier. */ mihfid_t::~mihfid_t() { if (ptr_instance) delete ptr_instance; } /** * Create a instance of the MIHF MIH Identifier. */ mih::id* mihfid_t::instance() { if (ptr_instance == NULL) ptr_instance = new mih::id(); return ptr_instance; } } /* namespace mihf */ } /* namespace odtone */
ATNoG/EMICOM
src/mihf/mihfid.cpp
C++
lgpl-3.0
1,457
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <!-- @(#)package.html Copyright (c) 2003-2015 The JUNG Authors. All Rights Reserved. License text: https://github.com/jrtom/jung/blob/master/LICENSE --> </head> <body> Methods for generating random graphs with various properties. These include: <ul> <li><code>BarabasiAlbertGenerator</code>: scale-free graphs using the preferential attachment heuristic. <li><code>EppsteinPowerLawGenerator</code>: graphs whose degree distribution approximates a power law <li><code>ErdosRenyiGenerator</code>: graphs for which edges are created with a specified probability <li><code>MixedRandomGraphGenerator</code>: takes the output of <code>BarabasiAlbertGenerator</code> and perturbs it to generate a mixed-mode analog with both directed and undirected edges. <li> </body> </html>
drzhonghao/grapa
jung-algorithms/src/main/java/edu/uci/ics/jung/algorithms/generators/random/package.html
HTML
lgpl-3.0
856
/* * MyJIT * Copyright (C) 2015 Petr Krajca, <petr.krajca@upol.cz> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ static void jit_dead_code_analysis(struct jit *jit, int remove_dead_code); static inline void jit_expand_patches_and_labels(struct jit *jit); static inline void jit_flw_analysis(struct jit *jit); static inline void jit_prepare_reg_counts(struct jit *jit); static inline void jit_prepare_arguments(struct jit *jit); void jit_get_reg_name(struct jit_disasm *disasm, char * r, int reg); static struct jit_disasm jit_debugging_disasm = { .indent_template = " ", .reg_template = "r%i", .freg_template = "fr%i", .arg_template = "arg%i", .farg_template = "farg%i", .reg_out_template = "out", .reg_fp_template = "fp", .reg_imm_template = "imm", .reg_fimm_template = "fimm", .reg_unknown_template = "(unknown reg.)", .label_template = "<label>", .label_forward_template = "<label>", .generic_addr_template = "<addr: 0x%lx>", .generic_value_template = "0x%lx", }; static void report_warning(struct jit *jit, jit_op *op, char *desc) { fprintf(stdout, "%s at function `%s' (%s:%i)\n", desc, op->debug_info->function, op->debug_info->filename, op->debug_info->lineno); print_op(stdout, &jit_debugging_disasm, op, NULL, 0); fprintf(stdout, "\n"); } static void append_msg(char *buf, char *format, ...) { va_list ap; if (strlen(buf)) strcat(buf, ", "); va_start(ap, format); vsprintf(buf + strlen(buf), format, ap); va_end(ap); } static void cleanup(struct jit *jit) { for (jit_op *op = jit_op_first(jit->ops); op; op = op->next) { if (op->live_in) { jit_set_free(op->live_in); op->live_in = NULL; } if (op->live_out) { jit_set_free(op->live_out); op->live_out = NULL; } if (GET_OP(op) == JIT_PROLOG) { if (op->arg[1]) { struct jit_func_info *info = (struct jit_func_info *)op->arg[1]; JIT_FREE(info->args); info->args = NULL; } } if (GET_OP(op) == JIT_PREPARE) { op->arg[0] = 0; op->arg[1] = 0; } } } static int check_dead_code(jit_op *op, char *msg_buf) { if (!op->in_use) { append_msg(msg_buf, "unreachable operation"); return JIT_WARN_DEAD_CODE; } return 0; } static int check_missing_patches(jit_op *op, char *msg_buf) { if ((((GET_OP(op) == JIT_CALL) || (GET_OP(op) == JIT_JMP)) && IS_IMM(op)) || is_cond_branch_op(op)) { if ((op->arg[0] == (jit_value) JIT_FORWARD) && (op->jmp_addr == NULL)) { append_msg(msg_buf, "missing patch"); return JIT_WARN_MISSING_PATCH; } } // FIXME: DATA_CADDR, DATA_DADDR, CODE_ADDR, DATA_ADDR return 0; } static int check_op_without_effect(jit_op *op, char *msg_buf) { // we have to skip these operations since, these are working with the flag register jit_opcode code = GET_OP(op); if ((code == JIT_ADDC) || (code == JIT_ADDX) || (code == JIT_SUBC) || (code == JIT_SUBX) || (code == JIT_BOADD) || (code == JIT_BOSUB) || (code == JIT_BNOADD) || (code == JIT_BNOSUB)) return 0; for (int i = 0; i < 3; i++) { if ((ARG_TYPE(op, i + 1) == TREG) && (!jit_set_get(op->live_out, op->arg[i]))) { append_msg(msg_buf, "operation without effect"); return JIT_WARN_OP_WITHOUT_EFFECT; } } return 0; } static void print_regs(jit_tree_key reg, jit_tree_value v, void *thunk) { char buf[32]; if (reg == R_FP) return; jit_get_reg_name(&jit_debugging_disasm, buf, reg); strcat(thunk, " "); strcat(thunk, buf); } static int check_uninitialized_registers(jit_op *op, char *msg_buf) { if (GET_OP(op) != JIT_PROLOG) return 0; if (op->live_in->root != NULL) { char buf[4096]; buf[0] = '\0'; jit_tree_walk(op->live_in->root, print_regs, buf); if (strlen(buf)) { append_msg(msg_buf, "uninitialized register(s): %s", buf); return JIT_WARN_UNINITIALIZED_REG; } } return 0; } static int valid_size(int size) { switch (size) { case 1: case 2: case 4: #ifdef JIT_ARCH_AMD64 case 8: #endif return 1; default: return 0; } } static int valid_fsize(int size) { return (size == 4) || (size == 8); } static int check_argument_sizes(jit_op *op, char *msg_buf) { switch (GET_OP(op)) { case JIT_LD: case JIT_LDX: case JIT_ST: case JIT_STX: if (valid_size(op->arg_size)) return 0; break; case JIT_FLD: case JIT_FLDX: case JIT_FST: case JIT_FSTX: case JIT_FPUTARG: case JIT_FRET: case JIT_FRETVAL: if (valid_fsize(op->arg_size)) return 0; break; case JIT_DECL_ARG: if (((op->arg[0] == JIT_SIGNED_NUM) || (op->arg[0] == JIT_UNSIGNED_NUM)) && valid_size(op->arg[1])) return 0; if ((op->arg[0] == JIT_FLOAT_NUM) && valid_fsize(op->arg[1])) return 0; if ((op->arg[0] == JIT_PTR) && (op->arg[1] == sizeof(void *))) return 0; break; default: return 0; } append_msg(msg_buf, "invalid data size"); return JIT_WARN_INVALID_DATA_SIZE; } #define CHECK_ARG_TYPE(op, index, _type) (((ARG_TYPE(op, index) != REG) && (ARG_TYPE(op, index) != TREG)) || (JIT_REG(op->arg[index - 1]).type == _type)) static int check_register_types(struct jit *jit, jit_op *op, char *msg_buf) { switch (GET_OP(op)) { case JIT_GETARG: { struct jit_func_info * info = jit_current_func_info(jit); if (info->args[op->arg[1]].type == JIT_FLOAT_NUM) { if (CHECK_ARG_TYPE(op, 1, JIT_RTYPE_FLOAT)) return 0; } else { if (CHECK_ARG_TYPE(op, 1, JIT_RTYPE_INT)) return 0; } break; } case JIT_FST: case JIT_TRUNC: case JIT_CEIL: case JIT_ROUND: case JIT_FLOOR: if (CHECK_ARG_TYPE(op, 1, JIT_RTYPE_INT) && CHECK_ARG_TYPE(op, 2, JIT_RTYPE_FLOAT)) return 0; break; case JIT_EXT: case JIT_FLD: if (CHECK_ARG_TYPE(op, 1, JIT_RTYPE_FLOAT) && CHECK_ARG_TYPE(op, 2, JIT_RTYPE_INT)) return 0; break; case JIT_FLDX: if (CHECK_ARG_TYPE(op, 1, JIT_RTYPE_FLOAT) && CHECK_ARG_TYPE(op, 2, JIT_RTYPE_INT) && CHECK_ARG_TYPE(op, 3, JIT_RTYPE_INT)) return 0; break; case JIT_FSTX: if (CHECK_ARG_TYPE(op, 1, JIT_RTYPE_INT) && CHECK_ARG_TYPE(op, 2, JIT_RTYPE_INT) && CHECK_ARG_TYPE(op, 3, JIT_RTYPE_FLOAT)) return 0; break; case JIT_FORCE_SPILL: case JIT_FORCE_ASSOC: return 0; default: if (!op->fp && CHECK_ARG_TYPE(op, 1, JIT_RTYPE_INT) && CHECK_ARG_TYPE(op, 2, JIT_RTYPE_INT) && CHECK_ARG_TYPE(op, 3, JIT_RTYPE_INT)) return 0; if (op->fp && CHECK_ARG_TYPE(op, 1, JIT_RTYPE_FLOAT) && CHECK_ARG_TYPE(op, 2, JIT_RTYPE_FLOAT) && CHECK_ARG_TYPE(op, 3, JIT_RTYPE_FLOAT)) return 0; } append_msg(msg_buf, "register type mismatch"); return JIT_WARN_REGISTER_TYPE_MISMATCH; } static int jit_op_is_data_op(jit_op *op) { while (op && ((GET_OP(op) == JIT_LABEL) || (GET_OP(op) == JIT_PATCH))) op = op->next; if (!op) return 0; jit_opcode code = GET_OP(op); return ((code == JIT_DATA_BYTE) || (code == JIT_DATA_REF_CODE) || (code == JIT_DATA_REF_DATA)); } static int check_data_alignment(jit_op *op, char *msg_buf) { if (jit_op_is_data_op(op) || (GET_OP(op) == JIT_CODE_ALIGN)) return 0; if ((GET_OP(op) == JIT_LABEL) || (GET_OP(op) == JIT_PATCH)) return 0; jit_op * prev = op->prev; while (prev) { if ((GET_OP(prev) == JIT_LABEL) || (GET_OP(prev) == JIT_PATCH)) prev = prev->prev; else break; } if (jit_op_is_data_op(prev)) { append_msg(msg_buf, "instruction follows unaligned data block"); return JIT_WARN_UNALIGNED_CODE; } return 0; } static int check_data_references(jit_op *op, char *msg_buf) { if (((GET_OP(op) == JIT_REF_DATA) || (GET_OP(op) == JIT_DATA_REF_DATA)) && !jit_op_is_data_op(op->jmp_addr)) { append_msg(msg_buf, "invalid data reference"); return JIT_WARN_INVALID_DATA_REFERENCE; } return 0; } static int check_code_references(jit_op *op, char *msg_buf) { if (((GET_OP(op) == JIT_REF_CODE) || (GET_OP(op) == JIT_DATA_REF_CODE)) && jit_op_is_data_op(op->jmp_addr)) { append_msg(msg_buf, "invalid code reference"); return JIT_WARN_INVALID_CODE_REFERENCE; } return 0; } void jit_check_code(struct jit *jit, int warnings) { char buf[8192]; jit_expand_patches_and_labels(jit); jit_dead_code_analysis(jit, 0); jit_prepare_reg_counts(jit); jit_prepare_arguments(jit); jit_flw_analysis(jit); for (jit_op *op = jit_op_first(jit->ops); op; op = op->next) { if (GET_OP(op) == JIT_PROLOG) jit->current_func = op; if (!op->debug_info) continue; buf[0] = '\0'; if (warnings & JIT_WARN_DEAD_CODE) op->debug_info->warnings |= check_dead_code(op, buf); if (warnings & JIT_WARN_MISSING_PATCH) op->debug_info->warnings |= check_missing_patches(op, buf); if (warnings & JIT_WARN_OP_WITHOUT_EFFECT) op->debug_info->warnings |= check_op_without_effect(op, buf); if (warnings & JIT_WARN_UNINITIALIZED_REG) op->debug_info->warnings |= check_uninitialized_registers(op, buf); if (warnings & JIT_WARN_INVALID_DATA_SIZE) op->debug_info->warnings |= check_argument_sizes(op, buf); if (warnings & JIT_WARN_REGISTER_TYPE_MISMATCH) op->debug_info->warnings |= check_register_types(jit, op, buf); if (warnings & JIT_WARN_UNALIGNED_CODE) op->debug_info->warnings |= check_data_alignment(op, buf); if (warnings & JIT_WARN_INVALID_DATA_REFERENCE) op->debug_info->warnings |= check_data_references(op, buf); if (warnings & JIT_WARN_INVALID_CODE_REFERENCE) op->debug_info->warnings |= check_code_references(op, buf); if (op->debug_info->warnings) report_warning(jit, op, buf); } cleanup(jit); }
quan-na/myjit
myjit/code-check.c
C
lgpl-3.0
9,903
/*+@@file@@----------------------------------------------------------------*//*! \file storprop.h \par Description Extension and update of headers for PellesC compiler suite. \par Project: PellesC Headers extension \date Created on Sat Sep 17 01:29:35 2016 \date Modified on Sat Sep 17 01:29:35 2016 \author frankie \*//*-@@file@@----------------------------------------------------------------*/ #ifndef __STORPROP_H__ #define __STORPROP_H__ #if __POCC__ >= 500 #pragma once #endif #include <setupapi.h> #define REDBOOK_DIGITAL_AUDIO_EXTRACTION_INFO_VERSION 1 typedef struct _REDBOOK_DIGITAL_AUDIO_EXTRACTION_INFO { ULONG Version; ULONG Accurate; ULONG Supported; ULONG AccurateMask0; } REDBOOK_DIGITAL_AUDIO_EXTRACTION_INFO, *PREDBOOK_DIGITAL_AUDIO_EXTRACTION_INFO; DWORD CdromCddaInfo(HDEVINFO HDevInfo, PSP_DEVINFO_DATA DevInfoData, PREDBOOK_DIGITAL_AUDIO_EXTRACTION_INFO CddaInfo, PULONG BufferSize); BOOL CdromKnownGoodDigitalPlayback(HDEVINFO HDevInfo, PSP_DEVINFO_DATA DevInfoData); LONG CdromEnableDigitalPlayback(HDEVINFO DevInfo, PSP_DEVINFO_DATA DevInfoData, BOOLEAN ForceUnknown); LONG CdromDisableDigitalPlayback(HDEVINFO DevInfo, PSP_DEVINFO_DATA DevInfoData); LONG CdromIsDigitalPlaybackEnabled(HDEVINFO DevInfo, PSP_DEVINFO_DATA DevInfoData, PBOOLEAN Enabled); #endif
Frankie-PellesC/fSDK
Include/storprop.h
C
lgpl-3.0
1,338
// Created file "Lib\src\MMC\X64\ndmgrpriv" typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID; #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ extern const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } DEFINE_GUID(IID_IScopeTree, 0xd8dbf067, 0x5fb2, 0x11d0, 0xa9, 0x86, 0x00, 0xc0, 0x4f, 0xd8, 0xd5, 0x65);
Frankie-PellesC/fSDK
Lib/src/MMC/X64/ndmgrpriv0000000A.c
C
lgpl-3.0
451
#include "nstokes.h" /* barycentric coordinates of point c[] in iel=p0,p1,p2 */ static inline int bar_2d(pPoint pp[3],double *c,int iel,double *cb) { double det; char i,i1,i2; det = (pp[1]->c[0] - pp[0]->c[0]) * (pp[2]->c[1] - pp[0]->c[1]) - (pp[1]->c[1] - pp[0]->c[1]) * (pp[2]->c[0] - pp[0]->c[0]); if ( fabs(det) < NS_EPSD ) return(0); det = 1.0 / det; /* barycentric coordinate, by use of Cramer's formulas */ for (i=0; i<2; i++) { i1 = (i+1) % 3; i2 = (i+2) % 3; cb[i] = (pp[i1]->c[0]-c[0])*(pp[i2]->c[1]-c[1]) - (pp[i1]->c[1]-c[1])*(pp[i2]->c[0]-c[0]); cb[i] *= det; } cb[2] = 1.0 - cb[0] - cb[1]; return(1); } /* return velocity P1_interpolation in v in element iv[3] */ static inline double vecint_P1_2d(double *un,int *iv,double *cb,double *v) { double *u0,*u1,*u2,dd; u0 = &un[2*(iv[0]-1)]; u1 = &un[2*(iv[1]-1)]; u2 = &un[2*(iv[2]-1)]; /* P1 interpolate of the speed */ v[0] = cb[0]*u0[0] + cb[1]*u1[0] + cb[2]*u2[0]; v[1] = cb[0]*u0[1] + cb[1]*u1[1] + cb[2]*u2[1]; dd = sqrt(v[0]*v[0] + v[1]*v[1]); return(dd); } /* find element containing c, starting from nsdep, return baryc. coord */ static int locelt_2d(pMesh mesh,int nsd,double *c,double *cb) { pTria pt; pPoint p0,p1,p2; double ax,ay,bx,by,cx,cy,eps; double aire1,aire2,aire3,dd; int i,sgn,nsf,nsp; nsf = nsd; nsp = 0; mesh->mark = ++mesh->mark; while ( nsf > 0 ) { pt = &mesh->tria[nsf]; if ( pt->mark == mesh->mark ) return(nsp); pt->mark = mesh->mark; /* area of triangle */ p0 = &mesh->point[pt->v[0]]; p1 = &mesh->point[pt->v[1]]; p2 = &mesh->point[pt->v[2]]; ax = p1->c[0] - p0->c[0]; ay = p1->c[1] - p0->c[1]; bx = p2->c[0] - p0->c[0]; by = p2->c[1] - p0->c[1]; dd = ax*by - ay*bx; sgn = dd > 0.0 ? 1 : -1; eps = sgn == 1 ? -NS_EPS*dd : NS_EPS*dd; /* barycentric */ bx = p1->c[0] - c[0]; by = p1->c[1] - c[1]; cx = p2->c[0] - c[0]; cy = p2->c[1] - c[1]; /* p in half-plane lambda_0 > 0 */ aire1 = sgn*(bx*cy - by*cx); if ( aire1 < eps ) { nsp = nsf; nsf = pt->adj[0] / 3; if ( !nsf ) { cb[0] = 0.0; nsf = nsp; } else continue; } ax = p0->c[0] - c[0]; ay = p0->c[1] - c[1]; aire2 = sgn*(cx*ay - cy*ax); if ( aire2 < eps ) { nsp = nsf; nsf = pt->adj[1] / 3; if ( !nsf ) { cb[1] = 0.0; nsf = nsp; } else continue; } aire3 = sgn*dd - aire1 - aire2; if ( aire3 < eps ) { nsp = nsf; nsf = pt->adj[2] / 3; if ( !nsf ) { cb[2] = 0.0; nsf = nsp; } else continue; } aire1 = NS_MAX(aire1,0.0); aire2 = NS_MAX(aire2,0.0); aire3 = NS_MAX(aire3,0.0); dd = aire1 + aire2 + aire3; if ( dd > NS_EPSD ) { dd = 1.0 / dd; cb[0] = aire1 * dd; cb[1] = aire2 * dd; cb[2] = aire3 * dd; } return(nsf); } /* no need for exhaustive search */ return(nsp); } /* computes the characteristic line emerging from point with barycentric coordinates cb in triangle iel and follows the characteristic on a length dt at most. Most often has to cross the boundary of the current triangle, thus stores in it the new triangle, in cb the barycentric coordinates in the new triangle of the crossing point, and updates dt with the remaining time to follow characteristic line */ static int travel_2d(NSst *nsst,double *cb,int *iel,double *dt) { pTria pt; pPoint p[3]; double *u0,*u1,*u2,m[3],ddt,tol,ux,uy,c[2],cb1[3]; int k; char i,i0,i1,i2; tol = *dt; k = *iel; pt = &nsst->mesh.tria[k]; p[0] = &nsst->mesh.point[pt->v[0]]; p[1] = &nsst->mesh.point[pt->v[1]]; p[2] = &nsst->mesh.point[pt->v[2]]; /* velocity at each vertex of iel */ u0 = &nsst->sol.un[2*(pt->v[0]-1)]; u1 = &nsst->sol.un[2*(pt->v[1]-1)]; u2 = &nsst->sol.un[2*(pt->v[2]-1)]; /* u = P1 velocity at the point of barycentric coordinates cb */ ux = cb[0]*u0[0] + cb[1]*u1[0] + cb[2]*u2[0]; uy = cb[0]*u0[1] + cb[1]*u1[1] + cb[2]*u2[1]; if ( ux*ux+uy*uy < NS_EPSD ) return(0); /* endpoint of the characteristic line starting from cb */ /* segment is of norm sqrt(ux*ux+uy*uy), and is to be followed for time dt, in the - direction */ c[0] = (cb[0]*p[0]->c[0] + cb[1]*p[1]->c[0] + cb[2]*p[2]->c[0]) - tol*ux; c[1] = (cb[0]*p[0]->c[1] + cb[1]*p[1]->c[1] + cb[2]*p[2]->c[1]) - tol*uy; /* barycentric coordinate of uu in the current triangle */ if ( !bar_2d(p,c,k,cb1) ) return(0); /* check if endpoint is in k */ for (i=0; i<3; i++) if ( cb1[i] < 0.0 ) break; if ( i == 3 ) { memcpy(cb,cb1,3*sizeof(double)); *dt -= tol; return(*dt > 0.0); } /* argument of the smallest value among 3 */ ddt = NS_TGV; i0 = -1; for (i=0; i<3; i++) { m[i] = cb[i] - cb1[i]; if ( m[i] > 0.0 ) { if ( tol*cb[i]/m[i] < ddt ) { ddt = tol*cb[i]/m[i]; i0 = i; } } } /* case when advection stays in same triangle */ if ( ddt > tol ) { memcpy(cb,cb1,3*sizeof(double)); *dt -= tol; } /* advection goes out of triangle: advect a minimum value */ if ( ddt < NS_EPS*tol ) { c[0] = cb[0]*p[0]->c[0] + cb[1]*p[1]->c[0] + cb[2]*p[2]->c[0] - NS_EPS*ux; c[1] = cb[0]*p[0]->c[1] + cb[1]*p[1]->c[1] + cb[2]*p[2]->c[1] - NS_EPS*uy; /* find the new triangle */ k = locelt_2d(&nsst->mesh,k,c,cb); if ( !k ) return(0); *iel = k; *dt -= NS_EPS; } else { /* barycentric coordinates of the exit point */ for (i=0; i<3; i++) cb1[i] = cb[i] - ddt* m[i]/tol; *dt -= ddt; /* find output triangle */ if ( !pt->adj[i0] ) { memcpy(cb,cb1,3*sizeof(double)); return(0); } else { i1 = (i0+1) % 3; i2 = (i0+2) % 3; *iel = pt->adj[i0] / 3; i0 = pt->adj[i0] % 3; cb[i0] = 0.0; cb[(i0+1) % 3] = cb1[i2]; cb[(i0+2) % 3] = cb1[i1]; } } return(*dt > 0.0); } static int nxtpt_2d(NSst *nsst,int *iel,double *c,double *cb,double step,double *v) { double cc[2]; int k; k = *iel; cc[0] = c[0] - step*v[0]; cc[1] = c[1] - step*v[1]; k = locelt_2d(&nsst->mesh,k,cc,cb); if ( k < 1 ) return(k); /* update */ c[0] = cc[0]; c[1] = cc[1]; vecint_P1_2d(nsst->sol.un,nsst->mesh.tria[k].v,cb,v); *iel = k; return(1); } /* advect P2 solution u0, result in u */ int advect_P2_2d(NSst *nsst) { return(1); } /* advect P1 solution u0, result in u */ int advect_P1_2d(NSst *nsst) { pTria pt; pPoint ppt; double *u0,*u1,*u2,cb[3],v[2],c[2],dt,dte,norm,st; int i,j,k,iel,kp,ns; dt = nsst->sol.dt; ns = 10; st = dt / ns; ++nsst->mesh.mark; for (k=1; k<=nsst->info.np; k++) { ppt = &nsst->mesh.point[k]; /* velocity at point p */ v[0] = nsst->sol.un[2*(k-1)+0]; v[1] = nsst->sol.un[2*(k-1)+1]; norm = sqrt(v[0]*v[0] + v[1]*v[1]); if ( norm < NS_EPSD ) continue; pt = &nsst->mesh.tria[ppt->s]; for (i=0; i<3; i++) if ( pt->v[i] == k ) break; /* barycentric coordinates of point p in triangle iel */ memset(cb,0,3*sizeof(double)); cb[i] = 1.0; /* next point = foot of the characteristic line */ c[0] = ppt->c[0]; c[1] = ppt->c[1]; dte = dt; for (iel=ppt->s,j=0; j<ns; j++) { kp = iel; if ( nxtpt_2d(nsst,&iel,c,cb,st,v) < 1 ) break; dte -= st; } if ( j < ns && !iel ) { iel = kp; while ( travel_2d(nsst,cb,&iel,&dte) ); } /* interpolate value at foot */ pt = &nsst->mesh.tria[iel]; u0 = &nsst->sol.un[2*(pt->v[0]-1)]; u1 = &nsst->sol.un[2*(pt->v[1]-1)]; u2 = &nsst->sol.un[2*(pt->v[2]-1)]; nsst->sol.u[2*(k-1)+0] = cb[0]*u0[0] + cb[1]*u1[0] + cb[2]*u2[0]; nsst->sol.u[2*(k-1)+1] = cb[0]*u0[1] + cb[1]*u1[1] + cb[2]*u2[1]; } return(1); }
loicNorgeot/ICStoolbox
src/Stokes/advect_2d.c
C
lgpl-3.0
8,030
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #include "createinvalidationresponse.h" #include "createinvalidationresponse_p.h" #include <QDebug> #include <QNetworkReply> #include <QXmlStreamReader> namespace QtAws { namespace CloudFront { /*! * \class QtAws::CloudFront::CreateInvalidationResponse * \brief The CreateInvalidationResponse class provides an interace for CloudFront CreateInvalidation responses. * * \inmodule QtAwsCloudFront * * <fullname>Amazon CloudFront</fullname> * * This is the <i>Amazon CloudFront API Reference</i>. This guide is for developers who need detailed information about * CloudFront API actions, data types, and errors. For detailed information about CloudFront features, see the <i>Amazon * CloudFront Developer * * \sa CloudFrontClient::createInvalidation */ /*! * Constructs a CreateInvalidationResponse object for \a reply to \a request, with parent \a parent. */ CreateInvalidationResponse::CreateInvalidationResponse( const CreateInvalidationRequest &request, QNetworkReply * const reply, QObject * const parent) : CloudFrontResponse(new CreateInvalidationResponsePrivate(this), parent) { setRequest(new CreateInvalidationRequest(request)); setReply(reply); } /*! * \reimp */ const CreateInvalidationRequest * CreateInvalidationResponse::request() const { Q_D(const CreateInvalidationResponse); return static_cast<const CreateInvalidationRequest *>(d->request); } /*! * \reimp * Parses a successful CloudFront CreateInvalidation \a response. */ void CreateInvalidationResponse::parseSuccess(QIODevice &response) { //Q_D(CreateInvalidationResponse); QXmlStreamReader xml(&response); /// @todo } /*! * \class QtAws::CloudFront::CreateInvalidationResponsePrivate * \brief The CreateInvalidationResponsePrivate class provides private implementation for CreateInvalidationResponse. * \internal * * \inmodule QtAwsCloudFront */ /*! * Constructs a CreateInvalidationResponsePrivate object with public implementation \a q. */ CreateInvalidationResponsePrivate::CreateInvalidationResponsePrivate( CreateInvalidationResponse * const q) : CloudFrontResponsePrivate(q) { } /*! * Parses a CloudFront CreateInvalidation response element from \a xml. */ void CreateInvalidationResponsePrivate::parseCreateInvalidationResponse(QXmlStreamReader &xml) { Q_ASSERT(xml.name() == QLatin1String("CreateInvalidationResponse")); Q_UNUSED(xml) ///< @todo } } // namespace CloudFront } // namespace QtAws
pcolby/libqtaws
src/cloudfront/createinvalidationresponse.cpp
C++
lgpl-3.0
3,220
package io.robe.mail; import io.robe.mail.queue.InMemoryMailQueue; import io.robe.mail.queue.MailQueue; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * A queue and consumer thread implementation. * Sender thread wakes up on every item insert and works until queue goes empty. * Every item in queue will be send only once. If any error occurs it is the developers responsibility to handle it. {@link io.robe.mail.MailEvent}. */ public class MailManager { private static final Logger LOGGER = LoggerFactory.getLogger(MailManager.class); private static final MailQueue<MailItem> queue = new InMemoryMailQueue(); private static MailSender sender; private static Thread consumerThread = new Thread(); private static Runnable consumer = new Runnable() { @Override public void run() { LOGGER.debug("Starting mail thread."); // Check queue and continue until it is empty. while (!queue.isEmpty()) { // Take first and remove from queue MailItem item = queue.poll(); LOGGER.info("Sending: " + item.getId() + " (" + queue.size() + ")"); // Decide to call events. boolean hasEvent = item.getEvent() != null; if (hasEvent) { item.getEvent().before(item); } try { // Send it! sender.sendMessage(item); LOGGER.info("Success: " + item.getId() + " (" + queue.size() + ")"); if (hasEvent) { item.getEvent().success(item); } } catch (Exception e) { LOGGER.info("Failed: " + item.getId() + " (" + queue.size() + ")"); LOGGER.debug(item.toString(), e); if (hasEvent) { item.getEvent().error(item, e); } } } LOGGER.debug("Stopping mail thread."); } }; static void setSender(MailSender sender) { MailManager.sender = sender; } public static boolean hasConfiguration() { try { return sender.getConfiguration() != null; } catch (Exception e) { e.printStackTrace(); return false; } } /** * Takes the mail item into the queue and manages the mail sender thread. * If thread is alive it will send the mail at the end of current thread queue. * Else a new thread will be created and started. * * @param item MailItem to send. * @return true if item added to the queue successfully. */ public static boolean sendMail(MailItem item) { LOGGER.debug("Mail : " + item.toString()); boolean result = queue.add(item); LOGGER.info("Adding mail to queue. Queue size: " + queue.size()); // If thread is alive leave the job to it // Else create new thread and start. if (!consumerThread.isAlive()) { consumerThread = new Thread(consumer); consumerThread.start(); } return result; } }
greenlaw110/robe
robe-mail/src/main/java/io/robe/mail/MailManager.java
Java
lgpl-3.0
3,208
package Genome::Model::CwlPipeline::Command::PrepForTransfer; use strict; use warnings; use File::Spec; use Genome; class Genome::Model::CwlPipeline::Command::PrepForTransfer { is => 'Command::V2', has => [ builds => { is => 'Genome::Model::Build::CwlPipeline', is_many => 1, doc => 'The build(s) to prepare for data transfer', }, directory => { is => 'Text', doc => 'The directory to prepare and write symlinks', }, md5sum => { is => 'Boolean', is_optional => 1, doc => 'Create a md5sum in the MANIFEST for each file', default_value => 0, }, ], doc => 'prepare a directory for transfer of CwlPipeline builds', }; sub help_detail { return <<EOHELP Prepare a directory for transfer of CwlPipeline build(s) files. Include a MANIFEST of files, subject names and optionally md5 checksums. EOHELP ; } sub execute { my $self = shift; my @headers = qw/ subject.name file.name /; if ($self->md5sum) { push @headers, 'md5sum'; } my $dir = $self->directory; if (-e $dir && !-d $dir) { $self->fatal_message('Existing path %s is not a directory', $dir); } elsif (-d $dir && !Genome::Sys->directory_is_empty($dir)) { $self->fatal_message('Unable to use existing non-empty directory %s', $dir); } Genome::Sys->create_directory($dir); my $writer = Genome::Utility::IO::SeparatedValueWriter->create( output => File::Spec->join($self->directory,'MANIFEST'), separator => "\t", headers => \@headers, ); for my $build ($self->builds) { my $results_directory = File::Spec->join($build->data_directory,'results'); my @file_paths = grep {-f $_} glob($results_directory .'/*'); for my $file_path (@file_paths) { my ($file_name, $dir, $suffix) = File::Basename::fileparse($file_path); my $symlink_name = $build->id .'.'. $file_name; my $symlink_path = File::Spec->join($self->directory,$symlink_name); my %data = ( 'subject.name' => $build->model->subject->name, 'file.name' => $symlink_name, ); if ($self->md5sum) { my $md5sum = Genome::Sys->md5sum($file_path); $data{md5sum} = $md5sum; } $writer->write_one(\%data); my $absolute_path = Genome::Sys->abs_path($file_path); Genome::Sys->create_symlink($absolute_path,$symlink_path); } } $writer->output->close(); return 1; } 1;
malachig/genome
lib/perl/Genome/Model/CwlPipeline/Command/PrepForTransfer.pm
Perl
lgpl-3.0
2,736
isc.DataSource.create({ ID:"employees", dataURL:"[ISOMORPHIC]/system/reference/inlineExamples/trees/dataBinding/employeesDataChildrenArrays.xml", recordXPath:"/Employees/employee", fields:[ {name:"Name"}, {name:"Job"}, {name:"directReports", childrenProperty:true} ] }); isc.TreeGrid.create({ ID: "employeeTree", dataSource: "employees", autoFetchData: true, // customized appearance width: 500, height: 400, nodeIcon:"icons/16/person.png", folderIcon:"icons/16/person.png", showOpenIcons:false, showDropIcons:false, closedIconSuffix:"" });
kylemwhite/isc
isomorphic_11.1p/system/reference/inlineExamples/trees/dataBinding/loadXMLChildrenArrays.js
JavaScript
lgpl-3.0
632
package import_catalogue; import javax.xml.stream.XMLStreamException; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import open_xml_reader.ResultDataSet; import open_xml_reader.WorkbookReader; /** * This thread is used to read batches of excel data * in background. * @author avonva * */ public class SheetReaderThread extends Thread { private static final Logger LOGGER = LogManager.getLogger(SheetReaderThread.class); private ResultDataSet rs; private WorkbookReader reader; private boolean finished; /** * Thread which reads one batch of the sheet * contained in the {@code reader}. Note that * you should call {@link WorkbookReader#processSheetName(String)} * and set {@link WorkbookReader#setBatchSize(int)} * before using this class. * @param reader */ public SheetReaderThread( WorkbookReader reader ) { this.reader = reader; this.finished = false; } @Override public void run() { if ( !reader.hasNext() ) return; // read the next batch of data try { rs = reader.next(); } catch (XMLStreamException e) { e.printStackTrace(); LOGGER.error("Cannot read workbook", e); } finished = true; } /** * Get the read data (when the process * is finished) * @return */ public ResultDataSet getData() { return rs; } public boolean isFinished() { return finished; } }
openefsa/CatalogueBrowser
src/import_catalogue/SheetReaderThread.java
Java
lgpl-3.0
1,394
package net.warpgame.engine.net.message; /** * @author Hubertus * Created 01.06.2018 */ public class UnknownMessageTypeException extends RuntimeException { public UnknownMessageTypeException(int messageType) { super("Could not find valid message processor for message type " + messageType); } }
WarpOrganization/warp
net/src/main/java/net/warpgame/engine/net/message/UnknownMessageTypeException.java
Java
lgpl-3.0
315
// UGThemes.h: interface for the UGThemes class. // ////////////////////////////////////////////////////////////////////// /*! ************************************************************************************** \file UGThemes.h ************************************************************************************** \author ³Â¹úÐÛ \brief רÌâͼ¼¯ºÏÀà¡£ \attention ----------------------------------------------------------------------------------<br> Copyright (c) 2000-2010 SuperMap Software Co., Ltd. <br> All Rights Reserved. <br> ----------------------------------------------------------------------------------<br> ************************************************************************************** \version 2005-05-20 ³Â¹úÐÛ ³õʼ»¯°æ±¾. <br> ************************************************************************************** */ #if !defined(AFX_UGTHEMES_H__869EEDDC_C92D_4D07_9903_4345F3138D0A__INCLUDED_) #define AFX_UGTHEMES_H__869EEDDC_C92D_4D07_9903_4345F3138D0A__INCLUDED_ #include "Map/UGTheme.h" namespace UGC { class MAP_API UGThemes { public: UGThemes(); #ifdef SYMBIAN60 ~UGThemes(); #else virtual ~UGThemes(); #endif UGThemes(const UGThemes& Themes); UGThemes& operator =(const UGThemes& Themes); public: static UGTheme* CreateTheme(UGTheme::UGThemeType nThemeType); static UGTheme* CloneTheme(UGTheme* pTheme); UGTheme* GetVisibleStyleTheme(UGdouble dScale)const; UGTheme* GetVisibleDotDensityTheme(UGdouble dScale)const; UGTheme* GetVisibleSymbolTheme(UGdouble dScale)const; UGTheme* GetVisibleLabelTheme(UGdouble dScale)const; UGTheme* GetVisibleGridTheme(UGdouble dScale)const; UGbool MoveTo(UGint nIndexFrom, UGint nIndexTo); UGbool MoveBottom(UGint nIndex); UGbool MoveDown(UGint nIndex); UGbool MoveUp(UGint nIndex); UGbool MoveTop(UGint nIndex); UGint Append(const UGThemes& Themes); UGint Add(UGTheme* pTheme); void InsertAt(UGint nIndex, UGTheme* pTheme); void SetAt(UGint nIndex, UGTheme* pTheme); UGTheme* GetAt(UGint nIndex)const; void RemoveAll(); UGint RemoveAt(UGint nIndex, UGint nCount = 1); UGint GetCount()const; UGbool IsEmpty()const; UGbool IsModified()const; void SetModifiedFlag(UGbool bModified = true); UGint Find(UGTheme* pTheme) const; UGString ToXML(UGint nVersion = 0)const; UGbool FromXML(const UGString& strXML, UGint nVersion = 0); protected: UGbool m_bModified; UGArray<UGTheme*> m_Themes; }; } #endif // !defined(AFX_UGTHEMES_H__869EEDDC_C92D_4D07_9903_4345F3138D0A__INCLUDED_)
zhouqin/EngineBaidu
01_SourceCode_7.0.0_B/Include/Map/UGThemes.h
C
lgpl-3.0
2,832
/** * * @author pquiring * * Created : Oct 11, 2013 */ import javaforce.JF; import java.awt.event.*; import javax.swing.*; public class Menu { private static MainPanel panel; public static void create(JFrame frame, MainPanel panel) { Menu.panel = panel; JMenuBar menu = create(true); frame.setJMenuBar(menu); } public static void create(JApplet applet, MainPanel panel) { Menu.panel = panel; JMenuBar menu = create(false); applet.setJMenuBar(menu); } private static JMenuBar create(boolean exit) { JMenuBar menuBar; JMenu menu; JMenuItem item; menuBar = new JMenuBar(); menu = new JMenu("File"); menu.setMnemonic('f'); menuBar.add(menu); item = new JMenuItem("New"); item.setMnemonic('n'); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panel.newTab(); } }); menu.add(item); item = new JMenuItem("Open"); item.setMnemonic('o'); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panel.openTab(); } }); menu.add(item); item = new JMenuItem("Save"); item.setMnemonic('s'); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panel.saveTab(); } }); menu.add(item); item = new JMenuItem("Save As"); item.setMnemonic('a'); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panel.saveAs(); } }); menu.add(item); item = new JMenuItem("Close"); item.setMnemonic('c'); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panel.closeTab(false); } }); menu.add(item); if (exit) { menu.add(new JSeparator()); item = new JMenuItem("Exit"); item.setMnemonic('x'); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { System.exit(0); } }); menu.add(item); } menu = new JMenu("Edit"); menu.setMnemonic('e'); menuBar.add(menu); item = new JMenuItem("Cut"); item.setMnemonic('t'); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_DOWN_MASK, false)); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panel.delSel(); } }); menu.add(item); item = new JMenuItem("Copy"); item.setMnemonic('y'); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_DOWN_MASK, false)); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { //copy is automatic when drawing a selection box } }); menu.add(item); item = new JMenuItem("Paste"); item.setMnemonic('p'); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK, false)); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panel.doPaste(false); } }); menu.add(item); item = new JMenuItem("Paste (System)"); item.setMnemonic('p'); item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_B, InputEvent.CTRL_DOWN_MASK, false)); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { panel.doPaste(true); } }); menu.add(item); menu = new JMenu("Help"); menu.setMnemonic('h'); menuBar.add(menu); item = new JMenuItem("About"); item.setMnemonic('a'); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { JF.showMessage("About", "jfPaint/" + MainPanel.version + "\n\nWebSite: jfpaint.sourceforge.net"); } }); menu.add(item); return menuBar; } }
ericomattos/javaforce
projects/jfpaint/src/Menu.java
Java
lgpl-3.0
4,322
<?php /** * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. * * You are hereby granted a non-exclusive, worldwide, royalty-free license to * use, copy, modify, and distribute this software in source code or binary * form for use in connection with the web services and APIs provided by * Facebook. * * As with any software that integrates with the Facebook platform, your use * of this software is subject to the Facebook Developer Principles and * Policies [http://developers.facebook.com/policy/]. This copyright notice * shall be included in all copies or substantial portions of the software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * */ namespace FacebookAds\Object\Values; use FacebookAds\Enum\AbstractEnum; /** * This class is auto-generated. * * For any issues or feature requests related to this class, please let us know * on github and we'll fix in our codegen framework. We'll not be able to accept * pull request for this class. * * @method static InstantArticleInsightsQueryResultBreakdownValues getInstance() */ class InstantArticleInsightsQueryResultBreakdownValues extends AbstractEnum { const AGE = 'age'; const COUNTRY = 'country'; const GENDER = 'gender'; const GENDER_AND_AGE = 'gender_and_age'; const IS_ORGANIC = 'is_organic'; const IS_SHARED_BY_IA_OWNER = 'is_shared_by_ia_owner'; const NO_BREAKDOWN = 'no_breakdown'; const PLATFORM = 'platform'; const REGION = 'region'; }
advanced-online-marketing/AOM
vendor/facebook/php-business-sdk/src/FacebookAds/Object/Values/InstantArticleInsightsQueryResultBreakdownValues.php
PHP
lgpl-3.0
1,902
#include <stdlib.h> #include <glib.h> #include "gegl.h" #include "opencl/gegl-cl-init.h" #define ITERATIONS 600 #define PERCENTILE 0.75 /* if we want to bias to the better results with more noise, increase this number towards 1.0, like 0.8 */ #define BAIL_THRESHOLD 0.001 #define BAIL_COUNT 20 #define MIN_ITER 20 static long ticks_start; typedef void (*t_run_perf)(GeglBuffer *buffer); long babl_ticks (void); /* using babl_ticks instead of gegl_ticks to be able to go further back in time */ void test_start (void); void test_end (const gchar *id, double bytes); void test_end_suffix (const gchar *id, const gchar *suffix, gdouble bytes); GeglBuffer *test_buffer (gint width, gint height, const Babl *format); void do_bench(const gchar *id, GeglBuffer *buffer, t_run_perf test_func, gboolean opencl); void bench(const gchar *id, GeglBuffer *buffer, t_run_perf test_func ); int converged = 0; long ticks_iter_start = 0; long iter_db[ITERATIONS]; int iter_no = 0; float prev_median = 0.0; void test_start (void) { ticks_start = babl_ticks (); iter_no = 0; converged = 0; prev_median = 0.0; } static void test_start_iter (void) { ticks_iter_start = babl_ticks (); } static int compare_long (const void * a, const void * b) { return ( *(long*)a - *(long*)b ); } static float compute_median (void) { qsort(iter_db,iter_no,sizeof(long),compare_long); return iter_db[(int)(iter_no * (1.0-PERCENTILE))]; } #include <math.h> #include <stdio.h> static void test_end_iter (void) { long ticks = babl_ticks ()-ticks_iter_start; float median; iter_db[iter_no] = ticks; iter_no++; median = compute_median (); if (iter_no > MIN_ITER && fabs ((median - prev_median) / median) < BAIL_THRESHOLD) { /* we've converged */ converged++; } else { converged = 0; } prev_median = median; } void test_end_suffix (const gchar *id, const gchar *suffix, gdouble bytes) { // long ticks = babl_ticks ()-ticks_start; g_print ("@ %s%s: %.2f megabytes/second\n", id, suffix, (bytes / 1024.0 / ITERATIONS/ 1024.0) / (compute_median()/1000000.0)); // (bytes / 1024.0 / 1024.0) / (ticks / 1000000.0)); } void test_end (const gchar *id, gdouble bytes) { test_end_suffix (id, "", bytes); } /* create a test buffer of random data in -0.5 to 2.0 range */ GeglBuffer *test_buffer (gint width, gint height, const Babl *format) { GeglRectangle bound = {0, 0, width, height}; GeglBuffer *buffer; gfloat *buf = g_malloc0 (width * height * 16); gint i; buffer = gegl_buffer_new (&bound, format); for (i=0; i < width * height * 4; i++) buf[i] = g_random_double_range (-0.5, 2.0); gegl_buffer_set (buffer, NULL, 0, babl_format ("RGBA float"), buf, 0); g_free (buf); return buffer; } void do_bench (const gchar *id, GeglBuffer *buffer, t_run_perf test_func, gboolean opencl) { gchar* suffix = ""; g_object_set(G_OBJECT(gegl_config()), "use-opencl", opencl, NULL); if (opencl) { if ( ! gegl_cl_is_accelerated()) { g_print("OpenCL is disabled. Skipping OpenCL test\n"); return; } suffix = " (OpenCL)"; } // warm up test_func(buffer); test_start (); for (int i=0; i<ITERATIONS && converged<4; ++i) { test_start_iter(); test_func(buffer); test_end_iter(); } test_end_suffix (id, suffix, ((double)gegl_buffer_get_pixel_count (buffer)) * 16 * ITERATIONS); } void bench (const gchar *id, GeglBuffer *buffer, t_run_perf test_func) { do_bench(id, buffer, test_func, FALSE ); do_bench(id, buffer, test_func, TRUE ); }
jvesely/gegl
perf/test-common.h
C
lgpl-3.0
4,089
#include "testutils.h" static void ref_mod (mp_limb_t *rp, const mp_limb_t *ap, const mp_limb_t *mp, mp_size_t mn) { mpz_t r, a, m; mpz_init (r); mpz_mod (r, mpz_roinit_n (a, ap, 2*mn), mpz_roinit_n (m, mp, mn)); mpz_limbs_copy (rp, r, mn); mpz_clear (r); } #define MAX_ECC_SIZE (1 + 521 / GMP_NUMB_BITS) #define MAX_SIZE (2*MAX_ECC_SIZE) #define COUNT 50000 /* Destructively normalize tp, then compare */ static int mod_equal(const struct ecc_modulo *m, const mp_limb_t *ref, mp_limb_t *tp) { if (mpn_cmp (tp, m->m, m->size) >= 0) mpn_sub_n (tp, tp, m->m, m->size); return mpn_cmp (ref, tp, m->size) == 0; } static void test_one(const char *name, const struct ecc_modulo *m, const mpz_t r) { mp_limb_t a[MAX_SIZE]; mp_limb_t t[MAX_SIZE]; mp_limb_t ref[MAX_SIZE]; mpz_limbs_copy (a, r, 2*m->size); ref_mod (ref, a, m->m, m->size); mpn_copyi (t, a, 2*m->size); m->mod (m, t, t); if (!mod_equal (m, ref, t)) { fprintf (stderr, "m->mod %s failed: bit_size = %u, rp == xp\n", name, m->bit_size); fprintf (stderr, "a = "); mpn_out_str (stderr, 16, a, 2*m->size); fprintf (stderr, "\nt = "); mpn_out_str (stderr, 16, t, m->size); fprintf (stderr, " (bad)\nref = "); mpn_out_str (stderr, 16, ref, m->size); fprintf (stderr, "\n"); abort (); } mpn_copyi (t, a, 2*m->size); m->mod (m, t + m->size, t); if (!mod_equal (m, ref, t + m->size)) { fprintf (stderr, "m->mod %s failed: bit_size = %u, rp == xp + size\n", name, m->bit_size); fprintf (stderr, "a = "); mpn_out_str (stderr, 16, a, 2*m->size); fprintf (stderr, "\nt = "); mpn_out_str (stderr, 16, t + m->size, m->size); fprintf (stderr, " (bad)\nref = "); mpn_out_str (stderr, 16, ref, m->size); fprintf (stderr, "\n"); abort (); } if (m->B_size < m->size) { mpn_copyi (t, a, 2*m->size); ecc_mod (m, t, t); if (!mod_equal (m, ref, t)) { fprintf (stderr, "ecc_mod %s failed: bit_size = %u, rp == xp\n", name, m->bit_size); fprintf (stderr, "a = "); mpn_out_str (stderr, 16, a, 2*m->size); fprintf (stderr, "\nt = "); mpn_out_str (stderr, 16, t, m->size); fprintf (stderr, " (bad)\nref = "); mpn_out_str (stderr, 16, ref, m->size); fprintf (stderr, "\n"); abort (); } mpn_copyi (t, a, 2*m->size); ecc_mod (m, t + m->size, t); if (!mod_equal (m, ref, t + m->size)) { fprintf (stderr, "ecc_mod %s failed: bit_size = %u, rp == xp + size\n", name, m->bit_size); fprintf (stderr, "a = "); mpn_out_str (stderr, 16, a, 2*m->size); fprintf (stderr, "\nt = "); mpn_out_str (stderr, 16, t + m->size, m->size); fprintf (stderr, " (bad)\nref = "); mpn_out_str (stderr, 16, ref, m->size); fprintf (stderr, "\n"); abort (); } } } static void test_modulo (gmp_randstate_t rands, const char *name, const struct ecc_modulo *m, unsigned count) { mpz_t r; unsigned j; mpz_init (r); for (j = 0; j < count; j++) { if (j & 2) { if (j & 1) mpz_rrandomb (r, rands, 2*m->size * GMP_NUMB_BITS); else mpz_urandomb (r, rands, 2*m->size * GMP_NUMB_BITS); } else { /* Test inputs close to a multiple of m. */ mpz_t q; unsigned q_size; int diff; mpz_urandomb(r, rands, 30); q_size = 11 + mpz_get_ui(r) % (m->size * GMP_NUMB_BITS - 10); mpz_urandomb(r, rands, 30); diff = mpz_get_si(r) % 20 - 10; if (j & 1) mpz_rrandomb (r, rands, q_size); else mpz_urandomb (r, rands, q_size); mpz_mul (r, r, mpz_roinit_n(q, m->m, m->size)); if (diff >= 0) mpz_add_ui (r, r, diff); else mpz_sub_ui (r, r, -diff); if (mpz_sgn(r) < 0) continue; } test_one (name, m, r); } mpz_clear (r); } static void test_fixed (void) { mpz_t r; mpz_init (r); /* Triggered a bug reported by Hanno Böck. */ mpz_set_str (r, "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFF001C2C00", 16); mpz_mul_2exp (r, r, 256); test_one ("p", &_nettle_secp_256r1.p, r); test_one ("q", &_nettle_secp_256r1.q, r); mpz_set_str (r, "ffffffff00000001fffffffeffffffffffffffffffffffffffffffc0000000000007ffffffffffffffffffffffffffff00000000000000000fffffffffffffff", 16); test_one ("p", &_nettle_secp_256r1.p, r); test_one ("q", &_nettle_secp_256r1.q, r); /* Triggered a bug reported by Hanno Böck. */ mpz_set_str (r, "4c9000000000000000000000000000000000000000000000004a604db486e000000000000000000000000000000000000000121025be29575adb2c8ffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16); test_one ("p", &_nettle_secp_384r1.p, r); test_one ("q", &_nettle_secp_384r1.q, r); /* Triggered a carry bug in development version. */ mpz_set_str (r, "e64a84643150260640e4677c19ffc4faef06042132b86af6e9ee33fe1850222e57a514d5f1d6d444008bb896a96a43d5629945e57548f5e12f66be132b24110cbb2df6d7d3dd3aaadc98b0bbf29573843ad72e57f59fc5d4f56cc599da18bb99", 16); test_one ("p", &_nettle_secp_384r1.p, r); test_one ("q", &_nettle_secp_384r1.q, r); mpz_clear (r); } static void test_patterns (const char *name, const struct ecc_modulo *m) { mpz_t r; unsigned j; mpz_init (r); for (j = m->bit_size; j < 2*m->bit_size; j++) { /* Single one bit */ mpz_set_ui (r, 1); mpz_mul_2exp (r, r, j); test_one (name, m, r); /* All ones. */ mpz_mul_2exp (r, r, 1); mpz_sub_ui (r, r, 1); test_one (name, m, r); } mpz_clear (r); } void test_main (void) { gmp_randstate_t rands; unsigned count = COUNT; unsigned i; gmp_randinit_default (rands); test_fixed (); for (i = 0; ecc_curves[i]; i++) { test_patterns ("p", &ecc_curves[i]->p); test_patterns ("q", &ecc_curves[i]->p); } if (test_randomize(rands)) count *= 20; for (i = 0; ecc_curves[i]; i++) { test_modulo (rands, "p", &ecc_curves[i]->p, count); test_modulo (rands, "q", &ecc_curves[i]->q, count); } gmp_randclear (rands); }
gnutls/nettle
testsuite/ecc-mod-test.c
C
lgpl-3.0
6,076
<?php /* * * ____ _ _ __ __ _ __ __ ____ * | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \ * | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) | * | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/ * |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_| * * This program 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. * * @author PocketMine Team * @link http://www.pocketmine.net/ * * */ declare(strict_types=1); namespace pocketmine\block; use pocketmine\math\AxisAlignedBB; /** * Air block */ class Air extends Transparent{ public function canBeFlowedInto() : bool{ return true; } public function canBeReplaced() : bool{ return true; } public function canBePlaced() : bool{ return false; } public function isSolid() : bool{ return false; } /** * @return AxisAlignedBB[] */ protected function recalculateCollisionBoxes() : array{ return []; } }
pmmp/PocketMine-MP
src/block/Air.php
PHP
lgpl-3.0
1,201
/* * codeare Copyright (C) 2007-2010 Kaveh Vahedipour * Forschungszentrum Juelich, 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 2 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., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301 USA */ #ifndef __ALGOS_HPP__ #define __ALGOS_HPP__ #define NOMINMAX #include <Matrix.hpp> #include <math.h> #include <limits> #include <vector> #include <algorithm> // std::reverse #include <numeric> #if !defined(_MSC_VER) || _MSC_VER>1200 #include <boost/math/special_functions/fpclassify.hpp> template<class T> inline static bool is_nan (T const& x) { return boost::math::isnan (x); } template <class T> inline static bool is_inf (T const& x) { return boost::math::isinf (x); } #endif template<class T, class S> inline static bool eq (const MatrixType<T>& A, const MatrixType<S>& B) { assert (A.Size() == B.Size()); for (size_t i = 0; i < A.Size(); ++i) if (A[i]!=B[i]) return false; return true; } /** * @brief Number of non-zero elements * * Usage: * @code * Matrix<cxfl> m = rand<double> (8,4,9,1,4); * * size_t nonz = nnz (M); // 1152 * @endcode * * @param M Matrix * @return Number of non-zero elements of matrix M */ template <class T> inline static size_t nnz (const Matrix<T>& M) { size_t nz = 0; for (size_t i = 0; i < M.Size(); ++i) if (M[i] != T(0)) ++nz; return nz; } template<class T, class S> inline unsigned short issame (const Matrix<T>& A, const Matrix<S>& B) { if (numel(A) != numel(B)) return 0; for (auto i = 0; i < numel(A); ++i) if (A[i]!=B[i]) return 0; if (size(A)==size(B)) return 2; return 1; } /** * @brief Is matrix X-dimensional? * * @param M Matrix * @param d Dimension * @return X-dimensional? */ template <class T> inline static bool isxd (const Matrix<T>& M, size_t d) { size_t l = 0; for (size_t i = 0; i < M.NDim(); ++i) if (M.Dim(i) > 1) ++l; return (l == d); } /** * @brief Is matrix 1D? * * @param M Matrix * @return 1D? */ template <class T> inline static bool isvec (const Matrix<T>& M) { return isxd(M, 1); } /** * @brief Is matrix 2D? * * @param M Matrix * @return 2D? */ template <class T> inline static bool is2d (const Matrix<T>& M) { return isxd(M, 2); } /** * @brief Is 2D square matrix? * * @param M Matrix * @return 2D? */ template <class T> inline static bool issquare (const Matrix<T>& M) { return isxd(M, 2) && (size(M,0) == size(M,1)); } /** * @brief Is matrix 3D? * * @param M Matrix * @return 3D? */ template <class T> inline static bool is3d (const Matrix<T>& M) { return isxd(M, 3); } /** * @brief Is matrix 4D? * * @param M Matrix * @return 4D? */ template <class T> inline static bool is4d (const Matrix<T>& M) { return isxd(M, 4); } /** * @brief All elements zero? * * @param M Matrix * @return All elements zero? */ template <class T> inline static bool iszero (const Matrix<T>& M) { for (size_t i = 0; i < M.Size(); ++i) if (M[i] != T(0)) return false; return true; } /** * @brief Empty matrix? * * @param M Matrix * @return Empty? */ template <class T> inline static bool isempty (const MatrixType<T>& M) { return (numel(M) == 1); } /** * @brief Which elements are NaN * * @param M Matrix * @return Matrix of booleans true where NaN */ template <class T> inline static Matrix<cbool> isinf (const Matrix<T>& M) { Matrix<cbool> res (M.Dim()); for (size_t i = 0; i < res.Size(); ++i) res[i] = (is_inf(TypeTraits<T>::Real(M[i]))||is_inf(TypeTraits<T>::Imag(M[i]))); return res; } /** * @brief Which elements are Inf * * @param M Matrix * @return Matrix of booleans true where inf */ template <class T> inline static Matrix<cbool> isnan (const Matrix<T>& M) { Matrix<cbool> res (M.Dim()); for (size_t i = 0; i < res.Size(); ++i) res.Container()[i] = (is_nan(TypeTraits<T>::Imag(M[i]))||is_nan(TypeTraits<T>::Imag(M[i]))); return res; } /** * @brief Which elements are Inf * * @param M Matrix * @return Matrix of booleans true where inf */ template <class T> inline static Matrix<cbool> isfinite (const Matrix<T>& M) { Matrix<cbool> res (M.Dim()); size_t i = numel(M); return res; } /** * @brief Make non finite elements (default T(0) else specify) * * @param M Matrix * @param v Optional value to which NaN and Inf elements are set. (default: T(0)) * @return Matrix stripped of NaN and Inf elements */ #if !defined(_MSC_VER) || _MSC_VER>1200 template <class T> inline static Matrix<T> dofinite (const Matrix<T>& M, const T& v = 0) { Matrix<T> res (M.Dim()); size_t i = numel(M); while (i--) res[i] = is_nan(TypeTraits<T>::Real(M[i])) ? v : M[i]; return res; } #endif /** * @brief Highest dimension unequal 1 * * Usage: * @code * Matrix<cxfl> m = rand<double> (8,7,6); * size_t nd = ndims(m); // 2 * @endcode * * @param M Matrix * @return Highest non-one dimension */ template <class T> inline static size_t ndims (const MatrixType<T>& M) { size_t nd = 0; for (size_t i = 1; i < M.NDim(); ++i) if (size(M,i) > 1) nd = i; return (nd + 1); } /** * @brief Diagonal of biggest square matrix from top left * * Usage: * @code * Matrix<cxfl> m = rand<double> (2,3); * Matrix<cxfl> d = diag (m); * @endcode * * @param M Matrix * @return Highest non-one dimension */ template <class T> inline static Matrix<T> diag (const Matrix<T>& M) { assert (is2d(M)); size_t sz = (std::min)(size(M,0),size(M,1)); Matrix<T> res (sz,1); for (size_t i = 0; i < sz; ++i) res(i) = M(i,i); return res; } /** * @brief RAM occupied * * @param M Matrix * @return Size in RAM in bytes. */ template <class T> inline static size_t SizeInRAM (const Matrix<T>& M) { return numel(M) * sizeof (T); } /** * @brief Get the number of matrix cells, i.e. dim_0*...*dim_16. * * @param M Matrix * @return Number of cells. */ template <class T, paradigm P> inline static size_t numel (const MatrixType<T,P>& M) { return M.Size(); } /** * @brief All elements non-zero? * * @param M Matrix in question * @return True if all elements non-zero */ template <class T> inline static bool all (const Matrix<T>& M) { return (nnz(M) == numel(M)); } /** * @brief Get size of a dimension * * @param M Matrix * @param d Dimension * @return Number of cells. */ template <class T> size_t size (const MatrixType<T>& M, size_t d) { return M.Dim(d); } template <class T> size_t size (const MatrixType<T,MPI>& M, size_t d) { return M.Dim(d); } /** * @brief Get vector of dimensions * * @param M Matrix * @return Dimension vector. */ template <class T,paradigm P> inline static Vector<size_t> size (const MatrixType<T,P>& M) { return M.Dim(); } /** * @brief Get resolution of a dimension * * @param M Matrix * @param d Dimension * @return Resolution */ template <class T> size_t resol (const Matrix<T>& M, size_t d) { return M.Res(d); } /** * @brief Get length * * @param M Matrix * @return Length */ template <class T> inline static size_t length (const Matrix<T>& M) { size_t l = 1; for (size_t i = 0; i < M.NDim(); ++i) l = (l > size(M,i)) ? l : size(M,i); return l; } /** * @brief Get Width * * @param M Matrix * @return Width */ template <class T> inline static size_t width (const Matrix<T>& M) { return size(M,1); } /** * @brief Get height * * @param M Matrix * @return Height */ template <class T> size_t height (const Matrix<T>& M) { return M.Dim(0); } /** * @brief Round down * * @param M Matrix * @return Rounded down matrix */ template<class T> inline static Matrix<T> floor (const Matrix<T>& M) { Matrix<T> res = M; for (size_t i = 0; i < numel(M); ++i) res[i] = floor ((float)res[i]); return res; } /** * @brief Round up * * @param M Matrix * @return Rounded up matrix */ template<class T> inline static Matrix<T> ceil (const Matrix<T>& M) { Matrix<T> res = M; for (size_t i = 0; i < numel(M); ++i) res[i] = ceil (res[i]); return res; } /** * @brief MATLAB-like round * * @param M Matrix * @return Rounded matrix */ template<class T> inline static Matrix<T> round (const Matrix<T>& M) { Matrix<T> res = M; for (size_t i = 0; i < numel(M); ++i) res[i] = ROUND (res[i]); return res; } /** * @brief Maximal element * * @param M Matrix * @return Maximum */ #ifdef _MSC_VER # ifdef max # undef max # endif #endif template<class T> inline static Matrix<T> max (const Matrix<T>& M, const size_t& dim = 0) { Vector<size_t> dims = size(M); size_t m = dims[0]; size_t n = numel(M)/m; dims[dim] = 1; Matrix<T> ret(dims); for (size_t i = 0; i < n; ++i) ret[i] = *std::max_element(M.Begin()+i*m,M.Begin()+(i+1)*m); return ret; } template<class T> inline static Matrix<T> max (const View<T,true>& M, const size_t& dim = 0) { Vector<size_t> dims = size(M); size_t m = dims[0]; size_t n = numel(M)/m; dims.erase(dims.begin()); Matrix<T> ret(dims); for (size_t j = 0; j < n; ++j) { ret[j] = -1e20; for (size_t i = 0; i < m; ++i) if (ret[j]<=M[j*m+i]) ret[j] = M[j*m+i]; } return ret; } template<class T> inline static T mmax (const Matrix<T>& M) { return *std::max_element(M.Begin(), M.End()); } template <class T> inline static T mmax (const View<T, true>& V) { T mx = -1e20; for (size_t i = 0; i < numel(V); ++i) if (V[i] >= mx) mx = V[i]; return mx; } /** * @brief Maximal element * * @param M Matrix * @return Maximum */ #ifdef _MSC_VER # ifdef min # undef min # endif #endif template<class T> inline static Matrix<T> min (const Matrix<T>& M, const size_t& dim = 0) { Vector<size_t> dims = size(M); size_t m = dims[0]; size_t n = numel(M)/m; dims[dim] = 1; Matrix<T> ret(dims); for (size_t i = 0; i < n; ++i) ret[i] = *std::min_element(M.Begin()+i*m,M.Begin()+(i+1)*m); return ret; } template<class T> inline static Matrix<T> min (const View<T,true>& M, const size_t& dim = 0) { Vector<size_t> dims = size(M); size_t m = dims[0]; size_t n = numel(M)/m; dims.erase(dims.begin()); Matrix<T> ret(dims); for (size_t j = 0; j < n; ++j) { ret[j] = 1e20; for (size_t i = 0; i < m; ++i) if (ret[j]>=M[j*m+i]) ret[j] = M[j*m+i]; } return ret; } template<class T> inline static T mmin (const Matrix<T>& M) { return *std::min_element(M.Begin(), M.End()); } template <class T> inline static T mmin (const View<T, true>& V) { T mx = 1e-20; for (size_t i = 0; i < numel(V); ++i) if (V[i] <= mx) mx = V[i]; return mx; } #include "CX.hpp" /** * @brief Transpose * * @param M 2D Matrix * @param c Conjugate while transposing * * @return Non conjugate transpose */ template <class T> inline static Matrix<T> transpose (const Matrix<T>& M, bool c = false) { assert (is2d(M)); Matrix<T> res (size(M,1),size(M,0)); for (size_t j = 0; j < size(res,1); ++j) for (size_t i = 0; i < size(res,0); ++i) res(i,j) = M(j,i); return c ? conj(res) : res; } /** * @brief Complex conjugate transpose * * @param M 2D Matrix * @return Complex conjugate transpose */ template <class T> inline static Matrix<T> ctranspose (const Matrix<T>& M) { return transpose (M, true); } #include "Creators.hpp" /* * @brief Create new vector * and copy the data into the new vector. If the target * is bigger, the remaining space is set 0. If it is * smaller data is truncted. * * @param M The matrix to resize * @param sz New length * @return Resized vector */ template <class T> inline static Matrix<T> resize (const Matrix<T>& M, size_t sz) { Matrix<T> res (sz,1); size_t copysz = std::min(numel(M), sz); typename Vector<T>:: iterator rb = res.Begin (); typename Vector<T>::const_iterator mb = M.Begin (); std::copy (mb, mb+copysz, rb); return res; } /** * @brief Create new vector * and copy the data into the new vector. If the target * is bigger, the remaining space is set 0. If it is * smaller data is truncted. * * @param M The matrix to resize * @param sc New height * @param sl New width * @return Resized vector */ template <class T> inline static Matrix<T> resize (const Matrix<T>& M, size_t sc, size_t sl) { assert(sl*sc==numel(M)); Matrix<T> ret(sc,sl); ret.Container() = M.Container(); return ret; } /* * @brief Create new vector * and copy the data into the new vector. If the target * is bigger, the remaining space is set 0. If it is * smaller data is truncted. * * @param M The matrix to resize * @param sz New length * @return Resized vector */ template <class T> inline static Matrix<T> resize (const Matrix<T>& M, const size_t& s0, const size_t& s1, const size_t& s2) { assert (numel(M)==s0*s1*s2); Matrix<T> res (s0,s1,s2); res.Container() = M.Container(); return res; } /* * @brief Create new vector * and copy the data into the new vector. If the target * is bigger, the remaining space is set 0. If it is * smaller data is truncted. * * @param M The matrix to resize * @param sz New length * @return Resized vector */ template <class T> inline static Matrix<T> resize (const Matrix<T>& M, const size_t& s0, const size_t& s1, const size_t& s2, const size_t& s3) { assert (numel(M)==s0*s1*s2*s3); Matrix<T> res (s0,s1,s2,s3); res.Container() = M.Container(); return res; } /* * @brief Create new vector * and copy the data into the new vector. If the target * is bigger, the remaining space is set 0. If it is * smaller data is truncted. * * @param M The matrix to resize * @param sz New length * @return Resized vector */ template <class T> inline static Matrix<T> resize (const Matrix<T>& M, const size_t& s0, const size_t& s1, const size_t& s2, const size_t& s3, const size_t& s4) { assert (numel(M)==s0*s1*s2*s3*s4); Matrix<T> res (s0,s1,s2,s3,s4); res.Container() = M.Container(); return res; } /** * @brief Create new matrix with the new dimensions * and copy the data into the new matrix. If the target * is bigger, the remaining space is set 0. If it is * smaller data is truncted. * * @param M The matrix to resize * @param sz New dimension vector * @return Resized copy */ template <class T> inline static Matrix<T> resize (const Matrix<T>& M, const Vector<size_t>& sz) { Matrix<T> res (sz); size_t copysz = std::min(numel(M), numel(res)); typename Vector<T>:: iterator rb = res.Begin (); typename Vector<T>::const_iterator mb = M.Begin (); std::copy (mb, mb+copysz, rb); return res; } template <class T> inline static T sum2 (const Matrix<T>& M) { return std::accumulate (M.Begin(), M.End(), (T)1, std::plus<T>()); } /** * @brief Sum along a dimension * * Usage: * @code * Matrix<cxfl> m = rand<double> (8,7,6); * m = sum (m,0); // dims (7,6); * @endcode * * @param M Matrix * @param d Dimension * @return Sum of M along dimension d */ template <class T> inline static Matrix<T> sum (const MatrixType<T>& M, const size_t& d = 0) { Vector<size_t> sz = size(M); size_t dim = sz[d]; Matrix<T> res; assert (d < M.NDim()); // No meaningful sum over particular dimension if (dim == 1) return res; // Empty? allocation if (isempty(M)) return res; // Inner size size_t insize = 1; for (size_t i = 0; i < d; ++i) insize *= sz[i]; // Outer size size_t outsize = 1; for (size_t i = d+1; i < std::min(M.NDim(),sz.size()); ++i) outsize *= sz[i]; // Adjust size vector and allocate sz [d] = 1; res = Matrix<T>(sz); // Sum #pragma omp parallel default (shared) { #pragma omp for for (int i = 0; i < outsize; ++i) { for (size_t j = 0; j < insize; ++j) { res[i*insize + j] = T(0); for (size_t k = 0; k < dim; ++k) res[i*insize + j] += M[i*insize*dim + j + k*insize]; } } } return res; } template <class T> inline static Matrix<T> mean (const MatrixType<T>& M, const size_t& d = 0) { return sum(M,d)/size(M,d); } /** * @brief Product along a dimension * * Usage: * @code * Matrix<cxfl> m = rand<double> (8,7,6); * m = prod (m,0); // dims (7,6); * @endcode * * @param M Matrix * @param d Dimension * @return Sum of M along dimension d */ template <class T> inline static Matrix<T> prod (const Matrix<T>& M, size_t d) { Matrix<size_t> sz = size(M); size_t dim = sz[d]; Matrix<T> res; assert (d < M.NDim()); // No meaningful sum over particular dimension if (dim == 1) return res; // Empty? allocation if (isempty(M)) return res; // Inner and outer sizes Vector<size_t>::const_iterator ci = sz.Begin(); size_t insize = std::accumulate (ci, ci+d, 1, c_multiply<size_t>); size_t outsize = std::accumulate (ci+d+1, ci+d+std::min(M.NDim(),sz.Size()), 1, c_multiply<size_t>); // Adjust size vector and allocate sz [d] = 1; res = Matrix<T>(sz); // Sum #pragma omp parallel default (shared) { #pragma omp for for (size_t i = 0; i < outsize; ++i) for (size_t j = 0; j < insize; ++j) { res[i*insize + j] = T(0); for (size_t k = 0; k < dim; ++k) res[i*insize + j] += M[i*insize*dim + j + k*insize]; } } return res; } /** * @brief Product of all elements * * Usage: * @code * Matrix<cxfl> m = rand<double> (8,7,6); * m = prod (m); * @endcode * * @param M Matrix * @return Sum of M along dimension d */ template <class T> inline static T prod (const Matrix<T>& M) { return std::accumulate(M.Begin(), M.End(), T(1), c_multiply<T>); } /** * @brief Sum of squares over a dimension * * Usage: * @code * Matrix<cxfl> m = rand<double> (8,7,6); * m = sos (M,1); // dims (8,6); * @endcode * * @param M Matrix * @param d Dimension * @return Sum of squares */ template <class T> inline static Matrix<typename TypeTraits<T>::RT> sos (const Matrix<T>& M, long d = -1) { typedef typename TypeTraits<T>::RT real_type; if (d == -1) d = ndims(M)-1; assert (d <= ndims(M)-1); const real_type* rt = (real_type*)&M[0]; Matrix<real_type> res(size(M)); for (size_t i = 0; i < numel(M); ++i) res[i] = rt[2*i]*rt[2*i]+rt[2*i+1]*rt[2*i+1]; return sum (res, d); } /** * @brief Get rid of unused dimensions * * Usage: * @code * Matrix<cxfl> m = rand<double> (1,8,7,1,6); * m = squeeze (m); // dims: (8,7,6); * @endcode * * @param M Matrix * @return Squeezed matrix */ template <class T> inline static Matrix<T> squeeze (const Matrix<T>& M) { Matrix<T> ret = M; ret.Squeeze(); return ret; } template<class T> inline static Matrix<T> squeeze (const View<T,true>& V) { Vector<size_t> vdim = size(V), dim; for (size_t i = 0; i < vdim.size(); ++i) if (vdim[i] > 1) dim.push_back(vdim[i]); Matrix<T> ret(dim); for (size_t i = 0; i < numel(V); ++i) ret[i] = V[i]; return ret; } /** * @brief MATLAB-like permute * * Usage: * @code * Matrix<cxfl> m = rand<double> (2,3,4); * m = permute (m, 0, 1, 2); // new dims: (4,2,3); * @endcode * * @param M Input matrix * @param perm New permuted dimensions * @return Permuted matrix */ template<class T> inline static Matrix<T> permute (const Matrix<T>& M, const size_t& n0, const size_t& n1, const size_t& n2) { Vector<size_t> odims = size(M); assert (numel(odims)==3); // Must be 3d Matrix<T> ret(odims[n0], odims[n1], odims[n2]); if (n0 == 0) { if (n1 == 1) { assert (n2 == 2); // 0,1,2 : nothing to do return M; } else { assert (n2 == 1); // 0,2,1 : n1*n2 copies for (size_t k = 0; k < odims[n2]; ++k) for (size_t j = 0; j < odims[n1]; ++j) std::copy (&M(0,k,j), &M(0,k,j)+odims[0], &ret(0,j,k)); } } else if (n0 == 1) { if (n1 == 0) { assert (n2 == 2); // 1,0,2 for (size_t k = 0; k < odims[n2]; ++k) for (size_t j = 0; j < odims[n1]; ++j) for (size_t i = 0; i < odims[n0]; ++i) ret(i,j,k) = M(j,i,k); } else { assert (n2 == 0); // 1,2,0 for (size_t k = 0; k < odims[n2]; ++k) for (size_t j = 0; j < odims[n1]; ++j) for (size_t i = 0; i < odims[n0]; ++i) ret(i,j,k) = M(k,i,j); } } else if (n0 == 2) { if (n1 == 1) { assert (n2 == 0); // 2,1,0 for (size_t k = 0; k < odims[n2]; ++k) for (size_t j = 0; j < odims[n1]; ++j) for (size_t i = 0; i < odims[n0]; ++i) ret(i,j,k) = M(k,j,i); } else { assert (n2 == 1); // 2,0,1 for (size_t k = 0; k < odims[n2]; ++k) for (size_t j = 0; j < odims[n1]; ++j) for (size_t i = 0; i < odims[n0]; ++i) ret(i,j,k) = M(j,k,i); } } else { assert(false); } return ret; } /** * @brief MATLAB-like permute * * Usage: * @code * Matrix<cxfl> m = rand<double> (2,3,4); * m = permute (m, 0, 1, 2); // new dims: (4,2,3); * @endcode * * @param M Input matrix * @param perm New permuted dimensions * @return Permuted matrix */ template<class T> inline static Matrix<T> permute (const Matrix<T>& M, const size_t& n0, const size_t& n1) { Vector<size_t> odims = size(M); assert (numel(odims)==2); // Must be 3d Matrix<T> ret(odims[n0], odims[n1]); if (n0 == 0) {// 0,1: nothing to do assert (n1 == 1); return M; } else if (n0 == 1) {// 1,0: transpose assert (n1 == 0); for (size_t j = 0; j < odims[n1]; ++j) for (size_t i = 0; i < odims[n0]; ++i) ret(i,j) = M(j,i); } else { // We should never be here assert(false); } return ret; } /** * @brief MATLAB-like permute * * Usage: * @code * Matrix<cxfl> m = rand<double> (1,8,7,1,6); * m = permute (m); // dims: (8,7,6); * @endcode * * @param M Input matrix * @param perm New permuted dimensions * @return Permuted matrix */ //#include "Print.hpp" template <class T> inline static Matrix<T> permute (const Matrix<T>& M, const Vector<size_t>& perm) { // Check that perm only includes one number between 0 and INVALID_DIM once size_t ndnew = perm.size(), i = 0; size_t ndold = ndims (M); // Must have same number of dimensions assert (ndnew == ndold); // Every number between 0 and ndnew must appear exactly once Vector<cbool> occupied; occupied.resize(ndnew); for (i = 0; i < ndnew; ++i) { assert (!occupied[perm[i]]); occupied [perm[i]] = true; } // Old and new sizes Vector<size_t> so = size (M); Vector<size_t> sn (16,1); for (i = 0; i < ndnew; ++i) sn[i] = so[perm[i]]; // Allocate new matrix with permuted dimensions Matrix<T> res(sn); // Relation of old to new indices Vector<size_t> d(16), od(16); for (i = 0; i < ndnew; ++i) od[i] = perm[i]; for ( ; i < 16; ++i) od[i] = i; // Copy data accordingly for (d[15] = 0; d[15] < size(M,15); d[15]++) for (d[14] = 0; d[14] < size(M,14); d[14]++) for (d[13] = 0; d[13] < size(M,13); d[13]++) for (d[12] = 0; d[12] < size(M,12); d[12]++) for (d[11] = 0; d[11] < size(M,11); d[11]++) for (d[10] = 0; d[10] < size(M,10); d[10]++) for (d[ 9] = 0; d[ 9] < size(M, 9); d[ 9]++) for (d[ 8] = 0; d[ 8] < size(M, 8); d[ 8]++) for (d[ 7] = 0; d[ 7] < size(M, 7); d[ 7]++) for (d[ 6] = 0; d[ 6] < size(M, 6); d[ 6]++) for (d[ 5] = 0; d[ 5] < size(M, 5); d[ 5]++) for (d[ 4] = 0; d[ 4] < size(M, 4); d[ 4]++) for (d[ 3] = 0; d[ 3] < size(M, 3); d[ 3]++) for (d[ 2] = 0; d[ 2] < size(M, 2); d[ 2]++) for (d[ 1] = 0; d[ 1] < size(M, 1); d[ 1]++) for (d[ 0] = 0; d[ 0] < size(M, 0); d[ 0]++) res (d[od[ 0]],d[od[ 1]],d[od[ 2]],d[od[ 3]], d[od[ 4]],d[od[ 5]],d[od[ 6]],d[od[ 7]], d[od[ 8]],d[od[ 9]],d[od[10]],d[od[11]], d[od[12]],d[od[13]],d[od[14]],d[od[15]]) = M (d[ 0],d[ 1],d[ 2],d[ 3],d[ 4],d[ 5], d[ 6],d[ 7],d[ 8],d[ 9],d[10],d[11], d[12],d[13],d[14],d[15]); // Remove trailing singelton dimensions sn.erase(sn.begin()+ndnew, sn.begin()+16); return resize(res, sn); } /** * @brief MATLAB-like diff */ template<class T> inline static Matrix<T> diff (const Matrix<T>& rhs, const size_t& n = 1, const size_t& dim = 0) { Matrix<T> ret, tmp; Vector<size_t> rhssize = size(rhs), pdims = rhssize, dim_ord; size_t ndims = rhssize.size(); if (dim > ndims) { printf (" *** ERROR (%s:%d) - diff dimension %zu" "exceeds matrix dimension %zu", __FILE__, __LINE__, dim, ndims); throw 404; } if (dim == 0) { ret = rhs; } else { if (dim == 1) { if (ndims == 2) { ret = permute (rhs,1,0); } else if (ndims == 3) { ret = permute (rhs,1,0,2); } else { dim_ord.resize(ndims); std::iota(dim_ord.begin(), dim_ord.end(), 1); std::iter_swap(dim_ord.begin(), dim_ord.begin()+1); ret = permute (rhs,dim_ord); } } else if (dim == 2) { if (ndims == 3) ret = permute (rhs,2,0,1); else { dim_ord.resize(ndims); std::iota(dim_ord.begin(), dim_ord.end(), 1); std::iter_swap(pdims.begin(), pdims.begin()+2); ret = permute (rhs,dim_ord); } } } Vector<T> col (size(rhs,0)); typename Vector<T>::iterator b, e, m; typename Vector<T>::const_iterator rb; size_t col_len = col.size(); for (size_t i = 0 ; i < n; ++i) { tmp = ret; for (b = ret.Begin(), e = b+col_len, m = b+1, rb = tmp.Begin(); b < ret.End(); b += col_len, e += col_len, m += col_len, rb += col_len) { std::rotate (b, m, e); std::transform (b, e, rb, b, std::minus<T>()); } } if (dim == 1) { if (ndims == 2) { ret = permute (rhs,1,0); } else if (ndims == 3) { ret = permute (rhs,1,0,2); } else { dim_ord.resize(ndims); std::iota(dim_ord.begin(), dim_ord.end(), 1); std::iter_swap(dim_ord.begin(), dim_ord.begin()+1); ret = permute (rhs,dim_ord); } } else if (dim == 2) { if (ndims == 3) ret = permute (rhs,2,0,1); else { dim_ord.resize(ndims); std::iota(dim_ord.begin(), dim_ord.end(), 1); std::iter_swap(pdims.begin(), pdims.begin()+2); ret = permute (rhs,dim_ord); } } return ret; } /** * @brief FLip up down * * @param M Matrix * @return Flipped matrix */ template <class T> inline static Matrix<T> flipud (const Matrix<T>& M) { size_t scol = size(M,0), ncol = numel(M)/scol; Matrix<T> res = M; if (scol == 1) // trivial return res; typedef typename Vector<T>::iterator VI; for (VI i = res.Container().begin(); i < res.Container().end(); i += scol) std::reverse(i, i+scol); return res; } /** * @brief FLip left right * * @param M Matrix * @return Flipped matrix */ template <class T> inline static Matrix<T> fliplr (const Matrix<T>& M) { size_t srow = size(M,1), scol = size(M,0), nrow = numel (M)/srow; Matrix<T> res (M.Dim()); for (size_t i = 0; i < nrow; ++i) for (size_t j = 0; j < srow; ++j) res[j*scol+i] = M[(srow-1-j)*scol+i]; return res; } /** * @brief Sort keep original indices */ typedef enum sort_dir { ASCENDING, DESCENDING } sort_dir; /** * @brief Get sort indices sorting elements of m * @param m Data to sort * @param sd Sort direction * @return sort indices */ template <typename T> inline static Vector<size_t> sort (const Matrix<T> &m, const sort_dir sd = ASCENDING) { Vector<size_t> idx(m.Size()); std::iota(idx.begin(), idx.end(), 0); if (sd == ASCENDING) sort(idx.begin(), idx.end(), [&m](size_t i1, size_t i2) {return m[i1] < m[i2];}); else sort(idx.begin(), idx.end(), [&m](size_t i1, size_t i2) {return m[i1] > m[i2];}); return idx; } #endif
kvahed/codeare
src/matrix/Algos.hpp
C++
lgpl-3.0
31,363
<!DOCTYPE html> <html lang="en"> <body> <div style="margin-left:5%; margin-top:5%;"> <span><a href="<?php echo site_url('admin/view/menu'); ?>">View All</a> </span> </div> <div class="container"> <h2><?php echo $title; ?> MENU</h2> <form action="<?php if($title == 'CREATE') echo site_url('admin/create/menu'); else echo site_url('admin/edit/menu/'.$menu->id); ?>" role="form" method="post" enctype="multipart/form-data"> <div class="form-group"> <label for="name">Name:</label> <input type="text" class="form-control" id="name" name="name" value="<?php if(isset($menu)) echo $menu->name; ?>"> </div> <button type="submit" class="btn btn-primary btn-block"><?php echo $title; ?></button> </form> </div> </body> </html>
mhobesong/shmyde
application/views/admin/create_menu.php
PHP
lgpl-3.0
752
// HTMLParser Library - A java-based parser for HTML // http://htmlparser.org // Copyright (C) 2006 Somik Raha // // Revision Control Information // // $URL: file:///svn/p/htmlparser/code/tags/HTMLParserProject-2.1/parser/src/main/java/org/htmlparser/tags/DefinitionList.java $ // $Author: derrickoswald $ // $Date: 2006-09-16 14:44:17 +0000 (Sat, 16 Sep 2006) $ // $Revision: 4 $ // // This library is free software; you can redistribute it and/or // modify it under the terms of the Common Public License; either // version 1.0 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 // Common Public License for more details. // // You should have received a copy of the Common Public License // along with this library; if not, the license is available from // the Open Source Initiative (OSI) website: // http://opensource.org/licenses/cpl1.0.php package org.htmlparser.tags; /** * A definition list tag (dl). */ public class DefinitionList extends CompositeTag { /** * The set of names handled by this tag. */ private static final String[] mIds = new String[] {"DL"}; /** * The set of end tag names that indicate the end of this tag. */ private static final String[] mEndTagEnders = new String[] {"BODY", "HTML"}; /** * Create a new bullet list (ordered or unordered) tag. */ public DefinitionList () { } /** * Return the set of names handled by this tag. * @return The names to be matched that create tags of this type. */ public String[] getIds () { return (mIds); } /** * Return the set of end tag names that cause this tag to finish. * @return The names of following end tags that stop further scanning. */ public String[] getEndTagEnders () { return (mEndTagEnders); } }
socialwareinc/html-parser
parser/src/main/java/org/htmlparser/tags/DefinitionList.java
Java
lgpl-3.0
2,098
# # BlueVia is a global iniciative of Telefonica delivered by Movistar and O2. # Please, check out www.bluevia.com and if you need more information # contact us at mailto:support@bluevia.com # require 'bluevia/clients/commons/bv_mo_client' module Bluevia class BVMoSmsClient < BVMoClient # This method retrieves the list of received SMS belonging to a specific registration ID. # # required params : # [*registration_id*] Bluevia short number for your country, including the country code without the + symbol # # returns nil or an array with a Bluevia::Schemas::SmsMessage object for every message # raise BlueviaError # # example: # response = @bc.get_all_messages("34217040") # def get_all_messages(registration_id) response = get_messages(registration_id, nil, nil, nil) filter_response(response) end # # Sends a start_notification request to the endpoint # # required params : # [*destination*] destination number # [*endpoint*] endpoint (basically an owned HTTP server) to deliver MMS notification # [*criteria*] Text to match in order to determine the application that shall receive the notification. # optional params : # [*correlator*] unique identifier (if not provided, SDK will generate one) # # returns location where the notification can be checked # raise BlueviaError # def start_notification(destination, endpoint, criteria, correlator = nil) aux = super(destination, endpoint, criteria, correlator) message = {:smsNotification => aux} response = base_create(MS_IN + MS_SUBS, nil, message, nil) if response.eql?"" or response.nil? location = Utils.filter_header(@Ir, 'location') unless location.nil? return location.gsub(/^.+\/subscriptions\/([^\/]+)/, '\1') end end e = response.new e.code = COD_12 e.message = ERR_PART3 + "start sms notification." raise BlueviaError.new(e) end # # This method stop message notification (MO) # # required params : # [*subscription_id*] The subscription identifier to be deleted # # returns true when everything was ok # raise BlueviaError # def stop_notification(subscription_id) super end private # # Auxiliary method for get_all_messages that filters response to # fill SmsMessage array and returns it. If response was empty then # nil is returned. # Returns BlueviaError if filtering was unsuccessfull. # def filter_response(response) begin return nil if response.nil? or !response.instance_of?(Hash) result = Array.new unless response.has_key? :receivedSMS smss = response['receivedSMS'] unless smss.has_key? :receivedSMS smss = smss['receivedSMS'] end else return SmsMessage.new end if smss.instance_of?(Array) smss.each{|sms| result << assign_item(sms) } else result << assign_item(smss) end result rescue StandardError => error e = BVResponse.new e.code = COD_12 e.message = ERR_PART3 + "create SmsMessage." raise BlueviaError.new(e) end end # # For every sms this method maps response's elements to SmsMessage attributes, # def assign_item(smss) item = SmsMessage.new item.message = smss['message'] item.date = smss ['dateTime'] item.origin_address = get_phone_alias(smss, 'originAddress') if smss['destinationAddress'].instance_of?Array smss['destinationAddress'].each{ item.destination << get_phone_alias(smss, 'destinationAddress') } else item.destination = get_phone_alias(smss, 'destinationAddress') end item end def init_untrusted(mode, consumer_key, consumer_secret, token_key = nil, token_secret = nil) super init end def init_trusted(mode, consumer_key, consumer_secret, cert_file, cert_pass) super init end # # This method sets parser and serializer for SMS MO client. # It also complete Rest part of the URL. # def init @Ip = Bluevia::IParser::JsonParser.new @Is = Bluevia::ISerializer::JsonSerializer.new is_rest end end end
BlueVia/Official-Library-Ruby
src/lib/bluevia/clients/bv_mo_sms_client.rb
Ruby
lgpl-3.0
4,644
/* GStreamer * * Copyright (C) <2005> Stefan Kost <ensonic at users dot sf dot net> * Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org> * * gstcontroller.c: dynamic parameter control subsystem * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 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 * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /** * SECTION:gstcontroller * @short_description: dynamic parameter control subsystem * * The controller subsystem offers a lightweight way to adjust gobject * properties over stream-time. It works by using time-stamped value pairs that * are queued for element-properties. At run-time the elements continously pull * values changes for the current stream-time. * * What needs to be changed in a #GstElement? * Very little - it is just two steps to make a plugin controllable! * <orderedlist> * <listitem><para> * mark gobject-properties paramspecs that make sense to be controlled, * by GST_PARAM_CONTROLLABLE. * </para></listitem> * <listitem><para> * when processing data (get, chain, loop function) at the beginning call * gst_object_sync_values(element,timestamp). * This will made the controller to update all gobject properties that are under * control with the current values based on timestamp. * </para></listitem> * </orderedlist> * * What needs to be done in applications? * Again its not a lot to change. * <orderedlist> * <listitem><para> * first put some properties under control, by calling * controller = gst_object_control_properties (object, "prop1", "prop2",...); * </para></listitem> * <listitem><para> * Get a #GstControlSource for the property and set it up. * csource = gst_interpolation_control_source_new (); * gst_interpolation_control_source_set_interpolation_mode(csource, mode); * gst_interpolation_control_source_set (csource,0 * GST_SECOND, value1); * gst_interpolation_control_source_set (csource,1 * GST_SECOND, value2); * </para></listitem> * <listitem><para> * Set the #GstControlSource in the controller. * gst_controller_set_control_source (controller, "prop1", csource); * </para></listitem> * <listitem><para> * start your pipeline * </para></listitem> * </orderedlist> */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include "gstcontroller.h" #include "gstcontrollerprivate.h" #include "gstcontrolsource.h" #include "gstinterpolationcontrolsource.h" #define GST_CAT_DEFAULT controller_debug GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT); static GObjectClass *parent_class = NULL; GQuark priv_gst_controller_key; /* property ids */ enum { PROP_CONTROL_RATE = 1 }; struct _GstControllerPrivate { GstClockTime control_rate; GstClockTime last_sync; }; /* helper */ static void gst_controlled_property_add_interpolation_control_source (GstControlledProperty * self) { GstControlSource *csource = GST_CONTROL_SOURCE (gst_interpolation_control_source_new ()); GST_INFO ("Adding a GstInterpolationControlSource because of backward compatibility"); g_return_if_fail (!self->csource); gst_control_source_bind (GST_CONTROL_SOURCE (csource), self->pspec); self->csource = csource; } /* * gst_controlled_property_new: * @object: for which object the controlled property should be set up * @name: the name of the property to be controlled * * Private method which initializes the fields of a new controlled property * structure. * * Returns: a freshly allocated structure or %NULL */ static GstControlledProperty * gst_controlled_property_new (GObject * object, const gchar * name) { GstControlledProperty *prop = NULL; GParamSpec *pspec; GST_INFO ("trying to put property '%s' under control", name); /* check if the object has a property of that name */ if ((pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (object), name))) { GST_DEBUG (" psec->flags : 0x%08x", pspec->flags); /* check if this param is witable && controlable && !construct-only */ g_return_val_if_fail ((pspec->flags & (G_PARAM_WRITABLE | GST_PARAM_CONTROLLABLE | G_PARAM_CONSTRUCT_ONLY)) == (G_PARAM_WRITABLE | GST_PARAM_CONTROLLABLE), NULL); if ((prop = g_slice_new (GstControlledProperty))) { prop->pspec = pspec; prop->name = pspec->name; prop->csource = NULL; prop->disabled = FALSE; memset (&prop->last_value, 0, sizeof (GValue)); g_value_init (&prop->last_value, G_PARAM_SPEC_VALUE_TYPE (prop->pspec)); } } else { GST_WARNING ("class '%s' has no property '%s'", G_OBJECT_TYPE_NAME (object), name); } return prop; } /* * gst_controlled_property_free: * @prop: the object to free * * Private method which frees all data allocated by a #GstControlledProperty * instance. */ static void gst_controlled_property_free (GstControlledProperty * prop) { if (prop->csource) g_object_unref (prop->csource); g_value_unset (&prop->last_value); g_slice_free (GstControlledProperty, prop); } /* * gst_controller_find_controlled_property: * @self: the controller object to search for a property in * @name: the gobject property name to look for * * Searches the list of properties under control. * * Returns: a #GstControlledProperty object of %NULL if the property is not * being controlled. */ static GstControlledProperty * gst_controller_find_controlled_property (GstController * self, const gchar * name) { GstControlledProperty *prop; GList *node; for (node = self->properties; node; node = g_list_next (node)) { prop = node->data; /* FIXME: eventually use GQuark to speed it up */ if (!strcmp (prop->name, name)) { return prop; } } GST_DEBUG ("controller does not (yet) manage property '%s'", name); return NULL; } /* * gst_controller_add_property: * @self: the controller object or %NULL if none yet exists * @object: object to bind the property * @name: name of projecty in @object * @ref_existing: pointer to flag that tracks if we need to ref an existng * controller still * * Creates a new #GstControlledProperty if there is none for property @name yet. * In case this is the first controlled propery, it creates the controller as * well. * * Returns: a newly created controller object or reffed existing one with the * given property bound. */ static GstController * gst_controller_add_property (GstController * self, GObject * object, const gchar * name, gboolean * ref_existing) { /* test if this property isn't yet controlled */ if (!self || !gst_controller_find_controlled_property (self, name)) { GstControlledProperty *prop; /* create GstControlledProperty and add to self->propeties List */ if ((prop = gst_controlled_property_new (object, name))) { /* if we don't have a controller object yet, now is the time to create one */ if (!self) { self = g_object_newv (GST_TYPE_CONTROLLER, 0, NULL); self->object = g_object_ref (object); /* store the controller */ g_object_set_qdata (object, priv_gst_controller_key, self); *ref_existing = FALSE; } else { /* only want one single _ref(), even for multiple properties */ if (*ref_existing) { g_object_ref (self); *ref_existing = FALSE; GST_INFO ("returning existing controller"); } } self->properties = g_list_prepend (self->properties, prop); } } else { GST_WARNING ("trying to control property %s again", name); if (*ref_existing) { g_object_ref (self); *ref_existing = FALSE; } } return self; } /* methods */ /** * gst_controller_new_valist: * @object: the object of which some properties should be controlled * @var_args: %NULL terminated list of property names that should be controlled * * Creates a new GstController for the given object's properties * * Returns: the new controller. */ GstController * gst_controller_new_valist (GObject * object, va_list var_args) { GstController *self; gboolean ref_existing = TRUE; gchar *name; g_return_val_if_fail (G_IS_OBJECT (object), NULL); GST_INFO ("setting up a new controller"); self = g_object_get_qdata (object, priv_gst_controller_key); /* create GstControlledProperty for each property */ while ((name = va_arg (var_args, gchar *))) { self = gst_controller_add_property (self, object, name, &ref_existing); } va_end (var_args); if (self) GST_INFO ("controller->ref_count=%d", G_OBJECT (self)->ref_count); return self; } /** * gst_controller_new_list: * @object: the object of which some properties should be controlled * @list: list of property names that should be controlled * * Creates a new GstController for the given object's properties * * Returns: the new controller. */ GstController * gst_controller_new_list (GObject * object, GList * list) { GstController *self; gboolean ref_existing = TRUE; gchar *name; GList *node; g_return_val_if_fail (G_IS_OBJECT (object), NULL); GST_INFO ("setting up a new controller"); self = g_object_get_qdata (object, priv_gst_controller_key); /* create GstControlledProperty for each property */ for (node = list; node; node = g_list_next (node)) { name = (gchar *) node->data; self = gst_controller_add_property (self, object, name, &ref_existing); } if (self) GST_INFO ("controller->ref_count=%d", G_OBJECT (self)->ref_count); return self; } /** * gst_controller_new: * @object: the object of which some properties should be controlled * @...: %NULL terminated list of property names that should be controlled * * Creates a new GstController for the given object's properties * * Returns: the new controller. */ GstController * gst_controller_new (GObject * object, ...) { GstController *self; va_list var_args; g_return_val_if_fail (G_IS_OBJECT (object), NULL); va_start (var_args, object); self = gst_controller_new_valist (object, var_args); va_end (var_args); return self; } /** * gst_controller_remove_properties_valist: * @self: the controller object from which some properties should be removed * @var_args: %NULL terminated list of property names that should be removed * * Removes the given object properties from the controller * * Returns: %FALSE if one of the given property isn't handled by the controller, %TRUE otherwise */ gboolean gst_controller_remove_properties_valist (GstController * self, va_list var_args) { gboolean res = TRUE; GstControlledProperty *prop; gchar *name; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); while ((name = va_arg (var_args, gchar *))) { /* find the property in the properties list of the controller, remove and free it */ g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, name))) { self->properties = g_list_remove (self->properties, prop); //g_signal_handler_disconnect (self->object, prop->notify_handler_id); gst_controlled_property_free (prop); } else { res = FALSE; } g_mutex_unlock (self->lock); } return res; } /** * gst_controller_remove_properties_list: * @self: the controller object from which some properties should be removed * @list: #GList of property names that should be removed * * Removes the given object properties from the controller * * Returns: %FALSE if one of the given property isn't handled by the controller, %TRUE otherwise */ gboolean gst_controller_remove_properties_list (GstController * self, GList * list) { gboolean res = TRUE; GstControlledProperty *prop; gchar *name; GList *tmp; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); for (tmp = list; tmp; tmp = g_list_next (tmp)) { name = (gchar *) tmp->data; /* find the property in the properties list of the controller, remove and free it */ g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, name))) { self->properties = g_list_remove (self->properties, prop); //g_signal_handler_disconnect (self->object, prop->notify_handler_id); gst_controlled_property_free (prop); } else { res = FALSE; } g_mutex_unlock (self->lock); } return res; } /** * gst_controller_remove_properties: * @self: the controller object from which some properties should be removed * @...: %NULL terminated list of property names that should be removed * * Removes the given object properties from the controller * * Returns: %FALSE if one of the given property isn't handled by the controller, %TRUE otherwise */ gboolean gst_controller_remove_properties (GstController * self, ...) { gboolean res; va_list var_args; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); va_start (var_args, self); res = gst_controller_remove_properties_valist (self, var_args); va_end (var_args); return res; } /** * gst_controller_set_property_disabled: * @self: the #GstController which should be disabled * @property_name: property to disable * @disabled: boolean that specifies whether to disable the controller * or not. * * This function is used to disable the #GstController on a property for * some time, i.e. gst_controller_sync_values() will do nothing for the * property. * * Since: 0.10.14 */ void gst_controller_set_property_disabled (GstController * self, const gchar * property_name, gboolean disabled) { GstControlledProperty *prop; g_return_if_fail (GST_IS_CONTROLLER (self)); g_return_if_fail (property_name); g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, property_name))) { prop->disabled = disabled; } g_mutex_unlock (self->lock); } /** * gst_controller_set_disabled: * @self: the #GstController which should be disabled * @disabled: boolean that specifies whether to disable the controller * or not. * * This function is used to disable all properties of the #GstController * for some time, i.e. gst_controller_sync_values() will do nothing. * * Since: 0.10.14 */ void gst_controller_set_disabled (GstController * self, gboolean disabled) { GList *node; GstControlledProperty *prop; g_return_if_fail (GST_IS_CONTROLLER (self)); g_mutex_lock (self->lock); for (node = self->properties; node; node = node->next) { prop = node->data; prop->disabled = disabled; } g_mutex_unlock (self->lock); } /** * gst_controller_set_control_source: * @self: the controller object * @property_name: name of the property for which the #GstControlSource should be set * @csource: the #GstControlSource that should be used for the property * * Sets the #GstControlSource for @property_name. If there already was a #GstControlSource * for this property it will be unreferenced. * * Returns: %FALSE if the given property isn't handled by the controller or the new #GstControlSource * couldn't be bound to the property, %TRUE if everything worked as expected. * * Since: 0.10.14 */ gboolean gst_controller_set_control_source (GstController * self, const gchar * property_name, GstControlSource * csource) { GstControlledProperty *prop; gboolean ret = FALSE; g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, property_name))) { GstControlSource *old = prop->csource; if (csource && (ret = gst_control_source_bind (csource, prop->pspec))) { g_object_ref (csource); prop->csource = csource; } else if (!csource) { ret = TRUE; prop->csource = NULL; } if (ret && old) g_object_unref (old); } g_mutex_unlock (self->lock); return ret; } /** * gst_controller_get_control_source: * @self: the controller object * @property_name: name of the property for which the #GstControlSource should be get * * Gets the corresponding #GstControlSource for the property. This should be unreferenced * again after use. * * Returns: the #GstControlSource for @property_name or NULL if the property is not * controlled by this controller or no #GstControlSource was assigned yet. * * Since: 0.10.14 */ GstControlSource * gst_controller_get_control_source (GstController * self, const gchar * property_name) { GstControlledProperty *prop; GstControlSource *ret = NULL; g_return_val_if_fail (GST_IS_CONTROLLER (self), NULL); g_return_val_if_fail (property_name, NULL); g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, property_name))) { ret = prop->csource; } g_mutex_unlock (self->lock); if (ret) g_object_ref (ret); return ret; } /** * gst_controller_get: * @self: the controller object which handles the properties * @property_name: the name of the property to get * @timestamp: the time the control-change should be read from * * Gets the value for the given controller-handled property at the requested * time. * * Returns: the GValue of the property at the given time, or %NULL if the * property isn't handled by the controller */ GValue * gst_controller_get (GstController * self, const gchar * property_name, GstClockTime timestamp) { GstControlledProperty *prop; GValue *val = NULL; g_return_val_if_fail (GST_IS_CONTROLLER (self), NULL); g_return_val_if_fail (property_name, NULL); g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), NULL); g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, property_name))) { val = g_new0 (GValue, 1); g_value_init (val, G_PARAM_SPEC_VALUE_TYPE (prop->pspec)); if (prop->csource) { gboolean res; /* get current value via control source */ res = gst_control_source_get_value (prop->csource, timestamp, val); if (!res) { g_free (val); val = NULL; } } else { g_object_get_property (self->object, prop->name, val); } } g_mutex_unlock (self->lock); return val; } /** * gst_controller_suggest_next_sync: * @self: the controller that handles the values * * Returns a suggestion for timestamps where buffers should be split * to get best controller results. * * Returns: Returns the suggested timestamp or %GST_CLOCK_TIME_NONE * if no control-rate was set. * * Since: 0.10.13 */ GstClockTime gst_controller_suggest_next_sync (GstController * self) { GstClockTime ret; g_return_val_if_fail (GST_IS_CONTROLLER (self), GST_CLOCK_TIME_NONE); g_return_val_if_fail (self->priv->control_rate != GST_CLOCK_TIME_NONE, GST_CLOCK_TIME_NONE); g_mutex_lock (self->lock); /* TODO: Implement more logic, depending on interpolation mode * and control points * FIXME: we need playback direction */ ret = self->priv->last_sync + self->priv->control_rate; g_mutex_unlock (self->lock); return ret; } /** * gst_controller_sync_values: * @self: the controller that handles the values * @timestamp: the time that should be processed * * Sets the properties of the element, according to the controller that (maybe) * handles them and for the given timestamp. * * If this function fails, it is most likely the application developers fault. * Most probably the control sources are not setup correctly. * * Returns: %TRUE if the controller values could be applied to the object * properties, %FALSE otherwise */ gboolean gst_controller_sync_values (GstController * self, GstClockTime timestamp) { GstControlledProperty *prop; GList *node; gboolean ret = TRUE, val_ret; GValue value = { 0, }; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE); GST_LOG ("sync_values"); g_mutex_lock (self->lock); g_object_freeze_notify (self->object); /* go over the controlled properties of the controller */ for (node = self->properties; node; node = g_list_next (node)) { prop = node->data; if (!prop->csource || prop->disabled) continue; GST_LOG ("property '%s' at ts=%" G_GUINT64_FORMAT, prop->name, timestamp); /* we can make this faster * http://bugzilla.gnome.org/show_bug.cgi?id=536939 */ g_value_init (&value, G_PARAM_SPEC_VALUE_TYPE (prop->pspec)); val_ret = gst_control_source_get_value (prop->csource, timestamp, &value); if (G_LIKELY (val_ret)) { /* always set the value for first time, but then only if it changed * this should limit g_object_notify invocations. * FIXME: can we detect negative playback rates? */ if ((timestamp < self->priv->last_sync) || gst_value_compare (&value, &prop->last_value) != GST_VALUE_EQUAL) { g_object_set_property (self->object, prop->name, &value); g_value_copy (&value, &prop->last_value); } } else { GST_DEBUG ("no control value for param %s", prop->name); } g_value_unset (&value); ret &= val_ret; } self->priv->last_sync = timestamp; g_object_thaw_notify (self->object); g_mutex_unlock (self->lock); return ret; } /** * gst_controller_get_value_arrays: * @self: the controller that handles the values * @timestamp: the time that should be processed * @value_arrays: list to return the control-values in * * Function to be able to get an array of values for one or more given element * properties. * * All fields of the %GstValueArray in the list must be filled correctly. * Especially the GstValueArray->values arrays must be big enough to keep * the requested amount of values. * * The types of the values in the array are the same as the property's type. * * <note><para>This doesn't modify the controlled GObject properties!</para></note> * * Returns: %TRUE if the given array(s) could be filled, %FALSE otherwise */ gboolean gst_controller_get_value_arrays (GstController * self, GstClockTime timestamp, GSList * value_arrays) { gboolean res = TRUE; GSList *node; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE); g_return_val_if_fail (value_arrays, FALSE); for (node = value_arrays; (res && node); node = g_slist_next (node)) { res = gst_controller_get_value_array (self, timestamp, node->data); } return (res); } /** * gst_controller_get_value_array: * @self: the controller that handles the values * @timestamp: the time that should be processed * @value_array: array to put control-values in * * Function to be able to get an array of values for one element property. * * All fields of @value_array must be filled correctly. Especially the * @value_array->values array must be big enough to keep the requested amount * of values. * * The type of the values in the array is the same as the property's type. * * <note><para>This doesn't modify the controlled GObject property!</para></note> * * Returns: %TRUE if the given array could be filled, %FALSE otherwise */ gboolean gst_controller_get_value_array (GstController * self, GstClockTime timestamp, GstValueArray * value_array) { gboolean res = FALSE; GstControlledProperty *prop; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE); g_return_val_if_fail (value_array, FALSE); g_return_val_if_fail (value_array->property_name, FALSE); g_return_val_if_fail (value_array->values, FALSE); g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, value_array->property_name))) { /* get current value_array via control source */ if (!prop->csource) goto out; res = gst_control_source_get_value_array (prop->csource, timestamp, value_array); } out: g_mutex_unlock (self->lock); return res; } /* gobject handling */ static void _gst_controller_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) { GstController *self = GST_CONTROLLER (object); switch (property_id) { case PROP_CONTROL_RATE:{ /* FIXME: don't change if element is playing, controller works for GObject so this wont work GstState c_state, p_state; GstStateChangeReturn ret; ret = gst_element_get_state (self->object, &c_state, &p_state, 0); if ((ret == GST_STATE_CHANGE_SUCCESS && (c_state == GST_STATE_NULL || c_state == GST_STATE_READY)) || (ret == GST_STATE_CHANGE_ASYNC && (p_state == GST_STATE_NULL || p_state == GST_STATE_READY))) { */ g_value_set_uint64 (value, self->priv->control_rate); /* } else { GST_WARNING ("Changing the control rate is only allowed if the elemnt" " is in NULL or READY"); } */ } break; default:{ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } break; } } /* sets the given properties for this object */ static void _gst_controller_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) { GstController *self = GST_CONTROLLER (object); switch (property_id) { case PROP_CONTROL_RATE:{ self->priv->control_rate = g_value_get_uint64 (value); } break; default:{ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } break; } } static void _gst_controller_dispose (GObject * object) { GstController *self = GST_CONTROLLER (object); if (self->object != NULL) { g_mutex_lock (self->lock); /* free list of properties */ if (self->properties) { GList *node; for (node = self->properties; node; node = g_list_next (node)) { GstControlledProperty *prop = node->data; gst_controlled_property_free (prop); } g_list_free (self->properties); self->properties = NULL; } /* remove controller from object's qdata list */ g_object_set_qdata (self->object, priv_gst_controller_key, NULL); g_object_unref (self->object); self->object = NULL; g_mutex_unlock (self->lock); } if (G_OBJECT_CLASS (parent_class)->dispose) (G_OBJECT_CLASS (parent_class)->dispose) (object); } static void _gst_controller_finalize (GObject * object) { GstController *self = GST_CONTROLLER (object); g_mutex_free (self->lock); if (G_OBJECT_CLASS (parent_class)->finalize) (G_OBJECT_CLASS (parent_class)->finalize) (object); } static void _gst_controller_init (GTypeInstance * instance, gpointer g_class) { GstController *self = GST_CONTROLLER (instance); self->lock = g_mutex_new (); self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GST_TYPE_CONTROLLER, GstControllerPrivate); self->priv->last_sync = GST_CLOCK_TIME_NONE; self->priv->control_rate = 100 * GST_MSECOND; } static void _gst_controller_class_init (GstControllerClass * klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); parent_class = g_type_class_peek_parent (klass); g_type_class_add_private (klass, sizeof (GstControllerPrivate)); gobject_class->set_property = _gst_controller_set_property; gobject_class->get_property = _gst_controller_get_property; gobject_class->dispose = _gst_controller_dispose; gobject_class->finalize = _gst_controller_finalize; priv_gst_controller_key = g_quark_from_static_string ("gst::controller"); /* register properties */ g_object_class_install_property (gobject_class, PROP_CONTROL_RATE, g_param_spec_uint64 ("control-rate", "control rate", "Controlled properties will be updated at least every control-rate nanoseconds", 1, G_MAXUINT, 100 * GST_MSECOND, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /* register signals */ /* set defaults for overridable methods */ } GType gst_controller_get_type (void) { static volatile gsize type = 0; if (g_once_init_enter (&type)) { GType _type; static const GTypeInfo info = { sizeof (GstControllerClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc) _gst_controller_class_init, /* class_init */ NULL, /* class_finalize */ NULL, /* class_data */ sizeof (GstController), 0, /* n_preallocs */ (GInstanceInitFunc) _gst_controller_init, /* instance_init */ NULL /* value_table */ }; _type = g_type_register_static (G_TYPE_OBJECT, "GstController", &info, 0); g_once_init_leave (&type, _type); } return type; } /* FIXME: backward compatibility functions */ /* * gst_controlled_property_set_interpolation_mode: * @self: the controlled property object to change * @mode: the new interpolation mode * * Sets the given Interpolation mode for the controlled property and activates * the respective interpolation hooks. * * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource * directly. * * Returns: %TRUE for success */ static gboolean gst_controlled_property_set_interpolation_mode (GstControlledProperty * self, GstInterpolateMode mode) { GstInterpolationControlSource *icsource; /* FIXME: backward compat, add GstInterpolationControlSource */ if (!self->csource) gst_controlled_property_add_interpolation_control_source (self); g_return_val_if_fail (GST_IS_INTERPOLATION_CONTROL_SOURCE (self->csource), FALSE); icsource = GST_INTERPOLATION_CONTROL_SOURCE (self->csource); return gst_interpolation_control_source_set_interpolation_mode (icsource, mode); } /** * gst_controller_set: * @self: the controller object which handles the properties * @property_name: the name of the property to set * @timestamp: the time the control-change is schedules for * @value: the control-value * * Set the value of given controller-handled property at a certain time. * * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource * directly. * * Returns: FALSE if the values couldn't be set (ex : properties not handled by controller), TRUE otherwise */ #ifndef GST_REMOVE_DEPRECATED #ifdef GST_DISABLE_DEPRECATED gboolean gst_controller_set (GstController * self, const gchar * property_name, GstClockTime timestamp, GValue * value); #endif gboolean gst_controller_set (GstController * self, const gchar * property_name, GstClockTime timestamp, GValue * value) { gboolean res = FALSE; GstControlledProperty *prop; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); g_return_val_if_fail (property_name, FALSE); g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, property_name))) { /* FIXME: backward compat, add GstInterpolationControlSource */ if (!prop->csource) gst_controlled_property_add_interpolation_control_source (prop); if (!GST_IS_INTERPOLATION_CONTROL_SOURCE (prop->csource)) goto out; res = gst_interpolation_control_source_set (GST_INTERPOLATION_CONTROL_SOURCE (prop->csource), timestamp, value); } out: g_mutex_unlock (self->lock); return res; } #endif /** * gst_controller_set_from_list: * @self: the controller object which handles the properties * @property_name: the name of the property to set * @timedvalues: a list with #GstTimedValue items * * Sets multiple timed values at once. * * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource * directly. * * Returns: %FALSE if the values couldn't be set (ex : properties not handled by controller), %TRUE otherwise */ #ifndef GST_REMOVE_DEPRECATED #ifdef GST_DISABLE_DEPRECATED gboolean gst_controller_set_from_list (GstController * self, const gchar * property_name, GSList * timedvalues); #endif gboolean gst_controller_set_from_list (GstController * self, const gchar * property_name, GSList * timedvalues) { gboolean res = FALSE; GstControlledProperty *prop; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); g_return_val_if_fail (property_name, FALSE); g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, property_name))) { /* FIXME: backward compat, add GstInterpolationControlSource */ if (!prop->csource) gst_controlled_property_add_interpolation_control_source (prop); if (!GST_IS_INTERPOLATION_CONTROL_SOURCE (prop->csource)) goto out; res = gst_interpolation_control_source_set_from_list (GST_INTERPOLATION_CONTROL_SOURCE (prop->csource), timedvalues); } out: g_mutex_unlock (self->lock); return res; } #endif /** * gst_controller_unset: * @self: the controller object which handles the properties * @property_name: the name of the property to unset * @timestamp: the time the control-change should be removed from * * Used to remove the value of given controller-handled property at a certain * time. * * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource * directly. * * Returns: %FALSE if the values couldn't be unset (ex : properties not handled by controller), %TRUE otherwise */ #ifndef GST_REMOVE_DEPRECATED #ifdef GST_DISABLE_DEPRECATED gboolean gst_controller_unset (GstController * self, const gchar * property_name, GstClockTime timestamp); #endif gboolean gst_controller_unset (GstController * self, const gchar * property_name, GstClockTime timestamp) { gboolean res = FALSE; GstControlledProperty *prop; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); g_return_val_if_fail (property_name, FALSE); g_return_val_if_fail (GST_CLOCK_TIME_IS_VALID (timestamp), FALSE); g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, property_name))) { if (!prop->csource || !GST_IS_INTERPOLATION_CONTROL_SOURCE (prop->csource)) goto out; res = gst_interpolation_control_source_unset (GST_INTERPOLATION_CONTROL_SOURCE (prop->csource), timestamp); } out: g_mutex_unlock (self->lock); return res; } #endif /** * gst_controller_unset_all: * @self: the controller object which handles the properties * @property_name: the name of the property to unset * * Used to remove all time-stamped values of given controller-handled property * * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource * directly. * * Returns: %FALSE if the values couldn't be unset (ex : properties not handled * by controller), %TRUE otherwise * Since: 0.10.5 */ #ifndef GST_REMOVE_DEPRECATED #ifdef GST_DISABLE_DEPRECATED gboolean gst_controller_unset_all (GstController * self, const gchar * property_name); #endif gboolean gst_controller_unset_all (GstController * self, const gchar * property_name) { GstControlledProperty *prop; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); g_return_val_if_fail (property_name, FALSE); g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, property_name))) { if (!prop->csource || !GST_IS_INTERPOLATION_CONTROL_SOURCE (prop->csource)) goto out; gst_interpolation_control_source_unset_all (GST_INTERPOLATION_CONTROL_SOURCE (prop->csource)); } out: g_mutex_unlock (self->lock); return TRUE; } #endif /** * gst_controller_get_all: * @self: the controller to get the list from * @property_name: the name of the property to get the list for * * Returns a read-only copy of the list of #GstTimedValue for the given property. * Free the list after done with it. * * <note><para>This doesn't modify the controlled GObject property!</para></note> * * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource * directly. * * Returns: a copy of the list, or %NULL if the property isn't handled by the controller */ #ifndef GST_REMOVE_DEPRECATED #ifdef GST_DISABLE_DEPRECATED const GList *gst_controller_get_all (GstController * self, const gchar * property_name); #endif const GList * gst_controller_get_all (GstController * self, const gchar * property_name) { const GList *res = NULL; GstControlledProperty *prop; g_return_val_if_fail (GST_IS_CONTROLLER (self), NULL); g_return_val_if_fail (property_name, NULL); g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, property_name))) { if (!prop->csource || !GST_IS_INTERPOLATION_CONTROL_SOURCE (prop->csource)) goto out; res = gst_interpolation_control_source_get_all (GST_INTERPOLATION_CONTROL_SOURCE (prop->csource)); } out: g_mutex_unlock (self->lock); return res; } #endif /** * gst_controller_set_interpolation_mode: * @self: the controller object * @property_name: the name of the property for which to change the interpolation * @mode: interpolation mode * * Sets the given interpolation mode on the given property. * * <note><para>User interpolation is not yet available and quadratic interpolation * is deprecated and maps to cubic interpolation.</para></note> * * Deprecated: Use #GstControlSource, for example #GstInterpolationControlSource * directly. * * Returns: %TRUE if the property is handled by the controller, %FALSE otherwise */ #ifndef GST_REMOVE_DEPRECATED #ifdef GST_DISABLE_DEPRECATED gboolean gst_controller_set_interpolation_mode (GstController * self, const gchar * property_name, GstInterpolateMode mode); #endif gboolean gst_controller_set_interpolation_mode (GstController * self, const gchar * property_name, GstInterpolateMode mode) { gboolean res = FALSE; GstControlledProperty *prop; g_return_val_if_fail (GST_IS_CONTROLLER (self), FALSE); g_return_val_if_fail (property_name, FALSE); g_mutex_lock (self->lock); if ((prop = gst_controller_find_controlled_property (self, property_name))) { res = gst_controlled_property_set_interpolation_mode (prop, mode); } g_mutex_unlock (self->lock); return res; } #endif
cpopescu/whispermedialib
third-party/gstreamer/gstreamer-0.10.29/libs/gst/controller/gstcontroller.c
C
lgpl-3.0
38,631
<?php /** * @author Amin Ghadersohi 7/1/2010 */ use CCR\DB\MySQLHelper; class PDODBMultiIngestor implements Ingestor { const MAX_QUERY_ATTEMPTS = 3; protected $_destination_db = null; protected $_source_db = null; protected $_source_query = null; protected $_insert_table = null; protected $_insert_fields = null; protected $_pre_ingest_update_statements; protected $_post_ingest_update_statements; protected $_delete_statement = null; protected $_count_statement = null; protected $_logger = null; protected $_trackchanges = false; /** * Helper instance for destination database. * * @var MySQLHelper */ protected $_dest_helper = null; function __construct( $dest_db, $source_db, $pre_ingest_update_statements = array(), $source_query, $insert_table, $insert_fields = array(), $post_ingest_update_statements = array(), $delete_statement = null, $count_statement = null ) { $this->_destination_db = $dest_db; $this->_source_db = $source_db; $this->_source_query = $source_query; $this->_insert_fields = $insert_fields; $this->_insert_table = $insert_table; $this->_pre_ingest_update_statements = $pre_ingest_update_statements; $this->_post_ingest_update_statements = $post_ingest_update_statements; $this->_delete_statement = $delete_statement; $this->_count_statement = $count_statement; $this->_logger = Log::singleton('null'); if ($this->_destination_db->_db_engine == 'mysql') { $this->_dest_helper = MySQLHelper::factory($this->_destination_db); } } public function enableChangeTracking() { $this->_trackchanges = true; } public function ingest() { $this->_logger->info( 'Started ingestion for class: ' . get_class($this) ); $time_start = microtime(true); $sourceRows = 0; $countRowsAffected = 0; foreach ($this->_pre_ingest_update_statements as $updateStatement) { try { $this->_logger->debug( "Pre ingest update statement: $updateStatement" ); $this->_source_db->handle()->prepare( $updateStatement )->execute(); } catch (PDOException $e) { $this->_logger->info(array( 'message' => $e->getMessage(), 'sql' => $updateStatement, 'stacktrace' => $e->getTraceAsString() )); } } // The count query must be before the source query for // unbuffered queries. if ($this->_count_statement != null) { $this->_logger->debug('Count query: ' . $this->_count_statement); $results = $this->_source_db->query($this->_count_statement); $rowsTotal = $results[0]['row_count']; } $this->_logger->debug('Source query: ' . $this->_source_query); $this->_logger->info(get_class($this) . ': Querying...'); $query_success = false; $n_attempts = 0; while ($query_success == false) { $n_attempts += 1; try { $srcStatement = $this->_source_db->handle()->prepare( $this->_source_query ); $srcStatement->execute(); $query_success = true; } catch (PDOException $e) { if ( !isset($srcStatement) || $srcStatement === false || $srcStatement->errorCode() != "40001" || $n_attempts > self::MAX_QUERY_ATTEMPTS ) { throw $e; } $this->_logger->info( get_class($this) . ': Query was cancelled by server with error ' . $srcStatement->errorCode() . '. Retrying ' . $n_attempts ); } } if ($this->_count_statement == null) { $rowsTotal = $srcStatement->rowCount(); } $this->_logger->debug("Row count: $rowsTotal"); $field_sep = chr(30); $line_sep = chr(29); $string_enc = chr(31); $this->_destination_db->handle()->prepare( 'SET FOREIGN_KEY_CHECKS = 0' )->execute(); if ($this->_delete_statement == null) { $this->_logger->debug("Truncating table {$this->_insert_table}"); $this->_destination_db->handle()->prepare( "TRUNCATE TABLE {$this->_insert_table}" )->execute(); } elseif ($this->_delete_statement !== 'nodelete') { $this->_logger->debug( 'Delete statement: ' . $this->_delete_statement ); $this->_destination_db->handle()->prepare( $this->_delete_statement )->execute(); } $infile_name = tempnam( sys_get_temp_dir(), sprintf( '%s.data.%s.', $this->_insert_table, $this->_destination_db->_db_port ) ); $f = fopen($infile_name, 'w'); if ($f === FALSE) { $this->_logger->debug("Failed to open '$infile_name'"); $infile_name = sys_get_temp_dir() . "/{$this->_insert_table}.data" . $this->_destination_db->_db_port . rand(); $f = fopen($infile_name, 'w'); if ($f === FALSE) { throw new Exception( get_class($this) . ': tmp file error: could not open file: ' . $infile_name ); } } $this->_logger->debug("Using temporary file '$infile_name'"); $exec_output = array(); while ( $srcRow = $srcStatement->fetch( PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT ) ) { $tmp_values = array(); foreach ($this->_insert_fields as $insert_field) { $tmp_values[$insert_field] = $insert_field == 'order_id' ? $sourceRows : ( !isset($srcRow[$insert_field]) ? '\N' : ( empty($srcRow[$insert_field]) ? $string_enc . '' . $string_enc : $srcRow[$insert_field] ) ); } fwrite($f, implode($field_sep, $tmp_values) . $line_sep); $sourceRows++; if ($sourceRows !== 0 && $sourceRows % 100000 == 0) { $message = sprintf( '%s: Rows Written to File: %d of %d', get_class($this), $sourceRows, $rowsTotal ); $this->_logger->info($message); } if ( $sourceRows !== 0 && $sourceRows % 250000 == 0 || $rowsTotal == $sourceRows ) { $load_statement = 'load data local infile \'' . $infile_name . '\' replace into table ' . $this->_insert_table . ' fields terminated by 0x1e optionally enclosed by 0x1f' . ' lines terminated by 0x1d (' . implode(',', $this->_insert_fields) . ')'; try { $output = array(); if ($this->_destination_db->_db_engine !== 'mysql') { throw new Exception( get_class($this) . ': Unsupported operation: currently only mysql' . 'is supported as destination db. ' . $this->_destination_db->_db_engine . ' was passed.' ); } $this->_dest_helper->executeStatement($load_statement); fclose($f); $f = fopen($infile_name, 'w'); } catch (Exception $e) { $this->_logger->err(array( 'message' => $e->getMessage(), 'stacktrace' => $e->getTraceAsString(), 'statement' => $load_statement, )); return; } } } fclose($f); unlink($infile_name); foreach ($this->_post_ingest_update_statements as $updateStatement) { try { $this->_logger->debug( "Post ingest update statement: $updateStatement" ); $this->_destination_db->handle()->prepare( $updateStatement )->execute(); } catch (PDOException $e) { $this->_logger->err(array( 'message' => $e->getMessage(), 'sql' => $updateStatement, 'stacktrace' => $e->getTraceAsString(), )); return; } } $this->_destination_db->handle()->prepare( "SET FOREIGN_KEY_CHECKS = 1" )->execute(); if ($rowsTotal > 0) { $this->_logger->debug('Analyzing table'); $this->_destination_db->handle()->prepare( "ANALYZE TABLE {$this->_insert_table}" )->execute(); } $time_end = microtime(true); $time = $time_end - $time_start; $message = sprintf( '%s: Rows Processed: %d of %d (Time Taken: %01.2f s)', get_class($this), $sourceRows, $rowsTotal, $time ); $this->_logger->info($message); // NOTE: This is needed for the log summary. $this->_logger->notice(array( 'message' => 'Finished ingestion', 'class' => get_class($this), 'start_time' => $time_start, 'end_time' => $time_end, 'records_examined' => $rowsTotal, 'records_loaded' => $sourceRows, )); } public function setLogger(Log $logger) { $this->_logger = $logger; if ($this->_dest_helper !== null) { $this->_dest_helper->setLogger($logger); } } public function getSchemaAndTableNames() { $tableinfo = explode(".", $this->_insert_table); if( 1 == count($tableinfo) ) { // Using unqualified table name return array("schema" => $this->_destination_db->_db_name, "tablename" => $this->_insert_table); } else { return array("schema" => $tableinfo[0], "tablename" => $tableinfo[1] ); } } public function checkForChanges() { $stmt = $this->_destination_db->handle()->prepare( "SELECT `COLUMN_NAME` FROM `information_schema`.`COLUMNS` WHERE (`TABLE_SCHEMA` = :schema) AND (`TABLE_NAME` = :tablename) AND (`COLUMN_KEY` = 'PRI')"); $stmt->execute( $this->getSchemaAndTableNames() ); $primarykeys = $stmt->fetchAll(); $constraints = array(); foreach($primarykeys as $keydata) { $constraints[] = sprintf(" b.%s = c.%s ", $keydata['COLUMN_NAME'], $keydata['COLUMN_NAME']); } if(0 == count($constraints)) { $this->_logger->info("no primary keys defined for {$this->_insert_table}. Change check not run."); return; } $primarykey = $primarykeys[0]['COLUMN_NAME']; $statement = "SELECT b.* FROM {$this->_insert_table}_backup b LEFT OUTER JOIN {$this->_insert_table} c ON (" . join("AND", $constraints) . ") WHERE c.{$primarykey} IS NULL"; $stmt = $this->_destination_db->handle()->prepare($statement); $stmt->execute(); $sadness = false; while($row = $stmt->fetch(PDO::FETCH_ASSOC) ) { $this->_logger->crit(array( 'message' => 'Missing row', 'rowdata' => print_r($row, true), 'class' => get_class($this) )); $sadness = true; } if(!$sadness) { $this->_logger->info("data consistency check passed for {$this->_insert_table}"); } } /** * Loads a pre- or post-ingest config file and generates SQL statements. * * This function can be used when an ingestor does not have any custom * pre- or post-ingest processing steps. If it does have custom operations, * then it is recommended that loadProcessingConfig and/or * addCommonProcessingStepToStatements be used directly. * * @param string $configFilePath The path to the config file. * @return array A list of SQL statements to execute. * @throws Exception The file could not be loaded * or is invalid. * @throws Exception The file contains a step that specifies * a custom or invalid operation. */ protected function getCommonProcessingStatements($configFilePath) { $processingSteps = $this->loadProcessingConfig($configFilePath); $processingStatements = array(); foreach ($processingSteps as $step) { $this->addCommonProcessingStepToStatements( $step, $processingStatements ); } return $processingStatements; } /** * Loads a config file for pre- or post-ingest processing of data. * * @param string $configFilePath The path to the config file. * @return array A list of processing steps to perform. * @throws Exception The file could not be loaded * or is invalid. */ protected function loadProcessingConfig($configFilePath) { if (! is_file($configFilePath)) { throw new Exception("'$configPath' is missing. If no processing is needed, use an empty array."); } $configFileContents = @file_get_contents($configFilePath); if ($configFileContents === false) { $error = error_get_last(); throw new Exception("Error opening file '$configFilePath': " . $error['message']); } $config = @json_decode($configFileContents); if ($config === null) { throw new Exception("Error decoding file '$configFilePath'."); } if (! is_array($config)) { throw new Exception("'$configFilePath' must be an array of processing steps."); } return $config; } /** * Adds the given step that uses a common operation to the given statements. * * This should be called after doing any custom processing of steps. If * the step's operation cannot be resolved, an exception will be thrown. * * @param stdClass $step The steps to examine. * @param array $statements The list of statements to append to. * @throws Exception The step's operation could not be handled. */ protected function addCommonProcessingStepToStatements( stdClass $step, array &$statements ) { $operation = $step->operation; if ($operation === 'execute_sql') { $statements[] = $step->sql; } else { throw new Exception("Unknown operation: $operation"); } } }
smgallo/xdmod
classes/DB/PDODBMultiIngestor.php
PHP
lgpl-3.0
16,026
""" Barcode Creation (PDF417) """ import os basedir = os.path.split(__file__)[0] bcdelib = os.path.join(basedir, 'psbcdelib.ps') class Barcode(object): __lib__ = open(bcdelib, 'r').read() @property def ps(self): raise NotImplementedError @property def eps(self): raise NotImplementedError
voipir/python-sii
src/sii/lib/printing/barcode/Barcode.py
Python
lgpl-3.0
331
/* * Commons Library * Copyright (c) 2015-2016 Sergey Grachev (sergey.grachev@yahoo.com). All rights reserved. * * This software 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. * * 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 Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this software. If not, see <http://www.gnu.org/licenses/>. */ package com.github.devmix.commons.javafx.api.mixins.javafx.scene.control; public interface TextInputControlMixin<D> extends com.github.devmix.commons.javafx.api.mixins.javafx.scene.control.ControlMixin<D> { D withFont(javafx.scene.text.Font arg0); D withEditable(boolean arg0); D withText(java.lang.String arg0); D withPromptText(java.lang.String arg0); D withTextFormatter(javafx.scene.control.TextFormatter<?> arg0); }
devmix/java-commons
commons-javafx/api/src/main/java/com/github/devmix/commons/javafx/api/mixins/javafx/scene/control/TextInputControlMixin.java
Java
lgpl-3.0
1,237
/* * This class was automatically generated with * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML * Schema. * $Id: VehicleModDescriptor.java,v 1.1.1.1 2010-05-04 22:06:01 ryan Exp $ */ package org.chocolate_milk.model.descriptors; //---------------------------------/ //- Imported classes and packages -/ //---------------------------------/ import org.chocolate_milk.model.VehicleMod; /** * Class VehicleModDescriptor. * * @version $Revision: 1.1.1.1 $ $Date: 2010-05-04 22:06:01 $ */ public class VehicleModDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { //--------------------------/ //- Class/Member Variables -/ //--------------------------/ /** * Field _elementDefinition. */ private boolean _elementDefinition; /** * Field _nsPrefix. */ private java.lang.String _nsPrefix; /** * Field _nsURI. */ private java.lang.String _nsURI; /** * Field _xmlName. */ private java.lang.String _xmlName; /** * Field _identity. */ private org.exolab.castor.xml.XMLFieldDescriptor _identity; //----------------/ //- Constructors -/ //----------------/ public VehicleModDescriptor() { super(); _xmlName = "VehicleMod"; _elementDefinition = true; //-- set grouping compositor setCompositorAsSequence(); org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; org.exolab.castor.mapping.FieldHandler handler = null; org.exolab.castor.xml.FieldValidator fieldValidator = null; //-- initialize attribute descriptors //-- initialize element descriptors //-- _listCoreMod desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.chocolate_milk.model.ListCoreMod.class, "_listCoreMod", "-error-if-this-is-used-", org.exolab.castor.xml.NodeType.Element); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { VehicleMod target = (VehicleMod) object; return target.getListCoreMod(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { VehicleMod target = (VehicleMod) object; target.setListCoreMod( (org.chocolate_milk.model.ListCoreMod) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return new org.chocolate_milk.model.ListCoreMod(); } }; desc.setSchemaType("org.chocolate_milk.model.ListCoreMod"); desc.setHandler(handler); desc.setContainer(true); desc.setClassDescriptor(new org.chocolate_milk.model.descriptors.ListCoreModDescriptor()); desc.setRequired(true); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: _listCoreMod fieldValidator = new org.exolab.castor.xml.FieldValidator(); fieldValidator.setMinOccurs(1); { //-- local scope } desc.setValidator(fieldValidator); //-- _name desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "Name", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { VehicleMod target = (VehicleMod) object; return target.getName(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { VehicleMod target = (VehicleMod) object; target.setName( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("string"); desc.setHandler(handler); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: _name fieldValidator = new org.exolab.castor.xml.FieldValidator(); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); typeValidator.setMaxLength(31); } desc.setValidator(fieldValidator); //-- _isActive desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_isActive", "IsActive", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { VehicleMod target = (VehicleMod) object; return target.getIsActive(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { VehicleMod target = (VehicleMod) object; target.setIsActive( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("string"); desc.setHandler(handler); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: _isActive fieldValidator = new org.exolab.castor.xml.FieldValidator(); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); } desc.setValidator(fieldValidator); //-- _desc desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_desc", "Desc", org.exolab.castor.xml.NodeType.Element); desc.setImmutable(true); handler = new org.exolab.castor.xml.XMLFieldHandler() { @Override public java.lang.Object getValue( java.lang.Object object ) throws IllegalStateException { VehicleMod target = (VehicleMod) object; return target.getDesc(); } @Override public void setValue( java.lang.Object object, java.lang.Object value) throws IllegalStateException, IllegalArgumentException { try { VehicleMod target = (VehicleMod) object; target.setDesc( (java.lang.String) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); } } @Override @SuppressWarnings("unused") public java.lang.Object newInstance(java.lang.Object parent) { return null; } }; desc.setSchemaType("string"); desc.setHandler(handler); desc.setMultivalued(false); addFieldDescriptor(desc); addSequenceElement(desc); //-- validation code for: _desc fieldValidator = new org.exolab.castor.xml.FieldValidator(); { //-- local scope org.exolab.castor.xml.validators.StringValidator typeValidator; typeValidator = new org.exolab.castor.xml.validators.StringValidator(); fieldValidator.setValidator(typeValidator); typeValidator.setWhiteSpace("preserve"); typeValidator.setMaxLength(256); } desc.setValidator(fieldValidator); } //-----------/ //- Methods -/ //-----------/ /** * Method getAccessMode. * * @return the access mode specified for this class. */ @Override() public org.exolab.castor.mapping.AccessMode getAccessMode( ) { return null; } /** * Method getIdentity. * * @return the identity field, null if this class has no * identity. */ @Override() public org.exolab.castor.mapping.FieldDescriptor getIdentity( ) { return _identity; } /** * Method getJavaClass. * * @return the Java class represented by this descriptor. */ @Override() public java.lang.Class getJavaClass( ) { return org.chocolate_milk.model.VehicleMod.class; } /** * Method getNameSpacePrefix. * * @return the namespace prefix to use when marshaling as XML. */ @Override() public java.lang.String getNameSpacePrefix( ) { return _nsPrefix; } /** * Method getNameSpaceURI. * * @return the namespace URI used when marshaling and * unmarshaling as XML. */ @Override() public java.lang.String getNameSpaceURI( ) { return _nsURI; } /** * Method getValidator. * * @return a specific validator for the class described by this * ClassDescriptor. */ @Override() public org.exolab.castor.xml.TypeValidator getValidator( ) { return this; } /** * Method getXMLName. * * @return the XML Name for the Class being described. */ @Override() public java.lang.String getXMLName( ) { return _xmlName; } /** * Method isElementDefinition. * * @return true if XML schema definition of this Class is that * of a global * element or element with anonymous type definition. */ public boolean isElementDefinition( ) { return _elementDefinition; } }
galleon1/chocolate-milk
src/org/chocolate_milk/model/descriptors/VehicleModDescriptor.java
Java
lgpl-3.0
11,343
/** * Copyright (c) 2011-2015, SpaceToad and the BuildCraft Team * http://www.mod-buildcraft.com * * BuildCraft is distributed under the terms of the Minecraft Mod Public * License 1.0, or MMPL. Please check the contents of the license located in * http://www.mod-buildcraft.com/MMPL-1.0.txt */ package buildcraft.core.lib.gui.tooltips; public class ToolTipLine { public String text; public final int color; public int spacing; public ToolTipLine(String text, int color) { this.text = text; this.color = color; } public ToolTipLine(String text) { this(text, -1); } public ToolTipLine() { this("", -1); } public void setSpacing(int spacing) { this.spacing = spacing; } public int getSpacing() { return spacing; } }
hea3ven/BuildCraft
common/buildcraft/core/lib/gui/tooltips/ToolTipLine.java
Java
lgpl-3.0
753
/* * Copyright (c) 2008 Poesys Associates. All rights reserved. * * This file is part of Poesys-DB. * * Poesys-DB 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. * * Poesys-DB 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 * Poesys-DB. If not, see <http://www.gnu.org/licenses/>. */ package com.poesys.db.dto; import com.poesys.db.pk.IPrimaryKey; /** * An interface for a cache of data transfer objects (DTOs); you can cache a * DTO, get a DTO from the cache using its primary key, remove a DTO from the * cache using its primary key, or clear the entire cache. * * @author Robert J. Muller * @param <T> the type of IDbDto to cache */ public interface IDtoCache<T extends IDbDto> { /** * Cache the object. * * @param object the object to cache */ void cache(T object); /** * Get a cached object using a primary key. If the object is not cached, the * method returns null. * * @param key the primary key for the object * @return the object or null if the object is not cached */ T get(IPrimaryKey key); /** * Remove a cached object using a primary key. If the object is not cached, * the method does nothing. If messaging is enabled, the method requests that * the object be removed from any remote caches. If distributed caching is * used, the method removes the cached object from the distributed cache. * * @param key the key that identifies the object to remove */ void remove(IPrimaryKey key); /** * Remove a cached object from the cache using a primary key. If the object is * not cached, the method does nothing. This method removes only a locally * cached object and does not request removal of the object from remote * caches. This method is for use in messaging-based caches, where receipt of * a subscribed topic results in local removal. * * @param key the key that identifies the object to remove */ void removeLocally(IPrimaryKey key); /** * Clear the cache, removing all cached objects of type T. This leaves the * cache itself but makes it empty. This method has no effect on a * distributed cache that has no iteration or query API, such as memcached. */ void clear(); }
Poesys-Associates/poesys-db
poesys-db/src/com/poesys/db/dto/IDtoCache.java
Java
lgpl-3.0
2,677
using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; using ZoneFiveSoftware.Common.Visuals.Fitness; using ZoneFiveSoftware.Common.Visuals; namespace RouteColourCode { class AddSettingsPage : IExtendSettingsPages { #region IExtendSettingsPages Members public IList<ISettingsPage> SettingsPages { get { List<ISettingsPage> pageList = new List<ISettingsPage>(); pageList.Add(new SettingsPage()); return pageList; } } #endregion } class SettingsPage: ISettingsPage { Control SettingsControl = null; #region ISettingsPage Members public Guid Id { get { return new Guid("E1DEED9E-939C-4DA3-B05B-506FFABD4819");} } public IList<ISettingsPage> SubPages { get { return null; } } #endregion #region IDialogPage Members public Control CreatePageControl() { SettingsControl = new SettingsPageControl(); return SettingsControl; } public bool HidePage() { return true; } public string PageName { get { return "RouteColourCode"; } } public void ShowPage(string bookmark) { SettingsControl.Show(); } public IPageStatus Status { get { return null; } } public void ThemeChanged(ITheme visualTheme) { // Themes not supported yet } public string Title { get { return "RouteColourCode"; } } public void UICultureChanged(System.Globalization.CultureInfo culture) { // Different cultures not supported } #endregion #region INotifyPropertyChanged Members public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; #endregion } }
staffann/route-colour-code
MapColourCode/SettingsPage.cs
C#
lgpl-3.0
2,181
package org.firelion.servlet; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpHost; import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.DefaultHttpRequestRetryHandler; import org.apache.http.impl.client.HttpClients; import org.apache.http.util.EntityUtils; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; /** * Created by chenglin on 15-10-6. * 处理google广告 aclk */ public class AclkServlet extends HttpServlet { public static String URI = "https://www.google.com.hk/search?newwindow=1&safe=strict&site=&source=hp&q="; @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { //URLencode不能处理 ‘+’和‘空格’ String url = req.getParameter("adurl"); //google搜索的起始页参数 String start = req.getParameter("start"); String ei = req.getParameter("ei"); //header String agent = req.getHeader("User-Agent"); String acceptLanguage = req.getHeader("Accept-Language"); boolean mobile = isMobile(agent); System.out.println("=============================="); System.out.println("请求参数url:" + url); System.out.println("请求参数agent:" + agent); System.out.println("请求参数isMobile:" + mobile); System.out.println("=============================="); resp.sendRedirect(url); } /** * 判断是否手机端请求 * @param agent * @return */ private boolean isMobile(String agent) { boolean isAndroid = agent.indexOf("Android") != -1 ; boolean isIPhone = agent.indexOf("iPhone") != -1 ; return isAndroid || isIPhone ; } @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { this.doPost(req,resp); } }
chenglin321/gsouke
src/main/java/org/firelion/servlet/AclkServlet.java
Java
lgpl-3.0
2,288
# AMF encoding/decoding library for Go The Adobe Integrated Runtime and Adobe Flash Player use AMF to communicate between an application and a remote server. AMF encodes remote procedure calls (RPC) into a compact binary representation that can be transferred over HTTP/HTTPS or the RTMP/RTMPS protocol. Objects and data values are serialized into this binary format, which increases performance, allowing applications to load data up to 10 times faster than with text-based formats such as XML or SOAP. ## AMF0 - [x] `int` / Number - [x] `float64` / Number - [x] `bool` / Boolean - [x] `string` / String - [x] `map[string]interface{}` / Object - [x] `nil` / Null - [x] `[]interface{}` / Array - [x] `time.Time` / Date ## AMF3 - [x] `int`, `uint` / Number - [x] `float64` / Number - [x] `bool` / Boolean - [x] `string` / String - [x] `nil` / Null - [x] `time.Time` / Date Work in progress
d3vil-st/amfconv
README.md
Markdown
lgpl-3.0
909
Virtuoso Console by Christopher Pugh ====================== This code is a single file header only library containint the backend for a Quake-style console. You can bind variables and functions from your C++ code with minimal application-side code, and use them at runtime. If nothing else, this code is a great workout for std::bind, std::function, and variadic templates. A graphical console widget using IMGUI is coming to this repo soon. Look at the test programs in the "demos" folder, read the library headers, and this file to understand usage. Creating a console ==================== It is as simple as declaring a variable of the GameConsole class. Virtuoso::QuakeStyleConsole console; Reading and Executing Commands: ================================= Simply call console.commandExecute(inputStream, outputStream) to read a line from the console's input stream and execute commands. This is what you would call in a graphical console when the user hits enter. Or you can just call it in a loop when you're using cin and cout in a terminal program for example. The input can be any istream including std::cin. And the output can be any ostream, including cout or a file Built in commands: =================== The following commands built in to every instance of the GameConsole class echo: prints the value of a variable help: With no arguments, prints a general help string on how to use the console. With an argument string naming a variable or a command, prints the help string for that variable or command. listCVars : list all variables bound to the console, including dynamically created ones listCmd : lists all commands bound to the console. listHelp : lists all the commands and CVars that have an available help string for the "help" command. runFile: runs commands in a text file named by the argument. Example: runFile "Game.ini" set: assigns a value to a variable. Uses istream operator >> to parse. var: declare a variable dynamically. CVars: ======== Variables can be bound from your program to the console as a console variable. They can then be printed, set, or dereferenced in console commands. You can bind any arbitrary variable in your C++ code to the console, allowing it to be printed, set, or dereferenced in console commands. The only requirement is that the datatype of the variable in C++ code has the >> and << operators overloaded for iostreams. For instance, in your code if you have the variable int health; You can call: console.bindCVar("health", health, "player life"); The first argument is the name of the variable in the console. The second argument is the reference to the actual variable in your C++ code. The third string is optional, and is the help string associated with the variable. If the user were to type "help health" into the console, the help string would be printed to the console's output stream. Variable names should not contain whitespace, since whitespace is a delimiter during parsing. Dynamic Variables ================== You can also create variables using the console directly, rather than binding variables from your C++ code. Dynamic variables are all implicitly of type string. They can be echo'ed, set, and dereferenced like any other variable. Example: var x hello world This creates a variable called 'x'. After the whitespace delimiter, the rest of the input line is assigned as the value of the variable. Thus, "echo x" will print "hello world" Using Variables ================= --Variables can be dereferenced into a command by prefixing the variable name with $. For instance: var temp 10 set health $temp --Variables can be printed with the echo command. echo health >10 --Variables can be set with the set command set health 200 echo health >200 Commands: ========= You can add arbitrary C++ functions to your code by giving the console a function pointer or std::function object. You can add member functions too. The console automatically parses any argument list of any datatype that can be read from an istream, so you never have to write a parser. The functions should return void, but they may take any argument type. The requirement is that the variable types used as arguments have the >> operator overloaded for istream input. They must also all have a default constructor. Code will be automatically generated that parses all the arguments to the function from the input stream and pass them in for you. You use the bindCommand method on the console like the following example: //function we want to bind as a console command void printSum(const int& a, const int& b){ std::cout<<a+b<<std::endl; } //.... console.bindCommand("sum", printSum); An optional third argument gives the help string for the command. Once the command is bound to the console, you simply type the name of the command followed by any arguments. For instance, sum 1 1 prints 2 when it is called from the demo program. If you want to bind a member function as a console command, you need to call console.bindMemberCommand() and pass the caller as an argument. For example : class Adder { std::string str; public: Adder(const std::string& pr):str(pr){} void add(int a, int b, int c, int d, int e) { std::clog << str << a+b+c+d+e << std::endl; } }; ... console.bindMemberCommand("sumFiveValues", a, &Adder::add, "Given five integers as input, sum them all. This demonstrates bindMemberCommand() using an object"); History File: =============== The console has a cache of previously used console commands. There is also support for saving and loading this command buffer, so that multiple runs of the program have access to recently used commands. At the beginning of your program you would call: console.loadHistoryFile("COMMAND_HISTORY.txt"); At the end of your program you would call: console.saveHistoryFile("COMMAND_HISTORY.txt"); You can also give these functions iostream references instead of strings containing file names. Comments =========== The '#' character at the beginning of a line causes the line to be regarded as a comment and ignored for execution. This is useful for ini files and the like. Misc ====== You can call the setHelpTopic method on a console instance to change the help string for a command or cVar at any time, even if you don't specify one at creation time. For instance, console.setHelpTopic("health", "the player's health");
VirtuosoChris/VirtuosoConsole
README.md
Markdown
lgpl-3.0
6,563
#ifndef OBSERVER_H #define OBSERVER_H /* * Copyright (c) 2016 CERN * @author Michele Castellana <michele.castellana@cern.ch> * * This source code 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 source 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 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 "vpi_user.h" class vvp_net_t; class Observer { public: virtual void update( vvp_net_t* ) = 0; protected: Observer() {}; }; #endif /* OBSERVER_H */
CastMi/mhdlsim
observer.h
C
lgpl-3.0
965
/******************************************************************************* * Copyright (C) 2014 Stefan Schroeder * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. ******************************************************************************/ package com.graphhopper.jsprit.core.problem.solution.route.activity; import com.graphhopper.jsprit.core.problem.AbstractActivity; import com.graphhopper.jsprit.core.problem.Capacity; import com.graphhopper.jsprit.core.problem.Location; public final class End extends AbstractActivity implements TourActivity { public static End newInstance(String locationId, double earliestArrival, double latestArrival) { return new End(locationId, earliestArrival, latestArrival); } public static End copyOf(End end) { return new End(end); } private final static Capacity capacity = Capacity.Builder.newInstance().build(); private double endTime = -1; private double theoretical_earliestOperationStartTime; private double theoretical_latestOperationStartTime; private double arrTime; private Location location; public void setTheoreticalEarliestOperationStartTime(double theoreticalEarliestOperationStartTime) { theoretical_earliestOperationStartTime = theoreticalEarliestOperationStartTime; } public void setTheoreticalLatestOperationStartTime(double theoreticalLatestOperationStartTime) { theoretical_latestOperationStartTime = theoreticalLatestOperationStartTime; } public End(Location location, double theoreticalStart, double theoreticalEnd) { super(); this.location = location; theoretical_earliestOperationStartTime = theoreticalStart; theoretical_latestOperationStartTime = theoreticalEnd; endTime = theoreticalEnd; setIndex(-2); } public End(String locationId, double theoreticalStart, double theoreticalEnd) { super(); if (locationId != null) this.location = Location.Builder.newInstance().setId(locationId).build(); theoretical_earliestOperationStartTime = theoreticalStart; theoretical_latestOperationStartTime = theoreticalEnd; endTime = theoreticalEnd; setIndex(-2); } public End(End end) { this.location = end.getLocation(); // this.locationId = end.getLocation().getId(); theoretical_earliestOperationStartTime = end.getTheoreticalEarliestOperationStartTime(); theoretical_latestOperationStartTime = end.getTheoreticalLatestOperationStartTime(); arrTime = end.getArrTime(); endTime = end.getEndTime(); setIndex(-2); } public double getTheoreticalEarliestOperationStartTime() { return theoretical_earliestOperationStartTime; } public double getTheoreticalLatestOperationStartTime() { return theoretical_latestOperationStartTime; } public double getEndTime() { return endTime; } public void setEndTime(double endTime) { this.endTime = endTime; } public void setLocation(Location location) { this.location = location; } @Override public Location getLocation() { return location; } @Override public double getOperationTime() { return 0.0; } @Override public String toString() { return "[type=" + getName() + "][location=" + location + "][twStart=" + Activities.round(theoretical_earliestOperationStartTime) + "][twEnd=" + Activities.round(theoretical_latestOperationStartTime) + "]"; } @Override public String getName() { return "end"; } @Override public double getArrTime() { return this.arrTime; } @Override public void setArrTime(double arrTime) { this.arrTime = arrTime; } @Override public TourActivity duplicate() { return new End(this); } @Override public Capacity getSize() { return capacity; } }
harshpoddar21/route_suggest_algo
jsprit-core/src/main/java/com/graphhopper/jsprit/core/problem/solution/route/activity/End.java
Java
lgpl-3.0
4,630
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Input; using System.IO; using MahApps.Metro.Controls; using MahApps.Metro.Controls.Dialogs; namespace WpfMinecraftCommandHelper2 { /// <summary> /// Favourite.xaml 的交互逻辑 /// </summary> public partial class Favourite : MetroWindow { public Favourite() { InitializeComponent(); appLanguage(); readCommand(); applyCommand(); } private string FloatHelpTitle = "帮助"; private string FloatConfirm = "确认"; private string FloatCancel = "取消"; private string FavouriteIndexError = "要修改的下标错误。"; private string FavouriteTip1 = "请输入该指令的说明文本 回车储存"; private string FavouriteTip2 = "请输入要保存的指令 回车储存"; private string FavouriteHelpStr = "编辑项目前请先选中一条(如没有请右键新建),然后右键修改,即可在文本框内编辑要填写的内容,回车键保存。\r\n如果软件更新后请保留文件夹下的Favourite.txt文件!\r\n\r\n快捷键说明:双击收藏夹条目可快捷编辑。收藏夹内对单条单击左右箭头可快速移动上下。"; private string FloatErrorTitle = "错误"; private string FloatHelpFileCantFind = ""; private void appLanguage() { SetLang setlang = new SetLang(); List<string> templang = setlang.SetFavourite(); try { FloatHelpTitle = templang[0]; FloatConfirm = templang[1]; FloatCancel = templang[2]; FavouriteIndexError = templang[3]; this.Title = templang[4]; FavouriteTip1 = templang[5]; FavouriteTip2 = templang[6]; FavouriteHelpStr = templang[7]; FloatErrorTitle = templang[8]; FloatHelpFileCantFind = templang[9]; } catch (Exception) { /* throw; */ } } //要修改的下标 private int revampIndex = -1; private void InfoBox_MouseEnter(object sender, MouseEventArgs e) { InfoBox.SelectAll(); } private void InfoBox_PreviewKeyUp(object sender, KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Enter) { if (revampIndex != -1) { namedListStr[revampIndex] = InfoBox.Text; applyCommand(); } else { this.ShowMessageAsync("", FavouriteIndexError, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel }); } } } private void InputBox_MouseEnter(object sender, MouseEventArgs e) { InputBox.SelectAll(); } private void InputBox_PreviewKeyUp(object sender, KeyEventArgs e) { if (e.Key == System.Windows.Input.Key.Enter) { if (revampIndex != -1) { commandListStr[revampIndex] = InputBox.Text; applyCommand(); } else { this.ShowMessageAsync("", FavouriteIndexError, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel }); } } } private void BNew_Click(object sender, RoutedEventArgs e) { newt(); } private void newt() { InfoBox.Text = FavouriteTip1; InputBox.Text = FavouriteTip2; bool iftrue = false; int tempindex = CommandList.SelectedIndex; if (CommandList.SelectedIndex == CommandList.Items.Count - 1) { iftrue = true; } namedListStr.Add(""); commandListStr.Add(""); applyCommand(); if (iftrue) { CommandList.SelectedIndex = tempindex + 1; } else { CommandList.SelectedIndex = tempindex; } } private void BCopy_Click(object sender, RoutedEventArgs e) { if (CommandList.SelectedIndex != -1) { Clipboard.SetData(DataFormats.UnicodeText, commandListStr[CommandList.SelectedIndex]); } else { this.ShowMessageAsync("", FavouriteIndexError, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel }); } } private void BRevamp_Click(object sender, RoutedEventArgs e) { revamp(); } private void revamp() { if (CommandList.SelectedIndex != -1) { revampIndex = CommandList.SelectedIndex; InfoBox.Text = namedListStr[revampIndex]; InputBox.Text = commandListStr[revampIndex]; } else { this.ShowMessageAsync("", FavouriteIndexError, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel }); } } private void BDelete_Click(object sender, RoutedEventArgs e) { if (CommandList.SelectedIndex != -1) { commandListStr.RemoveAt(CommandList.SelectedIndex); applyCommand(); } else { this.ShowMessageAsync("", FavouriteIndexError, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel }); } } private void BUp_Click(object sender, RoutedEventArgs e) { up(); } private void up() { if (CommandList.SelectedIndex != -1) { int index = CommandList.SelectedIndex; if (index != 0) { string temp = commandListStr[index]; string temp2 = namedListStr[index]; commandListStr[index] = commandListStr[index - 1]; commandListStr[index - 1] = temp; namedListStr[index] = namedListStr[index - 1]; namedListStr[index - 1] = temp2; applyCommand(); CommandList.SelectedIndex = index - 1; } } else { this.ShowMessageAsync("", FavouriteIndexError, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel }); } } private void BDown_Click(object sender, RoutedEventArgs e) { down(); } private void down() { if (CommandList.SelectedIndex != -1) { int index = CommandList.SelectedIndex; if (index != CommandList.Items.Count - 1) { string temp = commandListStr[index]; string temp2 = namedListStr[index]; commandListStr[index] = commandListStr[index + 1]; commandListStr[index + 1] = temp; namedListStr[index] = namedListStr[index + 1]; namedListStr[index + 1] = temp2; applyCommand(); CommandList.SelectedIndex = index + 1; } } else { this.ShowMessageAsync("", FavouriteIndexError, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel }); } } private static List<string> namedListStr = new List<string>(); private static List<string> commandListStr = new List<string>(); private void readCommand() { if (File.Exists(Directory.GetCurrentDirectory() + @"\Favourite.txt")) { commandListStr.Clear(); try { using (StreamReader sr = new StreamReader(Directory.GetCurrentDirectory() + @"\Favourite.txt", Encoding.UTF8)) { int lineCount = 0; while (sr.Peek() > 0) { lineCount++; string temp = sr.ReadLine(); if (lineCount == 0) { namedListStr.Add(temp); } else { if (lineCount % 2 == 0) { namedListStr.Add(temp); } else { commandListStr.Add(temp); } } } } } catch (Exception) { } } } private void saveCommand() { try { using (FileStream fs = new FileStream(Directory.GetCurrentDirectory() + @"\Favourite.txt", FileMode.Create)) { using (StreamWriter sw = new StreamWriter(fs, Encoding.UTF8)) { for (int i = 0; i < namedListStr.Count() + commandListStr.Count(); i++) { sw.WriteLine(namedListStr[i]); sw.WriteLine(commandListStr[i]); } } } } catch (Exception) { } } private void applyCommand() { CommandList.Items.Clear(); for (int i = 0; i < commandListStr.Count(); i++) { CommandList.Items.Add(namedListStr[i] + " - " + commandListStr[i]); } } private void MetroWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e) { saveCommand(); } private void helpBtn_Click(object sender, RoutedEventArgs e) { this.ShowMessageAsync(FloatHelpTitle, FavouriteHelpStr, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel }); } private void CommandList_MouseDoubleClick(object sender, MouseButtonEventArgs e) { revampIndex = CommandList.SelectedIndex; revamp(); } private void CommandList_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Left) { e.Handled = true; up(); } else if (e.Key == Key.Right) { e.Handled = true; down(); } } private void MetroWindow_PreviewKeyDown(object sender, KeyEventArgs e) { string path = Directory.GetCurrentDirectory() + @"\docs\Favourite.html"; if (e.Key == Key.F1) { if (File.Exists(path)) { System.Diagnostics.Process.Start(path); } else { this.ShowMessageAsync(FloatErrorTitle, FloatHelpFileCantFind, MessageDialogStyle.Affirmative, new MetroDialogSettings() { AffirmativeButtonText = FloatConfirm, NegativeButtonText = FloatCancel }); } } } //public void NewItems(string command) //{ // newt(); // revampIndex = CommandList.Items.Count - 1; // revamp(); // InputBox.Text = command; // //commandListStr[commandListStr.Count() - 1] = command; // //namedListStr[namedListStr.Count() - 1] = ""; // //applyCommand(); //} } }
IceLitty/Minecraft-Command-Helper
WpfMinecraftCommandHelper2/Favourite.xaml.cs
C#
lgpl-3.0
12,678
<!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.5.0_07) on Thu Apr 19 16:45:17 CEST 2007 --> <TITLE> InvalidSignatureValueException </TITLE> <META NAME="keywords" CONTENT="org.apache.xml.security.signature.InvalidSignatureValueException class"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { parent.document.title="InvalidSignatureValueException"; } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <!-- ========= 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>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/InvalidSignatureValueException.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../org/apache/xml/security/signature/InvalidDigestValueException.html" title="class in org.apache.xml.security.signature"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../org/apache/xml/security/signature/Manifest.html" title="class in org.apache.xml.security.signature"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/xml/security/signature/InvalidSignatureValueException.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="InvalidSignatureValueException.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<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> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_org.apache.xml.security.exceptions.XMLSecurityException">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.apache.xml.security.signature</FONT> <BR> Class InvalidSignatureValueException</H2> <PRE> java.lang.Object <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by ">java.lang.Throwable <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by ">java.lang.Exception <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/xml/security/exceptions/XMLSecurityException.html" title="class in org.apache.xml.security.exceptions">org.apache.xml.security.exceptions.XMLSecurityException</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/xml/security/signature/XMLSignatureException.html" title="class in org.apache.xml.security.signature">org.apache.xml.security.signature.XMLSignatureException</A> <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.xml.security.signature.InvalidSignatureValueException</B> </PRE> <DL> <DT><B>All Implemented Interfaces:</B> <DD>java.io.Serializable</DD> </DL> <HR> <DL> <DT><PRE>public class <B>InvalidSignatureValueException</B><DT>extends <A HREF="../../../../../org/apache/xml/security/signature/XMLSignatureException.html" title="class in org.apache.xml.security.signature">XMLSignatureException</A></DL> </PRE> <P> Raised if testing the signature value over <i>DigestValue</i> fails because of invalid signature. <P> <P> <DL> <DT><B>Author:</B></DT> <DD>Christian Geuer-Pollmann</DD> <DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/xml/security/signature/InvalidDigestValueException.html" title="class in org.apache.xml.security.signature"><CODE>MissingKeyFailureException MissingResourceFailureException</CODE></A>, <A HREF="../../../../../serialized-form.html#org.apache.xml.security.signature.InvalidSignatureValueException">Serialized Form</A></DL> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/xml/security/signature/InvalidSignatureValueException.html#InvalidSignatureValueException()">InvalidSignatureValueException</A></B>()</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor InvalidSignatureValueException</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/xml/security/signature/InvalidSignatureValueException.html#InvalidSignatureValueException(java.lang.String)">InvalidSignatureValueException</A></B>(java.lang.String&nbsp;_msgID)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor InvalidSignatureValueException</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/xml/security/signature/InvalidSignatureValueException.html#InvalidSignatureValueException(java.lang.String, java.lang.Exception)">InvalidSignatureValueException</A></B>(java.lang.String&nbsp;_msgID, java.lang.Exception&nbsp;_originalException)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor InvalidSignatureValueException</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/xml/security/signature/InvalidSignatureValueException.html#InvalidSignatureValueException(java.lang.String, java.lang.Object[])">InvalidSignatureValueException</A></B>(java.lang.String&nbsp;_msgID, java.lang.Object[]&nbsp;exArgs)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor InvalidSignatureValueException</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../org/apache/xml/security/signature/InvalidSignatureValueException.html#InvalidSignatureValueException(java.lang.String, java.lang.Object[], java.lang.Exception)">InvalidSignatureValueException</A></B>(java.lang.String&nbsp;_msgID, java.lang.Object[]&nbsp;exArgs, java.lang.Exception&nbsp;_originalException)</CODE> <BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructor InvalidSignatureValueException</TD> </TR> </TABLE> &nbsp; <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_org.apache.xml.security.exceptions.XMLSecurityException"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class org.apache.xml.security.exceptions.<A HREF="../../../../../org/apache/xml/security/exceptions/XMLSecurityException.html" title="class in org.apache.xml.security.exceptions">XMLSecurityException</A></B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><A HREF="../../../../../org/apache/xml/security/exceptions/XMLSecurityException.html#getMsgID()">getMsgID</A>, <A HREF="../../../../../org/apache/xml/security/exceptions/XMLSecurityException.html#getOriginalException()">getOriginalException</A>, <A HREF="../../../../../org/apache/xml/security/exceptions/XMLSecurityException.html#printStackTrace()">printStackTrace</A>, <A HREF="../../../../../org/apache/xml/security/exceptions/XMLSecurityException.html#printStackTrace(java.io.PrintStream)">printStackTrace</A>, <A HREF="../../../../../org/apache/xml/security/exceptions/XMLSecurityException.html#printStackTrace(java.io.PrintWriter)">printStackTrace</A>, <A HREF="../../../../../org/apache/xml/security/exceptions/XMLSecurityException.html#toString()">toString</A></CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Throwable"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Throwable</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, setStackTrace</CODE></TD> </TR> </TABLE> &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>equals, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> &nbsp; <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="InvalidSignatureValueException()"><!-- --></A><H3> InvalidSignatureValueException</H3> <PRE> public <B>InvalidSignatureValueException</B>()</PRE> <DL> <DD>Constructor InvalidSignatureValueException <P> </DL> <HR> <A NAME="InvalidSignatureValueException(java.lang.String)"><!-- --></A><H3> InvalidSignatureValueException</H3> <PRE> public <B>InvalidSignatureValueException</B>(java.lang.String&nbsp;_msgID)</PRE> <DL> <DD>Constructor InvalidSignatureValueException <P> <DL> <DT><B>Parameters:</B><DD><CODE>_msgID</CODE> - </DL> </DL> <HR> <A NAME="InvalidSignatureValueException(java.lang.String, java.lang.Object[])"><!-- --></A><H3> InvalidSignatureValueException</H3> <PRE> public <B>InvalidSignatureValueException</B>(java.lang.String&nbsp;_msgID, java.lang.Object[]&nbsp;exArgs)</PRE> <DL> <DD>Constructor InvalidSignatureValueException <P> <DL> <DT><B>Parameters:</B><DD><CODE>_msgID</CODE> - <DD><CODE>exArgs</CODE> - </DL> </DL> <HR> <A NAME="InvalidSignatureValueException(java.lang.String, java.lang.Exception)"><!-- --></A><H3> InvalidSignatureValueException</H3> <PRE> public <B>InvalidSignatureValueException</B>(java.lang.String&nbsp;_msgID, java.lang.Exception&nbsp;_originalException)</PRE> <DL> <DD>Constructor InvalidSignatureValueException <P> <DL> <DT><B>Parameters:</B><DD><CODE>_msgID</CODE> - <DD><CODE>_originalException</CODE> - </DL> </DL> <HR> <A NAME="InvalidSignatureValueException(java.lang.String, java.lang.Object[], java.lang.Exception)"><!-- --></A><H3> InvalidSignatureValueException</H3> <PRE> public <B>InvalidSignatureValueException</B>(java.lang.String&nbsp;_msgID, java.lang.Object[]&nbsp;exArgs, java.lang.Exception&nbsp;_originalException)</PRE> <DL> <DD>Constructor InvalidSignatureValueException <P> <DL> <DT><B>Parameters:</B><DD><CODE>_msgID</CODE> - <DD><CODE>exArgs</CODE> - <DD><CODE>_originalException</CODE> - </DL> </DL> <!-- ========= END OF CLASS DATA ========= --> <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>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/InvalidSignatureValueException.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;<A HREF="../../../../../org/apache/xml/security/signature/InvalidDigestValueException.html" title="class in org.apache.xml.security.signature"><B>PREV CLASS</B></A>&nbsp; &nbsp;<A HREF="../../../../../org/apache/xml/security/signature/Manifest.html" title="class in org.apache.xml.security.signature"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/xml/security/signature/InvalidSignatureValueException.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="InvalidSignatureValueException.html" target="_top"><B>NO FRAMES</B></A> &nbsp; &nbsp;<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> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#methods_inherited_from_class_org.apache.xml.security.exceptions.XMLSecurityException">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;METHOD</FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
test2v/DanDelXAdES
proj/javadoc/org/apache/xml/security/signature/InvalidSignatureValueException.html
HTML
lgpl-3.0
17,070
package hamaster.gradesign.keydist.controller; import static java.util.Objects.requireNonNull; import java.util.HashMap; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import hamaster.gradesign.keydist.client.Encoder; import hamaster.gradesign.keydist.mail.IBEMailParameterGenerator; @RestController public class ActivationController { private IBEMailParameterGenerator mailParameterGenerator; private Encoder base64; @Autowired public ActivationController(IBEMailParameterGenerator mailParameterGenerator, @Qualifier("base64Encoder") Encoder base64) { this.mailParameterGenerator = requireNonNull(mailParameterGenerator); this.base64 = requireNonNull(base64); } @GetMapping("/api/active") public Map<String, String> doActivate(@RequestParam(value = IBEMailParameterGenerator.CONTENT_KEY, required = true) String ct, @RequestParam(value = IBEMailParameterGenerator.SIGNATURE_KEY, required = true) String sg) { Map<String, String> result = new HashMap<String, String>(); ct = ct.replace('*', '+'); ct = ct.replace('-', '/'); sg = sg.replace('*', '+'); sg = sg.replace('-', '/'); byte[] cont = base64.decode(ct); byte[] sign = base64.decode(sg); int ve = mailParameterGenerator.verify(cont, sign); result.put("RESULT", Integer.toString(ve)); switch (ve) { case 0: result.put("MESSAGE", "Successfully activated."); //out.print("激活成功"); break; case 1: result.put("MESSAGE", "Error occurred when trying to activate."); //out.print("激活错误"); break; case 2: result.put("MESSAGE", "Activation token expired."); //out.print("未能在一周内激活"); break; case 3: result.put("MESSAGE", "Already activated."); //out.print("已经激活"); break; default: result.put("MESSAGE", "Unknown error."); //out.print("未知错误"); } return result; } }
wangyeee/IBE-Secure-Message
server/key-dist-server/src/main/java/hamaster/gradesign/keydist/controller/ActivationController.java
Java
lgpl-3.0
2,413
<!DOCTYPE html> <!-- Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.3.5 Version: 4.5.2 Author: KeenThemes Website: http://www.keenthemes.com/ Contact: support@keenthemes.com Follow: www.twitter.com/keenthemes Like: www.facebook.com/keenthemes Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project. --> <!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]--> <!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]--> <!--[if !IE]><!--> <html lang="en"> <!--<![endif]--> <!-- BEGIN HEAD --> <head> <meta charset="utf-8" /> <title>Metronic | User Login 2</title> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=device-width, initial-scale=1" name="viewport" /> <meta content="" name="description" /> <meta content="" name="author" /> <!-- BEGIN GLOBAL MANDATORY STYLES --> <!-- 将谷歌字体转换为本地文件 --> <!-- <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&subset=all" rel="stylesheet" type="text/css" /> --> <link href="../assets/layouts/layout/css/custom.min.css" rel="stylesheet" type="text/css" /> <link href="../assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" /> <link href="../assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" /> <link href="../assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" /> <link href="../assets/global/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css" /> <link href="../assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" /> <!-- END GLOBAL MANDATORY STYLES --> <!-- BEGIN PAGE LEVEL PLUGINS --> <link href="../assets/global/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" /> <link href="../assets/global/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" /> <!-- END PAGE LEVEL PLUGINS --> <!-- BEGIN THEME GLOBAL STYLES --> <link href="../assets/global/css/components.min.css" rel="stylesheet" id="style_components" type="text/css" /> <link href="../assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" /> <!-- END THEME GLOBAL STYLES --> <!-- BEGIN PAGE LEVEL STYLES --> <link href="../assets/pages/css/login-2.min.css" rel="stylesheet" type="text/css" /> <!-- END PAGE LEVEL STYLES --> <!-- BEGIN THEME LAYOUT STYLES --> <!-- END THEME LAYOUT STYLES --> <link rel="shortcut icon" href="favicon.ico" /> </head> <!-- END HEAD --> <body class=" login"> <!-- BEGIN LOGO --> <div class="logo"> <a href="index.html"> <img src="../assets/pages/img/logo-big-white.png" style="height: 17px;" alt="" /> </a> </div> <!-- END LOGO --> <!-- BEGIN LOGIN --> <div class="content"> <!-- BEGIN LOGIN FORM --> <form class="login-form" action="index.html" method="get"> <div class="form-title"> <span class="form-title">Welcome.</span> <span class="form-subtitle">Please login.</span> </div> <div class="alert alert-danger display-hide"> <button class="close" data-close="alert"></button> <span> Enter any username and password. </span> </div> <div class="form-group"> <!--ie8, ie9 does not support html5 placeholder, so we just show field title for that--> <label class="control-label visible-ie8 visible-ie9">Username</label> <input class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off" placeholder="Username" name="username" /> </div> <div class="form-group"> <label class="control-label visible-ie8 visible-ie9">Password</label> <input class="form-control form-control-solid placeholder-no-fix" type="password" autocomplete="off" placeholder="Password" name="password" /> </div> <div class="form-actions"> <button type="submit" class="btn red btn-block uppercase">Login</button> </div> <div class="form-actions"> <div class="pull-left"> <label class="rememberme check"> <input type="checkbox" name="remember" value="1" />Remember me </label> </div> <div class="pull-right forget-password-block"> <a href="javascript:;" id="forget-password" class="forget-password">Forgot Password?</a> </div> </div> <div class="login-options"> <h4 class="pull-left">Or login with</h4> <ul class="social-icons pull-right"> <li> <a class="social-icon-color facebook" data-original-title="facebook" href="javascript:;"></a> </li> <li> <a class="social-icon-color twitter" data-original-title="Twitter" href="javascript:;"></a> </li> <li> <a class="social-icon-color googleplus" data-original-title="Goole Plus" href="javascript:;"></a> </li> <li> <a class="social-icon-color linkedin" data-original-title="Linkedin" href="javascript:;"></a> </li> </ul> </div> <div class="create-account"> <p> <a href="javascript:;" class="btn-primary btn" id="register-btn">Create an account</a> </p> </div> </form> <!-- END LOGIN FORM --> <!-- BEGIN FORGOT PASSWORD FORM --> <form class="forget-form" action="index.html" method="post"> <div class="form-title"> <span class="form-title">Forget Password ?</span> <span class="form-subtitle">Enter your e-mail to reset it.</span> </div> <div class="form-group"> <input class="form-control placeholder-no-fix" type="text" autocomplete="off" placeholder="Email" name="email" /> </div> <div class="form-actions"> <button type="button" id="back-btn" class="btn btn-default">Back</button> <button type="submit" class="btn btn-primary uppercase pull-right">Submit</button> </div> </form> <!-- END FORGOT PASSWORD FORM --> <!-- BEGIN REGISTRATION FORM --> <form class="register-form" action="index.html" method="post"> <div class="form-title"> <span class="form-title">Sign Up</span> </div> <p class="hint"> Enter your personal details below: </p> <div class="form-group"> <label class="control-label visible-ie8 visible-ie9">Full Name</label> <input class="form-control placeholder-no-fix" type="text" placeholder="Full Name" name="fullname" /> </div> <div class="form-group"> <!--ie8, ie9 does not support html5 placeholder, so we just show field title for that--> <label class="control-label visible-ie8 visible-ie9">Email</label> <input class="form-control placeholder-no-fix" type="text" placeholder="Email" name="email" /> </div> <div class="form-group"> <label class="control-label visible-ie8 visible-ie9">Address</label> <input class="form-control placeholder-no-fix" type="text" placeholder="Address" name="address" /> </div> <div class="form-group"> <label class="control-label visible-ie8 visible-ie9">City/Town</label> <input class="form-control placeholder-no-fix" type="text" placeholder="City/Town" name="city" /> </div> <div class="form-group"> <label class="control-label visible-ie8 visible-ie9">Country</label> <select name="country" class="form-control"> <option value="">Country</option> <option value="AF">Afghanistan</option> <option value="AL">Albania</option> <option value="DZ">Algeria</option> <option value="AS">American Samoa</option> <option value="AD">Andorra</option> <option value="AO">Angola</option> <option value="AI">Anguilla</option> <option value="AR">Argentina</option> <option value="AM">Armenia</option> <option value="AW">Aruba</option> <option value="AU">Australia</option> <option value="AT">Austria</option> <option value="AZ">Azerbaijan</option> <option value="BS">Bahamas</option> <option value="BH">Bahrain</option> <option value="BD">Bangladesh</option> <option value="BB">Barbados</option> <option value="BY">Belarus</option> <option value="BE">Belgium</option> <option value="BZ">Belize</option> <option value="BJ">Benin</option> <option value="BM">Bermuda</option> <option value="BT">Bhutan</option> <option value="BO">Bolivia</option> <option value="BA">Bosnia and Herzegowina</option> <option value="BW">Botswana</option> <option value="BV">Bouvet Island</option> <option value="BR">Brazil</option> <option value="IO">British Indian Ocean Territory</option> <option value="BN">Brunei Darussalam</option> <option value="BG">Bulgaria</option> <option value="BF">Burkina Faso</option> <option value="BI">Burundi</option> <option value="KH">Cambodia</option> <option value="CM">Cameroon</option> <option value="CA">Canada</option> <option value="CV">Cape Verde</option> <option value="KY">Cayman Islands</option> <option value="CF">Central African Republic</option> <option value="TD">Chad</option> <option value="CL">Chile</option> <option value="CN">China</option> <option value="CX">Christmas Island</option> <option value="CC">Cocos (Keeling) Islands</option> <option value="CO">Colombia</option> <option value="KM">Comoros</option> <option value="CG">Congo</option> <option value="CD">Congo, the Democratic Republic of the</option> <option value="CK">Cook Islands</option> <option value="CR">Costa Rica</option> <option value="CI">Cote d'Ivoire</option> <option value="HR">Croatia (Hrvatska)</option> <option value="CU">Cuba</option> <option value="CY">Cyprus</option> <option value="CZ">Czech Republic</option> <option value="DK">Denmark</option> <option value="DJ">Djibouti</option> <option value="DM">Dominica</option> <option value="DO">Dominican Republic</option> <option value="EC">Ecuador</option> <option value="EG">Egypt</option> <option value="SV">El Salvador</option> <option value="GQ">Equatorial Guinea</option> <option value="ER">Eritrea</option> <option value="EE">Estonia</option> <option value="ET">Ethiopia</option> <option value="FK">Falkland Islands (Malvinas)</option> <option value="FO">Faroe Islands</option> <option value="FJ">Fiji</option> <option value="FI">Finland</option> <option value="FR">France</option> <option value="GF">French Guiana</option> <option value="PF">French Polynesia</option> <option value="TF">French Southern Territories</option> <option value="GA">Gabon</option> <option value="GM">Gambia</option> <option value="GE">Georgia</option> <option value="DE">Germany</option> <option value="GH">Ghana</option> <option value="GI">Gibraltar</option> <option value="GR">Greece</option> <option value="GL">Greenland</option> <option value="GD">Grenada</option> <option value="GP">Guadeloupe</option> <option value="GU">Guam</option> <option value="GT">Guatemala</option> <option value="GN">Guinea</option> <option value="GW">Guinea-Bissau</option> <option value="GY">Guyana</option> <option value="HT">Haiti</option> <option value="HM">Heard and Mc Donald Islands</option> <option value="VA">Holy See (Vatican City State)</option> <option value="HN">Honduras</option> <option value="HK">Hong Kong</option> <option value="HU">Hungary</option> <option value="IS">Iceland</option> <option value="IN">India</option> <option value="ID">Indonesia</option> <option value="IR">Iran (Islamic Republic of)</option> <option value="IQ">Iraq</option> <option value="IE">Ireland</option> <option value="IL">Israel</option> <option value="IT">Italy</option> <option value="JM">Jamaica</option> <option value="JP">Japan</option> <option value="JO">Jordan</option> <option value="KZ">Kazakhstan</option> <option value="KE">Kenya</option> <option value="KI">Kiribati</option> <option value="KP">Korea, Democratic People's Republic of</option> <option value="KR">Korea, Republic of</option> <option value="KW">Kuwait</option> <option value="KG">Kyrgyzstan</option> <option value="LA">Lao People's Democratic Republic</option> <option value="LV">Latvia</option> <option value="LB">Lebanon</option> <option value="LS">Lesotho</option> <option value="LR">Liberia</option> <option value="LY">Libyan Arab Jamahiriya</option> <option value="LI">Liechtenstein</option> <option value="LT">Lithuania</option> <option value="LU">Luxembourg</option> <option value="MO">Macau</option> <option value="MK">Macedonia, The Former Yugoslav Republic of</option> <option value="MG">Madagascar</option> <option value="MW">Malawi</option> <option value="MY">Malaysia</option> <option value="MV">Maldives</option> <option value="ML">Mali</option> <option value="MT">Malta</option> <option value="MH">Marshall Islands</option> <option value="MQ">Martinique</option> <option value="MR">Mauritania</option> <option value="MU">Mauritius</option> <option value="YT">Mayotte</option> <option value="MX">Mexico</option> <option value="FM">Micronesia, Federated States of</option> <option value="MD">Moldova, Republic of</option> <option value="MC">Monaco</option> <option value="MN">Mongolia</option> <option value="MS">Montserrat</option> <option value="MA">Morocco</option> <option value="MZ">Mozambique</option> <option value="MM">Myanmar</option> <option value="NA">Namibia</option> <option value="NR">Nauru</option> <option value="NP">Nepal</option> <option value="NL">Netherlands</option> <option value="AN">Netherlands Antilles</option> <option value="NC">New Caledonia</option> <option value="NZ">New Zealand</option> <option value="NI">Nicaragua</option> <option value="NE">Niger</option> <option value="NG">Nigeria</option> <option value="NU">Niue</option> <option value="NF">Norfolk Island</option> <option value="MP">Northern Mariana Islands</option> <option value="NO">Norway</option> <option value="OM">Oman</option> <option value="PK">Pakistan</option> <option value="PW">Palau</option> <option value="PA">Panama</option> <option value="PG">Papua New Guinea</option> <option value="PY">Paraguay</option> <option value="PE">Peru</option> <option value="PH">Philippines</option> <option value="PN">Pitcairn</option> <option value="PL">Poland</option> <option value="PT">Portugal</option> <option value="PR">Puerto Rico</option> <option value="QA">Qatar</option> <option value="RE">Reunion</option> <option value="RO">Romania</option> <option value="RU">Russian Federation</option> <option value="RW">Rwanda</option> <option value="KN">Saint Kitts and Nevis</option> <option value="LC">Saint LUCIA</option> <option value="VC">Saint Vincent and the Grenadines</option> <option value="WS">Samoa</option> <option value="SM">San Marino</option> <option value="ST">Sao Tome and Principe</option> <option value="SA">Saudi Arabia</option> <option value="SN">Senegal</option> <option value="SC">Seychelles</option> <option value="SL">Sierra Leone</option> <option value="SG">Singapore</option> <option value="SK">Slovakia (Slovak Republic)</option> <option value="SI">Slovenia</option> <option value="SB">Solomon Islands</option> <option value="SO">Somalia</option> <option value="ZA">South Africa</option> <option value="GS">South Georgia and the South Sandwich Islands</option> <option value="ES">Spain</option> <option value="LK">Sri Lanka</option> <option value="SH">St. Helena</option> <option value="PM">St. Pierre and Miquelon</option> <option value="SD">Sudan</option> <option value="SR">Suriname</option> <option value="SJ">Svalbard and Jan Mayen Islands</option> <option value="SZ">Swaziland</option> <option value="SE">Sweden</option> <option value="CH">Switzerland</option> <option value="SY">Syrian Arab Republic</option> <option value="TW">Taiwan, Province of China</option> <option value="TJ">Tajikistan</option> <option value="TZ">Tanzania, United Republic of</option> <option value="TH">Thailand</option> <option value="TG">Togo</option> <option value="TK">Tokelau</option> <option value="TO">Tonga</option> <option value="TT">Trinidad and Tobago</option> <option value="TN">Tunisia</option> <option value="TR">Turkey</option> <option value="TM">Turkmenistan</option> <option value="TC">Turks and Caicos Islands</option> <option value="TV">Tuvalu</option> <option value="UG">Uganda</option> <option value="UA">Ukraine</option> <option value="AE">United Arab Emirates</option> <option value="GB">United Kingdom</option> <option value="US">United States</option> <option value="UM">United States Minor Outlying Islands</option> <option value="UY">Uruguay</option> <option value="UZ">Uzbekistan</option> <option value="VU">Vanuatu</option> <option value="VE">Venezuela</option> <option value="VN">Viet Nam</option> <option value="VG">Virgin Islands (British)</option> <option value="VI">Virgin Islands (U.S.)</option> <option value="WF">Wallis and Futuna Islands</option> <option value="EH">Western Sahara</option> <option value="YE">Yemen</option> <option value="ZM">Zambia</option> <option value="ZW">Zimbabwe</option> </select> </div> <p class="hint"> Enter your account details below: </p> <div class="form-group"> <label class="control-label visible-ie8 visible-ie9">Username</label> <input class="form-control placeholder-no-fix" type="text" autocomplete="off" placeholder="Username" name="username" /> </div> <div class="form-group"> <label class="control-label visible-ie8 visible-ie9">Password</label> <input class="form-control placeholder-no-fix" type="password" autocomplete="off" id="register_password" placeholder="Password" name="password" /> </div> <div class="form-group"> <label class="control-label visible-ie8 visible-ie9">Re-type Your Password</label> <input class="form-control placeholder-no-fix" type="password" autocomplete="off" placeholder="Re-type Your Password" name="rpassword" /> </div> <div class="form-group margin-top-20 margin-bottom-20"> <label class="check"> <input type="checkbox" name="tnc" /> <span class="loginblue-font">I agree to the </span> <a href="javascript:;" class="loginblue-link">Terms of Service</a> <span class="loginblue-font">and</span> <a href="javascript:;" class="loginblue-link">Privacy Policy </a> </label> <div id="register_tnc_error"> </div> </div> <div class="form-actions"> <button type="button" id="register-back-btn" class="btn btn-default">Back</button> <button type="submit" id="register-submit-btn" class="btn red uppercase pull-right">Submit</button> </div> </form> <!-- END REGISTRATION FORM --> </div> <div class="copyright hide"> 2014 © Metronic. Admin Dashboard Template. </div> <!-- END LOGIN --> <!--[if lt IE 9]> <script src="../assets/global/plugins/respond.min.js"></script> <script src="../assets/global/plugins/excanvas.min.js"></script> <![endif]--> <!-- BEGIN CORE PLUGINS --> <script src="../assets/global/plugins/jquery.min.js" type="text/javascript"></script> <script src="../assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="../assets/global/plugins/js.cookie.min.js" type="text/javascript"></script> <script src="../assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script> <script src="../assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script> <script src="../assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script> <script src="../assets/global/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script> <script src="../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script> <!-- END CORE PLUGINS --> <!-- BEGIN PAGE LEVEL PLUGINS --> <script src="../assets/global/plugins/jquery-validation/js/jquery.validate.min.js" type="text/javascript"></script> <script src="../assets/global/plugins/jquery-validation/js/additional-methods.min.js" type="text/javascript"></script> <script src="../assets/global/plugins/select2/js/select2.full.min.js" type="text/javascript"></script> <!-- END PAGE LEVEL PLUGINS --> <!-- BEGIN THEME GLOBAL SCRIPTS --> <script src="../assets/global/scripts/app.min.js" type="text/javascript"></script> <!-- END THEME GLOBAL SCRIPTS --> <!-- BEGIN PAGE LEVEL SCRIPTS --> <script src="../assets/pages/scripts/login.min.js" type="text/javascript"></script> <!-- END PAGE LEVEL SCRIPTS --> <!-- BEGIN THEME LAYOUT SCRIPTS --> <!-- END THEME LAYOUT SCRIPTS --> </body> </html>
anndy201/mars-framework
com.sqsoft.mars.cloud/src/main/webapp/metronic/theme/admin/page_user_login_2.html
HTML
lgpl-3.0
28,153
package fr.labri.gumtree.gen.antlrantlr; import java.io.IOException; import org.antlr.runtime.*; import org.antlr.runtime.tree.CommonTree; import fr.labri.gumtree.gen.antlr.AbstractAntlrTreeGenerator; import fr.labri.gumtree.gen.antlrantlr.ANTLRv3Lexer; import fr.labri.gumtree.gen.antlrantlr.ANTLRv3Parser; public class AntlrGrammarTreeGenerator extends AbstractAntlrTreeGenerator { @Override protected CommonTree getStartSymbol(String file) throws RecognitionException, IOException { ANTLRStringStream stream = new ANTLRFileStream(file); ANTLRv3Lexer l = new ANTLRv3Lexer(stream); tokens = new TokenRewriteStream(l); ANTLRv3Parser p = new ANTLRv3Parser(tokens); return (CommonTree) p.grammarDef().getTree(); } @Override protected Parser getEmptyParser() { ANTLRStringStream stream = new ANTLRStringStream(); ANTLRv3Lexer l = new ANTLRv3Lexer(stream); CommonTokenStream tokens = new TokenRewriteStream(l); return new ANTLRv3Parser(tokens); } @Override public boolean handleFile(String file) { return file.toLowerCase().endsWith(".g"); } @Override public String getName() { return "antlr-antlr"; } }
taccoraw/gumtree
gen.antlr-antlr/src/main/java/fr/labri/gumtree/gen/antlrantlr/AntlrGrammarTreeGenerator.java
Java
lgpl-3.0
1,144
namespace Cfix.Control.Ui.Result { partial class ResultExplorer { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.IContainer components = null; /// <summary> /// Clean up any resources being used. /// </summary> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> protected override void Dispose( bool disposing ) { if ( disposing && ( components != null ) ) { components.Dispose(); } base.Dispose( disposing ); } #region Component Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager( typeof( ResultExplorer ) ); this.tree = new Aga.Controls.Tree.TreeViewAdv(); this.colName = new Aga.Controls.Tree.TreeColumn(); this.colExpression = new Aga.Controls.Tree.TreeColumn(); this.colMessage = new Aga.Controls.Tree.TreeColumn(); this.colLocation = new Aga.Controls.Tree.TreeColumn(); this.colStatus = new Aga.Controls.Tree.TreeColumn(); this.colDuration = new Aga.Controls.Tree.TreeColumn(); this.colLastError = new Aga.Controls.Tree.TreeColumn(); this.icons = new System.Windows.Forms.ImageList( this.components ); this.SuspendLayout(); // // tree // this.tree.AllowColumnReorder = true; this.tree.BackColor = System.Drawing.SystemColors.Window; this.tree.Columns.Add( this.colName ); this.tree.Columns.Add( this.colExpression ); this.tree.Columns.Add( this.colMessage ); this.tree.Columns.Add( this.colLocation ); this.tree.Columns.Add( this.colStatus ); this.tree.Columns.Add( this.colDuration ); this.tree.Columns.Add( this.colLastError ); this.tree.DefaultToolTipProvider = null; this.tree.Dock = System.Windows.Forms.DockStyle.Fill; this.tree.DragDropMarkColor = System.Drawing.Color.Black; this.tree.FullRowSelect = true; this.tree.GridLineStyle = ( ( Aga.Controls.Tree.GridLineStyle ) ( ( Aga.Controls.Tree.GridLineStyle.Horizontal | Aga.Controls.Tree.GridLineStyle.Vertical ) ) ); this.tree.LineColor = System.Drawing.SystemColors.ControlDark; this.tree.LoadOnDemand = true; this.tree.Location = new System.Drawing.Point( 0, 0 ); this.tree.Model = null; this.tree.Name = "tree"; this.tree.RowHeight = 18; this.tree.SelectedNode = null; this.tree.ShowNodeToolTips = true; this.tree.Size = new System.Drawing.Size( 488, 314 ); this.tree.TabIndex = 0; this.tree.UseColumns = true; this.tree.SelectionChanged += new System.EventHandler( this.tree_SelectionChanged ); // // colName // this.colName.Header = "Name"; this.colName.SortOrder = System.Windows.Forms.SortOrder.None; this.colName.TooltipText = null; this.colName.Width = 180; // // colExpression // this.colExpression.Header = "Expression"; this.colExpression.SortOrder = System.Windows.Forms.SortOrder.None; this.colExpression.TooltipText = null; this.colExpression.Width = 200; // // colMessage // this.colMessage.Header = "Message"; this.colMessage.SortOrder = System.Windows.Forms.SortOrder.None; this.colMessage.TooltipText = null; this.colMessage.Width = 180; // // colLocation // this.colLocation.Header = "Location"; this.colLocation.SortOrder = System.Windows.Forms.SortOrder.None; this.colLocation.TooltipText = null; this.colLocation.Width = 180; // // colStatus // this.colStatus.Header = "Status"; this.colStatus.SortOrder = System.Windows.Forms.SortOrder.None; this.colStatus.TooltipText = null; this.colStatus.Width = 80; // // colDuration // this.colDuration.Header = "Duration"; this.colDuration.SortOrder = System.Windows.Forms.SortOrder.None; this.colDuration.TooltipText = null; this.colDuration.Width = 100; // // colLastError // this.colLastError.Header = "Last Win32 error"; this.colLastError.SortOrder = System.Windows.Forms.SortOrder.None; this.colLastError.TooltipText = null; // // icons // this.icons.ImageStream = ( ( System.Windows.Forms.ImageListStreamer ) ( resources.GetObject( "icons.ImageStream" ) ) ); this.icons.TransparentColor = System.Drawing.Color.Magenta; this.icons.Images.SetKeyName( 0, "Status_Pending.bmp" ); this.icons.Images.SetKeyName( 1, "Status_Running.bmp" ); this.icons.Images.SetKeyName( 2, "Status_Skipped.bmp" ); this.icons.Images.SetKeyName( 3, "Status_Stopped.bmp" ); this.icons.Images.SetKeyName( 4, "Status_Succeeded.bmp" ); this.icons.Images.SetKeyName( 5, "Status_SucceededWithInconclusiveParts.bmp" ); this.icons.Images.SetKeyName( 6, "Status_SucceededWithSkippedParts.bmp" ); this.icons.Images.SetKeyName( 7, "Status_Failed.bmp" ); this.icons.Images.SetKeyName( 8, "Status_Inconclusive.bmp" ); this.icons.Images.SetKeyName( 9, "Status_PostprocessingFailed.bmp" ); this.icons.Images.SetKeyName( 10, "Inconclusive.bmp" ); this.icons.Images.SetKeyName( 11, "Failure.bmp" ); this.icons.Images.SetKeyName( 12, "StackFrame.bmp" ); this.icons.Images.SetKeyName( 13, "Information.bmp" ); this.icons.Images.SetKeyName( 14, "Warning.bmp" ); this.icons.Images.SetKeyName( 15, "Error.bmp" ); // // ResultExplorer // this.AutoScaleDimensions = new System.Drawing.SizeF( 6F, 13F ); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add( this.tree ); this.Name = "ResultExplorer"; this.Size = new System.Drawing.Size( 488, 314 ); this.ResumeLayout( false ); } #endregion private Aga.Controls.Tree.TreeViewAdv tree; private Aga.Controls.Tree.TreeColumn colName; private Aga.Controls.Tree.TreeColumn colLocation; private Aga.Controls.Tree.TreeColumn colStatus; private Aga.Controls.Tree.TreeColumn colMessage; private Aga.Controls.Tree.TreeColumn colExpression; private Aga.Controls.Tree.TreeColumn colLastError; private System.Windows.Forms.ImageList icons; private Aga.Controls.Tree.TreeColumn colDuration; } }
jpassing/visualassert
src/Cfix.Control/Cfix.Control.Ui/Result/ResultExplorer.Designer.cs
C#
lgpl-3.0
6,481
event_enhanced_gaping_spider = Creature:new { objectName = "@mob/creature_names:geonosian_gaping_spider_fire", customName = "Fire Breathing Spider (event)", socialGroup = "geonosian_creature", pvpFaction = "geonosian_creature", faction = "", level = 108, chanceHit = 2.5, damageMin = 715, damageMax = 1140, baseXp = 0, baseHAM = 32000, baseHAMmax = 39000, armor = 2, resists = {50,10,-1,95,-1,10,10,10,-1}, meatType = "meat_insect", meatAmount = 0, hideType = "", hideAmount = 0, boneType = "", boneAmount = 0, milk = 0, tamingChance = 0, ferocity = 0, pvpBitmask = AGGRESSIVE + ATTACKABLE + ENEMY, creatureBitmask = PACK + KILLER, optionsBitmask = 128, diet = CARNIVORE, templates = {"object/mobile/gaping_spider.iff"}, scale = 2.5, lootGroups = {}, weapons = {"creature_spit_small_toxicgreen"}, conversationTemplate = "", attacks = { {"strongpoison",""}, {"stunattack","stunChance=50"} } } CreatureTemplates:addCreatureTemplate(event_enhanced_gaping_spider, "event_enhanced_gaping_spider")
kidaa/Awakening-Core3
bin/scripts/mobile/event/event_enhanced_gaping_spider.lua
Lua
lgpl-3.0
1,032
<?php /** * integer_net Magento Module * * @category IntegerNet * @package IntegerNet_Solr * @copyright Copyright (c) 2016 integer_net GmbH (http://www.integer-net.de/) * @author Fabian Schmengler <fs@integer-net.de> */ namespace IntegerNet\Solr\Request; interface RequestFactory { /** * @return Request */ public function createRequest(); }
integer-net/solr-base
src/Solr/Request/RequestFactory.php
PHP
lgpl-3.0
378
#pragma once struct IRenderMesh; struct IRenderer { virtual ~IRenderer() {} virtual void PrepareFrame() = 0; virtual void DrawOneFrame() = 0; virtual void EndOneFrame() = 0; virtual void DrawMesh(IRenderMesh *) = 0; virtual void OnResize(int width, int height) = 0; };
swq0553/kaleido3d
Include/Interface/IRenderer.h
C
lgpl-3.0
282
<!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' lang='he' dir='rtl'> <head> <meta http-equiv='Content-Type' content='text/html; charset=windows-1255' /> <meta http-equiv='Content-Script-Type' content='text/javascript' /> <meta http-equiv='revisit-after' content='15 days' /> <title>ùåøùéí òí îùîòåú ãåîä, òí çéìåó áéï àåúéåú î=ô</title> <link rel='stylesheet' type='text/css' href='../../../_script/klli.css' /> <link rel='stylesheet' type='text/css' href='../../../tnk1/_themes/klli.css' /> <meta name='author' content="" /> <meta name='receiver' content="" /> <meta name='jmQovc' content="tnk1/ljon/jorj/m=p" /> <meta name='tvnit' content="tnk_jorj" /> <meta name='description' lang='he' content="ùåøùéí òí îùîòåú ãåîä, òí çéìåó áéï àåúéåú î=ô" /> <meta name='description' lang='en' content="this page is in Hebrew" /> <meta name='keywords' lang='he' content="î=ô áúð&quot;ê,ùåøùéí òí îùîòåú ãåîä, òí çéìåó áéï àåúéåú î=ô" /> </head> <!-- PHP Programming by Erel Segal - Rent a Brain http://tora.us.fm/rentabrain --> <body lang='he' dir='rtl' id = 'tnk1_ljon_jorj_m_p' class='rbjwrj tnk_jorj'> <div class='pnim'> <script type='text/javascript' src='../../../_script/vars.js'></script> <!--NiwutElyon0--> <div class='NiwutElyon'> <div class='NiwutElyon'><a class='link_to_homepage' href='../../../tnk1/index.html'>øàùé</a>&gt;<a href='../../../tnk1/ljon/index.html'>ìùåï äî÷øà</a>&gt;<a href='../../../tnk1/ljon/jorj/index.html'>ùåøùéí</a>&gt;<a href='../../../tnk1/ljon/jorj/m.html'>î</a>&gt;</div> <div class='NiwutElyon'><a class='link_to_homepage' href='../../../tnk1/index.html'>øàùé</a>&gt;<a href='../../../tnk1/ljon/index.html'>ìùåï äî÷øà</a>&gt;<a href='../../../tnk1/ljon/jorj/index.html'>ùåøùéí</a>&gt;<a href='../../../tnk1/ljon/jorj/p.html'>ô</a>&gt;</div> <div class='NiwutElyon'><a class='link_to_homepage' href='../../../tnk1/index.html'>øàùé</a>&gt;<a href='../../../tnk1/ljon/dq/jwrj.html'>ã÷ãå÷ äùåøù</a>&gt;<a href='../../../tnk1/ljon/jorj/qvucot.html'>÷áåöåú ùì ùåøùéí</a>&gt;<a href='../../../tnk1/ljon/jorj/jdmd.html'>ùãîã</a>&gt;</div> </div> <!--NiwutElyon1--> <h1 id='h1'>ùåøùéí òí îùîòåú ãåîä, òí çéìåó áéï àåúéåú î=ô</h1> <div id='idfields'> <p>÷åã: î=ô áúð"ê</p> <p>ñåâ: øáùåøù</p> <p>îàú: </p> <p>àì: </p> </div> <script type='text/javascript'>kotrt()</script> <ul id='ulbnim'> <li>òìùåøù_àåú: <a href='../../../tnk1/ljon/jorj/mlf=plf.html' class='eljwrj_awt dor1'>îìè=ôìè</a>&nbsp; <div class='dor2'> <span class='hgdrh_kllyt'>= ùåøùéí òí îùîòåú ãåîä, áçéìåó áéï ùúé àåúéåú ÷øåáåú.</span>&nbsp;&nbsp; </div><!--dor2--> </li> <li>òìùåøù_àåú: <a href='../../../tnk1/ljon/jorj/qbc=qmc=qpc.html' class='eljwrj_awt dor1'>÷áö=÷îö=÷ôö</a>&nbsp; <div class='dor2'> <span class='hgdrh_kllyt'>= ùåøùéí òí îùîòåú ãåîä, áçéìåó áéï ùúé àåúéåú ÷øåáåú.</span>&nbsp;&nbsp; </div><!--dor2--> </li> </ul><!--end--> <script type='text/javascript'> AnalyzeBnim(); ktov_bnim_jorj(); </script> <h2 id='tguvot'>úåñôåú åúâåáåú</h2> <script type='text/javascript'>ktov_bnim_axrim("<"+"ul>","</"+"ul>")</script> <script type='text/javascript'>tguva(); txtit()</script> </div><!--pnim--> </body> </html>
erelsgl/erel-sites
tnk1/ljon/jorj/m=p.html
HTML
lgpl-3.0
3,245
package com.jpexs.javactivex.example.controls.mediaplayer; import com.jpexs.javactivex.*; /** * IWMPMedia: Public interface. */ @GUID(value="{94D55E95-3FAC-11D3-B155-00C04F79FAA6}", base="{6BF52A52-394A-11D3-B153-00C04F79FAA6}") public interface IWMPMedia { /** * Returns the time of a marker * * @param MarkerNum * @return */ public double getMarkerTime(int MarkerNum); /** * Returns the name of a marker * * @param MarkerNum * @return */ public String getMarkerName(int MarkerNum); /** * Returns the name of the attribute whose index has been specified * * @param lIndex * @return */ public String getAttributeName(int lIndex); /** * Gets an item info by atom * * @param lAtom * @return */ public String getItemInfoByAtom(int lAtom); /** * Returns the value of specified attribute for this media * * @param bstrItemName * @return */ public String getItemInfo(String bstrItemName); /** * Is the attribute read only * * @param bstrItemName * @return */ public boolean isReadOnlyItem(String bstrItemName); /** * Is the media a member of the given playlist * * @param pPlaylist * @return */ public boolean isMemberOf(IWMPPlaylist pPlaylist); /** * Sets the value of specified attribute for this media * * @param bstrItemName * @param bstrVal */ public void setItemInfo(String bstrItemName, String bstrVal); /** * Getter for property sourceURL * * @return sourceURL value */ @Getter("sourceURL") public String getSourceURL(); /** * Getter for property name * * @return name value */ @Getter("name") public String getName(); /** * Setter for property name * * @param value New name value */ @Setter("name") public void setName(String value); /** * Getter for property imageSourceWidth * * @return imageSourceWidth value */ @Getter("imageSourceWidth") public int getImageSourceWidth(); /** * Getter for property imageSourceHeight * * @return imageSourceHeight value */ @Getter("imageSourceHeight") public int getImageSourceHeight(); /** * Getter for property markerCount * * @return markerCount value */ @Getter("markerCount") public int getMarkerCount(); /** * Getter for property duration * * @return duration value */ @Getter("duration") public double getDuration(); /** * Getter for property durationString * * @return durationString value */ @Getter("durationString") public String getDurationString(); /** * Getter for property attributeCount * * @return attributeCount value */ @Getter("attributeCount") public int getAttributeCount(); }
jindrapetrik/javactivex
src/com/jpexs/javactivex/example/controls/mediaplayer/IWMPMedia.java
Java
lgpl-3.0
2,681
/* Copyright 2013-2021 Paul Colby This file is part of QtAws. QtAws 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. QtAws 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 the QtAws. If not, see <http://www.gnu.org/licenses/>. */ #ifndef QTAWS_LISTOFFERINGSREQUEST_P_H #define QTAWS_LISTOFFERINGSREQUEST_P_H #include "medialiverequest_p.h" #include "listofferingsrequest.h" namespace QtAws { namespace MediaLive { class ListOfferingsRequest; class ListOfferingsRequestPrivate : public MediaLiveRequestPrivate { public: ListOfferingsRequestPrivate(const MediaLiveRequest::Action action, ListOfferingsRequest * const q); ListOfferingsRequestPrivate(const ListOfferingsRequestPrivate &other, ListOfferingsRequest * const q); private: Q_DECLARE_PUBLIC(ListOfferingsRequest) }; } // namespace MediaLive } // namespace QtAws #endif
pcolby/libqtaws
src/medialive/listofferingsrequest_p.h
C
lgpl-3.0
1,419
/* Generated By:JavaCC: Do not edit this line. CharStream.java Version 3.0 */ package gate.creole.annic.apache.lucene.analysis.standard; /** * This interface describes a character stream that maintains line and * column number positions of the characters. It also has the capability * to backup the stream to some extent. An implementation of this * interface is used in the TokenManager implementation generated by * JavaCCParser. * * All the methods except backup can be implemented in any fashion. backup * needs to be implemented correctly for the correct operation of the lexer. * Rest of the methods are all used to get information like line number, * column number and the String that constitutes a token and are not used * by the lexer. Hence their implementation won't affect the generated lexer's * operation. */ public interface CharStream { /** * Returns the next character from the selected input. The method * of selecting the input is the responsibility of the class * implementing this interface. Can throw any java.io.IOException. */ char readChar() throws java.io.IOException; /** * Returns the column position of the character last read. * @deprecated * @see #getEndColumn */ int getColumn(); /** * Returns the line number of the character last read. * @deprecated * @see #getEndLine */ int getLine(); /** * Returns the column number of the last character for current token (being * matched after the last call to BeginTOken). */ int getEndColumn(); /** * Returns the line number of the last character for current token (being * matched after the last call to BeginTOken). */ int getEndLine(); /** * Returns the column number of the first character for current token (being * matched after the last call to BeginTOken). */ int getBeginColumn(); /** * Returns the line number of the first character for current token (being * matched after the last call to BeginTOken). */ int getBeginLine(); /** * Backs up the input stream by amount steps. Lexer calls this method if it * had already read some characters, but could not use them to match a * (longer) token. So, they will be used again as the prefix of the next * token and it is the implemetation's responsibility to do this right. */ void backup(int amount); /** * Returns the next character that marks the beginning of the next token. * All characters must remain in the buffer between two successive calls * to this method to implement backup correctly. */ char BeginToken() throws java.io.IOException; /** * Returns a string made up of characters from the marked token beginning * to the current buffer position. Implementations have the choice of returning * anything that they want to. For example, for efficiency, one might decide * to just return null, which is a valid implementation. */ String GetImage(); /** * Returns an array of characters that make up the suffix of length 'len' for * the currently matched token. This is used to build up the matched string * for use in actions in the case of MORE. A simple and inefficient * implementation of this is as follows : * * { * String t = GetImage(); * return t.substring(t.length() - len, t.length()).toCharArray(); * } */ char[] GetSuffix(int len); /** * The lexer calls this function to indicate that it is done with the stream * and hence implementations can free any resources held by this class. * Again, the body of this function can be just empty and it will not * affect the lexer's operation. */ void Done(); }
liuhongchao/GATE_Developer_7.0
src/gate/creole/annic/apache/lucene/analysis/standard/CharStream.java
Java
lgpl-3.0
3,705
# Repositori de prova 1. Fitxers de codi 2. Fitxers de dades 3. Modificació nova 4. Increment de codi
joetds/prova1
README.md
Markdown
lgpl-3.0
104
/* * SQL statement name: create_constraint.sql * Type: Postgres SQL statement * Parameters: * 1: Table; e.g. t_rif40_studies * 2: Constraint; e.g. t_rif40_std_comp_geolevel_fk * 3: Foreign key fields; e.g. geography, comparison_geolevel_name * 4: Referenced table and columns; e.g. t_rif40_geolevels (geography, geolevel_name) * * Description: Create a constraint * Note: %% becomes % after substitution * * ALTER TABLE t_rif40_studies * ADD CONSTRAINT t_rif40_std_comp_geolevel_fk FOREIGN KEY (geography, comparison_geolevel_name) * REFERENCES t_rif40_geolevels (geography, geolevel_name); */ ALTER TABLE %1 ADD CONSTRAINT %2 FOREIGN KEY (%3) REFERENCES %4
smallAreaHealthStatisticsUnit/rapidInquiryFacility
rifNodeServices/sql/postgres/create_constraint.sql
SQL
lgpl-3.0
706