text
stringlengths
2
1.04M
meta
dict
/* * This source code is provided to illustrate the usage of a given feature * or technique and has been deliberately simplified. Additional steps * required for a production-quality application, such as security checks, * input validation and proper error handling, might not be present in * this sample code. */ package com.sun.tools.example.debug.bdi; public class NoThreadException extends Exception { private static final long serialVersionUID = 1846613539928921998L; }
{ "content_hash": "70b4b52c82f53c3cbdb58cd327df849c", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 74, "avg_line_length": 27.333333333333332, "alnum_prop": 0.7764227642276422, "repo_name": "rokn/Count_Words_2015", "id": "12512094f4d93334bcbdbf8b53c79eb023a809b8", "size": "1704", "binary": false, "copies": "27", "ref": "refs/heads/master", "path": "testing/openjdk2/jdk/src/share/classes/com/sun/tools/example/debug/bdi/NoThreadException.java", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "61802" }, { "name": "Ruby", "bytes": "18888605" } ], "symlink_target": "" }
package com.intellij.refactoring.copy; import com.intellij.CommonBundle; import com.intellij.ide.CopyPasteDelegator; import com.intellij.ide.util.EditorHelper; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.command.CommandProcessor; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.util.ThrowableComputable; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.openapi.vfs.encoding.EncodingRegistry; import com.intellij.openapi.wm.ToolWindowManager; import com.intellij.psi.*; import com.intellij.psi.impl.file.PsiDirectoryFactory; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.refactoring.RefactoringBundle; import com.intellij.refactoring.move.moveFilesOrDirectories.MoveFilesOrDirectoriesUtil; import com.intellij.refactoring.util.CommonRefactoringUtil; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.IOException; import java.util.HashSet; import java.util.Set; public class CopyFilesOrDirectoriesHandler extends CopyHandlerDelegateBase { @Override public boolean canCopy(PsiElement[] elements, boolean fromUpdate) { Set<String> names = new HashSet<String>(); for (PsiElement element : elements) { if (!(element instanceof PsiFileSystemItem)) return false; if (!element.isValid()) return false; if (element instanceof PsiCompiledFile) return false; String name = ((PsiFileSystemItem) element).getName(); if (names.contains(name)) { return false; } names.add(name); } PsiElement[] filteredElements = PsiTreeUtil.filterAncestors(elements); return filteredElements.length == elements.length; } @Override public void doCopy(final PsiElement[] elements, PsiDirectory defaultTargetDirectory) { if (defaultTargetDirectory == null) { defaultTargetDirectory = getCommonParentDirectory(elements); } Project project = defaultTargetDirectory != null ? defaultTargetDirectory.getProject() : elements [0].getProject(); if (defaultTargetDirectory != null) { defaultTargetDirectory = resolveDirectory(defaultTargetDirectory); if (defaultTargetDirectory == null) return; } copyAsFiles(elements, defaultTargetDirectory, project); } public static void copyAsFiles(PsiElement[] elements, PsiDirectory defaultTargetDirectory, Project project) { PsiDirectory targetDirectory = null; String newName = null; boolean openInEditor = true; if (ApplicationManager.getApplication().isUnitTestMode()) { targetDirectory = defaultTargetDirectory; } else { CopyFilesOrDirectoriesDialog dialog = new CopyFilesOrDirectoriesDialog(elements, defaultTargetDirectory, project, false); dialog.show(); if (dialog.isOK()) { newName = elements.length == 1 ? dialog.getNewName() : null; targetDirectory = dialog.getTargetDirectory(); openInEditor = dialog.openInEditor(); } } if (targetDirectory != null) { try { for (PsiElement element : elements) { PsiFileSystemItem psiElement = (PsiFileSystemItem)element; if (psiElement.isDirectory()) { MoveFilesOrDirectoriesUtil.checkIfMoveIntoSelf(psiElement, targetDirectory); } } } catch (IncorrectOperationException e) { CommonRefactoringUtil.showErrorHint(project, null, e.getMessage(), CommonBundle.getErrorTitle(), null); return; } copyImpl(elements, newName, targetDirectory, false, openInEditor); } } @Override public void doClone(final PsiElement element) { doCloneFile(element); } public static void doCloneFile(PsiElement element) { PsiDirectory targetDirectory; if (element instanceof PsiDirectory) { targetDirectory = ((PsiDirectory)element).getParentDirectory(); assert targetDirectory != null : element; } else { targetDirectory = ((PsiFile)element).getContainingDirectory(); } PsiElement[] elements = {element}; CopyFilesOrDirectoriesDialog dialog = new CopyFilesOrDirectoriesDialog(elements, null, element.getProject(), true); dialog.show(); if (dialog.isOK()) { String newName = dialog.getNewName(); copyImpl(elements, newName, targetDirectory, true, true); } } @Nullable private static PsiDirectory getCommonParentDirectory(PsiElement[] elements){ PsiDirectory result = null; for (PsiElement element : elements) { PsiDirectory directory; if (element instanceof PsiDirectory) { directory = (PsiDirectory)element; directory = directory.getParentDirectory(); } else if (element instanceof PsiFile) { directory = ((PsiFile)element).getContainingDirectory(); } else { throw new IllegalArgumentException("unexpected element " + element); } if (directory == null) continue; if (result == null) { result = directory; } else { if (PsiTreeUtil.isAncestor(directory, result, true)) { result = directory; } } } return result; } /** * @param elements * @param newName can be not null only if elements.length == 1 * @param targetDirectory * @param openInEditor */ private static void copyImpl(@NotNull final PsiElement[] elements, @Nullable final String newName, @NotNull final PsiDirectory targetDirectory, final boolean doClone, final boolean openInEditor) { if (doClone && elements.length != 1) { throw new IllegalArgumentException("invalid number of elements to clone:" + elements.length); } if (newName != null && elements.length != 1) { throw new IllegalArgumentException("no new name should be set; number of elements is: " + elements.length); } final Project project = targetDirectory.getProject(); Runnable command = new Runnable() { @Override public void run() { final Runnable action = new Runnable() { @Override public void run() { try { PsiFile firstFile = null; final int[] choice = elements.length > 1 || elements[0] instanceof PsiDirectory ? new int[]{-1} : null; for (PsiElement element : elements) { PsiFile f = copyToDirectory((PsiFileSystemItem)element, newName, targetDirectory, choice); if (firstFile == null) { firstFile = f; } } if (firstFile != null) { CopyHandler.updateSelectionInActiveProjectView(firstFile, project, doClone); if (!(firstFile instanceof PsiBinaryFile) && openInEditor){ EditorHelper.openInEditor(firstFile); ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { ToolWindowManager.getInstance(project).activateEditorComponent(); } }); } } } catch (final IncorrectOperationException ex) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { Messages.showErrorDialog(project, ex.getMessage(), RefactoringBundle.message("error.title")); } }); } catch (final IOException ex) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { Messages.showErrorDialog(project, ex.getMessage(), RefactoringBundle.message("error.title")); } }); } } }; ApplicationManager.getApplication().runWriteAction(action); } }; String title = RefactoringBundle.message(doClone ? "copy,handler.clone.files.directories" : "copy.handler.copy.files.directories"); CommandProcessor.getInstance().executeCommand(project, command, title, null); } /** * @param elementToCopy PsiFile or PsiDirectory * @param newName can be not null only if elements.length == 1 * @return first copied PsiFile (recursively); null if no PsiFiles copied */ @Nullable public static PsiFile copyToDirectory(@NotNull PsiFileSystemItem elementToCopy, @Nullable String newName, @NotNull PsiDirectory targetDirectory) throws IncorrectOperationException, IOException { return copyToDirectory(elementToCopy, newName, targetDirectory, null); } /** * @param elementToCopy PsiFile or PsiDirectory * @param newName can be not null only if elements.length == 1 * @param choice a horrible way to pass/keep user preference * @return first copied PsiFile (recursively); null if no PsiFiles copied */ @Nullable public static PsiFile copyToDirectory(@NotNull PsiFileSystemItem elementToCopy, @Nullable String newName, @NotNull PsiDirectory targetDirectory, @Nullable int[] choice) throws IncorrectOperationException, IOException { if (elementToCopy instanceof PsiFile) { PsiFile file = (PsiFile)elementToCopy; String name = newName == null ? file.getName() : newName; if (checkFileExist(targetDirectory, choice, file, name, "Copy")) return null; return targetDirectory.copyFileFrom(name, file); } else if (elementToCopy instanceof PsiDirectory) { PsiDirectory directory = (PsiDirectory)elementToCopy; if (directory.equals(targetDirectory)) { return null; } if (newName == null) newName = directory.getName(); final PsiDirectory existing = targetDirectory.findSubdirectory(newName); final PsiDirectory subdirectory = existing == null ? targetDirectory.createSubdirectory(newName) : existing; EncodingRegistry.doActionAndRestoreEncoding(directory.getVirtualFile(), new ThrowableComputable<VirtualFile, IOException>() { @Override public VirtualFile compute() { return subdirectory.getVirtualFile(); } }); PsiFile firstFile = null; PsiElement[] children = directory.getChildren(); for (PsiElement child : children) { PsiFileSystemItem item = (PsiFileSystemItem)child; PsiFile f = copyToDirectory(item, item.getName(), subdirectory, choice); if (firstFile == null) { firstFile = f; } } return firstFile; } else { throw new IllegalArgumentException("unexpected elementToCopy: " + elementToCopy); } } public static boolean checkFileExist(PsiDirectory targetDirectory, int[] choice, PsiFile file, String name, String title) { final PsiFile existing = targetDirectory.findFile(name); if (existing != null && !existing.equals(file)) { int selection; if (choice == null || choice[0] == -1) { String message = String.format("File '%s' already exists in directory '%s'", name, targetDirectory.getVirtualFile().getPath()); String[] options = choice == null ? new String[]{"Overwrite", "Skip"} : new String[]{"Overwrite", "Skip", "Overwrite for all", "Skip for all"}; selection = Messages.showDialog(message, title, options, 0, Messages.getQuestionIcon()); } else { selection = choice[0]; } if (choice != null && selection > 1) { choice[0] = selection % 2; selection = choice[0]; } if (selection == 0 && file != existing) { existing.delete(); } else { return true; } } return false; } @Nullable protected static PsiDirectory resolveDirectory(@NotNull PsiDirectory defaultTargetDirectory) { final Project project = defaultTargetDirectory.getProject(); final Boolean showDirsChooser = defaultTargetDirectory.getCopyableUserData(CopyPasteDelegator.SHOW_CHOOSER_KEY); if (showDirsChooser != null && showDirsChooser.booleanValue()) { final PsiDirectoryContainer directoryContainer = PsiDirectoryFactory.getInstance(project).getDirectoryContainer(defaultTargetDirectory); if (directoryContainer == null) { return defaultTargetDirectory; } return MoveFilesOrDirectoriesUtil.resolveToDirectory(project, directoryContainer); } return defaultTargetDirectory; } }
{ "content_hash": "f21bafb144c80050c0a9b64284af595d", "timestamp": "", "source": "github", "line_count": 335, "max_line_length": 135, "avg_line_length": 38.38507462686567, "alnum_prop": 0.6533167431371024, "repo_name": "romankagan/DDBWorkbench", "id": "eb2aa59b0a70cbe0081e2d9c5c35ad79a52c79f8", "size": "13459", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "platform/lang-impl/src/com/intellij/refactoring/copy/CopyFilesOrDirectoriesHandler.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "AspectJ", "bytes": "182" }, { "name": "C", "bytes": "174330" }, { "name": "C#", "bytes": "390" }, { "name": "C++", "bytes": "85270" }, { "name": "CSS", "bytes": "102018" }, { "name": "Erlang", "bytes": "10" }, { "name": "FLUX", "bytes": "57" }, { "name": "Groovy", "bytes": "1899897" }, { "name": "J", "bytes": "5050" }, { "name": "Java", "bytes": "128604770" }, { "name": "JavaScript", "bytes": "123045" }, { "name": "Objective-C", "bytes": "19702" }, { "name": "Perl", "bytes": "6549" }, { "name": "Python", "bytes": "17759911" }, { "name": "Ruby", "bytes": "1213" }, { "name": "Shell", "bytes": "45691" }, { "name": "TeX", "bytes": "60798" }, { "name": "XSLT", "bytes": "113531" } ], "symlink_target": "" }
<!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta name="keywords" content="JavaScript, Framework, Animation, Natural, System" /> <meta name="description" content="FloraJS simulates natural systems using JavaScript." /> <meta name="viewport" content = "user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <meta name='apple-mobile-web-app-capable' content='yes' /> <meta property='og:title' content='FloraJS' /> <meta property='og:url' content='http://www.florajs.com' /> <meta property='og:site_name' content='FloraJS' /> <title>FloraJS | Simulate natural systems with JavaScript</title> <link rel="stylesheet" href="css/Burner.min.css" type="text/css" charset="utf-8" /> <link rel="stylesheet" href="css/Flora.min.css" type="text/css" charset="utf-8" /> <script src="scripts/Burner.min.js" type="text/javascript" charset="utf-8"></script> <script src="scripts/Flora.min.js" type="text/javascript" charset="utf-8"></script> </head> <body> <script type="text/javascript" charset="utf-8"> Burner.System.init(function() { var world = Burner.System.firstWorld(); this.add('Dragger', { location: new Burner.Vector(world.width * 0.5, world.height * 0.75), draggable: true }); this.add('Mover'); this.add('Caption', { text: 'Flora.Dragger', opacity: 0.4, borderColor: 'transparent', position: 'top center' }); this.add('InputMenu', { opacity: 0.4, borderColor: 'transparent', position: 'bottom center' }); }); </script> </body> </html>
{ "content_hash": "3847b1cc495657a9f462e313a7b14a16", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 113, "avg_line_length": 36.638297872340424, "alnum_prop": 0.6225319396051103, "repo_name": "riselabs-ufba/RiPLE-HC-ExperimentalData", "id": "97159ca5a5978fc529e7f956130a9628d018e0e2", "size": "1722", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "case-studies/florajs-spl/public/Flora.Dragger.html", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2667" }, { "name": "CSS", "bytes": "531817" }, { "name": "Clojure", "bytes": "28" }, { "name": "HTML", "bytes": "2386347" }, { "name": "JavaScript", "bytes": "13655267" }, { "name": "Makefile", "bytes": "2494" }, { "name": "PHP", "bytes": "28796" }, { "name": "Python", "bytes": "7762" }, { "name": "Ruby", "bytes": "11986" }, { "name": "Shell", "bytes": "5746" } ], "symlink_target": "" }
package com.xhy.weibo.utils; /** * Created by xuhaoyang on 16/9/8. */ public class Constants { public static boolean isNotify = true; //SearchActivity 搜索内容 public static final String SEARCH_CONTENT = "search_content"; //StatusDetailActivity status public static final String STATUS_INTENT = "status"; public static final String TOKEN = "token"; public static final int TYPE_WRITE_FRIEND_LISTENER = 101; public static final String RESULT_DATA_USERNAME_AT = "USERNAME_AT"; public static final int ITEM_LIKE_TPYE = 0; public static final int ITEM_COMMENT_TPYE = 1; public static final int ITEM_FORWARD_TPYE = 2; public static final int ITEM_FORWARD_STATUS_TYPE = 3; //UserInfoActivty public static final String USER_ID = "UID"; public static final String STATUS_ID = "wid"; public static final String USER_NAME = "NAME"; public static final String SEND_FORWORD_SUCCESS = "SEND_FORWORD_OK"; public static final String SEND_STATUS_SUCCESS = "SEND_STATUS_OK"; /** * WriteStatusActivity */ //打上TAG标签 判断来自哪个Activity public static final String TAG = "TAG"; public static final int MAIN_ATY_CODE = 1; public static final int DETAIL_ATY_CODE = 2; public static final int COMMENT_ADPATER_CODE = 3; public static final String TYPE = "WRITECOMMENTACTIVITY_TYPE"; public static final int COMMENT_TYPE = 101; public static final int FORWARD_TYPE = 102; public static final int NEW_STATUS_TYPE = 103; public static final String COMMENT_INTENT = "comment"; public static final String SEND_COMMENT_SUCCESS = "SEND_COMMENT_OK"; //Request public static final int REQUEST_CODE_WRITE_FORWARD = 2; public static final int REQUEST_CODE_WRITE_STATUS = 3; /** * Settings */ public static final String SETTING_ITEM_CONTENT = "setting_item_content"; //jpush public static final String EXTRA_JPUSH_MESSAGE = "extra_jpush_message"; public static final String SERVICE_MESSAGE = "com.xhy.weibo.service.MessageService"; //WebView public static final String EXTRA_URL = "extra_url"; public static final String EXTRA_TITLE = "extra_browser"; }
{ "content_hash": "26cff3fcff8612cf14aec67946615df6", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 88, "avg_line_length": 30.76388888888889, "alnum_prop": 0.6961625282167043, "repo_name": "xuhaoyang/Weibo", "id": "57e343d3de198ab4dab3840952a45deb15957e80", "size": "2243", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/src/main/java/com/xhy/weibo/utils/Constants.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "682766" } ], "symlink_target": "" }
/* * ModeShape (http://www.modeshape.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.modeshape.web; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author kulikov */ public class BackupExportServlet extends HttpServlet { private static final long serialVersionUID = 1L; @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { File file = new File("zzz"); if (!file.exists()) { throw new FileNotFoundException(file.getAbsolutePath()); } File zipFile = new File("bak.zip"); ZipHelper zip = new ZipHelper(); zip.zipDir(new File("zzz").getAbsolutePath(), zipFile.getAbsolutePath()); response.setHeader("Content-Type", "application/zip"); response.setHeader("Content-Length", String.valueOf(file.length())); response.setHeader("Content-disposition", "attachment;filename=\"bak.zip\""); BufferedInputStream bis = new BufferedInputStream(new FileInputStream(zipFile)); BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); byte[] buf = new byte[1024]; while (true) { int length = bis.read(buf); if (length == -1) { break; } bos.write(buf, 0, length); } bos.flush(); bos.close(); bis.close(); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { doGet(request, response); } } class ZipHelper { public void zipDir(String dirName, String nameZipFile) throws IOException { ZipOutputStream zip = null; FileOutputStream fW = null; fW = new FileOutputStream(nameZipFile); zip = new ZipOutputStream(fW); addFolderToZip("", dirName, zip); zip.close(); fW.close(); } private void addFolderToZip(String path, String srcFolder, ZipOutputStream zip) throws IOException { File folder = new File(srcFolder); if (folder.list().length == 0) { addFileToZip(path, srcFolder, zip, true); } else { for (String fileName : folder.list()) { if (path.equals("")) { addFileToZip(folder.getName(), srcFolder + "/" + fileName, zip, false); } else { addFileToZip(path + "/" + folder.getName(), srcFolder + "/" + fileName, zip, false); } } } } private void addFileToZip(String path, String srcFile, ZipOutputStream zip, boolean flag) throws IOException { File folder = new File(srcFile); if (flag) { zip.putNextEntry(new ZipEntry(path + "/" + folder.getName() + "/")); } else { if (folder.isDirectory()) { addFolderToZip(path, srcFile, zip); } else { byte[] buf = new byte[1024]; int len; FileInputStream in = new FileInputStream(srcFile); zip.putNextEntry(new ZipEntry(path + "/" + folder.getName())); while ((len = in.read(buf)) > 0) { zip.write(buf, 0, len); } } } } }
{ "content_hash": "39a8ccb864399dc1005ae643e7c0c36e", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 114, "avg_line_length": 34.274193548387096, "alnum_prop": 0.6129411764705882, "repo_name": "flownclouds/modeshape", "id": "e9a86c9c3112ca338854e6dcd1eadff575a0cc05", "size": "4250", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "web/modeshape-web-explorer/src/main/java/org/modeshape/web/BackupExportServlet.java", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
""" Based on script by CCL Forensics """ import sys import os import os.path as path sys.path.append('/usr/local/munki/munkireportlib') import re import ccl_asldb import json import platform # Event Type strings to array position logformat 1 EVENTS = { 'filesharing.sessions.afp': 0, 'filesharing.sessions.smb': 1, 'caching.bytes.fromcache.toclients': 2, 'caching.bytes.fromorigin.toclients': 3, 'caching.bytes.frompeers.toclients': 4, 'system.cpu.utilization.user': 5, 'system.memory.physical.wired': 6, 'system.memory.physical.active': 7, 'system.cpu.utilization.idle': 8, 'system.memory.physical.free': 9, 'system.network.throughput.bytes.in': 10, 'system.memory.pressure': 11, 'system.cpu.utilization.system': 12, 'system.network.throughput.bytes.out': 13, 'system.cpu.utilization.nice': 14, 'system.memory.physical.inactive': 15} # Event Type strings to array position - logformat 0 FMT_PREV = { 'NetBytesInPerSecond': 10, 'NetBytesOutPerSecond': 13, 'UserCPU': 5, 'IdleCPU': 8, 'SystemCPU': 12, 'PhysicalMemoryInactive': 15, 'PhysicalMemoryActive': 7, 'PhysicalMemoryFree': 9, 'PhysicalMemoryWired': 6 } def getOsVersion(): """Returns the minor OS version.""" os_version_tuple = platform.mac_ver()[0].split('.') return int(os_version_tuple[1]) def __main__(): debug = False # Skip manual check if len(sys.argv) > 1: if sys.argv[1] == 'manualcheck': print 'Manual check: skipping' exit(0) if sys.argv[1] == 'debug': print '******* DEBUG MODE ********' debug = True # Determine logformat based on OS version logFormat = 1 if getOsVersion() < 10: logFormat = 0 if getOsVersion() >= 11: #If on 10.11 or higher, skip rest of this script return # Set path according to logformat if logFormat == 0: input_dir = '/var/log/performance/' else: input_dir = '/var/log/servermetricsd/' output_file_path = '/usr/local/munki/preflight.d/cache/servermetrics.json' out = {} if os.path.isdir(input_dir): for file_path in os.listdir(input_dir): file_path = path.join(input_dir, file_path) if debug: print("Reading: \"{0}\"".format(file_path)) try: f = open(file_path, "rb") except IOError as e: if debug: print("Couldn't open file {0} ({1}). Skipping this file".format(file_path, e)) continue try: db = ccl_asldb.AslDb(f) except ccl_asldb.AslDbError as e: if debug: print("Couldn't open file {0} ({1}). Skipping this file".format(file_path, e)) f.close() continue timestamp = '' for record in db: if debug: print "%s %s" % (record.timestamp, record.message.decode('UTF-8')) # print(record.key_value_dict); fmt_timestamp = record.timestamp.strftime('%Y-%m-%d %H:%M:%S') if fmt_timestamp != timestamp: timestamp = fmt_timestamp out[timestamp] = [0]*16 if logFormat == 0: for key in record.key_value_dict: #print "%s %s" % (key, record.key_value_dict[key]) # Look up key in index index = FMT_PREV.get(key, -1) if index >= 0: try: val = float(record.key_value_dict[key]) if 'CPU' in key: # correct cpu usage (has to be a fraction) val = val / 100 elif 'Memory' in key: # correct memory usage val = val * 4096 out[timestamp][index] = val except ValueError as e: continue elif logFormat == 1: key_val = [x.strip() for x in record.message.split(':')] index = EVENTS.get(key_val[0], -1) if index >= 0: try: out[timestamp][index] = float(key_val[1]) except ValueError as e: continue f.close() else: if debug: print "Log directory %s not found" % input_dir # Open and write output output = open(output_file_path, "w") output.write(json.dumps(out)) output.close() if __name__ == "__main__": __main__()
{ "content_hash": "a1d9e1078844d99b84063e3a50f7b3eb", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 98, "avg_line_length": 33.48, "alnum_prop": 0.48845081640780563, "repo_name": "poundbangbash/munkireport-php", "id": "a7e6ca4cd5305025d8a8f76581ef9503e3781e1c", "size": "5045", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "app/modules/servermetrics/scripts/servermetrics.py", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "12437" }, { "name": "HTML", "bytes": "709" }, { "name": "JavaScript", "bytes": "98453" }, { "name": "PHP", "bytes": "1759583" }, { "name": "Python", "bytes": "155305" }, { "name": "Shell", "bytes": "94719" } ], "symlink_target": "" }
ACCEPTED #### According to Index Fungorum #### Published in null #### Original name Leptosphaeria staticicola Unamuno ### Remarks null
{ "content_hash": "d142c75b2487f9a025cd8b4621944c04", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 33, "avg_line_length": 10.615384615384615, "alnum_prop": 0.7318840579710145, "repo_name": "mdoering/backbone", "id": "063f9905bb562caf1da70d17955b2153310b2da7", "size": "195", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "life/Fungi/Ascomycota/Dothideomycetes/Pleosporales/Leptosphaeriaceae/Leptosphaeria/Leptosphaeria staticicola/README.md", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
<?php namespace johnitvn\rbacplus\models; use Yii; use yii\data\ActiveDataProvider; use johnitvn\rbacplus\Module; /** * @author John Martin <john.itvn@gmail.com> * @since 1.0.0 * */ class AssignmentSearch extends \yii\base\Model { /** * @var Module $rbacModule */ protected $rbacModule; /** * * @var mixed $id */ public $id; /** * * @var string $login */ public $login; /** * @inheritdoc */ public function init() { parent::init(); $this->rbacModule = Yii::$app->getModule('rbac'); } /** * @inheritdoc */ public function rules() { return [ [['id', 'login'], 'safe'], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => Yii::t('rbac', 'ID'), 'login' => $this->rbacModule->userModelLoginFieldLabel, ]; } /** * Create data provider for Assignment model. */ public function search() { $query = call_user_func($this->rbacModule->userModelClassName . "::find"); $dataProvider = new ActiveDataProvider([ 'query' => $query, ]); $params = Yii::$app->request->getQueryParams(); if (!($this->load($params) && $this->validate())) { return $dataProvider; } $query->andFilterWhere([$this->usersModule->userModelIdField => $this->id]); $query->andFilterWhere(['like', $this->rbacModule->userModelLoginField, $this->login]); return $dataProvider; } }
{ "content_hash": "85e47ca458c771e444efc0405b7066d2", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 95, "avg_line_length": 20.3125, "alnum_prop": 0.5175384615384615, "repo_name": "riteshsingh1/advanced", "id": "5773f7547b7a4e8c3f84168a0ac196be90ed1b70", "size": "1625", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "vendor/johnitvn/yii2-rbac-plus/src/models/AssignmentSearch.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Batchfile", "bytes": "1541" }, { "name": "CSS", "bytes": "18060" }, { "name": "HTML", "bytes": "52572" }, { "name": "JavaScript", "bytes": "42030" }, { "name": "PHP", "bytes": "794154" } ], "symlink_target": "" }
$(function() { var leftSpace; function windowSizeChange() { var wSize=window.innerWidth; var jamAreaWidth=600; // .jamArea.width leftSpace=(wSize-jamAreaWidth)/2; $('<img />').knob({ id: 'knob01', image: 'jqskin/images/strat.png', left: leftSpace+500, top: 810, width: 80, height: 80, value: 70, change: ( function() { var val = Math.floor($(this).knob("value") / 10); document.getElementById("volumeText").innerHTML=val; sj.setVolume(val/10); }) }).appendTo('#volumeKnob'); $('<img />').knob({ id: 'knob01', image: 'jqskin/images/org_amp.png', left: leftSpace+400, top: 823, width: 64, height: 64, value: 20, change: ( function() { var val = Math.floor($(this).knob("value") / 10); val = val/10; document.getElementById("delayText").innerHTML=val; sj.setDelay(val); }) }).appendTo('#delayKnob'); } window.onresize=function() { document.getElementById("delayKnob").innerHTML=""; document.getElementById("volumeKnob").innerHTML=""; windowSizeChange(); }; windowSizeChange(); });
{ "content_hash": "a45d718c8b45ea4447eb21b4bc1494b0", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 76, "avg_line_length": 33.166666666666664, "alnum_prop": 0.4852835606604451, "repo_name": "ryoyakawai/speechJammerPlus", "id": "0a0c2661806d730892f2736b4133c64346a59cf7", "size": "1402", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "js/ctrlKnob.js", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2245" }, { "name": "JavaScript", "bytes": "28510" } ], "symlink_target": "" }
/* * http://www.mycodes.net */ // variables var $win = $(window); var clientWidth = $win.width(); var clientHeight = $win.height(); $(window).resize(function() { var newWidth = $win.width(); var newHeight = $win.height(); if (newWidth != clientWidth && newHeight != clientHeight) { location.replace(location); } }); (function($) { $.fn.typewriter = function() { this.each(function() { var $ele = $(this), str = $ele.html(), progress = 0; $ele.html(''); var timer = setInterval(function() { var current = str.substr(progress, 1); if (current == '<') { progress = str.indexOf('>', progress) + 1; } else { progress++; } $ele.html(str.substring(0, progress) + (progress & 1 ? '_' : '')); if (progress >= str.length) { clearInterval(timer); } }, 75); }); return this; }; })(jQuery); function timeElapse(date){ var current = Date(); var seconds = (Date.parse(current) - Date.parse(date)) / 1000; var days = Math.floor(seconds / (3600 * 24)); seconds = seconds % (3600 * 24); var hours = Math.floor(seconds / 3600); if (hours < 10) { hours = "0" + hours; } seconds = seconds % 3600; var minutes = Math.floor(seconds / 60); if (minutes < 10) { minutes = "0" + minutes; } seconds = seconds % 60; if (seconds < 10) { seconds = "0" + seconds; } var result = "第 <span class=\"digit\">" + days + "</span> 天 <span class=\"digit\">" + hours + "</span> 小时 <span class=\"digit\">" + minutes + "</span> 分钟 <span class=\"digit\">" + seconds + "</span> 秒"; $("#clock").html(result); }
{ "content_hash": "49b4b5bef121397cc1800496bd4f1b20", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 204, "avg_line_length": 27.35, "alnum_prop": 0.5484460694698354, "repo_name": "liwenbin1991/liwenbin1991.github.io", "id": "c40c7541ef4f384ab90b2886dcf97de5538724df", "size": "1655", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "works/love/renxi/functions.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "29435" }, { "name": "HTML", "bytes": "38988" }, { "name": "JavaScript", "bytes": "125467" } ], "symlink_target": "" }
<?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" > <objectAnimator android:duration="80" android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:propertyName="scaleX" android:valueFrom="1.1" android:valueTo="1.0" android:valueType="floatType" /> <objectAnimator android:duration="80" android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:propertyName="scaleY" android:valueFrom="1.1" android:valueTo="1.0" android:valueType="floatType" /> </set>
{ "content_hash": "e98f9d87575a4ff6f63f215e381d1bc3", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 79, "avg_line_length": 35.421052631578945, "alnum_prop": 0.6389301634472511, "repo_name": "cheyiliu/test4android", "id": "ee301f92dd6cd2d9a93e7966746282d37640c27b", "size": "673", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "res/animator/tv_zoom_out.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "271" }, { "name": "C++", "bytes": "1218" }, { "name": "CSS", "bytes": "1679" }, { "name": "Java", "bytes": "865752" } ], "symlink_target": "" }
package blobserver import ( "fmt" "sync" "github.com/simonz05/blobserver/config" ) // A StorageConstructor returns a Storage implementation from a configuration. type StorageConstructor func(*config.Config) (Storage, error) var mapLock sync.Mutex var storageConstructors = make(map[string]StorageConstructor) func RegisterStorageConstructor(typ string, ctor StorageConstructor) { mapLock.Lock() defer mapLock.Unlock() if _, ok := storageConstructors[typ]; ok { panic("blobserver: StorageConstructor already registered for type: " + typ) } storageConstructors[typ] = ctor } func CreateStorage(config *config.Config) (Storage, error) { mapLock.Lock() ctor, ok := storageConstructors[config.StorageType()] mapLock.Unlock() if !ok { return nil, fmt.Errorf("Storage type %s not known or loaded", config.StorageType()) } return ctor(config) }
{ "content_hash": "5b92f918047eb1af5de178133ca94b3e", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 85, "avg_line_length": 24.65714285714286, "alnum_prop": 0.7543453070683661, "repo_name": "simonz05/blobserver", "id": "63c4c121744bb105a0e40f9d917712de6e866f1e", "size": "1471", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "registry.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "76962" }, { "name": "Shell", "bytes": "285" } ], "symlink_target": "" }
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. using Microsoft.Azure.KeyVault; using Microsoft.Azure.Management.HDInsight.Models; using Microsoft.Azure.Test.HttpRecorder; using Microsoft.IdentityModel.Clients.ActiveDirectory; using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; using System.Threading.Tasks; using Xunit; using HDInsightStorageAccount = Microsoft.Azure.Management.HDInsight.Models.StorageAccount; namespace Management.HDInsight.Tests { /// <summary> /// Test utilities /// </summary> public static class HDInsightManagementTestUtilities { /// <summary> /// Validate cluster /// </summary> /// <param name="expectedClustername"></param> /// <param name="expectedParameters"></param> /// <param name="actualCluster"></param> public static void ValidateCluster(string expectedClustername, ClusterCreateParametersExtended expectedParameters, Cluster actualCluster) { Assert.Equal(expectedClustername, actualCluster.Name); Assert.Equal(expectedParameters.Properties.Tier, actualCluster.Properties.Tier, ignoreCase:true); Assert.NotNull(actualCluster.Etag); Assert.EndsWith(expectedClustername, actualCluster.Id); Assert.Equal("Running", actualCluster.Properties.ClusterState); Assert.Equal("Microsoft.HDInsight/clusters", actualCluster.Type); Assert.Equal(expectedParameters.Location, actualCluster.Location); Assert.Equal(expectedParameters.Tags, actualCluster.Tags); Assert.Equal(1, actualCluster.Properties.ConnectivityEndpoints.Count(c => c.Name.Equals("HTTPS", StringComparison.OrdinalIgnoreCase))); Assert.Equal(1, actualCluster.Properties.ConnectivityEndpoints.Count(c => c.Name.Equals("SSH", StringComparison.OrdinalIgnoreCase))); Assert.Equal(expectedParameters.Properties.OsType, actualCluster.Properties.OsType); Assert.Null(actualCluster.Properties.Errors); Assert.Equal(HDInsightClusterProvisioningState.Succeeded, actualCluster.Properties.ProvisioningState); Assert.Equal(expectedParameters.Properties.ClusterDefinition.Kind, actualCluster.Properties.ClusterDefinition.Kind); Assert.Equal(expectedParameters.Properties.ClusterVersion, actualCluster.Properties.ClusterVersion.Substring(0, 3)); Assert.Null(actualCluster.Properties.ClusterDefinition.Configurations); } /// <summary> /// Validate gateway settings /// </summary> /// <param name="expectedUserName"></param> /// <param name="expectedUserPassword"></param> /// <param name="actualGatewaySettings"></param> public static void ValidateGatewaySettings(string expectedUserName, string expectedUserPassword, GatewaySettings actualGatewaySettings) { Assert.NotNull(actualGatewaySettings); Assert.Equal("true", actualGatewaySettings.IsCredentialEnabled); Assert.Equal(expectedUserName, actualGatewaySettings.UserName); Assert.Equal(expectedUserPassword, actualGatewaySettings.Password); } /// <summary> /// Validate auto scale configuration /// </summary> /// <param name="expectedAutoscaleConfiguration"></param> /// <param name="actualAutoscaleConfiguration"></param> public static void ValidateAutoScaleConfig(Autoscale expectedAutoscaleConfiguration, Autoscale actualAutoscaleConfiguration) { Assert.NotNull(actualAutoscaleConfiguration); if (actualAutoscaleConfiguration.Capacity != null && expectedAutoscaleConfiguration.Capacity != null) { Assert.Equal(expectedAutoscaleConfiguration.Capacity.MinInstanceCount, actualAutoscaleConfiguration.Capacity.MinInstanceCount); Assert.Equal(expectedAutoscaleConfiguration.Capacity.MaxInstanceCount, actualAutoscaleConfiguration.Capacity.MaxInstanceCount); } else { Assert.Equal(expectedAutoscaleConfiguration.Capacity, actualAutoscaleConfiguration.Capacity); } if (actualAutoscaleConfiguration.Recurrence != null && expectedAutoscaleConfiguration.Recurrence != null) { Assert.Equal(expectedAutoscaleConfiguration.Recurrence.TimeZone, actualAutoscaleConfiguration.Recurrence.TimeZone); Assert.NotNull(expectedAutoscaleConfiguration.Recurrence.Schedule); Assert.NotNull(actualAutoscaleConfiguration.Recurrence.Schedule); Assert.Equal(expectedAutoscaleConfiguration.Recurrence.Schedule.Count, actualAutoscaleConfiguration.Recurrence.Schedule.Count); Assert.NotEmpty(expectedAutoscaleConfiguration.Recurrence.Schedule); for (int i = 0; i < expectedAutoscaleConfiguration.Recurrence.Schedule.Count; i++) { var expectedSchedule = expectedAutoscaleConfiguration.Recurrence.Schedule[i]; var actualSchedule = actualAutoscaleConfiguration.Recurrence.Schedule[i]; Assert.Equal(expectedSchedule.Days, actualSchedule.Days); Assert.NotNull(expectedSchedule.TimeAndCapacity); Assert.NotNull(actualSchedule.TimeAndCapacity); Assert.Equal(expectedSchedule.TimeAndCapacity.Time, actualSchedule.TimeAndCapacity.Time); Assert.Equal(expectedSchedule.TimeAndCapacity.MinInstanceCount, actualSchedule.TimeAndCapacity.MinInstanceCount); /* * Note: You may find that we don't compare expectedSchedule.TimeAndCapacity.MaxInstanceCount with actualSchedule.TimeAndCapacity.MaxInstanceCount here. * This is not an error. We do this intentionally. * The reason is that now RP will not make use of the parameter "expectedSchedule.TimeAndCapacity.MaxInstanceCount" when create cluster. * And the actualSchedule.TimeAndCapacity.MaxInstanceCount is equal with expectedSchedule.TimeAndCapacity.MinInstanceCount now. * We are not sure whether RP will change this design or not in the future. So We decided not to compare. */ } } else { Assert.Equal(expectedAutoscaleConfiguration.Recurrence, actualAutoscaleConfiguration.Recurrence); } } /// <summary> /// Create cluster create parameters for ADLS Gen1 relevant tests. /// </summary> /// <param name="commonData"></param> /// <param name="createParams"> /// If provided, the method will update the given parameters; /// Otherwise, a new create parameters will be created. /// </param> /// <returns></returns> public static ClusterCreateParametersExtended PrepareClusterCreateParamsForADLSv1(this CommonTestFixture commonData, ClusterCreateParametersExtended createParams = null) { var createParamsForADLSv1 = createParams ?? commonData.PrepareClusterCreateParams(); var configurations = (Dictionary<string, Dictionary<string, string>>)createParamsForADLSv1.Properties.ClusterDefinition.Configurations; string clusterIdentity = "clusterIdentity"; var clusterIdentityConfig = new Dictionary<string, string>() { { "clusterIdentity.applicationId", commonData.DataLakeClientId }, { "clusterIdentity.certificate", commonData.CertContent }, { "clusterIdentity.aadTenantId", "https://login.windows.net/" + commonData.TenantId }, { "clusterIdentity.resourceUri", "https://datalake.azure.net/" }, { "clusterIdentity.certificatePassword", commonData.CertPassword } }; configurations.Add(clusterIdentity, clusterIdentityConfig); bool isDefault = !createParamsForADLSv1.Properties.StorageProfile.Storageaccounts.Any(); if (isDefault) { string coreSite = "core-site"; var coreConfig = new Dictionary<string, string>() { { "fs.defaultFS", "adl://home" }, { "dfs.adls.home.hostname", commonData.DataLakeStoreAccountName + ".azuredatalakestore.net" }, { "dfs.adls.home.mountpoint", commonData.DataLakeStoreMountpoint } }; configurations.Add(coreSite, coreConfig); } return createParamsForADLSv1; } /// <summary> /// Create cluster create parameters for ADLS Gen2 relevant tests /// </summary> /// <param name="commonData"></param> /// <param name="storageAccountName"></param> /// <param name="storageResourceId"></param> /// <param name="msiResourceId"></param> /// <param name="createParams"></param> /// <returns></returns> public static ClusterCreateParametersExtended PrepareClusterCreateParamsForADLSv2( this CommonTestFixture commonData, string storageAccountName, string storageResourceId, string msiResourceId, ClusterCreateParametersExtended createParams = null) { var createParamsForADLSv2 = createParams ?? commonData.PrepareClusterCreateParams(); bool isDefault = !createParamsForADLSv2.Properties.StorageProfile.Storageaccounts.Any(); createParamsForADLSv2.Properties.StorageProfile.Storageaccounts.Add( new HDInsightStorageAccount { Name = storageAccountName + commonData.DfsEndpointSuffix, IsDefault = isDefault, FileSystem = commonData.ContainerName.ToLowerInvariant(), ResourceId = storageResourceId, MsiResourceId = msiResourceId } ); var identity = new ClusterIdentity { Type = ResourceIdentityType.UserAssigned, UserAssignedIdentities = new Dictionary<string, UserAssignedIdentity> { { msiResourceId, new UserAssignedIdentity() } } }; if (createParamsForADLSv2.Identity == null) { createParamsForADLSv2.Identity = identity; } else { // At this point, only user-assigned managed identity is supported by HDInsight. // So identity type is not checked. createParamsForADLSv2.Identity.UserAssignedIdentities.Union(identity.UserAssignedIdentities); } return createParamsForADLSv2; } /// <summary> /// Create cluster create parameters for WASB relevant tests. /// </summary> /// <param name="commonData"></param> /// <returns></returns> public static ClusterCreateParametersExtended PrepareClusterCreateParamsForWasb(this CommonTestFixture commonData) { return commonData.PrepareClusterCreateParams(commonData.StorageAccountName, commonData.StorageAccountKey); } /// <summary> /// Create cluster create parameters for WASB relevant tests. /// </summary> /// <param name="commonData"></param> /// <param name="storageAccountName"></param> /// <param name="storageAccountKey"></param> /// <returns></returns> private static ClusterCreateParametersExtended PrepareClusterCreateParams(this CommonTestFixture commonData, string storageAccountName = null, string storageAccountKey = null) { var storageAccounts = new List<HDInsightStorageAccount>(); if (storageAccountName != null) { storageAccounts.Add( new HDInsightStorageAccount { Name = storageAccountName + commonData.BlobEndpointSuffix, Key = storageAccountKey, Container = commonData.ContainerName.ToLowerInvariant(), IsDefault = true } ); } return new ClusterCreateParametersExtended { Location = commonData.Location, Properties = new ClusterCreateProperties { ClusterVersion = "3.6", OsType = OSType.Linux, Tier = Tier.Standard, ClusterDefinition = new ClusterDefinition { Kind = "Hadoop", Configurations = new Dictionary<string, Dictionary<string, string>>() { { "gateway", new Dictionary<string, string> { { "restAuthCredential.isEnabled", "true" }, { "restAuthCredential.username", commonData.ClusterUserName }, { "restAuthCredential.password", commonData.ClusterPassword } } } } }, ComputeProfile = new ComputeProfile { Roles = new List<Role> { new Role { Name = "headnode", TargetInstanceCount = 2, HardwareProfile = new HardwareProfile { VmSize = "Large" }, OsProfile = new OsProfile { LinuxOperatingSystemProfile = new LinuxOperatingSystemProfile { Username = commonData.SshUsername, Password = commonData.SshPassword } } }, new Role { Name = "workernode", TargetInstanceCount = 3, HardwareProfile = new HardwareProfile { VmSize = "Large" }, OsProfile = new OsProfile { LinuxOperatingSystemProfile = new LinuxOperatingSystemProfile { Username = commonData.SshUsername, Password = commonData.SshPassword } } }, new Role { Name = "zookeepernode", TargetInstanceCount = 3, HardwareProfile = new HardwareProfile { VmSize = "Small" }, OsProfile = new OsProfile { LinuxOperatingSystemProfile = new LinuxOperatingSystemProfile { Username = commonData.SshUsername, Password = commonData.SshPassword } } } } }, StorageProfile = new StorageProfile { Storageaccounts = storageAccounts } } }; } /// <summary> /// Determine whether the current test mode is record mode /// </summary> /// <returns></returns> public static bool IsRecordMode() { return HttpMockServer.Mode == HttpRecorderMode.Record; } /// <summary> /// Determine whether the current test mode is playback mode /// </summary> /// <returns></returns> public static bool IsPlaybackMode() { return HttpMockServer.Mode == HttpRecorderMode.Playback; } /// <summary> /// Get current subscription Id from test configurations(Environment variables). /// </summary> /// <returns></returns> public static string GetSubscriptionId() { string subscriptionId = null; if (IsRecordMode()) { var environment = TestEnvironmentFactory.GetTestEnvironment(); HttpMockServer.Variables[ConnectionStringKeys.SubscriptionIdKey] = environment.SubscriptionId; subscriptionId = environment.SubscriptionId; } else if (IsPlaybackMode()) { subscriptionId = HttpMockServer.Variables[ConnectionStringKeys.SubscriptionIdKey]; } return subscriptionId; } /// <summary> /// Get current tenant Id from test configurations(Environment variables). /// </summary> /// <returns></returns> public static string GetTenantId() { string tenantId = null; if (IsRecordMode()) { var environment = TestEnvironmentFactory.GetTestEnvironment(); HttpMockServer.Variables[ConnectionStringKeys.AADTenantKey] = environment.Tenant; tenantId = environment.Tenant; } else if (IsPlaybackMode()) { tenantId = HttpMockServer.Variables[ConnectionStringKeys.AADTenantKey]; } return tenantId; } /// <summary> /// Get service principal Id from test configurations(Environment variables). /// </summary> /// <returns></returns> public static string GetServicePrincipalId() { string servicePrincipalId = null; if (HttpMockServer.Mode == HttpRecorderMode.Record) { var environment = TestEnvironmentFactory.GetTestEnvironment(); HttpMockServer.Variables[ConnectionStringKeys.ServicePrincipalKey] = environment.ConnectionString.KeyValuePairs.GetValueUsingCaseInsensitiveKey(ConnectionStringKeys.ServicePrincipalKey); servicePrincipalId = HttpMockServer.Variables[ConnectionStringKeys.ServicePrincipalKey]; } else if (HttpMockServer.Mode == HttpRecorderMode.Playback) { servicePrincipalId = HttpMockServer.Variables[ConnectionStringKeys.ServicePrincipalKey]; } return servicePrincipalId; } /// <summary> /// Get service principal secret from test configurations(Environment variables). /// </summary> /// <returns></returns> public static string GetServicePrincipalSecret() { string servicePrincipalSecret = null; if (IsRecordMode()) { var environment = TestEnvironmentFactory.GetTestEnvironment(); servicePrincipalSecret = environment.ConnectionString.KeyValuePairs.GetValueUsingCaseInsensitiveKey(ConnectionStringKeys.ServicePrincipalSecretKey); } else if (IsPlaybackMode()) { servicePrincipalSecret = "xyz"; } return servicePrincipalSecret; } /// <summary> /// Get service principal object id from test configurations(Environment variables). /// </summary> /// <returns></returns> public static string GetServicePrincipalObjectId() { string servicePrincipalObjectId = null; if (IsRecordMode()) { var environment = TestEnvironmentFactory.GetTestEnvironment(); HttpMockServer.Variables[ConnectionStringKeys.AADClientIdKey] = environment.ConnectionString.KeyValuePairs.GetValueUsingCaseInsensitiveKey(ConnectionStringKeys.AADClientIdKey); servicePrincipalObjectId = HttpMockServer.Variables[ConnectionStringKeys.AADClientIdKey]; } else if (IsPlaybackMode()) { servicePrincipalObjectId = HttpMockServer.Variables[ConnectionStringKeys.AADClientIdKey]; } return servicePrincipalObjectId; } /// <summary> /// Create a key vault client /// </summary> /// <returns></returns> public static KeyVaultClient GetKeyVaultClient() { return new KeyVaultClient(GetAccessToken, GetHandlers()); } /// <summary> /// Get access token /// </summary> /// <param name="authority"></param> /// <param name="resource"></param> /// <param name="scope"></param> /// <returns></returns> public static async Task<string> GetAccessToken(string authority, string resource, string scope) { string accessToken = null; if (IsRecordMode()) { var context = new AuthenticationContext(authority, TokenCache.DefaultShared); string authClientId = GetServicePrincipalId(); string authSecret = GetServicePrincipalSecret(); var clientCredential = new ClientCredential(authClientId, authSecret); var result = await context.AcquireTokenAsync(resource, clientCredential).ConfigureAwait(false); accessToken = result.AccessToken; } else if (IsPlaybackMode()) { accessToken = "fake-token"; } return accessToken; } /// <summary> /// Get delegating handlers /// </summary> /// <returns></returns> public static DelegatingHandler[] GetHandlers() { HttpMockServer server = HttpMockServer.CreateInstance(); return new DelegatingHandler[] { server }; } } }
{ "content_hash": "1f4afd8f922828d07fde45bf435f59a3", "timestamp": "", "source": "github", "line_count": 492, "max_line_length": 202, "avg_line_length": 46.9349593495935, "alnum_prop": 0.5706738264333968, "repo_name": "Azure/azure-sdk-for-net", "id": "f438a351fad453d44180f055b45db18bb2ca9fc2", "size": "23094", "binary": false, "copies": "2", "ref": "refs/heads/main", "path": "sdk/hdinsight/Microsoft.Azure.Management.HDInsight/tests/TestHelpers/HDInsightManagementTestUtilities.cs", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
package org.shaf.shell.view; import org.junit.runner.RunWith; import org.junit.runners.Suite; /** * The class {@code TestPackage4ShellView} builds a suite that can be used to * run all of the tests within its package as well as within any subpackages of * its package. * * @author Mykola Galushka */ @RunWith(Suite.class) @Suite.SuiteClasses({ ProgressViewTest.class, StructuredViewTest.class, UnstructuredViewTest.class, ConfigurationViewTest.class, MapViewTest.class, CollectionViewTest.class }) public class TestPackage4ShellView { }
{ "content_hash": "a463c8cb7b63b501ffe96ab82fa71504", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 79, "avg_line_length": 29, "alnum_prop": 0.7767695099818511, "repo_name": "SHAF-WORK/shaf", "id": "1f598b35829b896934f1c8f099687c4f9697b64d", "size": "1152", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "shell/src/test/java/org/shaf/shell/view/TestPackage4ShellView.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "9550" }, { "name": "Java", "bytes": "1471340" }, { "name": "JavaScript", "bytes": "7370" }, { "name": "Shell", "bytes": "6433" } ], "symlink_target": "" }
module Spree class Feature < ActiveRecord::Base belongs_to :featureable, polymorphic: true has_one :image, -> { order(:position) }, as: :viewable, dependent: :destroy, class_name: "Spree::Image" accepts_nested_attributes_for :image, reject_if: lambda {|attributes| attributes['attachment'].blank? and attributes['id'].blank?}, allow_destroy: true before_save :set_sort_order default_scope -> { order('sort_order asc') } private def set_sort_order sort_order = featureable.features.size if sort_order.blank? end end end
{ "content_hash": "ef50e1c5f175e3389a90e37ec959dae8", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 155, "avg_line_length": 30.105263157894736, "alnum_prop": 0.6800699300699301, "repo_name": "kohactive/spree_featureable", "id": "dd4981170b60083a4b707fbc643bb617e8a2ab69", "size": "572", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/models/spree/feature.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "1349" }, { "name": "JavaScript", "bytes": "52" }, { "name": "Ruby", "bytes": "10191" } ], "symlink_target": "" }
import os import dj_database_url from decouple import config BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) ALLOWED_HOSTS = ['*'] SECRET_KEY = config('SECRET_KEY') EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' # Application definition DATABASES = { 'default': {} } INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', # Apps 'core', 'accounts', 'contact', # Libs 'widget_tweaks', ] MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] ROOT_URLCONF = '{{ project_name }}.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ] WSGI_APPLICATION = '{{ project_name }}.wsgi.application' AUTH_USER_MODEL = 'accounts.User' RECIPIENT_EMAIL = config('RECIPIENT_EMAIL', default='recipient@{{ project_name }}.com') # Internationalization # https://docs.djangoproject.com/en/1.11/topics/i18n/ LANGUAGE_CODE = 'pt-br' TIME_ZONE = 'America/Recife' USE_I18N = True USE_L10N = True USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.11/howto/static-files/ STATIC_URL = '/static/' STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), ]
{ "content_hash": "0aebfb2cf3ff0a2b419e07adb58ec63f", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 87, "avg_line_length": 24.402298850574713, "alnum_prop": 0.6655675930287329, "repo_name": "citiufpe/citi-webplate", "id": "dbb34b5ec58e2c241a5953e57c1b6f7ec7002936", "size": "2123", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "project_name/settings/base.py", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "2257" }, { "name": "JavaScript", "bytes": "1270" }, { "name": "Python", "bytes": "12004" }, { "name": "Shell", "bytes": "1611" } ], "symlink_target": "" }
//BloxManager.cs //Created on 01/05/2014 //Last Updated on 20/05/2014 //Version 0.84 //Weyns Peter //Email any bugs to projecteasyblox@gemail.com or request features //Comments: //This class is used to create the editor window and for manipulating the blox texture, spawning. using UnityEngine; using UnityEditor; using System.Collections; public class BloxManager : EditorWindow { GameObject __BloxManager; GameObject[] allBlox; Object prefabRoot; private Blox thisBlox; [MenuItem("Easy Blox/Blox Manager")] static void Init() { BloxManager window = (BloxManager)EditorWindow.GetWindow (typeof (BloxManager)); window.name = "Easy Blox Manager"; } private void PlaceNewBlox(float pos_x,float pos_y,float pos_z) { GameObject obj = null; prefabRoot = (GameObject)Instantiate(Resources.Load("Prefabs/Blox")); if (prefabRoot != null) { PrefabUtility.InstantiatePrefab(prefabRoot); if (thisBlox.name == "Completed") { obj = GameObject.Find("Blox(Clone)"); obj.name = "Master"; } else { obj = GameObject.Find("Blox(Clone)"); obj.name = "Selected"; } Selection.activeGameObject = obj; } else { Debug.Log("Could not place a new Blox,does the directory Prefabs/Blox/ contain the prefab called Blox?"); } if (thisBlox.name != "Master") thisBlox.name = "Completed"; Transform root = thisBlox.transform.root; SetNewBloxPosition(root,obj,pos_x,pos_y,pos_z); } private void SetNewBloxPosition(Transform root, GameObject obj, float pos_x,float pos_y,float pos_z) { Blox newBlox = (Blox)obj.GetComponent<Blox>(); //we copy the current attributes and apply them to the new blox object and then made a call to have it rendered newBlox.MyBloxMeshCategoryID = thisBlox.MyBloxMeshCategoryID; newBlox.MyBloxMeshID = thisBlox.MyBloxMeshID; newBlox.DoRender = true; newBlox.RenderMyTexture(); //Check to see if we have a root called Master and if we do, we assign this new blox as a child object if (root.name == "Master") newBlox.transform.parent = root; //we count all the blox in the scene and assign it a new ID newBlox.MyBloxID = GameObject.FindGameObjectsWithTag("Blox").Length; //if this blox has been turned into a wall, depending on that we may need to shift the blox height if (thisBlox.IsWall != true) newBlox.SetMyXPosition(thisBlox.transform.position.x + pos_x, thisBlox.transform.position.y + pos_y, thisBlox.transform.position.z + pos_z); else newBlox.SetMyXPosition(thisBlox.transform.position.x + pos_x, thisBlox.transform.position.y + pos_y -1.5f , thisBlox.transform.position.z + pos_z); } private void GoBackOrGoNext(string sign) { var cnt = 1; allBlox = GameObject.FindGameObjectsWithTag("Blox"); foreach(GameObject blox in allBlox) { bool bloxIdToFind; if (sign == "+") bloxIdToFind = FindThisBlox(thisBlox.MyBloxID + cnt); //returns true or false as a check to see if the next blox actually excists, else //if it does not we need to add +1 to the counter cnt bloxIdToFind = FindThisBlox(thisBlox.MyBloxID - cnt); //If we cant find a block with the ID we searched for we add +1 to the counter and we look again, until we find it if (bloxIdToFind == false) { cnt++; } if (sign == "+") { if (blox.GetComponent<Blox>().MyBloxID == (thisBlox.MyBloxID + cnt)) Selection.activeGameObject = blox; } else { if (blox.GetComponent<Blox>().MyBloxID == (thisBlox.MyBloxID - cnt)) Selection.activeGameObject = blox; } BloxSelection(blox); } } //We look for a blox to excist to transit towards, true it excists, false it does not private bool FindThisBlox(int id) { allBlox = GameObject.FindGameObjectsWithTag("Blox"); foreach(GameObject blox in allBlox) { if (blox.GetComponent<Blox>().MyBloxID == id) { return true; } } return false; } private void BloxSelection(GameObject cube) { if (thisBlox.name != "Master") thisBlox.name = "Completed"; if (cube.name != "Master") cube.name = "Selected"; } //Everything about OnGUI void OnGUI() { GUILayout.BeginVertical("Box"); BloxControls(); Options(); BloxEditor(); GUILayout.EndVertical(); } private void CheckForBloxManager() { var blmanager = GameObject.Find("__BloxManager"); if (blmanager != true) { __BloxManager = (GameObject)Instantiate(Resources.Load("Prefabs/__BloxManager")); __BloxManager.name = "__BloxManager"; } } private void Options() { GUILayout.BeginHorizontal("Box"); GUILayout.Label("Blox Options"); GUILayout.EndHorizontal(); if (GUILayout.Button("Player Spawn Location", GUILayout.Width(260))) { if (thisBlox != null) { CheckForOtherspawnPoints(); //reset all spawnpoints thisBlox.IsSpawnPoint = !thisBlox.IsSpawnPoint; } } } //##On Gui related items private void BloxControls() { //We place a new Master Blox if none excists if (GUILayout.Button("Place Master Blox", GUILayout.Width(260))) { //We check to see of this scene has a BloxManager before proceeding CheckForBloxManager(); var masterBlox = GameObject.Find("Master"); if (masterBlox != null) { Debug.Log("We already have a Master Blox on this scene, cannot spawn a second"); } else { prefabRoot = (GameObject)Instantiate(Resources.Load("Prefabs/Blox")); if (prefabRoot != null) { PrefabUtility.InstantiatePrefab(prefabRoot); GameObject.Find("Blox(Clone)").name = "Master"; Selection.activeGameObject = GameObject.Find("Master"); Selection.activeGameObject.GetComponent<Blox>().RenderMyTexture(); } else { Debug.Log("Does the directory Resources/Prefabs/ contain a Prefab called Blox?"); } } } } private void BloxEditor() { if (Selection.activeGameObject) { var myGameObject = Selection.activeGameObject; thisBlox = myGameObject.GetComponent<Blox>(); } GUILayout.Label("Go back or next -> blox "); if (thisBlox != null) { GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("Back")) { GoBackOrGoNext("-"); } GUILayout.Label(" ID " + thisBlox.MyBloxID,GUILayout.Width(60)); if (GUILayout.Button("Next")) { GoBackOrGoNext("+"); } GUILayout.EndHorizontal(); //GUILayout.BeginHorizontal("Box"); //Disabled, for testing purposes only // EditorGUILayout.Toggle(thisBlox._xPositive); // EditorGUILayout.Toggle(thisBlox._xNegative); // EditorGUILayout.Toggle(thisBlox._zPositive); // EditorGUILayout.Toggle(thisBlox._zNegative); //GUILayout.EndHorizontal(); GUILayout.BeginVertical("Box"); GUILayout.Label("New Blox Placement Menu"); GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("+")) { if (thisBlox._xPositive == false) { PlaceNewBlox(+1,0,0); } else { Debug.Log ("There is already a Blox at that location!"); } } GUILayout.Label(" X-Axis ",GUILayout.Width(60)); if (GUILayout.Button("-")) { if (thisBlox._xNegative == false) { PlaceNewBlox(-1,0,0); } else { Debug.Log ("There is already a Blox at that location!"); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("+")) { if (thisBlox._zPositive == false) { PlaceNewBlox(0,0,+1); } else { Debug.Log ("There is already a Blox at that location!"); } } GUILayout.Label(" Z-Axis ",GUILayout.Width(60)); if (GUILayout.Button("-")) { if (thisBlox._zNegative == false) { PlaceNewBlox(0,0,-1); } else { Debug.Log ("There is already a Blox at that location!"); } } GUILayout.EndHorizontal(); GUILayout.EndVertical(); //Mesh Renderer GUI parts GUILayout.BeginVertical("Box"); GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("<<",GUILayout.Width(25))) { if (thisBlox.MyBloxMeshCategoryID > 0) thisBlox.MyBloxMeshCategoryID--; thisBlox.MyBloxMeshID = 0; thisBlox.DoRender = true; thisBlox.RenderMyTexture(); } GUILayout.Box(thisBlox.texManager.GetClassName(thisBlox.MyBloxMeshCategoryID),GUILayout.Width(175)); if (GUILayout.Button(">>",GUILayout.Width(25))) { if (thisBlox.MyBloxMeshCategoryID < thisBlox.texManager.arrayNames.Length -1) thisBlox.MyBloxMeshCategoryID++; thisBlox.MyBloxMeshID = 0; thisBlox.DoRender = true; thisBlox.RenderMyTexture(); } GUILayout.EndVertical(); //Mesh Selection GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("<<",GUILayout.Height(100))) { if (thisBlox.MyBloxMeshID > 0) thisBlox.MyBloxMeshID--; thisBlox.DoRender = true; thisBlox.RenderMyTexture(); } GUILayout.Box(thisBlox.texManager.GetTexture(thisBlox.MyBloxMeshCategoryID,thisBlox.MyBloxMeshID),GUILayout.Height(100),GUILayout.Width(100)); if (GUILayout.Button(">>", GUILayout.Height(100))) { if (thisBlox.MyBloxMeshID < thisBlox.texManager.GetArrayLength(thisBlox.MyBloxMeshCategoryID,thisBlox.MyBloxMeshID)) thisBlox.MyBloxMeshID++; thisBlox.DoRender = true; thisBlox.RenderMyTexture(); } GUILayout.EndHorizontal(); GUILayout.EndHorizontal(); BloxCombine(); } } //We look through allblox to see if there are any cubes that pose as a spawnpoint for the player private void CheckForOtherspawnPoints() { allBlox = GameObject.FindGameObjectsWithTag("Blox"); foreach(GameObject blox in allBlox) { blox.GetComponent<Blox>().IsSpawnPoint = false; } } private void BloxCombine() { GUILayout.BeginHorizontal("Box"); if (GUILayout.Button("Combine Bloxes")) { Selection.activeGameObject = GameObject.Find("Master"); if (thisBlox.name == "Master") { thisBlox.name = "Completed"; thisBlox.CombineMeshes(); } } GUILayout.EndHorizontal(); } } // // //private void SetNewBloxPosition(GameObject obj, float pos_x,float pos_y,float pos_z) // { // Blox newBlox = null; // GameObject selectedBlox = null; // //// if (thisBlox.newMaster != true) //// { // //selectedBlox = GameObject.Find("Selected"); // //// } //// else //// { //// selectedBlox = GameObject.Find("Master"); //// thisBlox.newMaster = false; //// } // // Selection.activeGameObject = selectedBlox; // newBlox = (Blox)selectedBlox.GetComponent<Blox>(); // // //Todo: fix transition exception in another way // if (GameObject.Find("Master")) // newBlox.transform.parent = GameObject.Find("Master").transform; // // newBlox.MyBloxID = GameObject.FindGameObjectsWithTag("Blox").Length; //we count all the blox in the scene and assign it a new ID // // if (thisBlox.isWall != true) // newBlox.SetMyXPosition(thisBlox.transform.position.x + pos_x, thisBlox.transform.position.y + pos_y, thisBlox.transform.position.z + pos_z); //We set our location based on the New Blox // else // newBlox.SetMyXPosition(thisBlox.transform.position.x + pos_x, thisBlox.transform.position.y + pos_y -1.5f , thisBlox.transform.position.z + pos_z); // // newBlox.MyBloxMeshCategoryID = thisBlox.MyBloxMeshCategoryID; //We give it our current mesh Category // newBlox.MyBloxMeshID = thisBlox.MyBloxMeshID; //And we also give it our mesh ID // newBlox.RenderMyTexture(); //We call to render our textur // }
{ "content_hash": "22e79208fcb70286d27dd93f6d6251e7", "timestamp": "", "source": "github", "line_count": 448, "max_line_length": 190, "avg_line_length": 26.475446428571427, "alnum_prop": 0.6475845206980861, "repo_name": "thecodejunkie/Game.Prototype", "id": "fbc40c56f3b798dc3e1e666030caedbe8d8c53e7", "size": "11863", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Prototypes/PrototypeA/Assets/Scripts/Managers/BloxManager.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "67308" }, { "name": "JavaScript", "bytes": "43738" } ], "symlink_target": "" }
// Copyright 2020 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.chrome.browser.app.download.home; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.download.OfflineContentAvailabilityStatusProvider; /** * Helper class to determine whether or not the prefetch setting is enabled for Chrome. * This class does not require an explicit destroy call, but needs all observers to be * unregistered for full clean up. */ class PrefetchEnabledSupplier implements Supplier<Boolean> { // Supplier implementation. @Override public Boolean get() { return OfflineContentAvailabilityStatusProvider.getInstance().isSuggestedContentAvailable(); } }
{ "content_hash": "04c9a8a09a9e1a609ef09992133fa6fc", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 100, "avg_line_length": 37.666666666666664, "alnum_prop": 0.7787610619469026, "repo_name": "chromium/chromium", "id": "69248e65799a126fe60e152e19689700d8ce1532", "size": "791", "binary": false, "copies": "6", "ref": "refs/heads/main", "path": "chrome/android/java/src/org/chromium/chrome/browser/app/download/home/PrefetchEnabledSupplier.java", "mode": "33188", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
namespace autofill { const SkColor PasswordGenerationPopupView::kExplanatoryTextBackgroundColor = SkColorSetRGB(0xF5, 0xF5, 0xF5); const SkColor PasswordGenerationPopupView::kExplanatoryTextColor = SkColorSetRGB(0x66, 0x66, 0x66); const SkColor PasswordGenerationPopupView::kDividerColor = SkColorSetRGB(0xE9, 0xE9, 0xE9); } // namespace autofill
{ "content_hash": "c098d05a0a85ad9a79a124bb6a4bdf71", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 76, "avg_line_length": 36.2, "alnum_prop": 0.8038674033149171, "repo_name": "ondra-novak/chromium.src", "id": "7b35a4ba087271592ac21c737b29c914a227217f", "size": "600", "binary": false, "copies": "8", "ref": "refs/heads/nw", "path": "chrome/browser/ui/autofill/password_generation_popup_view.cc", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "AppleScript", "bytes": "6973" }, { "name": "Arduino", "bytes": "464" }, { "name": "Assembly", "bytes": "35318" }, { "name": "Batchfile", "bytes": "7621" }, { "name": "C", "bytes": "8692951" }, { "name": "C++", "bytes": "206833388" }, { "name": "CSS", "bytes": "871479" }, { "name": "HTML", "bytes": "24541148" }, { "name": "Java", "bytes": "5457985" }, { "name": "JavaScript", "bytes": "17791684" }, { "name": "Makefile", "bytes": "92563" }, { "name": "Objective-C", "bytes": "1312233" }, { "name": "Objective-C++", "bytes": "7105758" }, { "name": "PHP", "bytes": "97817" }, { "name": "PLpgSQL", "bytes": "218379" }, { "name": "Perl", "bytes": "69392" }, { "name": "Protocol Buffer", "bytes": "387183" }, { "name": "Python", "bytes": "6929739" }, { "name": "Shell", "bytes": "473664" }, { "name": "Standard ML", "bytes": "4131" }, { "name": "XSLT", "bytes": "418" }, { "name": "nesC", "bytes": "15206" } ], "symlink_target": "" }
''' This module checks if all Glassfish servers are running and if the SPECjEnterprise2010 application is running ''' from twisted.internet import reactor from twisted.web.client import Agent from twisted.web.http_headers import Headers from twisted.internet.protocol import Protocol from twisted.internet.defer import Deferred from twisted.internet import defer class BeginningPrinter(Protocol): def __init__(self, finished): self.finished = finished self.remaining = 1024 * 10 def dataReceived(self, bytes): if self.remaining: display = bytes[:self.remaining] print display self.remaining -= len(display) def connectionLost(self, reason): print 'Finished receiving body:', reason.getErrorMessage() self.finished.callback(None) def main(targets): agent = Agent(reactor) dlist = [] for name in targets: d = agent.request( 'GET', 'http://%s:8080/specj/' % name, Headers({'User-Agent': ['Twisted Web Client Example']}), None) d.addCallback(cbResponse, name) dlist.append(d) wait = defer.DeferredList(dlist) return wait failed = [] def cbResponse(ignored, target): if ignored.code == 200: print 'OK: %s' % target else: print 'FAIL: %s' % target failed.append(target) def cbShutdown(ignored): print 'done' reactor.stop() def _status(ignored): if len(failed) == 0: print 'SUCCESSFUL' else: print 'FAILED' if __name__ == '__main__': targets = [] for i in xrange(0,18): targets.append('target%i' % i) wait = main(targets) wait.addBoth(cbShutdown) wait.addCallback(_status) reactor.run()
{ "content_hash": "05ff6e3558fe4ba62c4a3d8987d9fe09", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 82, "avg_line_length": 26.571428571428573, "alnum_prop": 0.5962365591397849, "repo_name": "jacksonicson/paper.IS2015", "id": "d04e44de3c5dbe687f88e3af264f3f51d84780fd", "size": "1860", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "control/Control/src/control/glassfish.py", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "611" }, { "name": "C++", "bytes": "25818" }, { "name": "Python", "bytes": "1465500" }, { "name": "R", "bytes": "35368" }, { "name": "Rebol", "bytes": "1221" }, { "name": "Shell", "bytes": "5715" }, { "name": "Thrift", "bytes": "1346" } ], "symlink_target": "" }
package com.zheng.cms.dao.model; import java.io.Serializable; import java.util.ArrayList; import java.util.List; public class CmsArticleTagExample implements Serializable { protected String orderByClause; protected boolean distinct; protected List<Criteria> oredCriteria; private static final long serialVersionUID = 1L; private Integer limit; private Integer offset; public CmsArticleTagExample() { oredCriteria = new ArrayList<Criteria>(); } public void setOrderByClause(String orderByClause) { this.orderByClause = orderByClause; } public String getOrderByClause() { return orderByClause; } public void setDistinct(boolean distinct) { this.distinct = distinct; } public boolean isDistinct() { return distinct; } public List<Criteria> getOredCriteria() { return oredCriteria; } public void or(Criteria criteria) { oredCriteria.add(criteria); } public Criteria or() { Criteria criteria = createCriteriaInternal(); oredCriteria.add(criteria); return criteria; } public Criteria createCriteria() { Criteria criteria = createCriteriaInternal(); if (oredCriteria.size() == 0) { oredCriteria.add(criteria); } return criteria; } protected Criteria createCriteriaInternal() { Criteria criteria = new Criteria(); return criteria; } public void clear() { oredCriteria.clear(); orderByClause = null; distinct = false; } public void setLimit(Integer limit) { this.limit = limit; } public Integer getLimit() { return limit; } public void setOffset(Integer offset) { this.offset = offset; } public Integer getOffset() { return offset; } protected abstract static class GeneratedCriteria implements Serializable { protected List<Criterion> criteria; protected GeneratedCriteria() { super(); criteria = new ArrayList<Criterion>(); } public boolean isValid() { return criteria.size() > 0; } public List<Criterion> getAllCriteria() { return criteria; } public List<Criterion> getCriteria() { return criteria; } protected void addCriterion(String condition) { if (condition == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(condition)); } protected void addCriterion(String condition, Object value, String property) { if (value == null) { throw new RuntimeException("Value for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value)); } protected void addCriterion(String condition, Object value1, Object value2, String property) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + property + " cannot be null"); } criteria.add(new Criterion(condition, value1, value2)); } public Criteria andArticleTagIdIsNull() { addCriterion("article_tag_id is null"); return (Criteria) this; } public Criteria andArticleTagIdIsNotNull() { addCriterion("article_tag_id is not null"); return (Criteria) this; } public Criteria andArticleTagIdEqualTo(Integer value) { addCriterion("article_tag_id =", value, "articleTagId"); return (Criteria) this; } public Criteria andArticleTagIdNotEqualTo(Integer value) { addCriterion("article_tag_id <>", value, "articleTagId"); return (Criteria) this; } public Criteria andArticleTagIdGreaterThan(Integer value) { addCriterion("article_tag_id >", value, "articleTagId"); return (Criteria) this; } public Criteria andArticleTagIdGreaterThanOrEqualTo(Integer value) { addCriterion("article_tag_id >=", value, "articleTagId"); return (Criteria) this; } public Criteria andArticleTagIdLessThan(Integer value) { addCriterion("article_tag_id <", value, "articleTagId"); return (Criteria) this; } public Criteria andArticleTagIdLessThanOrEqualTo(Integer value) { addCriterion("article_tag_id <=", value, "articleTagId"); return (Criteria) this; } public Criteria andArticleTagIdIn(List<Integer> values) { addCriterion("article_tag_id in", values, "articleTagId"); return (Criteria) this; } public Criteria andArticleTagIdNotIn(List<Integer> values) { addCriterion("article_tag_id not in", values, "articleTagId"); return (Criteria) this; } public Criteria andArticleTagIdBetween(Integer value1, Integer value2) { addCriterion("article_tag_id between", value1, value2, "articleTagId"); return (Criteria) this; } public Criteria andArticleTagIdNotBetween(Integer value1, Integer value2) { addCriterion("article_tag_id not between", value1, value2, "articleTagId"); return (Criteria) this; } public Criteria andArticleIdIsNull() { addCriterion("article_id is null"); return (Criteria) this; } public Criteria andArticleIdIsNotNull() { addCriterion("article_id is not null"); return (Criteria) this; } public Criteria andArticleIdEqualTo(Integer value) { addCriterion("article_id =", value, "articleId"); return (Criteria) this; } public Criteria andArticleIdNotEqualTo(Integer value) { addCriterion("article_id <>", value, "articleId"); return (Criteria) this; } public Criteria andArticleIdGreaterThan(Integer value) { addCriterion("article_id >", value, "articleId"); return (Criteria) this; } public Criteria andArticleIdGreaterThanOrEqualTo(Integer value) { addCriterion("article_id >=", value, "articleId"); return (Criteria) this; } public Criteria andArticleIdLessThan(Integer value) { addCriterion("article_id <", value, "articleId"); return (Criteria) this; } public Criteria andArticleIdLessThanOrEqualTo(Integer value) { addCriterion("article_id <=", value, "articleId"); return (Criteria) this; } public Criteria andArticleIdIn(List<Integer> values) { addCriterion("article_id in", values, "articleId"); return (Criteria) this; } public Criteria andArticleIdNotIn(List<Integer> values) { addCriterion("article_id not in", values, "articleId"); return (Criteria) this; } public Criteria andArticleIdBetween(Integer value1, Integer value2) { addCriterion("article_id between", value1, value2, "articleId"); return (Criteria) this; } public Criteria andArticleIdNotBetween(Integer value1, Integer value2) { addCriterion("article_id not between", value1, value2, "articleId"); return (Criteria) this; } public Criteria andTagIdIsNull() { addCriterion("tag_id is null"); return (Criteria) this; } public Criteria andTagIdIsNotNull() { addCriterion("tag_id is not null"); return (Criteria) this; } public Criteria andTagIdEqualTo(Integer value) { addCriterion("tag_id =", value, "tagId"); return (Criteria) this; } public Criteria andTagIdNotEqualTo(Integer value) { addCriterion("tag_id <>", value, "tagId"); return (Criteria) this; } public Criteria andTagIdGreaterThan(Integer value) { addCriterion("tag_id >", value, "tagId"); return (Criteria) this; } public Criteria andTagIdGreaterThanOrEqualTo(Integer value) { addCriterion("tag_id >=", value, "tagId"); return (Criteria) this; } public Criteria andTagIdLessThan(Integer value) { addCriterion("tag_id <", value, "tagId"); return (Criteria) this; } public Criteria andTagIdLessThanOrEqualTo(Integer value) { addCriterion("tag_id <=", value, "tagId"); return (Criteria) this; } public Criteria andTagIdIn(List<Integer> values) { addCriterion("tag_id in", values, "tagId"); return (Criteria) this; } public Criteria andTagIdNotIn(List<Integer> values) { addCriterion("tag_id not in", values, "tagId"); return (Criteria) this; } public Criteria andTagIdBetween(Integer value1, Integer value2) { addCriterion("tag_id between", value1, value2, "tagId"); return (Criteria) this; } public Criteria andTagIdNotBetween(Integer value1, Integer value2) { addCriterion("tag_id not between", value1, value2, "tagId"); return (Criteria) this; } } public static class Criteria extends GeneratedCriteria implements Serializable { protected Criteria() { super(); } } public static class Criterion implements Serializable { private String condition; private Object value; private Object secondValue; private boolean noValue; private boolean singleValue; private boolean betweenValue; private boolean listValue; private String typeHandler; public String getCondition() { return condition; } public Object getValue() { return value; } public Object getSecondValue() { return secondValue; } public boolean isNoValue() { return noValue; } public boolean isSingleValue() { return singleValue; } public boolean isBetweenValue() { return betweenValue; } public boolean isListValue() { return listValue; } public String getTypeHandler() { return typeHandler; } protected Criterion(String condition) { super(); this.condition = condition; this.typeHandler = null; this.noValue = true; } protected Criterion(String condition, Object value, String typeHandler) { super(); this.condition = condition; this.value = value; this.typeHandler = typeHandler; if (value instanceof List<?>) { this.listValue = true; } else { this.singleValue = true; } } protected Criterion(String condition, Object value) { this(condition, value, null); } protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { super(); this.condition = condition; this.value = value; this.secondValue = secondValue; this.typeHandler = typeHandler; this.betweenValue = true; } protected Criterion(String condition, Object value, Object secondValue) { this(condition, value, secondValue, null); } } }
{ "content_hash": "17a978247b401f412657874a0311722c", "timestamp": "", "source": "github", "line_count": 403, "max_line_length": 102, "avg_line_length": 29.615384615384617, "alnum_prop": 0.5839128613322162, "repo_name": "lhrl/zheng", "id": "cb6d4ea395ff26723f738d7561d04d70d1748b76", "size": "11935", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "zheng-cms/zheng-cms-dao/src/main/java/com/zheng/cms/dao/model/CmsArticleTagExample.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4637" }, { "name": "CSS", "bytes": "270408" }, { "name": "HTML", "bytes": "110495" }, { "name": "Java", "bytes": "1403431" }, { "name": "JavaScript", "bytes": "528585" }, { "name": "Shell", "bytes": "19713" } ], "symlink_target": "" }
{% extends 'base.html' %} {% block content %} {% if category %} <div class="page-header"> <h1 class="pull-left">category:{{ category }} </h1> <h2 class="pull-right"> <a href="/t/{{ category.slug }}/new"> <i style="color:green" class="fa fa-plus-circle"></i></a></h2> </div> {% if projects %} <table class="table"> <thead><tr><th></th><th>Project</th><th>Last activity</th><th>Total time</th></tr></thead> <tbody> {% for project in projects %} <tr> <th><a href="/t/{{ project.category.slug }}/{{ project.pk }}/delete"><i style="color:grey" class="fa fa-trash-o"></i></a></th> <th><a href="/t/{{ project.category.slug }}/{{ project.slug }}">{{ project.name }}</a></th> <th>{{ project.delta_to_last_edit }}h ago</th> <th>{{ project.total_time }}h </th> </tr> {% endfor %} </tbody> </table> {% endif %} {% else %} <p>No projects are available in this category.</p> {% endif %} {% endblock %}
{ "content_hash": "d8af3ac9bccfe156b3eefaae9f8e51d2", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 150, "avg_line_length": 38.3, "alnum_prop": 0.46475195822454307, "repo_name": "rixx/tempus", "id": "14f9b271c89152c4f1e8321814872f789da1c8cc", "size": "1149", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "tempus/timetracking/templates/t/category.html", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "6249" }, { "name": "Python", "bytes": "36596" } ], "symlink_target": "" }
package org.usfirst.frc.team2465.robot; import edu.wpi.first.wpilibj.AnalogInput; import edu.wpi.first.wpilibj.AnalogOutput; import edu.wpi.first.wpilibj.AnalogTrigger; import edu.wpi.first.wpilibj.Counter; import edu.wpi.first.wpilibj.DigitalInput; import edu.wpi.first.wpilibj.DigitalOutput; import edu.wpi.first.wpilibj.DriverStation; import edu.wpi.first.wpilibj.Encoder; import edu.wpi.first.wpilibj.Jaguar; import edu.wpi.first.wpilibj.SampleRobot; import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.Timer; import edu.wpi.first.wpilibj.Victor; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; /** * This example program demonstrates the use of the MXP * Expansion IO capabilities of the navX MXP, including * the following capabilities: * * -- DIGITAL I/O -- * * - Pulse-Width Modulation [PWM] (e.g., Motor Control) * - Digital Inputs (e.g., Contact Switch closure) * - Digital Outputs (e.g., Relay control) * - Quadrature Encoder (e.g., Wheel Encoder) * * -- ANALOG I/O -- * * - Analog Inputs (e.g., Ultrasonic Sensor) * - Analog Input Trigger (e.g., Proximity Sensor trigger) * - Analog Trigger Counter * - Analog Output (e.g., Constant-current LED, Sound) * * This example also demonstrates a simple method for calculating the * 'RoboRIO Channel Number' which corresponds to a given navX MXP IO * Pin number. * * For more details on navX MXP Expansion I/O, please see * http://navx-mxp.kauailabs.com/installation/io-expansion/ */ public class Robot extends SampleRobot { Joystick stick; /* Digital IO */ Victor pwm_out_9; /* E.g., PWM out to motor controller */ Jaguar pwm_out_8; /* E.g., PWM out to motor controller */ DigitalInput dig_in_7; /* E.g., input from contact switch */ DigitalInput dig_in_6; /* E.g., input from contact switch */ DigitalOutput dig_out_5; /* E.g., output to relay or LED */ DigitalOutput dig_out_4; /* E.g., output to relay or LED */ Encoder enc_3and2; /* E.g., Wheel Encoder */ Encoder enc_1and0; /* E.g., Wheel Encoder */ /* Analog Inputs */ AnalogInput an_in_1; /* E.g., Ultrasonic Sensor */ AnalogTrigger an_trig_0; /* E.g., Proximity Sensor Threshold */ Counter an_trig_0_counter; /* E.g., Count of an_trig_0 events */ /* Analog Outputs */ AnalogOutput an_out_1; /* E.g., Constant-current LED output */ AnalogOutput an_out_0; /* E.g., Speaker output */ public final double MXP_IO_VOLTAGE = 3.3f; /* Alternately, 5.0f */; public final double MIN_AN_TRIGGER_VOLTAGE = 0.76f; public final double MAX_AN_TRIGGER_VOLTAGE = MXP_IO_VOLTAGE - 2.0f; public Robot() { stick = new Joystick(0); try { /* Construct Digital I/O Objects */ pwm_out_9 = new Victor( getChannelFromPin( PinType.PWM, 9 )); pwm_out_8 = new Jaguar( getChannelFromPin( PinType.PWM, 8 )); dig_in_7 = new DigitalInput( getChannelFromPin( PinType.DigitalIO, 7 )); dig_in_6 = new DigitalInput( getChannelFromPin( PinType.DigitalIO, 6 )); dig_out_5 = new DigitalOutput( getChannelFromPin( PinType.DigitalIO, 5 )); dig_out_4 = new DigitalOutput( getChannelFromPin( PinType.DigitalIO, 4 )); enc_3and2 = new Encoder( getChannelFromPin( PinType.DigitalIO, 3 ), getChannelFromPin( PinType.DigitalIO, 2 )); enc_1and0 = new Encoder( getChannelFromPin( PinType.DigitalIO, 1 ), getChannelFromPin( PinType.DigitalIO, 0 )); /* Construct Analog I/O Objects */ /* NOTE: Due to a board layout issue on the navX MXP board revision */ /* 3.3, there is noticeable crosstalk between AN IN pins 3, 2 and 1. */ /* For that reason, use of pin 3 and pin 2 is NOT RECOMMENDED. */ an_in_1 = new AnalogInput( getChannelFromPin( PinType.AnalogIn, 1 )); an_trig_0 = new AnalogTrigger( getChannelFromPin( PinType.AnalogIn, 0 )); an_trig_0_counter = new Counter( an_trig_0 ); an_out_1 = new AnalogOutput( getChannelFromPin( PinType.AnalogOut, 1 )); an_out_0 = new AnalogOutput( getChannelFromPin( PinType.AnalogOut, 0 )); /* Configure I/O Objects */ pwm_out_9.setSafetyEnabled(false); /* Disable Motor Safety for Demo */ pwm_out_8.setSafetyEnabled(false); /* Disable Motor Safety for Demo */ /* Configure Analog Trigger */ an_trig_0.setAveraged(true); an_trig_0.setLimitsVoltage(MIN_AN_TRIGGER_VOLTAGE, MAX_AN_TRIGGER_VOLTAGE); } catch (RuntimeException ex ) { DriverStation.reportError( "Error instantiating MXP pin on navX MXP: " + ex.getMessage(), true); } } /** * Wait for 2 seconds then stop */ public void autonomous() { Timer.delay(2.0); // for 2 seconds } public enum PinType { DigitalIO, PWM, AnalogIn, AnalogOut }; public final int MAX_NAVX_MXP_DIGIO_PIN_NUMBER = 9; public final int MAX_NAVX_MXP_ANALOGIN_PIN_NUMBER = 3; public final int MAX_NAVX_MXP_ANALOGOUT_PIN_NUMBER = 1; public final int NUM_ROBORIO_ONBOARD_DIGIO_PINS = 10; public final int NUM_ROBORIO_ONBOARD_PWM_PINS = 10; public final int NUM_ROBORIO_ONBOARD_ANALOGIN_PINS = 4; /* getChannelFromPin( PinType, int ) - converts from a navX MXP */ /* Pin type and number to the corresponding RoboRIO Channel */ /* Number, which is used by the WPI Library functions. */ public int getChannelFromPin( PinType type, int io_pin_number ) throws IllegalArgumentException { int roborio_channel = 0; if ( io_pin_number < 0 ) { throw new IllegalArgumentException("Error: navX MXP I/O Pin #"); } switch ( type ) { case DigitalIO: if ( io_pin_number > MAX_NAVX_MXP_DIGIO_PIN_NUMBER ) { throw new IllegalArgumentException("Error: Invalid navX MXP Digital I/O Pin #"); } roborio_channel = io_pin_number + NUM_ROBORIO_ONBOARD_DIGIO_PINS + (io_pin_number > 3 ? 4 : 0); break; case PWM: if ( io_pin_number > MAX_NAVX_MXP_DIGIO_PIN_NUMBER ) { throw new IllegalArgumentException("Error: Invalid navX MXP Digital I/O Pin #"); } roborio_channel = io_pin_number + NUM_ROBORIO_ONBOARD_PWM_PINS; break; case AnalogIn: if ( io_pin_number > MAX_NAVX_MXP_ANALOGIN_PIN_NUMBER ) { throw new IllegalArgumentException("Error: Invalid navX MXP Analog Input Pin #"); } roborio_channel = io_pin_number + NUM_ROBORIO_ONBOARD_ANALOGIN_PINS; break; case AnalogOut: if ( io_pin_number > MAX_NAVX_MXP_ANALOGOUT_PIN_NUMBER ) { throw new IllegalArgumentException("Error: Invalid navX MXP Analog Output Pin #"); } roborio_channel = io_pin_number; break; } return roborio_channel; } /** * Runs the motors with arcade steering. */ public void operatorControl() { while (isOperatorControl() && isEnabled()) { /* Process Digital I/O (Outputs controlled by joystick) */ pwm_out_9.set(stick.getX()); pwm_out_8.set(stick.getY()); SmartDashboard.putBoolean( "DigIn7", dig_in_7.get()); SmartDashboard.putBoolean( "DigIn6", dig_in_6.get()); dig_out_5.set(stick.getRawButton(1)); dig_out_4.set(stick.getRawButton(2)); SmartDashboard.putNumber( "Enc3and2", enc_3and2.get()); SmartDashboard.putNumber( "Enc1and0", enc_1and0.get()); /* Process Analog Inputs */ SmartDashboard.putNumber( "AnalogIn1", an_in_1.getAverageVoltage()); SmartDashboard.putBoolean( "AnalogTrigger0", an_trig_0.getTriggerState()); SmartDashboard.putNumber( "AnalogTriggerCounter0", an_trig_0_counter.get()); /* Process Analog Outputs (Outputs controlled by joystick) */ an_out_1.setVoltage(Math.abs(stick.getX()) * MXP_IO_VOLTAGE); an_out_0.setVoltage(Math.abs(stick.getY()) * MXP_IO_VOLTAGE); Timer.delay(0.005); /* wait for a motor update time */ } } /** * Runs during test mode */ public void test() { } }
{ "content_hash": "3abafa2839dfcecfbf1f23e41ccd10f6", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 99, "avg_line_length": 46.08, "alnum_prop": 0.5708550347222222, "repo_name": "FRC1458/turtleshell", "id": "11482fea3f12cd8dabd96ff7275e6e6ae1eb25a6", "size": "9216", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "libs/navx-mxp/navx-roborio-java/examples/navXMXP_ExpansionIO/src/org/usfirst/frc/team2465/robot/Robot.java", "mode": "33261", "license": "mit", "language": [ { "name": "Arduino", "bytes": "7042" }, { "name": "C", "bytes": "43737" }, { "name": "C++", "bytes": "55439" }, { "name": "HTML", "bytes": "900" }, { "name": "Java", "bytes": "632229" }, { "name": "JavaScript", "bytes": "329" }, { "name": "Processing", "bytes": "2002" }, { "name": "Shell", "bytes": "118" } ], "symlink_target": "" }
using System.Collections.Generic; using NUnit.Framework; namespace CompositeC1Contrib.Tests { public class MailAddressTests { [TestCaseSource(nameof(ValidMailAddress))] public void Valid(string address) { var isValid = MailAddressValidator.IsValid(address); Assert.That(isValid, Is.True); } [TestCaseSource(nameof(InvalidMailAddress))] public void Invalid(string address) { var isValid = MailAddressValidator.IsValid(address); Assert.That(isValid, Is.False); } private static IEnumerable<string> ValidMailAddress() { return new List<string> { "david.jones@proseware.com", "d.j@server1.proseware.com", "jones@ms1.proseware.com", "j@proseware.com9", "js#internal@proseware.com", "j_9@[129.126.118.1]", "js@proseware.com9", "js@contoso.中国", "pauli@østerø.dk", "mohamed2500-@hotmail.com", "js*@proseware.com", "j.s@server1.proseware.com", "user@[IPv6:2001:db8::1]", "other.email-with-dash@example.com", "disposable.style.email.with+symbol@example.com", "very.common@example.com", "Lars@olhuset.dk", "Lars@OlHuset.dk", "lars@OlHuset.dk" }; } private static IEnumerable<string> InvalidMailAddress() { return new List<string> { "j.@server1.proseware.com", "j..s@proseware.com", "js@proseware..com", "østerø@pauli.dk", "øster@pauli.dk", "sterø@pauli.dk", "indkøb@flyingseafood.dk", "Abc.example.com", "A@b@c@example.com", "a\"b(c)d,e:f;g<h>i[j\\k]l@example.com", "just\"not\"right@example.com" }; } } }
{ "content_hash": "a8c72ebd1c0b99293f1dfbb85bd44c76", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 65, "avg_line_length": 31.797101449275363, "alnum_prop": 0.4699179580674567, "repo_name": "burningice2866/CompositeC1Contrib", "id": "93ea141671f7f43e8fbb0daeb4fd6d3e2e602c6c", "size": "2207", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Core.Tests/MailAddressTests.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP.NET", "bytes": "12894" }, { "name": "C#", "bytes": "680107" }, { "name": "CSS", "bytes": "2766" }, { "name": "HTML", "bytes": "2927" }, { "name": "JavaScript", "bytes": "2427" }, { "name": "XSLT", "bytes": "6068" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <TITLE> Uses of Interface org.apache.cxf.security.LoginSecurityContext (Apache CXF API 2.7.5 API) </TITLE> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Interface org.apache.cxf.security.LoginSecurityContext (Apache CXF API 2.7.5 API)"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/cxf/security/LoginSecurityContext.html" title="interface in org.apache.cxf.security"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&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-all.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> Apache CXF API</EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/cxf/security//class-useLoginSecurityContext.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="LoginSecurityContext.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> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <CENTER> <H2> <B>Uses of Interface<br>org.apache.cxf.security.LoginSecurityContext</B></H2> </CENTER> No usage of org.apache.cxf.security.LoginSecurityContext <P> <HR> <!-- ======= START OF BOTTOM NAVBAR ====== --> <A NAME="navbar_bottom"><!-- --></A> <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_bottom_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../org/apache/cxf/security/LoginSecurityContext.html" title="interface in org.apache.cxf.security"><FONT CLASS="NavBarFont1"><B>Class</B></FONT></A>&nbsp;</TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Use</B></FONT>&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-all.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> Apache CXF API</EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> &nbsp;PREV&nbsp; &nbsp;NEXT</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?org/apache/cxf/security//class-useLoginSecurityContext.html" target="_top"><B>FRAMES</B></A> &nbsp; &nbsp;<A HREF="LoginSecurityContext.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> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> Apache CXF </BODY> </HTML>
{ "content_hash": "9af2f3c94074ea05af62287b73dcd9a2", "timestamp": "", "source": "github", "line_count": 143, "max_line_length": 228, "avg_line_length": 42.13286713286713, "alnum_prop": 0.6220746887966805, "repo_name": "mulesoft-consulting/sumtotal-connector", "id": "d337bcae1f24ae87a739eb51ab6d3a37af56b2f4", "size": "6025", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "lib/apache-cxf-2.7.5/docs/api/org/apache/cxf/security/class-use/LoginSecurityContext.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Groovy", "bytes": "1843" }, { "name": "Java", "bytes": "1644889" }, { "name": "JavaScript", "bytes": "37150" }, { "name": "Perl", "bytes": "3647" }, { "name": "Ruby", "bytes": "951" }, { "name": "Scala", "bytes": "108" }, { "name": "Shell", "bytes": "59560" } ], "symlink_target": "" }
<section ng-controller="ProductsController" ng-init="find()"> <div class="page-header"> <h1> Products </h1> </div> <form> <div class="form-group"> <div class="input-group"> <div class="input-group-addon"> <i class="glyphicon glyphicon-search"></i> </div> <input type="text" class="form-control" placeholder="Search products" ng-model="filterProducts"> </div> </div> </form> <div class="list-group"> <a ng-repeat="product in products | filter:filterProducts" class="list-group-item"> <div class="row"> <div class="col-md-2"> <span ng-if="product.image"> <img ng-src="./uploads/products/pictures/{{ingridient.image}}" class="img-thumbnail user-profile-picture"> </span> </div> <div class="col-md-6"> <h4 class="list-group-item-heading" ng-bind="product.caption"></h4> <p class="list-group-item-text" ng-bind="product.infoCard"></p> </div> </div> </a> </div> <div class="alert alert-warning text-center" ng-if="!products.length"> No ingridients yet, why don't you <a ui-sref="products.create">create one</a>? </div> </section>
{ "content_hash": "76541fe3ac2c30259e9bab968a01997c", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 130, "avg_line_length": 39.416666666666664, "alnum_prop": 0.5024665257223396, "repo_name": "Promnovatsia/temp-github-cookbook", "id": "80b2c957be44afc6fd2f96f5952f24a1d66fe97b", "size": "1419", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "modules/recipes/client/views/products/products-list.client.view.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "16377" }, { "name": "HTML", "bytes": "165286" }, { "name": "JavaScript", "bytes": "1042126" }, { "name": "Shell", "bytes": "688" } ], "symlink_target": "" }
title: "Embedded Sass is Live" author: Natalie Weizenbaum date: 2022-02-01 2:00 PST --- After several years of planning and development, I'm excited to finally announce the stable release of Embedded Dart Sass along with its first official wrapper, the [`sass-embedded`] package available now on npm! [`sass-embedded`]: https://www.npmjs.com/package/sass-embedded Embedded Sass is an ongoing effort to make a highly-performant Sass library available to as many different languages as possible, starting with Node.js. Although Node.js already has access to the pure-JS `sass` package, the nature of JavaScript inherently limits how quickly this package can process large Sass files especially in asynchronous mode. We expect `sass-embedded` to be a major boon to developers for whom compilation speed is a concern, particularly the remaining users of `node-sass` for whom performance has been a major reason to avoid Dart Sass. The `sass-embedded` package fully supports the [new JS API] as well as the [legacy API] other than a few cosmetic options. You can use it as a drop-in replacement for the `sass` package, and it should work with all the same build plugins and libraries. Note that `sass-embedded` is a bit faster in *asynchronous* mode than it is in synchronous mode (whereas the `sass` package was faster in synchronous mode). For substantial Sass files, running `sass-embedded` in either mode will generally be much faster than `sass`. [new JS API]: https://sass-lang.com/documentation/js-api#usage [legacy API]: https://sass-lang.com/documentation/js-api#legacy-api In order to limit the confusion about which version of which package supports which feature, the `sass-embedded` package will always have the same version as the `sass` package. When new features are added to the JS API, they'll be supported at the same time in both packages, and when new language features are added to Sass they'll always be included in a new `sass-embedded` release straight away. ## How it Works Embedded Sass is composed of three parts: 1. [The compiler], a Dart executable that wraps Dart Sass and does the actual heavy lifting of parsing and compiling the files. Dart native executables are generally much faster than JavaScript, so using them for the computationally-intensive work of stylesheet evaluation is where Embedded Sass gets its speed. 2. [The host], a library in any language (in this case JavaScript) that provides a usable end-user API for invoking the compiler. The host provides callers with configuration options, including the ability to define custom importers and Sass functions that are used by the compilation. 3. [The protocol], a [protocol-buffer]-based specification of how the host and the compiler communicate with one another. This communication happens over the standard input and output streams of the compiler executable, which is invoked by the host to perform each compilation. [The compiler]: https://github.com/sass/dart-sass-embedded [The host]: https://github.com/sass/embedded-host-node [The protocol]: https://github.com/sass/embedded-protocol [protocol-buffer]: https://en.wikipedia.org/wiki/Protocol_Buffers ## Other Languages Embedded Sass was designed in part as a way for languages other than JavaScript to have access to the full power of Sass compilation with custom importers and functions, similarly to how C++ wrappers for [LibSass] worked in the past. We hope that community members will use this protocol to implement embedded hosts for many other popular frontend languages. If you end up doing so, message us [on Twitter] or [Gitter] and we'll link it on this site! [LibSass]: https://sass-lang.com/libsass [on Twitter]: https://twitter.com/SassCSS [Gitter]: https://gitter.im/sass/sass
{ "content_hash": "df0f6ec4c22c2bd95fc9b8cf915e711e", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 82, "avg_line_length": 50.49333333333333, "alnum_prop": 0.7826775811988381, "repo_name": "sass/sass-site", "id": "8cfcec8a76fa094b4adfdb8a799afba684af8d7c", "size": "3791", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "source/blog/032-embedded-sass-is-live.md", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "10127" }, { "name": "Haml", "bytes": "63843" }, { "name": "JavaScript", "bytes": "32781" }, { "name": "Ruby", "bytes": "32631" }, { "name": "SCSS", "bytes": "33875" } ], "symlink_target": "" }
set -ex #Variables PACKAGE_NAME=commons-compress PACKAGE_VERSION=rel/1.19 PACKAGE_URL=https://github.com/apache/commons-compress.git #Extract version from command line echo "Usage: $0 [-v <PACKAGE_VERSION>]" echo "PACKAGE_VERSION is an optional paramater whose default value is 1.19, not all versions are supported." PACKAGE_VERSION="${1:-$PACKAGE_VERSION}" #Dependencies apt update && apt install -y git wget unzip openjdk-8-jdk openjdk-8-jre maven python3 export HOME=/home/tester mkdir -p /home/tester/output cd /home/tester ln -s /usr/bin/python3 /bin/python OS_NAME=$(cat /etc/os-release | grep ^PRETTY_NAME | cut -d= -f2) function get_checkout_url(){ url=$1 CHECKOUT_URL=`python3 -c "url='$url';github_url=url.split('tree')[0];print(github_url);"` echo $CHECKOUT_URL } function get_working_path(){ url=$1 CHECKOUT_URL=`python3 -c "url='$url';github_url,uri=url.split('tree');uris=uri.split('/');print('/'.join(uris[2:]));"` echo $CHECKOUT_URL } CLONE_URL=$(get_checkout_url $PACKAGE_URL) if [ "$PACKAGE_URL" = "$CLONE_URL" ]; then WORKING_PATH="./" else WORKING_PATH=$(get_working_path $PACKAGE_URL) fi if ! git clone $CLONE_URL $PACKAGE_NAME; then echo "------------------$PACKAGE_NAME:clone_fails---------------------------------------" echo "$PACKAGE_URL $PACKAGE_NAME" > /home/tester/output/clone_fails echo "$PACKAGE_NAME | $PACKAGE_URL | $PACKAGE_VERSION | $OS_NAME | GitHub | Fail | Clone_Fails" > /home/tester/output/version_tracker exit 1 fi function get_list_of_jars_generated(){ VALIDATE_DIR=$1 FILE_NAME=$1 find -name *.jar >> $FILE_NAME } export HOME_DIR=/home/tester/$PACKAGE_NAME cd $HOME_DIR git checkout $PACKAGE_VERSION cd $WORKING_PATH #Build and test mvn verify -Dorg.ops4j.pax.url.mvn.repositories="https://repo1.maven.org/maven2@id=central" #The following failing tests are in parity with x86: #1. UTF8ZipFilesTest.testReadWinZipArchive:137 ? MalformedInput Input length = 1 #2. UTF8ZipFilesTest.testReadWinZipArchiveForStream:165 ? MalformedInput Input len
{ "content_hash": "7abc982e33b1141b879ceb8f8230a3d8", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 138, "avg_line_length": 31.159420289855074, "alnum_prop": 0.6646511627906977, "repo_name": "ppc64le/build-scripts", "id": "e186a356548cb9f107f5301b84c15baf85824d27", "size": "3216", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "c/commons-compress/commons-compress_1.19_1.18_1.9_ubuntu_18.04.sh", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1464" }, { "name": "C", "bytes": "14922" }, { "name": "Dockerfile", "bytes": "731231" }, { "name": "Groovy", "bytes": "984" }, { "name": "Makefile", "bytes": "7280" }, { "name": "OpenEdge ABL", "bytes": "37872" }, { "name": "Python", "bytes": "37596" }, { "name": "Roff", "bytes": "7458" }, { "name": "Shell", "bytes": "13688799" } ], "symlink_target": "" }
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <!-- Detailed information how to contribute: https://flywaydb.org/documentation/contribute/code/ A number of Jdbc drivers are unfortunately not available from Maven Central due to licensing issues. Instructions for installing them: https://flywaydb.org/documentation/contribute/devEnvironmentSetup.html If your contribution does not require changes to the database-specific code it is also possible to run the build without having to install the Jdbc drivers or databases using: mvn -P-InstallableDBTest -P-CommercialDBTest If you do not wish to install Oracle, DB2 and SqlServer you can run the build with: mvn -P-CommercialDBTest If you wish to run to Vertica, RedShift oder DB2 zOS tests, you can run the build with on of the following: mvn -PVerticaRedshiftDBTest mvn -PDB2zOSDBTest --> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.flywaydb</groupId> <artifactId>flyway-parent</artifactId> <version>0-SNAPSHOT</version> </parent> <artifactId>flyway-core</artifactId> <packaging>jar</packaging> <name>${project.artifactId}</name> <licenses> <license> <name>Apache License, Version 2.0</name> <url>https://github.com/flyway/flyway/blob/master/LICENSE.txt</url> <distribution>repo</distribution> </license> </licenses> <dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.jboss</groupId> <artifactId>jboss-vfs</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.common</artifactId> <optional>true</optional> <scope>provided</scope> </dependency> <dependency> <groupId>com.google.android</groupId> <artifactId>android</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.postgresql</groupId> <artifactId>postgresql</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.hsqldb</groupId> <artifactId>hsqldb</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.xerial</groupId> <artifactId>sqlite-jdbc</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-1.0-sdk</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-labs</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-testing</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.google.appengine</groupId> <artifactId>appengine-api-stubs</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.mariadb.jdbc</groupId> <artifactId>mariadb-java-client</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>net.sourceforge.jtds</groupId> <artifactId>jtds</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-it</artifactId> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-testing-util</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-hadoop-compat</artifactId> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.hbase</groupId> <artifactId>hbase-hadoop2-compat</artifactId> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.phoenix</groupId> <artifactId>phoenix-core</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> <plugins> <plugin> <artifactId>maven-resources-plugin</artifactId> <executions> <execution> <id>copy-license</id> <goals> <goal>copy-resources</goal> </goals> <phase>generate-resources</phase> <configuration> <resources> <resource> <directory>..</directory> <includes> <include>LICENSE.txt</include> <include>README.txt</include> </includes> </resource> </resources> <outputDirectory>${project.build.outputDirectory}/META-INF</outputDirectory> </configuration> </execution> </executions> </plugin> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <configuration> <instructions> <Bundle-SymbolicName>org.flywaydb.core</Bundle-SymbolicName> <Export-Package> org.flywaydb.core;version=${project.version}, org.flywaydb.core.api.*;version=${project.version} </Export-Package> <Import-Package> android.content;version="[4.0.1.2,5)";resolution:=optional, android.content.pm;version="[4.0.1.2,5)";resolution:=optional, android.content.res;version="[4.0.1.2,5)";resolution:=optional, android.util;version="[4.0.1.2,5)";resolution:=optional, dalvik.system;version="[4.0.1.2,5)";resolution:=optional, javax.sql, org.apache.commons.logging;version="[1.1,2)";resolution:=optional, org.jboss.vfs;version="[3.1.0,4)";resolution:=optional, org.postgresql.copy;version="[9.3.1102,10.0)";resolution:=optional, org.postgresql.core;version="[9.3.1102,10.0)";resolution:=optional, org.osgi.framework;version="1.3.0";resolution:=mandatory, org.slf4j;version="[1.6,2)";resolution:=optional, org.springframework.*;version="[2.5,5.0)";resolution:=optional </Import-Package> </instructions> </configuration> <executions> <execution> <id>bundle-manifest</id> <phase>process-classes</phase> <goals> <goal>manifest</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-javadoc-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> <sourceFileIncludes> <sourceFileInclude>**/core/Flyway.java</sourceFileInclude> <sourceFileInclude>**/core/api/**/*.java</sourceFileInclude> </sourceFileIncludes> </configuration> </plugin> </plugins> </build> <reporting> <plugins> <plugin> <artifactId>maven-javadoc-plugin</artifactId> <version>2.9.1</version> <configuration> <encoding>UTF-8</encoding> <sourceFileIncludes> <sourceFileInclude>**/core/Flyway.java</sourceFileInclude> <sourceFileInclude>**/core/api/**/*.java</sourceFileInclude> </sourceFileIncludes> </configuration> </plugin> </plugins> </reporting> <profiles> <profile> <id>EmbeddedDBTest</id> <activation> <activeByDefault>true</activeByDefault> </activation> <build> <plugins> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <configuration> <!-- Don't run the embedded Phoenix test by default, it has its own profile --> <excludedGroups>org.flywaydb.core.DbCategory$InstallableDB,org.flywaydb.core.DbCategory$Phoenix</excludedGroups> </configuration> </plugin> </plugins> </build> </profile> <profile> <id>InstallableDBTest</id> <activation> <activeByDefault>true</activeByDefault> </activation> <build> <plugins> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <configuration> <excludedGroups>org.flywaydb.core.DbCategory$CommercialDB,org.flywaydb.core.DbCategory$Phoenix</excludedGroups> </configuration> </plugin> </plugins> </build> </profile> <profile> <id>CommercialDBTest</id> <activation> <activeByDefault>true</activeByDefault> </activation> <dependencies> <dependency> <groupId>com.microsoft.sqlserver</groupId> <artifactId>sqljdbc4</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.ibm.db2</groupId> <artifactId>db2jcc4</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.sap.db.jdbc</groupId> <artifactId>ngdbc</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <configuration> <excludedGroups>org.flywaydb.core.DbCategory$ContributorSupportedDB,org.flywaydb.core.DbCategory$Phoenix</excludedGroups> </configuration> </plugin> </plugins> </build> </profile> <profile> <id>VerticaRedshiftDBTest</id> <activation> <activeByDefault>false</activeByDefault> </activation> <dependencies> <dependency> <groupId>com.vertica</groupId> <artifactId>vertica-jdbc</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <configuration> <excludedGroups>org.flywaydb.core.DbCategory$DB2zOS,org.flywaydb.core.DbCategory$Redshift,org.flywaydb.core.DbCategory$SolidDB,org.flywaydb.core.DbCategory$Phoenix</excludedGroups> </configuration> </plugin> </plugins> </build> </profile> <profile> <id>DB2zOSDBTest</id> <activation> <activeByDefault>false</activeByDefault> </activation> <dependencies> <dependency> <groupId>com.ibm.db2</groupId> <artifactId>db2jcc</artifactId> <version>8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>com.ibm.db2</groupId> <artifactId>db2jcc_license_cisuz</artifactId> <version>3.4.65</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <configuration> <excludedGroups>org.flywaydb.core.DbCategory$Vertica,org.flywaydb.core.DbCategory$Redshift,org.flywaydb.core.DbCategory$SolidDB,org.flywaydb.core.DbCategory$Phoenix</excludedGroups> </configuration> </plugin> </plugins> </build> </profile> <profile> <id>SolidDBTest</id> <activation> <activeByDefault>false</activeByDefault> </activation> <dependencies> <dependency> <groupId>com.ibm</groupId> <artifactId>SolidDriver</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <configuration> <excludedGroups>org.flywaydb.core.DbCategory$Vertica,org.flywaydb.core.DbCategory$Redshift,org.flywaydb.core.DbCategory$DB2zOS,org.flywaydb.core.DbCategory$Phoenix</excludedGroups> </configuration> </plugin> </plugins> </build> </profile> <profile> <id>PhoenixDBTest</id> <activation> <activeByDefault>false</activeByDefault> </activation> <dependencies> <!-- When using Phoenix, bring in extra SLF4J logging bridges so we can turn the log levels on Hadoop, HBase, etc. --> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>1.7.7</version> <scope>test</scope> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>log4j-over-slf4j</artifactId> <version>1.7.7</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-failsafe-plugin</artifactId> <configuration> <!-- Exclude everything but Phoenix --> <excludedGroups>org.flywaydb.core.DbCategory$CommercialDB,org.flywaydb.core.DbCategory$ContributorSupportedDB,org.flywaydb.core.DbCategory$OpenSourceDB,org.flywaydb.core.DbCategory$Derby,org.flywaydb.core.DbCategory$H2,org.flywaydb.core.DbCategory$HSQL,org.flywaydb.core.DbCategory$SQLite</excludedGroups> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <!-- Force per-class parallelization --> <configuration> <parallel>classes</parallel> </configuration> </plugin> </plugins> </build> </profile> </profiles> </project>
{ "content_hash": "4347566048674c4393fa2b1ff331d33f", "timestamp": "", "source": "github", "line_count": 467, "max_line_length": 333, "avg_line_length": 41.1627408993576, "alnum_prop": 0.4951360349581231, "repo_name": "murdos/flyway", "id": "d15d35670be6a00de3bc939322a05781e7d35da1", "size": "19223", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "flyway-core/pom.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "6651" }, { "name": "Groovy", "bytes": "31570" }, { "name": "HTML", "bytes": "3722" }, { "name": "Java", "bytes": "1397209" }, { "name": "PLSQL", "bytes": "45023" }, { "name": "PLpgSQL", "bytes": "4581" }, { "name": "SQLPL", "bytes": "13909" }, { "name": "Scala", "bytes": "25679" }, { "name": "Shell", "bytes": "1638" } ], "symlink_target": "" }
<?php namespace Ekyna\Component\Commerce\Common\Listener; use Ekyna\Component\Commerce\Common\Model\SaleInterface; use Ekyna\Component\Commerce\Common\Notify\NotifyBuilder; use Ekyna\Component\Commerce\Common\Notify\NotifyQueue; use Ekyna\Component\Resource\Model\ResourceInterface; use Ekyna\Component\Resource\Persistence\PersistenceTrackerInterface; /** * Class AbstractNotifyListener * @package Ekyna\Component\Commerce\Common\Listener * @author Etienne Dauvergne <contact@ekyna.com> */ abstract class AbstractNotifyListener { /** * @var PersistenceTrackerInterface */ protected $tracker; /** * @var NotifyQueue */ protected $queue; /** * @var NotifyBuilder */ protected $builder; /** * Constructor. * * @param PersistenceTrackerInterface $tracker * @param NotifyQueue $queue * @param NotifyBuilder $builder */ public function __construct( PersistenceTrackerInterface $tracker, NotifyQueue $queue, NotifyBuilder $builder ) { $this->tracker = $tracker; $this->queue = $queue; $this->builder = $builder; } /** * Returns whether the state of the given resource changed to the given state. * * @param ResourceInterface $resource * @param string $state * * @return bool */ protected function didStateChangeTo(ResourceInterface $resource, string $state): bool { if (empty($stateCs = $this->tracker->getChangeSet($resource, 'state'))) { return false; } if ($stateCs[1] === $state && $stateCs[0] !== $state) { return true; } return false; } /** * Returns whether the sale has a notification with the given type and key number. * * @param SaleInterface $sale * @param string $type * @param string $key * @param string $number * * @return bool */ protected function hasNotification(SaleInterface $sale, string $type, string $key, string $number): bool { foreach ($sale->getNotifications() as $n) { if ($n->getType() !== $type) { continue; } if ($n->hasData($key) && $n->getData($key) === $number) { return true; } } return false; } /** * Creates, build and enqueue a notify instance. * * @param string $type * @param ResourceInterface $resource */ protected function notify(string $type, ResourceInterface $resource): void { // Create $notify = $this->builder->create($type, $resource); // Schedule $this->queue->schedule($notify); } }
{ "content_hash": "621e46122c6e88cff7a3b107a975c099", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 108, "avg_line_length": 25.45945945945946, "alnum_prop": 0.5799716914366596, "repo_name": "ekyna/Commerce", "id": "3c02ac9a5f2bd3cc96878be0d2b999323e3327db", "size": "2826", "binary": false, "copies": "1", "ref": "refs/heads/0.7", "path": "Common/Listener/AbstractNotifyListener.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "3575955" }, { "name": "Twig", "bytes": "20385" } ], "symlink_target": "" }
package dagger.android; import dagger.internal.Beta; /** Provides an {@link AndroidInjector}. */ @Beta public interface HasAndroidInjector { /** Returns an {@link AndroidInjector}. */ AndroidInjector<Object> androidInjector(); }
{ "content_hash": "acda7959a036d4232ab32b7c938a256d", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 44, "avg_line_length": 19.75, "alnum_prop": 0.7341772151898734, "repo_name": "dushmis/dagger", "id": "3b497182b3bb5db24c2c4f6d6ade13e3e0a782a0", "size": "839", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "java/dagger/android/HasAndroidInjector.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "1289133" }, { "name": "Shell", "bytes": "2962" } ], "symlink_target": "" }
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__) require 'assetz'
{ "content_hash": "a00c2d3085495e6cacf4802abaa6514f", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 58, "avg_line_length": 38, "alnum_prop": 0.6447368421052632, "repo_name": "moss-rb/assetz", "id": "063b1e2966594ea20db144bfaf5d5bd3781bb3cc", "size": "76", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "spec/spec_helper.rb", "mode": "33188", "license": "mit", "language": [ { "name": "Ruby", "bytes": "1886" }, { "name": "Shell", "bytes": "131" } ], "symlink_target": "" }
from CIM15.IEC61970.Core.IdentifiedObject import IdentifiedObject class Hazard(IdentifiedObject): """A hazard is any object or condition that is a danger for causing loss or perils to an asset and/or people. Examples of hazards are trees growing under overhead power lines, a park being located by a substation (i.e., children climb fence to recover a ball), a lake near an overhead distribution line (fishing pole/line contacting power lines), etc.A hazard is any object or condition that is a danger for causing loss or perils to an asset and/or people. Examples of hazards are trees growing under overhead power lines, a park being located by a substation (i.e., children climb fence to recover a ball), a lake near an overhead distribution line (fishing pole/line contacting power lines), etc. """ def __init__(self, category='', Locations=None, status=None, *args, **kw_args): """Initialises a new 'Hazard' instance. @param category: Category by utility's corporate standards and practices. @param Locations: The point or polygon location of a given hazard. @param status: """ #: Category by utility's corporate standards and practices. self.category = category self._Locations = [] self.Locations = [] if Locations is None else Locations self.status = status super(Hazard, self).__init__(*args, **kw_args) _attrs = ["category"] _attr_types = {"category": str} _defaults = {"category": ''} _enums = {} _refs = ["Locations", "status"] _many_refs = ["Locations"] def getLocations(self): """The point or polygon location of a given hazard. """ return self._Locations def setLocations(self, value): for p in self._Locations: filtered = [q for q in p.Hazards if q != self] self._Locations._Hazards = filtered for r in value: if self not in r._Hazards: r._Hazards.append(self) self._Locations = value Locations = property(getLocations, setLocations) def addLocations(self, *Locations): for obj in Locations: if self not in obj._Hazards: obj._Hazards.append(self) self._Locations.append(obj) def removeLocations(self, *Locations): for obj in Locations: if self in obj._Hazards: obj._Hazards.remove(self) self._Locations.remove(obj) status = None
{ "content_hash": "2b9ac37e49624bfb74645f2feb387ead", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 703, "avg_line_length": 41.71666666666667, "alnum_prop": 0.6448262085497403, "repo_name": "rwl/PyCIM", "id": "9903c50a77abee654f273c792bec0822d694fae6", "size": "3603", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "CIM15/IEC61970/Informative/InfLocations/Hazard.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "7420564" } ], "symlink_target": "" }
- Update bundler version - Update ruby version - Update dependency version # v2.0.0 ## Changes - Remove rest-client dependency - Optimize symbols as keys # v1.2.0 ## Changes - Add timeout to TWW gem request
{ "content_hash": "3b963207aba910a447ecdffb88b1166e", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 32, "avg_line_length": 15.071428571428571, "alnum_prop": 0.7298578199052133, "repo_name": "dlibanori/tww", "id": "0146c86df8f66040cd86b61d0a098b815e7c9dfc", "size": "232", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "CHANGELOG.md", "mode": "33188", "license": "mit", "language": [ { "name": "Gherkin", "bytes": "631" }, { "name": "Ruby", "bytes": "12183" }, { "name": "Shell", "bytes": "131" } ], "symlink_target": "" }
<!DOCTYPE HTML> <html> <head> <meta charset="UTF-8"> <title>Spectral factorization using Kolmogorov 1939 approach</title> <link rel="canonical" href="http://cvxr.com/cvx/examples/antenna_array_design/html/spectral_fact.html"> <link rel="stylesheet" href="../../examples.css" type="text/css"> </head> <body> <div id="header"> <h1>Spectral factorization using Kolmogorov 1939 approach</h1> Jump to:&nbsp;&nbsp;&nbsp;&nbsp; <a href="#source">Source code</a>&nbsp;&nbsp;&nbsp;&nbsp; Text output &nbsp;&nbsp;&nbsp;&nbsp; Plots &nbsp;&nbsp;&nbsp;&nbsp;<a href="../../index.html">Library index</a> </div> <div id="content"> <a id="source"></a> <pre class="codeinput"> <span class="comment">% (code follows pp. 232-233, Signal Analysis, by A. Papoulis)</span> <span class="comment">%</span> <span class="comment">% Computes the minimum-phase impulse response which satisfies</span> <span class="comment">% given auto-correlation.</span> <span class="comment">%</span> <span class="comment">% Input:</span> <span class="comment">% r: top-half of the auto-correlation coefficients</span> <span class="comment">% starts from 0th element to end of the auto-corelation</span> <span class="comment">% should be passed in as a column vector</span> <span class="comment">% Output</span> <span class="comment">% h: impulse response that gives the desired auto-correlation</span> <span class="keyword">function</span> h = spectral_fact(r) <span class="comment">% length of the impulse response sequence</span> nr = length(r); n = (nr+1)/2; <span class="comment">% over-sampling factor</span> mult_factor = 30; <span class="comment">% should have mult_factor*(n) &gt;&gt; n</span> m = mult_factor*n; <span class="comment">% computation method:</span> <span class="comment">% H(exp(jTw)) = alpha(w) + j*phi(w)</span> <span class="comment">% where alpha(w) = 1/2*ln(R(w)) and phi(w) = Hilbert_trans(alpha(w))</span> <span class="comment">% compute 1/2*ln(R(w))</span> w = 2*pi*[0:m-1]/m; R = exp( -j*kron(w',[-(n-1):n-1]) )*r; R = abs(real(R)); <span class="comment">% remove numerical noise from the imaginary part</span> figure; plot(20*log10(R)); alpha = 1/2*log(R); <span class="comment">% find the Hilbert transform</span> alphatmp = fft(alpha); alphatmp(floor(m/2)+1:m) = -alphatmp(floor(m/2)+1:m); alphatmp(1) = 0; alphatmp(floor(m/2)+1) = 0; phi = real(ifft(j*alphatmp)); <span class="comment">% now retrieve the original sampling</span> index = find(rem([0:m-1],mult_factor)==0); alpha1 = alpha(index); phi1 = phi(index); <span class="comment">% compute the impulse response (inverse Fourier transform)</span> h = ifft(exp(alpha1+j*phi1),n); </pre> </div> </body> </html>
{ "content_hash": "7bd943af3e57e38c88ad056ecfa22f5b", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 103, "avg_line_length": 37.388888888888886, "alnum_prop": 0.6794205052005944, "repo_name": "wittawatj/kernel-ep", "id": "075db77358e6010f8274d1d3e5711a657bc88e77", "size": "2692", "binary": false, "copies": "6", "ref": "refs/heads/master", "path": "code/3rdparty/cvx/examples/antenna_array_design/html/spectral_fact.html", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "285141" }, { "name": "MATLAB", "bytes": "830838" }, { "name": "Vim script", "bytes": "73590" } ], "symlink_target": "" }
from typing import Any, TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from .._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from azure.core.credentials_async import AsyncTokenCredential class AzureDigitalTwinsAPIConfiguration(Configuration): # pylint: disable=too-many-instance-attributes """Configuration for AzureDigitalTwinsAPI. Note that all parameters used to create this instance are saved as instance attributes. :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :keyword api_version: Api Version. Default value is "2022-05-31". Note that overriding this default value may result in unsupported behavior. :paramtype api_version: str """ def __init__( self, credential: "AsyncTokenCredential", **kwargs: Any ) -> None: super(AzureDigitalTwinsAPIConfiguration, self).__init__(**kwargs) api_version = kwargs.pop('api_version', "2022-05-31") # type: str if credential is None: raise ValueError("Parameter 'credential' must not be None.") self.credential = credential self.api_version = api_version self.credential_scopes = kwargs.pop('credential_scopes', ['https://digitaltwins.azure.net/.default']) kwargs.setdefault('sdk_moniker', 'azuredigitaltwinsapi/{}'.format(VERSION)) self._configure(**kwargs) def _configure( self, **kwargs: Any ) -> None: self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs) self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs) self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs) self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs) self.http_logging_policy = kwargs.get('http_logging_policy') or policies.HttpLoggingPolicy(**kwargs) self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs) self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs) self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs) self.authentication_policy = kwargs.get('authentication_policy') if self.credential and not self.authentication_policy: self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
{ "content_hash": "ed7169e21f4a1a43a3206a93b14c3060", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 134, "avg_line_length": 47.64912280701754, "alnum_prop": 0.7106038291605302, "repo_name": "Azure/azure-sdk-for-python", "id": "1be0c6b5217f4db50223dba5d6133ab76df92204", "size": "3184", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "sdk/digitaltwins/azure-digitaltwins-core/azure/digitaltwins/core/_generated/aio/_configuration.py", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "1224" }, { "name": "Bicep", "bytes": "24196" }, { "name": "CSS", "bytes": "6089" }, { "name": "Dockerfile", "bytes": "4892" }, { "name": "HTML", "bytes": "12058" }, { "name": "JavaScript", "bytes": "8137" }, { "name": "Jinja", "bytes": "10377" }, { "name": "Jupyter Notebook", "bytes": "272022" }, { "name": "PowerShell", "bytes": "518535" }, { "name": "Python", "bytes": "715484989" }, { "name": "Shell", "bytes": "3631" } ], "symlink_target": "" }
package org.jivesoftware.smackx.workgroup.agent; import java.util.*; import org.jivesoftware.smackx.workgroup.QueueUser; /** * A queue in a workgroup, which is a pool of agents that are routed a specific type of * chat request. */ public class WorkgroupQueue { private String name; private Status status = Status.CLOSED; private int averageWaitTime = -1; private Date oldestEntry = null; private Set<QueueUser> users = Collections.emptySet(); private int maxChats = 0; private int currentChats = 0; /** * Creates a new workgroup queue instance. * * @param name the name of the queue. */ WorkgroupQueue(String name) { this.name = name; } /** * Returns the name of the queue. * * @return the name of the queue. */ public String getName() { return name; } /** * Returns the status of the queue. * * @return the status of the queue. */ public Status getStatus() { return status; } void setStatus(Status status) { this.status = status; } /** * Returns the number of users waiting in the queue waiting to be routed to * an agent. * * @return the number of users waiting in the queue. */ public int getUserCount() { if (users == null) { return 0; } return users.size(); } /** * Returns an Iterator for the users in the queue waiting to be routed to * an agent (QueueUser instances). * * @return an Iterator for the users waiting in the queue. */ public Iterator<QueueUser> getUsers() { if (users == null) { return new HashSet<QueueUser>().iterator(); } return Collections.unmodifiableSet(users).iterator(); } void setUsers(Set<QueueUser> users) { this.users = users; } /** * Returns the average amount of time users wait in the queue before being * routed to an agent. If average wait time info isn't available, -1 will * be returned. * * @return the average wait time */ public int getAverageWaitTime() { return averageWaitTime; } void setAverageWaitTime(int averageTime) { this.averageWaitTime = averageTime; } /** * Returns the date of the oldest request waiting in the queue. If there * are no requests waiting to be routed, this method will return <tt>null</tt>. * * @return the date of the oldest request in the queue. */ public Date getOldestEntry() { return oldestEntry; } void setOldestEntry(Date oldestEntry) { this.oldestEntry = oldestEntry; } /** * Returns the maximum number of simultaneous chats the queue can handle. * * @return the max number of chats the queue can handle. */ public int getMaxChats() { return maxChats; } void setMaxChats(int maxChats) { this.maxChats = maxChats; } /** * Returns the current number of active chat sessions in the queue. * * @return the current number of active chat sessions in the queue. */ public int getCurrentChats() { return currentChats; } void setCurrentChats(int currentChats) { this.currentChats = currentChats; } /** * A class to represent the status of the workgroup. The possible values are: * * <ul> * <li>WorkgroupQueue.Status.OPEN -- the queue is active and accepting new chat requests. * <li>WorkgroupQueue.Status.ACTIVE -- the queue is active but NOT accepting new chat * requests. * <li>WorkgroupQueue.Status.CLOSED -- the queue is NOT active and NOT accepting new * chat requests. * </ul> */ public static class Status { /** * The queue is active and accepting new chat requests. */ public static final Status OPEN = new Status("open"); /** * The queue is active but NOT accepting new chat requests. This state might * occur when the workgroup has closed because regular support hours have closed, * but there are still several requests left in the queue. */ public static final Status ACTIVE = new Status("active"); /** * The queue is NOT active and NOT accepting new chat requests. */ public static final Status CLOSED = new Status("closed"); /** * Converts a String into the corresponding status. Valid String values * that can be converted to a status are: "open", "active", and "closed". * * @param type the String value to covert. * @return the corresponding Type. */ public static Status fromString(String type) { if (type == null) { return null; } type = type.toLowerCase(); if (OPEN.toString().equals(type)) { return OPEN; } else if (ACTIVE.toString().equals(type)) { return ACTIVE; } else if (CLOSED.toString().equals(type)) { return CLOSED; } else { return null; } } private String value; private Status(String value) { this.value = value; } public String toString() { return value; } } }
{ "content_hash": "c3dbe3b369a3fedb317e00ae9019d6ea", "timestamp": "", "source": "github", "line_count": 207, "max_line_length": 98, "avg_line_length": 27.714975845410628, "alnum_prop": 0.5570855848004184, "repo_name": "mcaprari/smack", "id": "b43c826081ba27e0616a02515e1cd74b0bde4015", "size": "6405", "binary": false, "copies": "12", "ref": "refs/heads/master", "path": "source/org/jivesoftware/smackx/workgroup/agent/WorkgroupQueue.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Java", "bytes": "4220836" } ], "symlink_target": "" }
package org.xs.dntown.wx.common.persistence; import org.hibernate.Session; import org.hibernate.SessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.xs.dntown.wx.common.utils.Reflections; /** * 底层数据支持类 */ public class BaseDao <T>{ @Autowired protected SessionFactory sessionFactory; /** * 获取 Session */ public Session getSession(){ return sessionFactory.getCurrentSession(); } /** * 强制与数据库同步 */ public void flush(){ getSession().flush(); } /** * 清除缓存数据 */ public void clear(){ getSession().clear(); } /** * 实体类类型(由构造方法自动赋值) */ protected Class<?> entityClass; /** * 构造函数 */ public BaseDao() { entityClass = Reflections.getClassGenricType(getClass()); } }
{ "content_hash": "8649895a5f90cbf9c028b9e958fc8b85", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 62, "avg_line_length": 15.6875, "alnum_prop": 0.6759628154050464, "repo_name": "ctxsdhy/dntown", "id": "5be37a993b01e672387bf8017bf2846bcdf07022", "size": "835", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "dntown-wx/dntown-wx-core/src/main/java/org/xs/dntown/wx/common/persistence/BaseDao.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "111585" } ], "symlink_target": "" }
<div class="doc-content"> <header class="api-profile-header" > <h2 class="md-display-1" >API Reference</h2> </header> <div layout="row" class="api-options-bar with-icon"></div> <div class="api-profile-description"> <p><code>$mdMedia</code> is used to evaluate whether a given media query is true or false given the current device&#39;s screen / window size. The media query will be re-evaluated on resize, allowing you to register a watch.</p> <p><code>$mdMedia</code> also has pre-programmed support for media queries that match the layout breakpoints. (<code>sm</code>, <code>gt-sm</code>, <code>md</code>, <code>gt-md</code>, <code>lg</code>, <code>gt-lg</code>).</p> </div> <div> <section class="api-section"> <h2 id="Usage">Usage</h2> <hljs lang="js"> app.controller(&#39;MyController&#39;, function($mdMedia, $scope) { $scope.$watch(function() { return $mdMedia(&#39;lg&#39;); }, function(big) { $scope.bigScreen = big; }); $scope.screenIsSmall = $mdMedia(&#39;sm&#39;); $scope.customQuery = $mdMedia(&#39;(min-width: 1234px)&#39;); $scope.anotherCustom = $mdMedia(&#39;max-width: 300px&#39;); }); </hljs> </section> <section class="api-section"> <section class="api-section"> </section> <div class="api-param-table"> <table class="no-style"> <thead> <tr> <th>Returns</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td> <code class="api-type label type-hint type-hint-boolean">boolean</code></td> <td class="description"><p>a boolean representing whether or not the given media query is true or false.</p> </td> </tr> </tbody> </table> </div> </section> </div> </div>
{ "content_hash": "2b97e7f762f8155e9e07bea51096eb08", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 117, "avg_line_length": 19.850574712643677, "alnum_prop": 0.6259409380428489, "repo_name": "angular/code.material.angularjs.org", "id": "c66bc3b709db5bc413636463f5c926f055e394f5", "size": "1727", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "0.9.8/partials/api/material.core/service/$mdMedia.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "33810102" }, { "name": "HTML", "bytes": "41451971" }, { "name": "JavaScript", "bytes": "27787154" }, { "name": "SCSS", "bytes": "461693" } ], "symlink_target": "" }
require "rjava" # [The "BSD licence"] # Copyright (c) 2005-2006 Terence Parr # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. module Org::Antlr::Test module TestUnBufferedTreeNodeStreamImports #:nodoc: class_module.module_eval { include ::Java::Lang include ::Org::Antlr::Test include ::Org::Antlr::Runtime::Tree include_const ::Org::Antlr::Runtime, :CommonToken include_const ::Org::Antlr::Runtime, :Token } end class TestUnBufferedTreeNodeStream < TestUnBufferedTreeNodeStreamImports.const_get :TestTreeNodeStream include_class_members TestUnBufferedTreeNodeStreamImports typesig { [Object] } def new_stream(t) return UnBufferedTreeNodeStream.new(t) end typesig { [] } def test_buffer_overflow buf = StringBuffer.new buf2 = StringBuffer.new # make ^(101 102 ... n) t = CommonTree.new(CommonToken.new(101)) buf.append(" 101") buf2.append(" 101") buf2.append(" ") buf2.append(Token::DOWN) i = 0 while i <= UnBufferedTreeNodeStream::INITIAL_LOOKAHEAD_BUFFER_SIZE + 10 t.add_child(CommonTree.new(CommonToken.new(102 + i))) buf.append(" ") buf.append(102 + i) buf2.append(" ") buf2.append(102 + i) i += 1 end buf2.append(" ") buf2.append(Token::UP) stream = new_stream(t) expecting = buf.to_s found = to_nodes_only_string(stream) assert_equals(expecting, found) expecting = RJava.cast_to_string(buf2.to_s) found = RJava.cast_to_string(stream.to_s) assert_equals(expecting, found) end typesig { [] } # Test what happens when tail hits the end of the buffer, but there # is more room left. Specifically that would mean that head is not # at 0 but has advanced somewhere to the middle of the lookahead # buffer. # # Use consume() to advance N nodes into lookahead. Then use LT() # to load at least INITIAL_LOOKAHEAD_BUFFER_SIZE-N nodes so the # buffer has to wrap. def test_buffer_wrap n = 10 # make tree with types: 1 2 ... INITIAL_LOOKAHEAD_BUFFER_SIZE+N t = CommonTree.new(nil) i = 0 while i < UnBufferedTreeNodeStream::INITIAL_LOOKAHEAD_BUFFER_SIZE + n t.add_child(CommonTree.new(CommonToken.new(i + 1))) i += 1 end # move head to index N stream = new_stream(t) i_ = 1 while i_ <= n # consume N node = stream._lt(1) assert_equals(i_, node.get_type) stream.consume i_ += 1 end # now use LT to lookahead past end of buffer remaining = UnBufferedTreeNodeStream::INITIAL_LOOKAHEAD_BUFFER_SIZE - n wrap_by = 4 # wrap around by 4 nodes assert_true("bad test code; wrapBy must be less than N", wrap_by < n) i__ = 1 while i__ <= remaining + wrap_by # wrap past end of buffer node = stream._lt(i__) # look ahead to ith token assert_equals(n + i__, node.get_type) i__ += 1 end end typesig { [] } def initialize super() end private alias_method :initialize__test_un_buffered_tree_node_stream, :initialize end end
{ "content_hash": "754df38b10547f4d291147164389303d", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 104, "avg_line_length": 36.25984251968504, "alnum_prop": 0.6605863192182411, "repo_name": "neelance/antlr4ruby", "id": "b518d70e2a3ca4bc23758fbfd5d2f779f3f3dabb", "size": "4605", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "antlr4ruby/lib/org/antlr/test/TestUnBufferedTreeNodeStream.rb", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "2588943" }, { "name": "Ruby", "bytes": "3099327" }, { "name": "Smalltalk", "bytes": "1692" } ], "symlink_target": "" }
<?php namespace Symfony\Component\Security\Acl\Voter; use Symfony\Component\HttpKernel\Log\LoggerInterface; use Symfony\Component\Security\Acl\Domain\ObjectIdentity; use Symfony\Component\Security\Acl\Domain\RoleSecurityIdentity; use Symfony\Component\Security\Acl\Domain\UserSecurityIdentity; use Symfony\Component\Security\Acl\Exception\NoAceFoundException; use Symfony\Component\Security\Acl\Exception\AclNotFoundException; use Symfony\Component\Security\Acl\Model\AclProviderInterface; use Symfony\Component\Security\Acl\Permission\PermissionMapInterface; use Symfony\Component\Security\Acl\Model\SecurityIdentityRetrievalStrategyInterface; use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface; use Symfony\Component\Security\Core\Role\RoleHierarchyInterface; /** * This voter can be used as a base class for implementing your own permissions. * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ class AclVoter implements VoterInterface { private $aclProvider; private $permissionMap; private $objectIdentityRetrievalStrategy; private $securityIdentityRetrievalStrategy; private $allowIfObjectIdentityUnavailable; private $logger; public function __construct(AclProviderInterface $aclProvider, ObjectIdentityRetrievalStrategyInterface $oidRetrievalStrategy, SecurityIdentityRetrievalStrategyInterface $sidRetrievalStrategy, PermissionMapInterface $permissionMap, LoggerInterface $logger = null, $allowIfObjectIdentityUnavailable = true) { $this->aclProvider = $aclProvider; $this->permissionMap = $permissionMap; $this->objectIdentityRetrievalStrategy = $oidRetrievalStrategy; $this->securityIdentityRetrievalStrategy = $sidRetrievalStrategy; $this->logger = $logger; $this->allowIfObjectIdentityUnavailable = $allowIfObjectIdentityUnavailable; } public function supportsAttribute($attribute) { return $this->permissionMap->contains($attribute); } public function vote(TokenInterface $token, $object, array $attributes) { $firstCall = true; foreach ($attributes as $attribute) { if (!$this->supportsAttribute($attribute)) { continue; } if ($firstCall) { $firstCall = false; if (null === $object) { if (null !== $this->logger) { $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); } return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN; } else if ($object instanceof FieldVote) { $field = $object->getField(); $object = $object->getDomainObject(); } else { $field = null; } if (null === $oid = $this->objectIdentityRetrievalStrategy->getObjectIdentity($object)) { if (null !== $this->logger) { $this->logger->debug(sprintf('Object identity unavailable. Voting to %s', $this->allowIfObjectIdentityUnavailable? 'grant access' : 'abstain')); } return $this->allowIfObjectIdentityUnavailable ? self::ACCESS_GRANTED : self::ACCESS_ABSTAIN; } $sids = $this->securityIdentityRetrievalStrategy->getSecurityIdentities($token); try { $acl = $this->aclProvider->findAcl($oid, $sids); } catch (AclNotFoundException $noAcl) { if (null !== $this->logger) { $this->logger->debug('No ACL found for the object identity. Voting to deny access.'); } return self::ACCESS_DENIED; } } try { if (null === $field && $acl->isGranted($this->permissionMap->getMasks($attribute), $sids, false)) { if (null !== $this->logger) { $this->logger->debug('ACL found, permission granted. Voting to grant access'); } return self::ACCESS_GRANTED; } else if (null !== $field && $acl->isFieldGranted($field, $this->permissionMap->getMasks($attribute), $sids, false)) { if (null !== $this->logger) { $this->logger->debug('ACL found, permission granted. Voting to grant access'); } return self::ACCESS_GRANTED; } if (null !== $this->logger) { $this->logger->debug('ACL found, insufficient permissions. Voting to deny access.'); } return self::ACCESS_DENIED; } catch (NoAceFoundException $noAce) { if (null !== $this->logger) { $this->logger->debug('ACL found, no ACE applicable. Voting to deny access.'); } return self::ACCESS_DENIED; } } // no attribute was supported return self::ACCESS_ABSTAIN; } /** * You can override this method when writing a voter for a specific domain * class. * * @return Boolean */ public function supportsClass($class) { return true; } }
{ "content_hash": "cb6b6bd10ad8343eca91642a24a185a6", "timestamp": "", "source": "github", "line_count": 137, "max_line_length": 309, "avg_line_length": 41.11678832116788, "alnum_prop": 0.6106870229007634, "repo_name": "ajessu/jobeet", "id": "e7811edb3a849175760a976fb92d78df2cdc79db", "size": "5862", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "vendor/symfony/src/Symfony/Component/Security/Acl/Voter/AclVoter.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "49519" } ], "symlink_target": "" }
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is JavaScript Engine testing utilities. * * The Initial Developer of the Original Code is * Mozilla Foundation. * Portions created by the Initial Developer are Copyright (C) 2008 * the Initial Developer. All Rights Reserved. * * Contributor(s): * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ //----------------------------------------------------------------------------- var BUGNUMBER = 459389; var summary = 'Do not crash with JIT'; var actual = ''; var expect = ''; printBugNumber(BUGNUMBER); printStatus (summary); print('mmmm, food!'); jit(true); var SNI = {}; SNI.MetaData={}; SNI.MetaData.Parameter=function() { var parameters={}; this.addParameter=function(key,value) { parameters[key]=[]; parameters[key].push(value); }; this.getParameter=function(key,separator){ if(!parameters[key]) { return; } return parameters[key].join(separator); }; this.getKeys=function() { return parameters; }; }; SNI.MetaData.Manager=function(){ var m=new SNI.MetaData.Parameter(); this.getParameter=m.getParameter; }; var MetaDataManager=SNI.MetaData.Manager; SNI.Ads={ }; SNI.Ads.Url=function(){ var p=new SNI.MetaData.Parameter(); this.addParameter=p.addParameter; this.getParameter=p.getParameter; }; function Ad() { var url=new SNI.Ads.Url(); this.addParameter=url.addParameter; this.getParameter=url.getParameter; } function DartAd() AdUrl.prototype=new Ad(); function AdUrl() { } function AdRestriction() { var p=new SNI.MetaData.Parameter(); this.addParameter=p.addParameter; this.getParameter=p.getParameter; this.getKeys=p.getKeys; } function AdRestrictionManager(){ this.restriction=[]; this.isActive=isActive; this.isMatch=isMatch; this.startMatch=startMatch; function isActive(ad,mdm){ var value=false; for(var i=0;i<this.restriction.length;i++) { adRestriction=this.restriction[i]; value=this.startMatch(ad,mdm,adRestriction); } } function startMatch(ad,mdm,adRestriction){ for(var key in adRestriction.getKeys()){ var restrictions=adRestriction.getParameter(key,','); var value=mdm.getParameter(key,''); match=this.isMatch(value,restrictions); if(!match){ value=ad.getParameter(key,'') match=this.isMatch(value,restrictions); } } } function isMatch(value,restrictions){ var match=false; if(value) { splitValue=value.split(''); for(var x=0;x<splitValue.length;x++){ for(var a;a<restrictions.length;a++){ } } } return match; } } var adRestrictionManager = new AdRestrictionManager(); var restrictionLeader6 = new AdRestriction(); restrictionLeader6.addParameter("", ""); adRestrictionManager.restriction.push(restrictionLeader6); var restrictionLeader7 = new AdRestriction(); restrictionLeader7.addParameter("", ""); adRestrictionManager.restriction.push(restrictionLeader7); function FoodAd(adtype) { ad=new DartAd() ad.addParameter("",adtype) adRestrictionManager.isActive(ad, mdManager) } var mdManager = new MetaDataManager() ; FoodAd('P') jit(false); reportCompare(expect, actual, summary);
{ "content_hash": "566d83498c3675dc116bcad7d866e3bb", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 79, "avg_line_length": 29.00657894736842, "alnum_prop": 0.7269222045815378, "repo_name": "daejunpark/jsaf", "id": "e8d748af307eef68e31c1bc9cc20295e2196091a", "size": "4409", "binary": false, "copies": "11", "ref": "refs/heads/master", "path": "tests/browser_extensions/js1_8/regress/regress-459389.js", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "ApacheConf", "bytes": "379" }, { "name": "C", "bytes": "59067" }, { "name": "C++", "bytes": "13294" }, { "name": "CSS", "bytes": "9351891" }, { "name": "Emacs Lisp", "bytes": "9812" }, { "name": "HTML", "bytes": "19106074" }, { "name": "Jasmin", "bytes": "46" }, { "name": "Java", "bytes": "375421" }, { "name": "JavaScript", "bytes": "51177272" }, { "name": "Makefile", "bytes": "3558" }, { "name": "Objective-C", "bytes": "345276" }, { "name": "Objective-J", "bytes": "4500028" }, { "name": "PHP", "bytes": "12684" }, { "name": "Perl", "bytes": "5278" }, { "name": "Python", "bytes": "75059" }, { "name": "Ruby", "bytes": "22932" }, { "name": "Scala", "bytes": "5542753" }, { "name": "Shell", "bytes": "91018" }, { "name": "VimL", "bytes": "6985" }, { "name": "XML", "bytes": "1288109" } ], "symlink_target": "" }
class Admin::StudentsController < ApplicationController def index end end
{ "content_hash": "e752e208a5dad07bb92c836d1191267e", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 55, "avg_line_length": 19.5, "alnum_prop": 0.8076923076923077, "repo_name": "natsteinmetz/partner_dashboard", "id": "c6042f89b4c520dff2127228037f92079c6f5253", "size": "78", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/controllers/admin/students_controller.rb", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "1872" }, { "name": "CoffeeScript", "bytes": "5226" }, { "name": "JavaScript", "bytes": "682" }, { "name": "Ruby", "bytes": "119624" } ], "symlink_target": "" }
import * as React from 'react'; import { IconBaseProps } from 'react-icon-base'; export default class FaBattery0 extends React.Component<IconBaseProps, any> { }
{ "content_hash": "27abf008adb4642fad0c30eaea026000", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 79, "avg_line_length": 53.666666666666664, "alnum_prop": 0.7639751552795031, "repo_name": "smrq/DefinitelyTyped", "id": "0a3abd265281fb54283ea13e05b88d5229c465da", "size": "161", "binary": false, "copies": "8", "ref": "refs/heads/master", "path": "types/react-icons/fa/battery-0.d.ts", "mode": "33188", "license": "mit", "language": [ { "name": "JavaScript", "bytes": "1193" }, { "name": "TypeScript", "bytes": "24350620" } ], "symlink_target": "" }
 #pragma once #include <aws/lightsail/Lightsail_EXPORTS.h> #include <aws/lightsail/LightsailRequest.h> #include <aws/core/utils/memory/stl/AWSString.h> #include <utility> namespace Aws { namespace Lightsail { namespace Model { /** */ class AWS_LIGHTSAIL_API DeleteKeyPairRequest : public LightsailRequest { public: DeleteKeyPairRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "DeleteKeyPair"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** * <p>The name of the key pair to delete.</p> */ inline const Aws::String& GetKeyPairName() const{ return m_keyPairName; } /** * <p>The name of the key pair to delete.</p> */ inline bool KeyPairNameHasBeenSet() const { return m_keyPairNameHasBeenSet; } /** * <p>The name of the key pair to delete.</p> */ inline void SetKeyPairName(const Aws::String& value) { m_keyPairNameHasBeenSet = true; m_keyPairName = value; } /** * <p>The name of the key pair to delete.</p> */ inline void SetKeyPairName(Aws::String&& value) { m_keyPairNameHasBeenSet = true; m_keyPairName = std::move(value); } /** * <p>The name of the key pair to delete.</p> */ inline void SetKeyPairName(const char* value) { m_keyPairNameHasBeenSet = true; m_keyPairName.assign(value); } /** * <p>The name of the key pair to delete.</p> */ inline DeleteKeyPairRequest& WithKeyPairName(const Aws::String& value) { SetKeyPairName(value); return *this;} /** * <p>The name of the key pair to delete.</p> */ inline DeleteKeyPairRequest& WithKeyPairName(Aws::String&& value) { SetKeyPairName(std::move(value)); return *this;} /** * <p>The name of the key pair to delete.</p> */ inline DeleteKeyPairRequest& WithKeyPairName(const char* value) { SetKeyPairName(value); return *this;} /** * <p>The RSA fingerprint of the Lightsail default key pair to delete.</p> * <p>The <code>expectedFingerprint</code> parameter is required only when * specifying to delete a Lightsail default key pair.</p> */ inline const Aws::String& GetExpectedFingerprint() const{ return m_expectedFingerprint; } /** * <p>The RSA fingerprint of the Lightsail default key pair to delete.</p> * <p>The <code>expectedFingerprint</code> parameter is required only when * specifying to delete a Lightsail default key pair.</p> */ inline bool ExpectedFingerprintHasBeenSet() const { return m_expectedFingerprintHasBeenSet; } /** * <p>The RSA fingerprint of the Lightsail default key pair to delete.</p> * <p>The <code>expectedFingerprint</code> parameter is required only when * specifying to delete a Lightsail default key pair.</p> */ inline void SetExpectedFingerprint(const Aws::String& value) { m_expectedFingerprintHasBeenSet = true; m_expectedFingerprint = value; } /** * <p>The RSA fingerprint of the Lightsail default key pair to delete.</p> * <p>The <code>expectedFingerprint</code> parameter is required only when * specifying to delete a Lightsail default key pair.</p> */ inline void SetExpectedFingerprint(Aws::String&& value) { m_expectedFingerprintHasBeenSet = true; m_expectedFingerprint = std::move(value); } /** * <p>The RSA fingerprint of the Lightsail default key pair to delete.</p> * <p>The <code>expectedFingerprint</code> parameter is required only when * specifying to delete a Lightsail default key pair.</p> */ inline void SetExpectedFingerprint(const char* value) { m_expectedFingerprintHasBeenSet = true; m_expectedFingerprint.assign(value); } /** * <p>The RSA fingerprint of the Lightsail default key pair to delete.</p> * <p>The <code>expectedFingerprint</code> parameter is required only when * specifying to delete a Lightsail default key pair.</p> */ inline DeleteKeyPairRequest& WithExpectedFingerprint(const Aws::String& value) { SetExpectedFingerprint(value); return *this;} /** * <p>The RSA fingerprint of the Lightsail default key pair to delete.</p> * <p>The <code>expectedFingerprint</code> parameter is required only when * specifying to delete a Lightsail default key pair.</p> */ inline DeleteKeyPairRequest& WithExpectedFingerprint(Aws::String&& value) { SetExpectedFingerprint(std::move(value)); return *this;} /** * <p>The RSA fingerprint of the Lightsail default key pair to delete.</p> * <p>The <code>expectedFingerprint</code> parameter is required only when * specifying to delete a Lightsail default key pair.</p> */ inline DeleteKeyPairRequest& WithExpectedFingerprint(const char* value) { SetExpectedFingerprint(value); return *this;} private: Aws::String m_keyPairName; bool m_keyPairNameHasBeenSet = false; Aws::String m_expectedFingerprint; bool m_expectedFingerprintHasBeenSet = false; }; } // namespace Model } // namespace Lightsail } // namespace Aws
{ "content_hash": "de1452aa8532c23b292e055a2c75e344", "timestamp": "", "source": "github", "line_count": 142, "max_line_length": 145, "avg_line_length": 38.73943661971831, "alnum_prop": 0.6900563533902927, "repo_name": "aws/aws-sdk-cpp", "id": "893176bfe7675adbdb2ced66c84ca42e4f9f0c7e", "size": "5620", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "aws-cpp-sdk-lightsail/include/aws/lightsail/model/DeleteKeyPairRequest.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "309797" }, { "name": "C++", "bytes": "476866144" }, { "name": "CMake", "bytes": "1245180" }, { "name": "Dockerfile", "bytes": "11688" }, { "name": "HTML", "bytes": "8056" }, { "name": "Java", "bytes": "413602" }, { "name": "Python", "bytes": "79245" }, { "name": "Shell", "bytes": "9246" } ], "symlink_target": "" }
using System; using System.Collections.Generic; using System.Text; namespace Jaeger4Net { public class Reference { public SpanContext Context { get; } public string Type { get; } public Reference(SpanContext context, string type) { this.Context = context; this.Type = type; } } }
{ "content_hash": "07fef6e80d900482a61dbf273f552b13", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 58, "avg_line_length": 19.944444444444443, "alnum_prop": 0.5933147632311978, "repo_name": "gideonkorir/jaeger4net", "id": "e2b366512bda6ee9cdba2a575d2d51930a784e3f", "size": "361", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Jaeger4Net/Reference.cs", "mode": "33188", "license": "mit", "language": [ { "name": "C#", "bytes": "83475" } ], "symlink_target": "" }
package org.terasology.entitySystem.event; /** * A consumable event is an event that can be prevented from continuing through remaining event receivers. This is * primarily useful for input event. * * @author Immortius */ public interface ConsumableEvent extends Event { /** * Tells whether or not the Event has been consumed. * @return true if the the event has been consumed, false otherwise. */ boolean isConsumed(); /** * Marks the Event as consumed. * Makes subsequent {@link #isConsumed()} calls return true. */ void consume(); }
{ "content_hash": "5cdac1d88363e0998705784dcc6da773", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 114, "avg_line_length": 25.695652173913043, "alnum_prop": 0.6802030456852792, "repo_name": "samuto/Terasology", "id": "b9812d7cbe9ae7290977af60048b1671c073ed33", "size": "1187", "binary": false, "copies": "10", "ref": "refs/heads/develop", "path": "engine/src/main/java/org/terasology/entitySystem/event/ConsumableEvent.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "38" }, { "name": "GLSL", "bytes": "109450" }, { "name": "Groovy", "bytes": "1996" }, { "name": "Java", "bytes": "6402121" }, { "name": "Protocol Buffer", "bytes": "9493" }, { "name": "Shell", "bytes": "7873" } ], "symlink_target": "" }
include(Platform/Windows-Intel) set(CMAKE_BUILD_TYPE_INIT Debug) set(_COMPILE_Fortran " /fpp") set(CMAKE_Fortran_MODDIR_FLAG "-module:") set(CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib") __windows_compiler_intel(Fortran) string(APPEND CMAKE_Fortran_FLAGS_INIT " /W1 /nologo /fpp /libs:dll /threads") string(APPEND CMAKE_Fortran_FLAGS_DEBUG_INIT " /Od /debug:full /dbglibs") string(APPEND CMAKE_Fortran_FLAGS_MINSIZEREL_INIT " /O1 /DNDEBUG") string(APPEND CMAKE_Fortran_FLAGS_RELEASE_INIT " /O2 /DNDEBUG") string(APPEND CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT " /O2 /debug:full /DNDEBUG")
{ "content_hash": "3001d9706d62676cf0b070f3701d37f7", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 82, "avg_line_length": 54, "alnum_prop": 0.7676767676767676, "repo_name": "pipou/rae", "id": "3981a092b3b5d883377f0bd6d2e57a535c486fc4", "size": "594", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "builder/cmake/macos/share/cmake-3.8/Modules/Platform/Windows-Intel-Fortran.cmake", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "2544" }, { "name": "C", "bytes": "48544" }, { "name": "C++", "bytes": "6334" }, { "name": "CMake", "bytes": "8152333" }, { "name": "CSS", "bytes": "56991" }, { "name": "Cuda", "bytes": "901" }, { "name": "Emacs Lisp", "bytes": "44259" }, { "name": "Fortran", "bytes": "6400" }, { "name": "HTML", "bytes": "36295522" }, { "name": "JavaScript", "bytes": "296574" }, { "name": "M4", "bytes": "4433" }, { "name": "Roff", "bytes": "4627932" }, { "name": "Shell", "bytes": "59955" }, { "name": "Vim script", "bytes": "140497" } ], "symlink_target": "" }
START_ATF_NAMESPACE namespace Info { using _PARTICLE_ELEMENTUpDate1_ptr = void (WINAPIV*)(struct _PARTICLE_ELEMENT*, float); using _PARTICLE_ELEMENTUpDate1_clbk = void (WINAPIV*)(struct _PARTICLE_ELEMENT*, float, _PARTICLE_ELEMENTUpDate1_ptr); }; // end namespace Info END_ATF_NAMESPACE
{ "content_hash": "9b95f4cce2ae5e1679a2104a9285435c", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 126, "avg_line_length": 45, "alnum_prop": 0.7015873015873015, "repo_name": "goodwinxp/Yorozuya", "id": "80c7f1699591d21ae9286121218c0b3798627ee8", "size": "500", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "library/ATF/_PARTICLE_ELEMENTInfo.hpp", "mode": "33188", "license": "mit", "language": [ { "name": "C", "bytes": "207291" }, { "name": "C++", "bytes": "21670817" } ], "symlink_target": "" }
<!DOCTYPE html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Place favicon.ico and apple-touch-icon.png in the root directory --> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/main.css"> <script src="js/vendor/modernizr-2.6.2.min.js"></script> <link rel="stylesheet" href="css/bootstrap.css"> <link rel="stylesheet" href="css/shCore.css"> <link rel="stylesheet" href="css/shThemeDefault.css"> <script src="js/shCore.js"></script> <script src="js/shBrushPhp.js"></script> </head> <body> <!--[if lt IE 7]> <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <!-- Add your site or application content here --> <div class='alert alert-success'> 我們開始分析core/Loader.php。<br/> </div> <!-- You also need to add some content to highlight, but that is covered elsewhere. --> <pre class="brush: php"> <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); // ------------------------------------------------------------------------ /** * Loader Class * * Loads views and files * * @package CodeIgniter * @subpackage Libraries * @author ExpressionEngine Dev Team * @category Loader * @link http://codeigniter.com/user_guide/libraries/loader.html */ class CI_Loader { // All these are set automatically. Don't mess with them. /** * Nesting level of the output buffering mechanism * * @var int * @access protected */ protected $_ci_ob_level; /** * List of paths to load views from * * @var array * @access protected */ protected $_ci_view_paths = array(); /** * List of paths to load libraries from * * @var array * @access protected */ protected $_ci_library_paths = array(); /** * List of paths to load models from * * @var array * @access protected */ protected $_ci_model_paths = array(); /** * List of paths to load helpers from * * @var array * @access protected */ protected $_ci_helper_paths = array(); /** * List of loaded base classes * Set by the controller class * * @var array * @access protected */ protected $_base_classes = array(); // Set by the controller class /** * List of cached variables * * @var array * @access protected */ protected $_ci_cached_vars = array(); /** * List of loaded classes * * @var array * @access protected */ protected $_ci_classes = array(); /** * List of loaded files * * @var array * @access protected */ protected $_ci_loaded_files = array(); /** * List of loaded models * * @var array * @access protected */ protected $_ci_models = array(); /** * List of loaded helpers * * @var array * @access protected */ protected $_ci_helpers = array(); /** * List of class name mappings * * @var array * @access protected */ protected $_ci_varmap = array('unit_test' => 'unit', 'user_agent' => 'agent'); /** * Constructor * * Sets the path to the view files and gets the initial output buffering level */ public function __construct() { $this->_ci_ob_level = ob_get_level(); $this->_ci_library_paths = array(APPPATH, BASEPATH); $this->_ci_helper_paths = array(APPPATH, BASEPATH); $this->_ci_model_paths = array(APPPATH); $this->_ci_view_paths = array(APPPATH.'views/' => TRUE); log_message('debug', "Loader Class Initialized"); } // -------------------------------------------------------------------- /** * Initialize the Loader * * This method is called once in CI_Controller. * * @param array * @return object */ public function initialize() { $this->_ci_classes = array(); $this->_ci_loaded_files = array(); $this->_ci_models = array(); $this->_base_classes =& is_loaded(); $this->_ci_autoloader(); return $this; } </pre> <div class='alert alert-danger'> 這些東西寫在__construct就好了,多寫個initialize是畫蛇添足? </div> <pre class="brush: php"> // -------------------------------------------------------------------- /** * Is Loaded * * A utility function to test if a class is in the self::$_ci_classes array. * This function returns the object name if the class tested for is loaded, * and returns FALSE if it isn't. * * It is mainly used in the form_helper -> _get_validation_object() * * @param string class being checked for * @return mixed class object name on the CI SuperObject or FALSE */ public function is_loaded($class) { if (isset($this->_ci_classes[$class])) { return $this->_ci_classes[$class]; } return FALSE; } // -------------------------------------------------------------------- /** * Class Loader * * This function lets users load and instantiate classes. * It is designed to be called from a user's app controllers. * * @param string the name of the class * @param mixed the optional parameters * @param string an optional object name * @return void */ public function library($library = '', $params = NULL, $object_name = NULL) { if (is_array($library)) { foreach ($library as $class) { $this->library($class, $params); } return; } if ($library == '' OR isset($this->_base_classes[$library])) { return FALSE; } if ( ! is_null($params) && ! is_array($params)) { $params = NULL; } $this->_ci_load_class($library, $params, $object_name); } </pre> <div class='alert alert-success'> </div> <div class='alert alert-danger'> </div> <pre class="brush: php"> // -------------------------------------------------------------------- /** * Model Loader * * This function lets users load and instantiate models. * * @param string the name of the class * @param string name for the model * @param bool database connection * @return void */ public function model($model, $name = '', $db_conn = FALSE) { if (is_array($model)) { foreach ($model as $babe) { $this->model($babe); } return; } if ($model == '') { return; } $path = ''; // Is the model in a sub-folder? If so, parse out the filename and path. if (($last_slash = strrpos($model, '/')) !== FALSE) { // The path is in front of the last slash $path = substr($model, 0, $last_slash + 1); // And the model name behind it $model = substr($model, $last_slash + 1); } </pre> <div class='alert alert-success'> 注意這邊,並不是strpos函數,是strrpos函數。差了一個r。<br/> 前者找第一次出現位置,後者找最後一次出現位置。<br/> PHP這個語言真的太胡搞了。 </div> <pre class="brush: php"> if ($name == '') { $name = $model; } if (in_array($name, $this->_ci_models, TRUE)) { return; } $CI =& get_instance(); if (isset($CI->$name)) { show_error('The model name you are loading is the name of a resource that is already being used: '.$name); } </pre> <div class='alert alert-success'> 在core/controller.php的建構式內,有將一堆載入的類別塞給controller物件的成員變數。<br/> 由於接下來會將$name塞給同樣的全域物件,所以這邊要進行defense。 </div> <pre class="brush: php"> $model = strtolower($model); foreach ($this->_ci_model_paths as $mod_path) { if ( ! file_exists($mod_path.'models/'.$path.$model.'.php')) { continue; } if ($db_conn !== FALSE AND ! class_exists('CI_DB')) { if ($db_conn === TRUE) { $db_conn = ''; } $CI->load->database($db_conn, FALSE, TRUE); } if ( ! class_exists('CI_Model')) { load_class('Model', 'core'); } require_once($mod_path.'models/'.$path.$model.'.php'); $model = ucfirst($model); $CI->$name = new $model(); $this->_ci_models[] = $name; return; } // couldn't find the model show_error('Unable to locate the model you have specified: '.$model); } </pre> <div class='alert alert-danger'> 注意看這段讀取model的程式碼。<br/> 不覺得它很難理解嗎?<br/> 明明只是載入類別而已。<br/> 當發現code很難讀的時候,不要急著擔心自己不夠強。<br/> 因為,可能是寫下這段code的人不夠強。我下面告訴你為什麼,光是foreach就很醜。 </div> <div class='alert alert-danger'> 這個載入model方法的第三個參數$db_conn是用來決定連接資料庫的方式。<br/> 是只執行一次的動作,卻寫在foreach內,瑕疵啊,也讓code更難理解。 </div> <div class='alert alert-danger'> CI_Model存在與否不應該在foreach內檢查。同上,它應該是只執行一次的動作。 </div> <pre class="brush: php"> // -------------------------------------------------------------------- /** * Database Loader * * @param string the DB credentials * @param bool whether to return the DB object * @param bool whether to enable active record (this allows us to override the config setting) * @return object */ public function database($params = '', $return = FALSE, $active_record = NULL) { // Grab the super object $CI =& get_instance(); // Do we even need to load the database class? if (class_exists('CI_DB') AND $return == FALSE AND $active_record == NULL AND isset($CI->db) AND is_object($CI->db)) { return FALSE; } require_once(BASEPATH.'database/DB.php'); if ($return === TRUE) { return DB($params, $active_record); } // Initialize the db variable. Needed to prevent // reference errors with some configurations $CI->db = ''; // Load the DB class $CI->db =& DB($params, $active_record); } </pre> <div class='alert alert-success'> 載入DB.php。<br/> 注意,DB是一個函數,而非類別。真正的CI_DB類別會定義在函數內。<br/> 詳細請見:<a href='db.html'>資料庫介面的入口:database/DB.php</a>。 </div> <!-- You also need to add some content to highlight, but that is covered elsewhere. --> <pre class="brush: php"> // -------------------------------------------------------------------- /** * Load the Utilities Class * * @return string */ public function dbutil() { if ( ! class_exists('CI_DB')) { $this->database(); } $CI =& get_instance(); // for backwards compatibility, load dbforge so we can extend dbutils off it // this use is deprecated and strongly discouraged $CI->load->dbforge(); require_once(BASEPATH.'database/DB_utility.php'); require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_utility.php'); $class = 'CI_DB_'.$CI->db->dbdriver.'_utility'; $CI->dbutil = new $class(); } // -------------------------------------------------------------------- /** * Load the Database Forge Class * * @return string */ public function dbforge() { if ( ! class_exists('CI_DB')) { $this->database(); } $CI =& get_instance(); require_once(BASEPATH.'database/DB_forge.php'); require_once(BASEPATH.'database/drivers/'.$CI->db->dbdriver.'/'.$CI->db->dbdriver.'_forge.php'); $class = 'CI_DB_'.$CI->db->dbdriver.'_forge'; $CI->dbforge = new $class(); } // -------------------------------------------------------------------- /** * Load View * * This function is used to load a "view" file. It has three parameters: * * 1. The name of the "view" file to be included. * 2. An associative array of data to be extracted for use in the view. * 3. TRUE/FALSE - whether to return the data or load it. In * some cases it's advantageous to be able to return data so that * a developer can process it in some way. * * @param string * @param array * @param bool * @return void */ public function view($view, $vars = array(), $return = FALSE) { return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return)); } // -------------------------------------------------------------------- /** * Load File * * This is a generic file loader * * @param string * @param bool * @return string */ public function file($path, $return = FALSE) { return $this->_ci_load(array('_ci_path' => $path, '_ci_return' => $return)); } // -------------------------------------------------------------------- /** * Set Variables * * Once variables are set they become available within * the controller class and its "view" files. * * @param array * @param string * @return void */ public function vars($vars = array(), $val = '') { if ($val != '' AND is_string($vars)) { $vars = array($vars => $val); } $vars = $this->_ci_object_to_array($vars); if (is_array($vars) AND count($vars) > 0) { foreach ($vars as $key => $val) { $this->_ci_cached_vars[$key] = $val; } } } // -------------------------------------------------------------------- /** * Get Variable * * Check if a variable is set and retrieve it. * * @param array * @return void */ public function get_var($key) { return isset($this->_ci_cached_vars[$key]) ? $this->_ci_cached_vars[$key] : NULL; } // -------------------------------------------------------------------- /** * Load Helper * * This function loads the specified helper file. * * @param mixed * @return void */ public function helper($helpers = array()) { foreach ($this->_ci_prep_filename($helpers, '_helper') as $helper) { if (isset($this->_ci_helpers[$helper])) { continue; } $ext_helper = APPPATH.'helpers/'.config_item('subclass_prefix').$helper.'.php'; // Is this a helper extension request? if (file_exists($ext_helper)) { $base_helper = BASEPATH.'helpers/'.$helper.'.php'; if ( ! file_exists($base_helper)) { show_error('Unable to load the requested file: helpers/'.$helper.'.php'); } include_once($ext_helper); include_once($base_helper); $this->_ci_helpers[$helper] = TRUE; log_message('debug', 'Helper loaded: '.$helper); continue; } // Try to load the helper foreach ($this->_ci_helper_paths as $path) { if (file_exists($path.'helpers/'.$helper.'.php')) { include_once($path.'helpers/'.$helper.'.php'); $this->_ci_helpers[$helper] = TRUE; log_message('debug', 'Helper loaded: '.$helper); break; } } // unable to load the helper if ( ! isset($this->_ci_helpers[$helper])) { show_error('Unable to load the requested file: helpers/'.$helper.'.php'); } } } // -------------------------------------------------------------------- /** * Load Helpers * * This is simply an alias to the above function in case the * user has written the plural form of this function. * * @param array * @return void */ public function helpers($helpers = array()) { $this->helper($helpers); } // -------------------------------------------------------------------- /** * Loads a language file * * @param array * @param string * @return void */ public function language($file = array(), $lang = '') { $CI =& get_instance(); if ( ! is_array($file)) { $file = array($file); } foreach ($file as $langfile) { $CI->lang->load($langfile, $lang); } } // -------------------------------------------------------------------- /** * Loads a config file * * @param string * @param bool * @param bool * @return void */ public function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE) { $CI =& get_instance(); $CI->config->load($file, $use_sections, $fail_gracefully); } // -------------------------------------------------------------------- /** * Driver * * Loads a driver library * * @param string the name of the class * @param mixed the optional parameters * @param string an optional object name * @return void */ public function driver($library = '', $params = NULL, $object_name = NULL) { if ( ! class_exists('CI_Driver_Library')) { // we aren't instantiating an object here, that'll be done by the Library itself require BASEPATH.'libraries/Driver.php'; } if ($library == '') { return FALSE; } // We can save the loader some time since Drivers will *always* be in a subfolder, // and typically identically named to the library if ( ! strpos($library, '/')) { $library = ucfirst($library).'/'.$library; } return $this->library($library, $params, $object_name); } // -------------------------------------------------------------------- /** * Add Package Path * * Prepends a parent path to the library, model, helper, and config path arrays * * @param string * @param boolean * @return void */ public function add_package_path($path, $view_cascade=TRUE) { $path = rtrim($path, '/').'/'; array_unshift($this->_ci_library_paths, $path); array_unshift($this->_ci_model_paths, $path); array_unshift($this->_ci_helper_paths, $path); $this->_ci_view_paths = array($path.'views/' => $view_cascade) + $this->_ci_view_paths; // Add config file path $config =& $this->_ci_get_component('config'); array_unshift($config->_config_paths, $path); } // -------------------------------------------------------------------- /** * Get Package Paths * * Return a list of all package paths, by default it will ignore BASEPATH. * * @param string * @return void */ public function get_package_paths($include_base = FALSE) { return $include_base === TRUE ? $this->_ci_library_paths : $this->_ci_model_paths; } // -------------------------------------------------------------------- /** * Remove Package Path * * Remove a path from the library, model, and helper path arrays if it exists * If no path is provided, the most recently added path is removed. * * @param type * @param bool * @return type */ public function remove_package_path($path = '', $remove_config_path = TRUE) { $config =& $this->_ci_get_component('config'); if ($path == '') { $void = array_shift($this->_ci_library_paths); $void = array_shift($this->_ci_model_paths); $void = array_shift($this->_ci_helper_paths); $void = array_shift($this->_ci_view_paths); $void = array_shift($config->_config_paths); } else { $path = rtrim($path, '/').'/'; foreach (array('_ci_library_paths', '_ci_model_paths', '_ci_helper_paths') as $var) { if (($key = array_search($path, $this->{$var})) !== FALSE) { unset($this->{$var}[$key]); } } if (isset($this->_ci_view_paths[$path.'views/'])) { unset($this->_ci_view_paths[$path.'views/']); } if (($key = array_search($path, $config->_config_paths)) !== FALSE) { unset($config->_config_paths[$key]); } } // make sure the application default paths are still in the array $this->_ci_library_paths = array_unique(array_merge($this->_ci_library_paths, array(APPPATH, BASEPATH))); $this->_ci_helper_paths = array_unique(array_merge($this->_ci_helper_paths, array(APPPATH, BASEPATH))); $this->_ci_model_paths = array_unique(array_merge($this->_ci_model_paths, array(APPPATH))); $this->_ci_view_paths = array_merge($this->_ci_view_paths, array(APPPATH.'views/' => TRUE)); $config->_config_paths = array_unique(array_merge($config->_config_paths, array(APPPATH))); } // -------------------------------------------------------------------- /** * Loader * * This function is used to load views and files. * Variables are prefixed with _ci_ to avoid symbol collision with * variables made available to view files * * @param array * @return void */ protected function _ci_load($_ci_data) { // Set the default data variables foreach (array('_ci_view', '_ci_vars', '_ci_path', '_ci_return') as $_ci_val) { $$_ci_val = ( ! isset($_ci_data[$_ci_val])) ? FALSE : $_ci_data[$_ci_val]; } $file_exists = FALSE; // Set the path to the requested file if ($_ci_path != '') { $_ci_x = explode('/', $_ci_path); $_ci_file = end($_ci_x); } else { $_ci_ext = pathinfo($_ci_view, PATHINFO_EXTENSION); $_ci_file = ($_ci_ext == '') ? $_ci_view.'.php' : $_ci_view; foreach ($this->_ci_view_paths as $view_file => $cascade) { if (file_exists($view_file.$_ci_file)) { $_ci_path = $view_file.$_ci_file; $file_exists = TRUE; break; } if ( ! $cascade) { break; } } } if ( ! $file_exists && ! file_exists($_ci_path)) { show_error('Unable to load the requested file: '.$_ci_file); } // This allows anything loaded using $this->load (views, files, etc.) // to become accessible from within the Controller and Model functions. $_ci_CI =& get_instance(); foreach (get_object_vars($_ci_CI) as $_ci_key => $_ci_var) { if ( ! isset($this->$_ci_key)) { $this->$_ci_key =& $_ci_CI->$_ci_key; } } /* * Extract and cache variables * * You can either set variables using the dedicated $this->load_vars() * function or via the second parameter of this function. We'll merge * the two types and cache them so that views that are embedded within * other views can have access to these variables. */ if (is_array($_ci_vars)) { $this->_ci_cached_vars = array_merge($this->_ci_cached_vars, $_ci_vars); } extract($this->_ci_cached_vars); /* * Buffer the output * * We buffer the output for two reasons: * 1. Speed. You get a significant speed boost. * 2. So that the final rendered template can be * post-processed by the output class. Why do we * need post processing? For one thing, in order to * show the elapsed page load time. Unless we * can intercept the content right before it's sent to * the browser and then stop the timer it won't be accurate. */ ob_start(); // If the PHP installation does not support short tags we'll // do a little string replacement, changing the short tags // to standard PHP echo statements. if ((bool) @ini_get('short_open_tag') === FALSE AND config_item('rewrite_short_tags') == TRUE) { echo eval('?>'.preg_replace("/;*\s*\?>/", "; ?>", str_replace('<?=', '<?php echo ', file_get_contents($_ci_path)))); } else { include($_ci_path); // include() vs include_once() allows for multiple views with the same name } log_message('debug', 'File loaded: '.$_ci_path); // Return the file data if requested if ($_ci_return === TRUE) { $buffer = ob_get_contents(); @ob_end_clean(); return $buffer; } /* * Flush the buffer... or buff the flusher? * * In order to permit views to be nested within * other views, we need to flush the content back out whenever * we are beyond the first level of output buffering so that * it can be seen and included properly by the first included * template and any subsequent ones. Oy! * */ if (ob_get_level() > $this->_ci_ob_level + 1) { ob_end_flush(); } else { $_ci_CI->output->append_output(ob_get_contents()); @ob_end_clean(); } } // -------------------------------------------------------------------- /** * Load class * * This function loads the requested class. * * @param string the item that is being loaded * @param mixed any additional parameters * @param string an optional object name * @return void */ protected function _ci_load_class($class, $params = NULL, $object_name = NULL) { // Get the class name, and while we're at it trim any slashes. // The directory path can be included as part of the class name, // but we don't want a leading slash $class = str_replace('.php', '', trim($class, '/')); // Was the path included with the class name? // We look for a slash to determine this $subdir = ''; if (($last_slash = strrpos($class, '/')) !== FALSE) { // Extract the path $subdir = substr($class, 0, $last_slash + 1); // Get the filename from the path $class = substr($class, $last_slash + 1); } // We'll test for both lowercase and capitalized versions of the file name foreach (array(ucfirst($class), strtolower($class)) as $class) { $subclass = APPPATH.'libraries/'.$subdir.config_item('subclass_prefix').$class.'.php'; // Is this a class extension request? if (file_exists($subclass)) { $baseclass = BASEPATH.'libraries/'.ucfirst($class).'.php'; if ( ! file_exists($baseclass)) { log_message('error', "Unable to load the requested class: ".$class); show_error("Unable to load the requested class: ".$class); } // Safety: Was the class already loaded by a previous call? if (in_array($subclass, $this->_ci_loaded_files)) { // Before we deem this to be a duplicate request, let's see // if a custom object name is being supplied. If so, we'll // return a new instance of the object if ( ! is_null($object_name)) { $CI =& get_instance(); if ( ! isset($CI->$object_name)) { return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name); } } $is_duplicate = TRUE; log_message('debug', $class." class already loaded. Second attempt ignored."); return; } include_once($baseclass); include_once($subclass); $this->_ci_loaded_files[] = $subclass; return $this->_ci_init_class($class, config_item('subclass_prefix'), $params, $object_name); } // Lets search for the requested library file and load it. $is_duplicate = FALSE; foreach ($this->_ci_library_paths as $path) { $filepath = $path.'libraries/'.$subdir.$class.'.php'; // Does the file exist? No? Bummer... if ( ! file_exists($filepath)) { continue; } // Safety: Was the class already loaded by a previous call? if (in_array($filepath, $this->_ci_loaded_files)) { // Before we deem this to be a duplicate request, let's see // if a custom object name is being supplied. If so, we'll // return a new instance of the object if ( ! is_null($object_name)) { $CI =& get_instance(); if ( ! isset($CI->$object_name)) { return $this->_ci_init_class($class, '', $params, $object_name); } } $is_duplicate = TRUE; log_message('debug', $class." class already loaded. Second attempt ignored."); return; } include_once($filepath); $this->_ci_loaded_files[] = $filepath; return $this->_ci_init_class($class, '', $params, $object_name); } } // END FOREACH // One last attempt. Maybe the library is in a subdirectory, but it wasn't specified? if ($subdir == '') { $path = strtolower($class).'/'.$class; return $this->_ci_load_class($path, $params); } // If we got this far we were unable to find the requested class. // We do not issue errors if the load call failed due to a duplicate request if ($is_duplicate == FALSE) { log_message('error', "Unable to load the requested class: ".$class); show_error("Unable to load the requested class: ".$class); } } // -------------------------------------------------------------------- /** * Instantiates a class * * @param string * @param string * @param bool * @param string an optional object name * @return null */ protected function _ci_init_class($class, $prefix = '', $config = FALSE, $object_name = NULL) { // Is there an associated config file for this class? Note: these should always be lowercase if ($config === NULL) { // Fetch the config paths containing any package paths $config_component = $this->_ci_get_component('config'); if (is_array($config_component->_config_paths)) { // Break on the first found file, thus package files // are not overridden by default paths foreach ($config_component->_config_paths as $path) { // We test for both uppercase and lowercase, for servers that // are case-sensitive with regard to file names. Check for environment // first, global next if (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php')) { include($path .'config/'.ENVIRONMENT.'/'.strtolower($class).'.php'); break; } elseif (defined('ENVIRONMENT') AND file_exists($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php')) { include($path .'config/'.ENVIRONMENT.'/'.ucfirst(strtolower($class)).'.php'); break; } elseif (file_exists($path .'config/'.strtolower($class).'.php')) { include($path .'config/'.strtolower($class).'.php'); break; } elseif (file_exists($path .'config/'.ucfirst(strtolower($class)).'.php')) { include($path .'config/'.ucfirst(strtolower($class)).'.php'); break; } } } } if ($prefix == '') { if (class_exists('CI_'.$class)) { $name = 'CI_'.$class; } elseif (class_exists(config_item('subclass_prefix').$class)) { $name = config_item('subclass_prefix').$class; } else { $name = $class; } } else { $name = $prefix.$class; } // Is the class name valid? if ( ! class_exists($name)) { log_message('error', "Non-existent class: ".$name); show_error("Non-existent class: ".$class); } // Set the variable name we will assign the class to // Was a custom class name supplied? If so we'll use it $class = strtolower($class); if (is_null($object_name)) { $classvar = ( ! isset($this->_ci_varmap[$class])) ? $class : $this->_ci_varmap[$class]; } else { $classvar = $object_name; } // Save the class name and object name $this->_ci_classes[$class] = $classvar; // Instantiate the class $CI =& get_instance(); if ($config !== NULL) { $CI->$classvar = new $name($config); } else { $CI->$classvar = new $name; } } // -------------------------------------------------------------------- /** * Autoloader * * The config/autoload.php file contains an array that permits sub-systems, * libraries, and helpers to be loaded automatically. * * @param array * @return void */ private function _ci_autoloader() { if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) { include(APPPATH.'config/'.ENVIRONMENT.'/autoload.php'); } else { include(APPPATH.'config/autoload.php'); } if ( ! isset($autoload)) { return FALSE; } // Autoload packages if (isset($autoload['packages'])) { foreach ($autoload['packages'] as $package_path) { $this->add_package_path($package_path); } } // Load any custom config file if (count($autoload['config']) > 0) { $CI =& get_instance(); foreach ($autoload['config'] as $key => $val) { $CI->config->load($val); } } // Autoload helpers and languages foreach (array('helper', 'language') as $type) { if (isset($autoload[$type]) AND count($autoload[$type]) > 0) { $this->$type($autoload[$type]); } } // A little tweak to remain backward compatible // The $autoload['core'] item was deprecated if ( ! isset($autoload['libraries']) AND isset($autoload['core'])) { $autoload['libraries'] = $autoload['core']; } // Load libraries if (isset($autoload['libraries']) AND count($autoload['libraries']) > 0) { // Load the database driver. if (in_array('database', $autoload['libraries'])) { $this->database(); $autoload['libraries'] = array_diff($autoload['libraries'], array('database')); } // Load all other libraries foreach ($autoload['libraries'] as $item) { $this->library($item); } } // Autoload models if (isset($autoload['model'])) { $this->model($autoload['model']); } } // -------------------------------------------------------------------- /** * Object to Array * * Takes an object as input and converts the class variables to array key/vals * * @param object * @return array */ protected function _ci_object_to_array($object) { return (is_object($object)) ? get_object_vars($object) : $object; } // -------------------------------------------------------------------- /** * Get a reference to a specific library or model * * @param string * @return bool */ protected function &_ci_get_component($component) { $CI =& get_instance(); return $CI->$component; } // -------------------------------------------------------------------- /** * Prep filename * * This function preps the name of various items to make loading them more reliable. * * @param mixed * @param string * @return array */ protected function _ci_prep_filename($filename, $extension) { if ( ! is_array($filename)) { return array(strtolower(str_replace('.php', '', str_replace($extension, '', $filename)).$extension)); } else { foreach ($filename as $key => $val) { $filename[$key] = strtolower(str_replace('.php', '', str_replace($extension, '', $val)).$extension); } return $filename; } } } /* End of file Loader.php */ /* Location: ./system/core/Loader.php */ </pre> <div class='alert alert-danger'> </div> <!-- Finally, to actually run the highlighter, you need to include this JS on your page --> <script type="text/javascript"> SyntaxHighlighter.all() </script> </body> <style> body{ width: 960px; margin: 0 auto; background-color: #444; } .alert{ line-height: 2; } </style> </html>
{ "content_hash": "0c572d025d4d5f6c581011ed224dcbfe", "timestamp": "", "source": "github", "line_count": 1368, "max_line_length": 184, "avg_line_length": 24.836988304093566, "alnum_prop": 0.5631456573564471, "repo_name": "howtomakeaturn/howtomakeaturn.github.io", "id": "b946997a6dfbfe606ed8283c3f6885fa5b56b784", "size": "35016", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "ci/loader.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "ApacheConf", "bytes": "13" }, { "name": "CSS", "bytes": "86292" }, { "name": "HTML", "bytes": "2137320" }, { "name": "JavaScript", "bytes": "26922" }, { "name": "PHP", "bytes": "1179397" } ], "symlink_target": "" }
<?php include_partial('aMedia/uploadMultiple', array('form' => $form)) ?>
{ "content_hash": "8e2e1f0e81a5de43bb9bb151c0d196b9", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 77, "avg_line_length": 78, "alnum_prop": 0.6410256410256411, "repo_name": "samura/asandbox", "id": "ce8369717a992c1d69dadf0fe0c91efad9166ae2", "size": "78", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "plugins/apostrophePlugin/modules/aMedia/templates/_uploadMultipleWrapper.php", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "112011" }, { "name": "CSS", "bytes": "685576" }, { "name": "ColdFusion", "bytes": "169639" }, { "name": "JavaScript", "bytes": "6842500" }, { "name": "Lasso", "bytes": "33194" }, { "name": "PHP", "bytes": "3947439" }, { "name": "Perl", "bytes": "39076" }, { "name": "Python", "bytes": "47611" }, { "name": "Shell", "bytes": "2221" }, { "name": "XSLT", "bytes": "5930" } ], "symlink_target": "" }
'use strict'; angular.module('appLogin', [ 'ngRoute' ]);
{ "content_hash": "b1ce9e7079baffc640da5c5f61315952", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 28, "avg_line_length": 11.8, "alnum_prop": 0.6271186440677966, "repo_name": "ibm-apiconnect/pot", "id": "ea06dd067b1c8660279d2d132e38e3018ad361bc", "size": "59", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app-consumer/app/app-login/app-login.module.js", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "57572" }, { "name": "HTML", "bytes": "21778" }, { "name": "JavaScript", "bytes": "71120" } ], "symlink_target": "" }
@implementation SBInstagramModel + (void) setIsSearchByTag:(BOOL) isSearchByTag{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setBool:isSearchByTag forKey:@"instagram_isSearchByTag"]; [def synchronize]; } + (BOOL) isSearchByTag{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; return [def boolForKey:@"instagram_isSearchByTag"]; } + (void) setSearchTag:(NSString *)searchTag{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:searchTag forKey:@"instagram_searchTag"]; [def synchronize]; } + (NSString *)searchTag{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; return [def objectForKey:@"instagram_searchTag"]; } + (void) checkInstagramAccesTokenWithBlock:(void (^)(NSError * error))block{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; NSString *token = [def objectForKey:@"instagram_access_token"]; if (!token) { token = [SBInstagramModel model].instagramDefaultAccessToken ?: INSTAGRAM_DEFAULT_ACCESS_TOKEN; [def setObject:token forKey:@"instagram_access_token"]; [def synchronize]; } NSMutableDictionary * params = [NSMutableDictionary dictionaryWithCapacity:0]; [params setObject:token forKey:@"access_token"]; NSString *uId = [SBInstagramModel model].instagramUserId ?: INSTAGRAM_USER_ID; if (!uId || uId.length <= 0) { uId = @"25025320"; //instagram user } [[SBInstagramHTTPRequestOperationManager sharedManager] GET:[NSString stringWithFormat:@"users/%@",uId?:@""] parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { if (block){ block(nil); } } failure:^(AFHTTPRequestOperation *operation, NSError *error) { if (block){ block(error); } }]; } + (void) mediaUserWithUserId:(NSString *)userId andBlock:(void (^)(NSArray *mediaArray, NSError * error))block{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; NSString *token = [def objectForKey:@"instagram_access_token"]; NSMutableDictionary * params = [NSMutableDictionary dictionaryWithCapacity:0]; [params setObject:token forKey:@"access_token"]; [params setObject:@"33" forKey:@"count"]; NSString *path = [NSString stringWithFormat:@"users/%@/media/recent",userId?:@""]; if (SBInstagramModel.isSearchByTag) { path = [NSString stringWithFormat:@"tags/%@/media/recent",userId]; } [[SBInstagramHTTPRequestOperationManager sharedManager] GET:path parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { NSArray *mediaArr = responseObject[@"data"]; NSDictionary *paging = responseObject[@"pagination"]; __block NSMutableArray *mediaArrEntities = [NSMutableArray arrayWithCapacity:0]; [mediaArr enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL *stop) { SBInstagramMediaPagingEntity *media = [SBInstagramMediaPagingEntity entityWithDataDictionary:obj andPagingDictionary:paging]; [mediaArrEntities addObject:media]; }]; if (block) { block(mediaArrEntities,nil); } } failure:^(AFHTTPRequestOperation *operation, NSError *error) { if (block){ block(nil, error); } }]; } + (void) mediaMultipleUsersWithArr:(NSArray *)usersId complete:(void (^)(NSArray *mediaArray,NSArray *multipleMedia, NSError * error))block{ NSMutableArray *entitiesArr = [NSMutableArray array]; NSMutableArray *lastEntitiesArr = [NSMutableArray array]; __block int count = 0; __block NSError *error1 = nil;; [usersId enumerateObjectsUsingBlock:^(NSString *userId, NSUInteger idx, BOOL *stop) { [SBInstagramModel mediaUserWithUserId:userId andBlock:^(NSArray *mediaArray, NSError *error) { if (!error) { if (mediaArray.count > 0) { [entitiesArr addObjectsFromArray:mediaArray]; [lastEntitiesArr addObject:mediaArray[mediaArray.count-1]]; } }else{ error1 = error; } count++; if (count == usersId.count) { [entitiesArr sortUsingComparator:^NSComparisonResult(SBInstagramMediaPagingEntity *obj1, SBInstagramMediaPagingEntity *obj2) { return [obj2.mediaEntity.createdTime compare:obj1.mediaEntity.createdTime]; }]; block(entitiesArr,lastEntitiesArr,error1); } }]; }]; } + (void) mediaUserWithPagingEntity:(SBInstagramMediaPagingEntity *)entity andBlock:(void (^)(NSArray *mediaArray, NSError * error))block{ NSString *path = [entity.nextUrl stringByReplacingOccurrencesOfString:[[SBInstagramHTTPRequestOperationManager sharedManager].baseURL absoluteString] withString:@""]; if (!path) { block(@[],nil); return; } [[SBInstagramHTTPRequestOperationManager sharedManager] GET:path parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { NSArray *mediaArr = responseObject[@"data"]; NSDictionary *paging = responseObject[@"pagination"]; __block NSMutableArray *mediaArrEntities = [NSMutableArray arrayWithCapacity:0]; [mediaArr enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL *stop) { SBInstagramMediaPagingEntity *media = [SBInstagramMediaPagingEntity entityWithDataDictionary:obj andPagingDictionary:paging]; [mediaArrEntities addObject:media]; }]; if (block) { block(mediaArrEntities,nil); } } failure:^(AFHTTPRequestOperation *operation, NSError *error) { if (block){ block(nil, error); } }]; } +(void) mediaMultiplePagingWithArr:(NSArray *)entities complete:(void (^)(NSArray *mediaArray,NSArray *multipleMedia, NSError * error))block{ NSMutableArray *entitiesArr = [NSMutableArray array]; NSMutableArray *lastEntitiesArr = [NSMutableArray array]; __block int count = 0; __block NSError *error1 = nil;; [entities enumerateObjectsUsingBlock:^(SBInstagramMediaPagingEntity *entity, NSUInteger idx, BOOL *stop) { [SBInstagramModel mediaUserWithPagingEntity:entity andBlock:^(NSArray *mediaArray, NSError *error) { if (!error) { if (mediaArray.count > 0) { [entitiesArr addObjectsFromArray:mediaArray]; [lastEntitiesArr addObject:mediaArray[mediaArray.count-1]]; } }else{ error1 = error; } count++; if (count == entities.count) { [entitiesArr sortUsingComparator:^NSComparisonResult(SBInstagramMediaPagingEntity *obj1, SBInstagramMediaPagingEntity *obj2) { return [obj2.mediaEntity.createdTime compare:obj1.mediaEntity.createdTime]; }]; block(entitiesArr,lastEntitiesArr,error1); } }]; }]; } + (void) downloadImageWithUrl:(NSString *)url andBlock:(void (^)(UIImage *image, NSError * error))block{ NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; [operation setResponseSerializer:[AFImageResponseSerializer serializer]]; [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { NSError *error = nil; if (responseObject) { if (block) { block(responseObject, error); } } } failure:^(AFHTTPRequestOperation *operation, NSError *error) { if (block) { block(nil, error); } }]; [operation start]; } + (void) downloadVideoWithUrl:(NSString *)url complete:(void (^)(NSString *localUrl, NSError * error))block{ NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *path = [[paths objectAtIndex:0] stringByAppendingPathComponent:@"SBInstagramVideo.mp4"]; AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; AFHTTPRequestOperation *op = [manager GET:url parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { NSLog(@"successful download to %@", path); if (block) { block(path,nil); } } failure:^(AFHTTPRequestOperation *operation, NSError *error) { NSLog(@"Error: %@", error); if (block) { block(nil,error); } }]; op.outputStream = [NSOutputStream outputStreamToFileAtPath:path append:NO]; } + (void) likersFromMediaEntity:(SBInstagramMediaEntity *)mediaEntity complete:(void (^)(NSMutableArray *likers, NSError * error))block{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; NSString *token = [def objectForKey:@"instagram_access_token"]; NSMutableDictionary * params = [NSMutableDictionary dictionaryWithCapacity:0]; [params setObject:token forKey:@"access_token"]; NSString *path = [NSString stringWithFormat:@"media/%@/likes",mediaEntity.mediaId]; [[SBInstagramHTTPRequestOperationManager sharedManager] GET:path parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject) { if (block) { NSMutableArray *likers = [NSMutableArray array]; NSArray *arr = responseObject[@"data"]; [arr enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { [likers addObject:[SBInstagramUserEntity entityWithDictionary:obj]]; }]; block(likers,nil); } } failure:^(AFHTTPRequestOperation *operation, NSError *error) { if (block) { block(nil,error); } }]; } #pragma mark - v2 + (SBInstagramModel *) model{ return [self new]; } //setters - (void) setInstagramRedirectUri:(NSString *)instagramRedirectUri{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:instagramRedirectUri forKey:@"instagram_instagramRedirectUri"]; [def synchronize]; } - (void) setInstagramClientSecret:(NSString *)instagramClientSecret{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:instagramClientSecret forKey:@"instagram_instagramClientSecret"]; [def synchronize]; } - (void) setInstagramClientId:(NSString *)instagramClientId{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:instagramClientId forKey:@"instagram_instagramClientId"]; [def synchronize]; } - (void) setInstagramDefaultAccessToken:(NSString *)instagramDefaultAccessToken{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:instagramDefaultAccessToken forKey:@"instagram_instagramDefaultAccessToken"]; [def synchronize]; } - (void) setInstagramUserId:(NSString *)instagramUserId{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:instagramUserId forKey:@"instagram_instagramUserId"]; [def synchronize]; } -(void) setLoadingImageName:(NSString *)loadingImageName{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:loadingImageName forKey:@"instagram_loadingImageName"]; [def synchronize]; } -(void) setVideoPlayImageName:(NSString *)videoPlayImageName{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:videoPlayImageName forKey:@"instagram_videoPlayImageName"]; [def synchronize]; } -(void) setVideoPauseImageName:(NSString *)videoPauseImageName{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:videoPauseImageName forKey:@"instagram_videoPauseImageName"]; [def synchronize]; } -(void) setplayStandardResolution:(BOOL)playStandardResolution{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setBool:playStandardResolution forKey:@"instagram_playStandardResolution"]; [def synchronize]; } - (void) setInstagramMultipleUsersId:(NSArray *)instagramMultipleUsersId{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; [def setObject:instagramMultipleUsersId forKey:@"instagram_instagramMultipleUsersId"]; [def synchronize]; } //getters - (NSString *) instagramRedirectUri{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; return [def objectForKey:@"instagram_instagramRedirectUri"]; } - (NSString *) instagramClientSecret{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; return [def objectForKey:@"instagram_instagramClientSecret"]; } - (NSString *) instagramClientId{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; return [def objectForKey:@"instagram_instagramClientId"]; } - (NSString *) instagramDefaultAccessToken{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; return [def objectForKey:@"instagram_instagramDefaultAccessToken"]; } - (NSString *) instagramUserId{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; return [def objectForKey:@"instagram_instagramUserId"]; } -(NSString *) loadingImageName{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; NSString *name = [def objectForKey:@"instagram_loadingImageName"]; return name ?: @"SBInstagramLoading"; } -(NSString *) videoPlayImageName{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; NSString *name = [def objectForKey:@"instagram_videoPlayImageName"]; return name ?: @"SBInsta_play"; } -(NSString *) videoPauseImageName{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; NSString *name = [def objectForKey:@"instagram_videoPauseImageName"]; return name ?: @"SBInsta_pause"; } - (BOOL) playStandardResolution{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; return [def boolForKey:@"instagram_playStandardResolution"]; } - (NSArray *) instagramMultipleUsersId{ NSUserDefaults *def = [NSUserDefaults standardUserDefaults]; return [def objectForKey:@"instagram_instagramMultipleUsersId"]; } @end
{ "content_hash": "fd9f1c8e5c68bc0f33bcba2b3adae265", "timestamp": "", "source": "github", "line_count": 398, "max_line_length": 196, "avg_line_length": 38.027638190954775, "alnum_prop": 0.6545754872811365, "repo_name": "Busta117/SBInstagram", "id": "af886aa622cacd517aa600ae64eae03e7c0b3335", "size": "15345", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "SBInstagram/SBInstagramModel.m", "mode": "33188", "license": "mit", "language": [ { "name": "Objective-C", "bytes": "570999" } ], "symlink_target": "" }
package org.team225.robot2014.commands.catapult.presets; import edu.wpi.first.wpilibj.command.CommandGroup; import org.team225.robot2014.commands.catapult.Launch; /** * * @author Andrew */ public class HPKick extends CommandGroup { public HPKick() { addSequential(new Launch(false, false, 0, true)); } }
{ "content_hash": "fc977cfe131e249f35a11131496e8b85", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 57, "avg_line_length": 20.625, "alnum_prop": 0.7151515151515152, "repo_name": "FRCTeam225/Robot2014", "id": "5a47e0a8cfe5fca43d86c3e4dd89b38436835ff8", "size": "330", "binary": false, "copies": "1", "ref": "refs/heads/cmp", "path": "src/org/team225/robot2014/commands/catapult/presets/HPKick.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Java", "bytes": "98364" } ], "symlink_target": "" }
<?xml version="1.0" encoding="UTF-8"?> <ldswebml type="image" uri="/media-library/images/easter#jesus-easter-821713" xml:lang="eng" locale="eng" status="publish"> <search-meta> <uri-title its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">jesus-easter-821713</uri-title> <source>jesus-easter-821713</source> <publication-type its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">image</publication-type> <media-type its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">image</media-type> <publication value="ldsorg">LDS.org</publication> <publication-date value="2012-04-09">2012-04-09</publication-date> <title/> <description/> <collections> <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">global-search</collection> <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">media</collection> <collection its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">images</collection> </collections> <subjects> <subject>Jesus</subject> <subject>Christ</subject> <subject>crucifixion</subject> <subject>hands</subject> <subject>bound</subject> <subject>tied</subject> <subject>judgement</subject> <subject>trial</subject> <subject>easter</subject> <subject>resurrection</subject> </subjects> </search-meta> <no-search> <path>http://media.ldscdn.org/images/media-library/easter/jesus-easter-821713-gallery.jpg</path> <images> <small its:translate="no" xmlns:its="http://www.w3.org/2005/11/its">http://media.ldscdn.org/images/media-library/easter/jesus-easter-821713-thumbnail.jpg</small> </images> <download-urls> <download-url> <label>Mobile</label> <size>81 KB</size> <path>http://media.ldscdn.org/images/media-library/easter/jesus-easter-821713-mobile.jpg</path> </download-url> <download-url> <label>Tablet</label> <size>90 KB</size> <path>http://media.ldscdn.org/images/media-library/easter/jesus-easter-821713-tablet.jpg</path> </download-url> <download-url> <label>Print</label> <size>159 KB</size> <path>http://media.ldscdn.org/images/media-library/easter/jesus-easter-821713-print.jpg</path> </download-url> <download-url> <label>Wallpaper</label> <size>412 KB</size> <path>http://media.ldscdn.org/images/media-library/easter/jesus-easter-821713-wallpaper.jpg</path> </download-url> </download-urls> </no-search> <ldse-meta its:translate="no" xmlns="http://lds.org/code/lds-edit" xmlns:its="http://www.w3.org/2005/11/its"><document id="jesus-easter-821713" locale="eng" uri="/media-library/images/easter#jesus-easter-821713" status="publish" site="ldsorg" source="chq" words="117" tgp="0.4091"/><created username="lds-edit" userid=""/><last-modified date="2012-05-10T12:26:12.550235-06:00" username="lds-edit" userid=""/></ldse-meta></ldswebml>
{ "content_hash": "27d17a7fac1a43b76f590e3b3ad02122", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 431, "avg_line_length": 57.01724137931034, "alnum_prop": 0.6120350771091624, "repo_name": "freshie/ml-taxonomies", "id": "3882ebaa0687ba760d20917a46ecac8a02095785", "size": "3307", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "roxy/data/gospel-topical-explorer-v2/content/images/jesus-easter-821713.xml", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "4422" }, { "name": "CSS", "bytes": "38665" }, { "name": "HTML", "bytes": "356" }, { "name": "JavaScript", "bytes": "411651" }, { "name": "Ruby", "bytes": "259121" }, { "name": "Shell", "bytes": "7329" }, { "name": "XQuery", "bytes": "857170" }, { "name": "XSLT", "bytes": "13753" } ], "symlink_target": "" }
package org.maproulette.models.dal import java.sql.Connection import anorm.SqlParser._ import anorm._ import javax.inject.Inject import org.joda.time.DateTime import org.maproulette.Config import org.maproulette.cache.CacheManager import org.maproulette.data.{Actions, TaskType, VirtualChallengeType} import org.maproulette.exception.InvalidException import org.maproulette.framework.model.{User, ClusteredPoint, Point, PointReview, Task} import org.maproulette.framework.psql.Paging import org.maproulette.models._ import org.maproulette.models.utils.DALHelper import org.maproulette.permissions.Permission import org.maproulette.session.{SearchChallengeParameters, SearchLocation, SearchParameters} import play.api.db.Database import play.api.libs.json.JodaReads._ import play.api.libs.json.{JsString, JsValue, Json} import org.maproulette.framework.mixins.Locking import org.maproulette.framework.repository.RepositoryMixin import org.maproulette.framework.service.TaskClusterService /** * @author mcuthbert */ class VirtualChallengeDAL @Inject() ( override val db: Database, override val permission: Permission, val taskDAL: TaskDAL, val taskClusterService: TaskClusterService, val config: Config ) extends RepositoryMixin with DALHelper with BaseDAL[Long, VirtualChallenge] with Locking[Task] { override val cacheManager = new CacheManager[Long, VirtualChallenge](config, Config.CACHE_ID_VIRTUAL_CHALLENGES) override val tableName: String = "virtual_challenges" implicit val baseTable: String = tableName implicit val searchLocationWrites = Json.writes[SearchLocation] implicit val searchLocationReads = Json.reads[SearchLocation] override val parser: RowParser[VirtualChallenge] = { get[Long]("virtual_challenges.id") ~ get[String]("virtual_challenges.name") ~ get[DateTime]("virtual_challenges.created") ~ get[DateTime]("virtual_challenges.modified") ~ get[Option[String]]("virtual_challenges.description") ~ get[Long]("virtual_challenges.owner_id") ~ get[String]("virtual_challenges.search_parameters") ~ get[DateTime]("virtual_challenges.expiry") map { case id ~ name ~ created ~ modified ~ description ~ ownerId ~ searchParameters ~ expiry => new VirtualChallenge( id, name, created, modified, description, ownerId, Json.parse(searchParameters).as[SearchParameters], expiry ) } } /** * The insert function for virtual challenges needs to create a new challenge and then find all the * tasks based on the search parameters in the virtual challenge * * @param element The element that you are inserting to the database * @param user The user executing the task * @return The object that was inserted into the database. This will include the newly created id */ override def insert(element: VirtualChallenge, user: User)( implicit c: Option[Connection] = None ): VirtualChallenge = { this.cacheManager.withOptionCaching { () => withMRTransaction { implicit c => // check if any virtual challenges with the same name need to expire // calling the retrieve function will also remove any expired virtual challenges this.retrieveListByName(List(element.name)) val validParameters = element.taskIdList match { case Some(ids) => ids.nonEmpty case None => element.searchParameters.location match { case Some(box) if (box.right - box.left) * (box.top - box.bottom) < config.virtualChallengeLimit => true case None => element.searchParameters.boundingGeometries match { case Some(bp) => true case None => false } } } if (validParameters) { val query = """INSERT INTO virtual_challenges (owner_id, name, description, search_parameters, expiry) VALUES ({owner}, {name}, {description}, {parameters}, {expiry}::timestamp) RETURNING *""" val newChallenge = SQL(query) .on( Symbol("owner") -> user.osmProfile.id, Symbol("name") -> element.name, Symbol("description") -> element.description, Symbol("parameters") -> Json.toJson(element.searchParameters).toString(), Symbol("expiry") -> ToParameterValue .apply[String] .apply(String.valueOf(element.expiry)) ) .as(this.parser.single) c.commit() element.taskIdList match { case Some(ids) => this.createVirtualChallengeFromIds(newChallenge.id, ids) case None => this.rebuildVirtualChallenge(newChallenge.id, element.searchParameters, user) } Some(newChallenge) } else { throw new InvalidException( s"Bounding Box that has an area smaller than ${config.virtualChallengeLimit} required to create virtual challenge." ) } } }.get } /** * This function will rebuild the virtual challenge based on the search parameters that have been stored with the object * * @param id The id of the virtual challenge * @param user The user making the request * @param c implicit connection * @return */ def rebuildVirtualChallenge(id: Long, params: SearchParameters, user: User)( implicit c: Option[Connection] = None ): Unit = { permission.hasWriteAccess(VirtualChallengeType(), user)(id) withMRTransaction { implicit c => val (count, result) = this.taskClusterService.getTasksInBoundingBox(user, params, Paging(-1, 0)) result .grouped(config.virtualChallengeBatchSize) .foreach(batch => { val insertRows = batch.map(point => s"(${point.id}, $id)").mkString(",") SQL""" INSERT INTO virtual_challenge_tasks (task_id, virtual_challenge_id) VALUES #$insertRows """.execute() c.commit() }) } } private def createVirtualChallengeFromIds(id: Long, idList: List[Long])( implicit c: Option[Connection] = None ): Unit = { withMRTransaction { implicit c => val insertRows = idList.map(taskId => s"($taskId, $id)").mkString(",") SQL""" INSERT INTO virtual_challenge_tasks (task_id, virtual_challenge_id) VALUES #$insertRows """.execute() c.commit() } } override def retrieveListByName( implicit names: List[String], parentId: Long, c: Option[Connection] = None ): List[VirtualChallenge] = this.removeExpiredFromList(super.retrieveListByName) /** * The update function is limited in that you can only update the superficial elements, name * and description. The only value of consequence that you can update is expiry, which by default * is set to a day but can be extended by the user. * * @param updates The updates in json form * @param user The user executing the task * @param id The id of the object that you are updating * @param c * @return An optional object, it will return None if no object found with a matching id that was supplied */ override def update( updates: JsValue, user: User )(implicit id: Long, c: Option[Connection] = None): Option[VirtualChallenge] = { permission.hasWriteAccess(VirtualChallengeType(), user) this.cacheManager.withUpdatingCache(Long => retrieveById) { implicit cachedItem => withMRTransaction { implicit c => // first if the virtual challenge has expired then just delete it val expiry = (updates \ "expiry").asOpt[DateTime].getOrElse(cachedItem.expiry) if (DateTime.now().isAfter(expiry)) { this.delete(cachedItem.id, user) throw new InvalidException("Could not update virtual challenge as it has already expired") } else { val name = (updates \ "name").asOpt[String].getOrElse(cachedItem.name) val description = (updates \ "description").asOpt[String].getOrElse(cachedItem.description.getOrElse("")) val query = """UPDATE virtual_challenges SET name = {name}, description = {description}, expiry = {expiry}::timestamp WHERE id = {id} RETURNING *""" SQL(query) .on( Symbol("name") -> name, Symbol("description") -> description, Symbol("expiry") -> ToParameterValue.apply[String].apply(String.valueOf(expiry)), Symbol("id") -> id ) .as(this.parser.*) .headOption } } } } // --- FOLLOWING FUNCTION OVERRIDE BASE FUNCTION TO SIMPLY REMOVE ANY RETRIEVED VIRTUAL CHALLENGES // --- THAT ARE EXPIRED override def retrieveById( implicit id: Long, c: Option[Connection] = None ): Option[VirtualChallenge] = { super.retrieveById match { case Some(vc) if vc.isExpired => this.delete(id, User.superUser) None case x => x } } def listTasks(id: Long, user: User, limit: Int, offset: Int)( implicit c: Option[Connection] = None ): List[Task] = { permission.hasReadAccess(VirtualChallengeType(), user)(id) withMRTransaction { implicit c => SQL"""SELECT tasks.#${taskDAL.retrieveColumnsWithReview} FROM tasks LEFT OUTER JOIN task_review ON task_review.task_id = tasks.id INNER JOIN virtual_challenge_tasks vct ON vct.task_id = tasks.id WHERE virtual_challenge_id = $id LIMIT #${sqlLimit(limit)} OFFSET $offset""".as(taskDAL.parser.*) } } /** * Gets a random task from the list of tasks associated with the virtual challenge * * @param id The id of the virtual challenge * @param params The search parameters, most of the parameters will not be used * @param user The user making the request * @param proximityId Id of the task to find the closest next task * @param c * @return An optional Task, None if no tasks available */ def getRandomTask( id: Long, params: SearchParameters, user: User, proximityId: Option[Long] = None )(implicit c: Option[Connection] = None): Option[Task] = { permission.hasReadAccess(VirtualChallengeType(), user)(id) // The default where clause will check to see if the parents are enabled, that the task is // not locked (or if it is, it is locked by the current user) and that the status of the task // is either Created or Skipped val taskStatusList = params.taskParams.taskStatus match { case Some(l) if l.nonEmpty => l case _ => { config.skipTooHard match { case true => List(Task.STATUS_CREATED, Task.STATUS_SKIPPED) case false => List(Task.STATUS_CREATED, Task.STATUS_SKIPPED, Task.STATUS_TOO_HARD) } } } val whereClause = new StringBuilder(s""" WHERE vct.virtual_challenge_id = $id AND (l.id IS NULL OR l.user_id = ${user.id}) AND tasks.status IN ({statusList}) """) val proximityOrdering = proximityId match { case Some(id) => appendInWhereClause(whereClause, s"tasks.id != $id") s"ST_Distance(tasks.location, (SELECT location FROM tasks WHERE id = $id))," case None => "" } val query = s"""SELECT tasks.${taskDAL.retrieveColumnsWithReview} FROM tasks LEFT JOIN locked l ON l.item_id = tasks.id LEFT OUTER JOIN task_review ON task_review.task_id = tasks.id INNER JOIN virtual_challenge_tasks vct ON vct.task_id = tasks.id ${whereClause.toString} ORDER BY $proximityOrdering tasks.status, RANDOM() LIMIT 1""" this.withSingleLocking(user, Some(TaskType())) { () => withMRTransaction { implicit c => SQL(query) .on( Symbol("statusList") -> ToParameterValue.apply[List[Int]].apply(taskStatusList) ) .as(taskDAL.parser.*) .headOption } } } /** * Simple query to retrieve the next task in the sequence * * @param id The parent of the task * @param currentTaskId The current task that we are basing our query from * @return An optional task, if no more tasks in the list will retrieve the first task */ def getSequentialNextTask(id: Long, currentTaskId: Long)( implicit c: Option[Connection] = None ): Option[(Task, Lock)] = { this.withMRConnection { implicit c => val lp = for { task <- taskDAL.parser lock <- lockedParser } yield task -> lock val query = s"""SELECT locked.*, tasks.${taskDAL.retrieveColumnsWithReview} FROM tasks LEFT JOIN locked ON locked.item_id = tasks.id LEFT OUTER JOIN task_review ON task_review.task_id = tasks.id WHERE tasks.id = (SELECT task_id FROM virtual_challenge_tasks WHERE task_id > $currentTaskId AND virtual_challenge_id = $id LIMIT 1) """ SQL(query).as(lp.*).headOption match { case Some(t) => Some(t) case None => val loopQuery = s"""SELECT locked.*, tasks.${taskDAL.retrieveColumnsWithReview} FROM tasks LEFT JOIN locked ON locked.item_id = tasks.id LEFT OUTER JOIN task_review ON task_review.task_id = tasks.id WHERE tasks.id = (SELECT task_id FROM virtual_challenge_tasks WHERE virtual_challenge_id = $id AND task_id != $currentTaskId ORDER BY id ASC LIMIT 1) """ SQL(loopQuery).as(lp.*).headOption } } } /** * Simple query to retrieve the previous task in the sequence * * @param id The parent of the task * @param currentTaskId The current task that we are basing our query from * @return An optional task, if no more tasks in the list will retrieve the last task */ def getSequentialPreviousTask(id: Long, currentTaskId: Long)( implicit c: Option[Connection] = None ): Option[(Task, Lock)] = { this.withMRConnection { implicit c => val lp = for { task <- taskDAL.parser lock <- lockedParser } yield task -> lock val query = s"""SELECT locked.*, tasks.${taskDAL.retrieveColumnsWithReview} FROM tasks LEFT JOIN locked ON locked.item_id = tasks.id LEFT OUTER JOIN task_review ON task_review.task_id = tasks.id WHERE tasks.id = (SELECT task_id FROM virtual_challenge_tasks WHERE task_id < $currentTaskId AND virtual_challenge_id = $id LIMIT 1) """ SQL(query).as(lp.*).headOption match { case Some(t) => Some(t) case None => val loopQuery = s"""SELECT locked.*, tasks.${taskDAL.retrieveColumnsWithReview} FROM tasks LEFT JOIN locked ON locked.item_id = tasks.id LEFT OUTER JOIN task_review ON task_review.task_id = tasks.id WHERE tasks.id = (SELECT task_id FROM virtual_challenge_tasks WHERE virtual_challenge_id = $id AND task_id != $currentTaskId ORDER BY id DESC LIMIT 1) """ SQL(loopQuery).as(lp.*).headOption } } } /** * Retrieve tasks geographically closest to the given task id within the * given virtual challenge. Ignores tasks that are complete, locked by other * users, or that the current user has worked on in the last hour */ def getNearbyTasks(user: User, challengeId: Long, proximityId: Long, limit: Int = 5)( implicit c: Option[Connection] = None ): List[Task] = { val query = s"""SELECT tasks.${taskDAL.retrieveColumnsWithReview} FROM tasks LEFT JOIN locked l ON l.item_id = tasks.id LEFT JOIN virtual_challenge_tasks vct on vct.task_id = tasks.id LEFT OUTER JOIN task_review ON task_review.task_id = tasks.id WHERE tasks.id <> $proximityId AND vct.virtual_challenge_id = $challengeId AND (l.id IS NULL OR l.user_id = ${user.id}) AND tasks.status IN (0, 3, 6) AND NOT tasks.id IN ( SELECT task_id FROM status_actions WHERE osm_user_id = ${user.osmProfile.id} AND created >= NOW() - '1 hour'::INTERVAL) ORDER BY ST_Distance(tasks.location, (SELECT location FROM tasks WHERE id = $proximityId)), tasks.status, RANDOM() LIMIT ${this.sqlLimit(limit)}""" this.withMRTransaction { implicit c => SQL(query).as(taskDAL.parser.*) } } /** * Gets the combined geometry of all the tasks that are associated with the virtual challenge * NOTE* Due to the way this function finds the geometries, it could be quite slow. * * @param challengeId The id for the virtual challenge * @param statusFilter To view the geojson for only tasks with a specific status * @param c The implicit connection for the function * @return A JSON string representing the geometry */ def getChallengeGeometry(challengeId: Long, statusFilter: Option[List[Int]] = None)( implicit c: Option[Connection] = None ): String = { this.withMRConnection { implicit c => val filter = statusFilter match { case Some(s) => s"AND status IN (${s.mkString(",")}" case None => "" } SQL"""SELECT ROW_TO_JSON(f)::TEXT AS geometries FROM ( SELECT 'FeatureCollection' AS type, ARRAY_TO_JSON(ARRAY_AGG(ST_ASGEOJSON(geom)::JSON)) AS features FROM tasks WHERE id IN (SELECT task_id FROM virtual_challenge_tasks WHERE virtual_challenge_id = $challengeId) #$filter ) as f""".as(str("geometries").single) } } /** * Retrieves the json that contains the central points for all the tasks in the virtual challenge. * One caveat to Virtual Challenges, is that if a project or challenge is flagged as deleted that has tasks * in the virtual challenge, then those tasks will remain part of the virtual challenge until the * tasks are cleared from the database. * * @param challengeId The id of the virtual challenge * @param statusFilter Filter the displayed task cluster points by their status * @return A list of clustered point objects */ def getClusteredPoints(challengeId: Long, statusFilter: Option[List[Int]] = None)( implicit c: Option[Connection] = None ): List[ClusteredPoint] = { this.withMRConnection { implicit c => val filter = statusFilter match { case Some(s) => s"AND status IN (${s.mkString(",")}" case None => "" } val pointParser = long("id") ~ str("name") ~ str("instruction") ~ str("location") ~ int("status") ~ get[Option[String]]("cooperative_work") ~ get[Option[DateTime]]("mapped_on") ~ get[Option[Long]]("completed_time_spent") ~ get[Option[Long]]("completed_by") ~ get[Option[Int]]("review_status") ~ get[Option[Long]]("review_requested_by") ~ get[Option[Long]]("reviewed_by") ~ get[Option[DateTime]]("reviewed_at") ~ get[Option[DateTime]]("review_started_at") ~ get[Option[List[Long]]]("additional_reviewers") ~ get[Option[Int]]("meta_review_status") ~ get[Option[Long]]("meta_reviewed_by") ~ get[Option[DateTime]]("meta_reviewed_at") ~ int("priority") ~ get[Option[Long]]("bundle_id") ~ get[Option[Boolean]]("is_bundle_primary") map { case id ~ name ~ instruction ~ location ~ status ~ cooperativeWork ~ mappedOn ~ completedTimeSpent ~ completedBy ~ reviewStatus ~ reviewRequestedBy ~ reviewedBy ~ reviewedAt ~ reviewStartedAt ~ additionalReviewers ~ metaReviewStatus ~ metaReviewedBy ~ metaReviewedAt ~ priority ~ bundleId ~ isBundlePrimary => val locationJSON = Json.parse(location) val coordinates = (locationJSON \ "coordinates").as[List[Double]] val point = Point(coordinates(1), coordinates.head) val pointReview = PointReview( reviewStatus, reviewRequestedBy, reviewedBy, reviewedAt, metaReviewStatus, metaReviewedBy, metaReviewedAt, reviewStartedAt, additionalReviewers ) ClusteredPoint( id, -1, "", name, -1, "", point, JsString(""), instruction, DateTime.now(), -1, Actions.ITEM_TYPE_TASK, status, cooperativeWork, mappedOn, completedTimeSpent, completedBy, pointReview, priority, bundleId, isBundlePrimary ) } SQL"""SELECT tasks.id, name, instruction, status, cooperative_work_json::TEXT as cooperative_work, mapped_on, completed_time_spent, completed_by, review_status, review_requested_by, reviewed_by, reviewed_at, review_started_at, meta_review_status, meta_reviewed_by, meta_reviewed_at, additional_reviewers, ST_AsGeoJSON(location) AS location, priority, bundle_id, is_bundle_primary FROM tasks LEFT OUTER JOIN task_review ON task_review.task_id = tasks.id WHERE tasks.id IN (SELECT task_id FROM virtual_challenge_tasks WHERE virtual_challenge_id = $challengeId) #$filter""" .as(pointParser.*) } } /** * For Virtual Challenges the retrieveByName function won't quite work as expected, there is a possibility * that there are multiple Virtual Challenges with the same name. This function will simply return the * first one. Generally retrieveListByName should be used instead. * * @param name The name you are looking up by * @param parentId * @param c * @return The object that you are looking up, None if not found */ override def retrieveByName( implicit name: String, parentId: Long, c: Option[Connection] = None ): Option[VirtualChallenge] = { super.retrieveByName(name, parentId) match { case Some(vc) if vc.isExpired => this.delete(vc.id, User.superUser) None case x => x } } override def retrieveListById( limit: Int, offset: Int )(implicit ids: List[Long], c: Option[Connection] = None): List[VirtualChallenge] = this.removeExpiredFromList(super.retrieveListById(limit, offset)) private def removeExpiredFromList(superList: List[VirtualChallenge]): List[VirtualChallenge] = { superList.flatMap(vc => { if (vc.isExpired) { this.delete(vc.id, User.superUser) None } else { Some(vc) } }) } override def retrieveListByPrefix( prefix: String, limit: Int, offset: Int, onlyEnabled: Boolean, orderColumn: String, orderDirection: String )(implicit parentId: Long, c: Option[Connection] = None): List[VirtualChallenge] = this.removeExpiredFromList( super.retrieveListByPrefix(prefix, limit, offset, onlyEnabled, orderColumn, orderDirection) ) override def find( searchString: String, limit: Int, offset: Int, onlyEnabled: Boolean, orderColumn: String, orderDirection: String )(implicit parentId: Long, c: Option[Connection] = None): List[VirtualChallenge] = this.removeExpiredFromList( super.find(searchString, limit, offset, onlyEnabled, orderColumn, orderDirection) ) override def list( limit: Int, offset: Int, onlyEnabled: Boolean, searchString: String, orderColumn: String, orderDirection: String )(implicit parentId: Long, c: Option[Connection] = None): List[VirtualChallenge] = this.removeExpiredFromList( super.list(limit, offset, onlyEnabled, searchString, orderColumn, orderDirection) ) // --- END OF OVERRIDDEN FUNCTIONS TO FILTER OUT ANY EXPIRED VIRTUAL CHALLENGES }
{ "content_hash": "9abd45596d8f33bea8841bcfb9af494f", "timestamp": "", "source": "github", "line_count": 618, "max_line_length": 127, "avg_line_length": 40.70550161812298, "alnum_prop": 0.6097948799491175, "repo_name": "mgcuthbert/maproulette2", "id": "9fef7c87e35563c07364a52acb9089d9e27064c2", "size": "25297", "binary": false, "copies": "1", "ref": "refs/heads/dev", "path": "app/org/maproulette/models/dal/VirtualChallengeDAL.scala", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "406" }, { "name": "PLSQL", "bytes": "217" }, { "name": "PLpgSQL", "bytes": "73463" }, { "name": "Python", "bytes": "2366" }, { "name": "Scala", "bytes": "1065413" }, { "name": "Shell", "bytes": "1671" }, { "name": "TSQL", "bytes": "27870" } ], "symlink_target": "" }
layout: page title: Martha Conway's 89th Birthday date: 2016-05-24 author: Jose Harrington tags: weekly links, java status: published summary: Suspendisse et leo tempor, pellentesque magna quis. banner: images/banner/meeting-01.jpg booking: startDate: 07/22/2019 endDate: 07/23/2019 ctyhocn: ARBWEHX groupCode: MC8B published: true --- Maecenas vel purus eget odio semper mattis. Mauris eu aliquet nisl. Ut venenatis mauris justo, vitae ultrices odio scelerisque at. Sed dignissim ac nunc in imperdiet. Maecenas consequat felis leo, vitae eleifend tellus placerat id. Mauris in felis quis neque faucibus ullamcorper. Interdum et malesuada fames ac ante ipsum primis in faucibus. Suspendisse lorem purus, dignissim sed dolor elementum, faucibus viverra neque. Donec vel gravida tellus. Proin vestibulum in nisi sed iaculis. Donec imperdiet fermentum eleifend. Nulla vitae vestibulum dui, ut placerat enim. Phasellus ornare felis est, vitae rhoncus ipsum molestie egestas. Nulla ornare porttitor risus, id facilisis augue ullamcorper et. Nulla ac placerat est, ac varius justo. Etiam non fermentum sapien. Duis eget mattis ex. Phasellus cursus purus eu justo ultrices dictum. Integer ac convallis eros. Aliquam eu lacus condimentum, lobortis ligula quis, faucibus nibh. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce eu massa sodales odio facilisis fermentum ut ut nisi. Nulla quis aliquet quam, quis egestas neque. Duis ultricies venenatis metus ac maximus. Donec imperdiet, felis eu eleifend ornare, risus orci venenatis tellus, quis ullamcorper enim sem in neque. Morbi aliquam dapibus sapien, a condimentum enim accumsan sed. 1 Etiam semper enim sed eleifend porta 1 Etiam efficitur sem pulvinar metus posuere malesuada 1 Curabitur vel mauris iaculis, ornare eros ac, posuere purus 1 Fusce auctor nulla sit amet purus consectetur, et sagittis risus semper 1 Vestibulum id nibh finibus orci vulputate eleifend 1 Vestibulum quis dolor ut enim tempor varius. Sed lorem ipsum, ornare malesuada lacinia eu, lacinia et urna. Duis quis molestie arcu, a tincidunt nibh. Integer risus nisi, lobortis eu massa id, vulputate scelerisque neque. Etiam sodales commodo aliquam. Nunc placerat pharetra dui in pharetra. Pellentesque nibh eros, feugiat id odio interdum, viverra ultricies ligula. Nullam vel felis sed magna facilisis lacinia. Aenean sagittis accumsan pharetra. Proin laoreet mattis volutpat. Praesent dignissim nibh ut nulla tincidunt venenatis. Nullam laoreet ante in blandit congue.
{ "content_hash": "0c21ee2521158ee8d7a0582763c29486", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 707, "avg_line_length": 98, "alnum_prop": 0.8155416012558869, "repo_name": "KlishGroup/prose-pogs", "id": "0c6b25649d08b1700d2a6301c9b34735618d0602", "size": "2552", "binary": false, "copies": "1", "ref": "refs/heads/gh-pages", "path": "pogs/A/ARBWEHX/MC8B/index.md", "mode": "33188", "license": "mit", "language": [], "symlink_target": "" }
"""The tests for the counter component.""" # pylint: disable=protected-access import asyncio import logging from homeassistant.core import CoreState, State, Context from homeassistant.setup import async_setup_component from homeassistant.components.counter import ( DOMAIN, CONF_INITIAL, CONF_RESTORE, CONF_STEP, CONF_NAME, CONF_ICON) from homeassistant.const import (ATTR_ICON, ATTR_FRIENDLY_NAME) from tests.common import mock_restore_cache from tests.components.counter.common import ( async_decrement, async_increment, async_reset) _LOGGER = logging.getLogger(__name__) async def test_config(hass): """Test config.""" invalid_configs = [ None, 1, {}, {'name with space': None}, ] for cfg in invalid_configs: assert not await async_setup_component(hass, DOMAIN, {DOMAIN: cfg}) async def test_config_options(hass): """Test configuration options.""" count_start = len(hass.states.async_entity_ids()) _LOGGER.debug('ENTITIES @ start: %s', hass.states.async_entity_ids()) config = { DOMAIN: { 'test_1': {}, 'test_2': { CONF_NAME: 'Hello World', CONF_ICON: 'mdi:work', CONF_INITIAL: 10, CONF_RESTORE: False, CONF_STEP: 5, } } } assert await async_setup_component(hass, 'counter', config) await hass.async_block_till_done() _LOGGER.debug('ENTITIES: %s', hass.states.async_entity_ids()) assert count_start + 2 == len(hass.states.async_entity_ids()) await hass.async_block_till_done() state_1 = hass.states.get('counter.test_1') state_2 = hass.states.get('counter.test_2') assert state_1 is not None assert state_2 is not None assert 0 == int(state_1.state) assert ATTR_ICON not in state_1.attributes assert ATTR_FRIENDLY_NAME not in state_1.attributes assert 10 == int(state_2.state) assert 'Hello World' == \ state_2.attributes.get(ATTR_FRIENDLY_NAME) assert 'mdi:work' == state_2.attributes.get(ATTR_ICON) async def test_methods(hass): """Test increment, decrement, and reset methods.""" config = { DOMAIN: { 'test_1': {}, } } assert await async_setup_component(hass, 'counter', config) entity_id = 'counter.test_1' state = hass.states.get(entity_id) assert 0 == int(state.state) async_increment(hass, entity_id) await hass.async_block_till_done() state = hass.states.get(entity_id) assert 1 == int(state.state) async_increment(hass, entity_id) await hass.async_block_till_done() state = hass.states.get(entity_id) assert 2 == int(state.state) async_decrement(hass, entity_id) await hass.async_block_till_done() state = hass.states.get(entity_id) assert 1 == int(state.state) async_reset(hass, entity_id) await hass.async_block_till_done() state = hass.states.get(entity_id) assert 0 == int(state.state) async def test_methods_with_config(hass): """Test increment, decrement, and reset methods with configuration.""" config = { DOMAIN: { 'test': { CONF_NAME: 'Hello World', CONF_INITIAL: 10, CONF_STEP: 5, } } } assert await async_setup_component(hass, 'counter', config) entity_id = 'counter.test' state = hass.states.get(entity_id) assert 10 == int(state.state) async_increment(hass, entity_id) await hass.async_block_till_done() state = hass.states.get(entity_id) assert 15 == int(state.state) async_increment(hass, entity_id) await hass.async_block_till_done() state = hass.states.get(entity_id) assert 20 == int(state.state) async_decrement(hass, entity_id) await hass.async_block_till_done() state = hass.states.get(entity_id) assert 15 == int(state.state) @asyncio.coroutine def test_initial_state_overrules_restore_state(hass): """Ensure states are restored on startup.""" mock_restore_cache(hass, ( State('counter.test1', '11'), State('counter.test2', '-22'), )) hass.state = CoreState.starting yield from async_setup_component(hass, DOMAIN, { DOMAIN: { 'test1': { CONF_RESTORE: False, }, 'test2': { CONF_INITIAL: 10, CONF_RESTORE: False, }, }}) state = hass.states.get('counter.test1') assert state assert int(state.state) == 0 state = hass.states.get('counter.test2') assert state assert int(state.state) == 10 @asyncio.coroutine def test_restore_state_overrules_initial_state(hass): """Ensure states are restored on startup.""" mock_restore_cache(hass, ( State('counter.test1', '11'), State('counter.test2', '-22'), )) hass.state = CoreState.starting yield from async_setup_component(hass, DOMAIN, { DOMAIN: { 'test1': {}, 'test2': { CONF_INITIAL: 10, }, }}) state = hass.states.get('counter.test1') assert state assert int(state.state) == 11 state = hass.states.get('counter.test2') assert state assert int(state.state) == -22 @asyncio.coroutine def test_no_initial_state_and_no_restore_state(hass): """Ensure that entity is create without initial and restore feature.""" hass.state = CoreState.starting yield from async_setup_component(hass, DOMAIN, { DOMAIN: { 'test1': { CONF_STEP: 5, } }}) state = hass.states.get('counter.test1') assert state assert int(state.state) == 0 async def test_counter_context(hass, hass_admin_user): """Test that counter context works.""" assert await async_setup_component(hass, 'counter', { 'counter': { 'test': {} } }) state = hass.states.get('counter.test') assert state is not None await hass.services.async_call('counter', 'increment', { 'entity_id': state.entity_id, }, True, Context(user_id=hass_admin_user.id)) state2 = hass.states.get('counter.test') assert state2 is not None assert state.state != state2.state assert state2.context.user_id == hass_admin_user.id
{ "content_hash": "862bf606d3ef0b473f04497427130a01", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 75, "avg_line_length": 26.151020408163266, "alnum_prop": 0.606524114250039, "repo_name": "jamespcole/home-assistant", "id": "97a39cdeb73b46b61e5761cbce842a9372052d1b", "size": "6407", "binary": false, "copies": "7", "ref": "refs/heads/master", "path": "tests/components/counter/test_init.py", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "1175" }, { "name": "Dockerfile", "bytes": "1081" }, { "name": "HCL", "bytes": "826" }, { "name": "Python", "bytes": "14822074" }, { "name": "Ruby", "bytes": "745" }, { "name": "Shell", "bytes": "17609" } ], "symlink_target": "" }
namespace consensus { namespace wal { static bool isWal(const std::string& fname) { // TODO(optimize) size_t len = fname.length(); return len > 4 && fname.substr(len - 4, 4) == ".wal"; } static void parseWalName(const std::string& fname, uint64_t* segId, uint64_t* segStart) { sscanf(fname.c_str(), "%zu-%zu.wal", segId, segStart); } // Returns: Error::YARaftError / OK Status AppendToMemStore(yaraft::pb::Entry& e, yaraft::MemoryStorage* memstore) { auto& vec = memstore->TEST_Entries(); if (!vec.empty()) { if (e.term() < vec.rbegin()->term()) { return FMT_Status( YARaftError, "new entry [index:{}, term:{}] has lower term than last entry [index:{}, term:{}]", e.index(), e.term(), vec.rbegin()->index(), vec.rbegin()->term()); } int del = vec.size() - 1; while (del >= 0) { if (vec[del].index() < e.index()) { break; } del--; } size_t sz = vec.size(); for (int i = del + 1; i < sz; i++) { vec.pop_back(); } } memstore->Append(e); return Status::OK(); } ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// LogManager::LogManager(const WriteAheadLogOptions& options) : lastIndex_(0), options_(options), empty_(false) {} LogManager::~LogManager() { Close(); } Status LogManager::Recover(const WriteAheadLogOptions& options, yaraft::MemStoreUptr* memstore, LogManagerUPtr* pLogManager) { RETURN_NOT_OK_APPEND(Env::Default()->CreateDirIfMissing(options.log_dir), fmt::format(" [log_dir: \"{}\"]", options.log_dir)); std::vector<std::string> files; RETURN_NOT_OK_APPEND(Env::Default()->GetChildren(options.log_dir, &files), fmt::format(" [log_dir: \"{}\"]", options.log_dir)); // finds all files with suffix ".wal" std::map<uint64_t, uint64_t> wals; // ordered by segId for (const auto& f : files) { if (isWal(f)) { uint64_t segId, segStart; parseWalName(f, &segId, &segStart); wals[segId] = segStart; } } LogManagerUPtr& m = *pLogManager; m.reset(new LogManager(options)); if (wals.empty()) { return Status::OK(); } m->empty_ = false; LOG_ASSERT(*memstore == nullptr); memstore->reset(new yaraft::MemoryStorage); FMT_LOG(INFO, "recovering from {} wals, starts from {}-{}, ends at {}-{}", wals.size(), wals.begin()->first, wals.begin()->second, wals.rbegin()->first, wals.rbegin()->second); for (auto it = wals.begin(); it != wals.end(); it++) { std::string fname = options.log_dir + "/" + SegmentFileName(it->first, it->second); SegmentMetaData meta; RETURN_NOT_OK( ReadSegmentIntoMemoryStorage(fname, memstore->get(), &meta, options.verify_checksum)); m->files_.push_back(std::move(meta)); } return Status::OK(); } Status LogManager::Write(const PBEntryVec& entries, const yaraft::pb::HardState* hs) { if (entries.empty()) { return Status::OK(); } uint64_t beginIdx = entries.begin()->index(); if (empty_) { lastIndex_ = beginIdx - 1; // start at the first entry received. empty_ = false; } return doWrite(entries.begin(), entries.end(), hs); } // Required: begin != end Status LogManager::doWrite(ConstPBEntriesIterator begin, ConstPBEntriesIterator end, const yaraft::pb::HardState* hs) { auto segStart = begin; auto it = segStart; while (true) { if (!current_) { LogWriter* w; ASSIGN_IF_OK(LogWriter::New(this), w); current_.reset(w); } ASSIGN_IF_OK(current_->Append(segStart, end, hs), it); if (it == end) { // write complete break; } // hard state must have been written after a batch write completes. if (hs) { hs = nullptr; } lastIndex_ = std::prev(it)->index(); finishCurrentWriter(); segStart = it; } return Status::OK(); } Status LogManager::Sync() { if (current_) { return current_->Sync(); } return Status::OK(); } Status LogManager::Close() { if (current_) { finishCurrentWriter(); } return Status::OK(); } Status LogManager::GC(WriteAheadLog::CompactionHint* hint) { return Status::OK(); } void LogManager::finishCurrentWriter() { SegmentMetaData meta; FATAL_NOT_OK(current_->Finish(&meta), "LogWriter::Finish"); files_.push_back(meta); delete current_.release(); } } // namespace wal } // namespace consensus
{ "content_hash": "a2d80e4d23271e042aafde94d6d103ea", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 98, "avg_line_length": 26.88095238095238, "alnum_prop": 0.58303808680248, "repo_name": "neverchanje/consensus-yaraft", "id": "bd05a878b113d89844e12bb092958fcf042c7f6e", "size": "5222", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/wal/log_manager.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "3882" }, { "name": "C++", "bytes": "173854" }, { "name": "CMake", "bytes": "40466" }, { "name": "Python", "bytes": "6506" }, { "name": "Shell", "bytes": "12977" } ], "symlink_target": "" }
<?php namespace Per\JobeetBundle; use Symfony\Component\HttpKernel\Bundle\Bundle; class PerJobeetBundle extends Bundle { }
{ "content_hash": "4193a4b7b4c131152d6c25e021e2d4ab", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 47, "avg_line_length": 14, "alnum_prop": 0.8015873015873016, "repo_name": "alexpopa13/symfony.local", "id": "81da2fa619d6e388db519164f85eb70513941655", "size": "126", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Per/JobeetBundle/PerJobeetBundle.php", "mode": "33188", "license": "mit", "language": [ { "name": "ApacheConf", "bytes": "3073" }, { "name": "CSS", "bytes": "9703" }, { "name": "PHP", "bytes": "82463" } ], "symlink_target": "" }
package command import ( "fmt" . "github.com/ForceCLI/force/error" . "github.com/ForceCLI/force/lib" "github.com/spf13/cobra" ) func init() { RootCmd.AddCommand(eventLogFileCmd) } var eventLogFileCmd = &cobra.Command{ Use: "eventlogfile [eventlogfileId]", Short: "List and fetch event log file", Example: ` force eventlogfile force eventlogfile 0AT300000000XQ7GAM `, Args: cobra.MaximumNArgs(1), Run: func(cmd *cobra.Command, args []string) { if len(args) == 0 { listEventLogFiles() return } getEventLogFile(args[0]) }, } func listEventLogFiles() { records, err := force.QueryEventLogFiles() if err != nil { ErrorAndExit(err.Error()) } DisplayForceRecords(records) } func getEventLogFile(logId string) { log, err := force.RetrieveEventLogFile(logId) if err != nil { ErrorAndExit(err.Error()) } fmt.Println(log) }
{ "content_hash": "aa0f2eeae72898907cbd003c9febe10c", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 47, "avg_line_length": 18.695652173913043, "alnum_prop": 0.7011627906976744, "repo_name": "cwarden/force", "id": "203a09f12bbc6eeafcfc4fd16c8432ac497c7663", "size": "860", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "command/eventlogfile.go", "mode": "33188", "license": "mit", "language": [ { "name": "Go", "bytes": "383330" }, { "name": "Makefile", "bytes": "1108" } ], "symlink_target": "" }
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_101) on Wed Aug 17 15:44:59 UTC 2016 --> <title>PresenceEventListener (Openfire 4.0.3 Javadoc)</title> <meta name="date" content="2016-08-17"> <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="PresenceEventListener (Openfire 4.0.3 Javadoc)"; } } catch(err) { } //--> var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><b>Openfire 4.0.3 Javadoc</b></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/jivesoftware/openfire/user/PresenceEventDispatcher.html" title="class in org.jivesoftware.openfire.user"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/jivesoftware/openfire/user/User.html" title="class in org.jivesoftware.openfire.user"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/jivesoftware/openfire/user/PresenceEventListener.html" target="_top">Frames</a></li> <li><a href="PresenceEventListener.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">org.jivesoftware.openfire.user</div> <h2 title="Interface PresenceEventListener" class="title">Interface PresenceEventListener</h2> </div> <div class="contentContainer"> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Known Implementing Classes:</dt> <dd><a href="../../../../org/jivesoftware/openfire/pep/IQPEPHandler.html" title="class in org.jivesoftware.openfire.pep">IQPEPHandler</a></dd> </dl> <hr> <br> <pre>public interface <span class="typeNameLabel">PresenceEventListener</span></pre> <div class="block">Interface to listen for presence events. Use the <a href="../../../../org/jivesoftware/openfire/user/PresenceEventDispatcher.html#addListener-org.jivesoftware.openfire.user.PresenceEventListener-"><code>PresenceEventDispatcher.addListener(PresenceEventListener)</code></a> method to register for events.</div> <dl> <dt><span class="simpleTagLabel">Author:</span></dt> <dd>Gaston Dombiak</dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jivesoftware/openfire/user/PresenceEventListener.html#availableSession-org.jivesoftware.openfire.session.ClientSession-org.xmpp.packet.Presence-">availableSession</a></span>(<a href="../../../../org/jivesoftware/openfire/session/ClientSession.html" title="interface in org.jivesoftware.openfire.session">ClientSession</a>&nbsp;session, org.xmpp.packet.Presence&nbsp;presence)</code> <div class="block">Notification message indicating that a session that was not available is now available.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jivesoftware/openfire/user/PresenceEventListener.html#presenceChanged-org.jivesoftware.openfire.session.ClientSession-org.xmpp.packet.Presence-">presenceChanged</a></span>(<a href="../../../../org/jivesoftware/openfire/session/ClientSession.html" title="interface in org.jivesoftware.openfire.session">ClientSession</a>&nbsp;session, org.xmpp.packet.Presence&nbsp;presence)</code> <div class="block">Notification message indicating that an available session has changed its presence.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jivesoftware/openfire/user/PresenceEventListener.html#subscribedToPresence-org.xmpp.packet.JID-org.xmpp.packet.JID-">subscribedToPresence</a></span>(org.xmpp.packet.JID&nbsp;subscriberJID, org.xmpp.packet.JID&nbsp;authorizerJID)</code> <div class="block">Notification message indicating that a user has successfully subscribed to the presence of another user.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jivesoftware/openfire/user/PresenceEventListener.html#unavailableSession-org.jivesoftware.openfire.session.ClientSession-org.xmpp.packet.Presence-">unavailableSession</a></span>(<a href="../../../../org/jivesoftware/openfire/session/ClientSession.html" title="interface in org.jivesoftware.openfire.session">ClientSession</a>&nbsp;session, org.xmpp.packet.Presence&nbsp;presence)</code> <div class="block">Notification message indicating that a session that was available is no longer available.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/jivesoftware/openfire/user/PresenceEventListener.html#unsubscribedToPresence-org.xmpp.packet.JID-org.xmpp.packet.JID-">unsubscribedToPresence</a></span>(org.xmpp.packet.JID&nbsp;unsubscriberJID, org.xmpp.packet.JID&nbsp;recipientJID)</code> <div class="block">Notification message indicating that a user has unsubscribed to the presence of another user.</div> </td> </tr> </table> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="availableSession-org.jivesoftware.openfire.session.ClientSession-org.xmpp.packet.Presence-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>availableSession</h4> <pre>void&nbsp;availableSession(<a href="../../../../org/jivesoftware/openfire/session/ClientSession.html" title="interface in org.jivesoftware.openfire.session">ClientSession</a>&nbsp;session, org.xmpp.packet.Presence&nbsp;presence)</pre> <div class="block">Notification message indicating that a session that was not available is now available. A session becomes available when an available presence is received. Sessions that are available will have a route in the routing table thus becoming eligible for receiving messages (in particular messages sent to the user bare JID).</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>session</code> - the session that is now available.</dd> <dd><code>presence</code> - the received available presence.</dd> </dl> </li> </ul> <a name="unavailableSession-org.jivesoftware.openfire.session.ClientSession-org.xmpp.packet.Presence-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>unavailableSession</h4> <pre>void&nbsp;unavailableSession(<a href="../../../../org/jivesoftware/openfire/session/ClientSession.html" title="interface in org.jivesoftware.openfire.session">ClientSession</a>&nbsp;session, org.xmpp.packet.Presence&nbsp;presence)</pre> <div class="block">Notification message indicating that a session that was available is no longer available. A session becomes unavailable when an unavailable presence is received. The entity may still be connected to the server and may send an available presence later to indicate that communication can proceed.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>session</code> - the session that is no longer available.</dd> <dd><code>presence</code> - the received unavailable presence.</dd> </dl> </li> </ul> <a name="presenceChanged-org.jivesoftware.openfire.session.ClientSession-org.xmpp.packet.Presence-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>presenceChanged</h4> <pre>void&nbsp;presenceChanged(<a href="../../../../org/jivesoftware/openfire/session/ClientSession.html" title="interface in org.jivesoftware.openfire.session">ClientSession</a>&nbsp;session, org.xmpp.packet.Presence&nbsp;presence)</pre> <div class="block">Notification message indicating that an available session has changed its presence. This is the case when the user presence changed the show value (e.g. away, dnd, etc.) or the presence status message.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>session</code> - the affected session.</dd> <dd><code>presence</code> - the received available presence with the new information.</dd> </dl> </li> </ul> <a name="subscribedToPresence-org.xmpp.packet.JID-org.xmpp.packet.JID-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>subscribedToPresence</h4> <pre>void&nbsp;subscribedToPresence(org.xmpp.packet.JID&nbsp;subscriberJID, org.xmpp.packet.JID&nbsp;authorizerJID)</pre> <div class="block">Notification message indicating that a user has successfully subscribed to the presence of another user.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>subscriberJID</code> - the user that initiated the subscription.</dd> <dd><code>authorizerJID</code> - the user that authorized the subscription.</dd> </dl> </li> </ul> <a name="unsubscribedToPresence-org.xmpp.packet.JID-org.xmpp.packet.JID-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>unsubscribedToPresence</h4> <pre>void&nbsp;unsubscribedToPresence(org.xmpp.packet.JID&nbsp;unsubscriberJID, org.xmpp.packet.JID&nbsp;recipientJID)</pre> <div class="block">Notification message indicating that a user has unsubscribed to the presence of another user.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>unsubscriberJID</code> - the user that initiated the unsubscribe request.</dd> <dd><code>recipientJID</code> - the recipient user of the unsubscribe request.</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../index-all.html">Index</a></li> <li><a href="../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><b>Openfire 4.0.3 Javadoc</b></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../org/jivesoftware/openfire/user/PresenceEventDispatcher.html" title="class in org.jivesoftware.openfire.user"><span class="typeNameLink">Prev&nbsp;Class</span></a></li> <li><a href="../../../../org/jivesoftware/openfire/user/User.html" title="class in org.jivesoftware.openfire.user"><span class="typeNameLink">Next&nbsp;Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../index.html?org/jivesoftware/openfire/user/PresenceEventListener.html" target="_top">Frames</a></li> <li><a href="PresenceEventListener.html" target="_top">No&nbsp;Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../allclasses-noframe.html">All&nbsp;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> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li>Constr&nbsp;|&nbsp;</li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small><i>Copyright &copy; 2003-2008 Jive Software.</i></small></p> </body> </html>
{ "content_hash": "4b506cd6dbf9f0613b2723c66871255c", "timestamp": "", "source": "github", "line_count": 350, "max_line_length": 419, "avg_line_length": 44.04, "alnum_prop": 0.6831451926819774, "repo_name": "paridhika/XMPP_Parking", "id": "ac4728e4550fa703abdd55699b2cb8eb23eb133a", "size": "15414", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "openfire_src/documentation/docs/javadoc/org/jivesoftware/openfire/user/PresenceEventListener.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Batchfile", "bytes": "7690" }, { "name": "C", "bytes": "3814" }, { "name": "CSS", "bytes": "762513" }, { "name": "Groff", "bytes": "5245078" }, { "name": "HTML", "bytes": "49197186" }, { "name": "Java", "bytes": "26205517" }, { "name": "JavaScript", "bytes": "6526390" }, { "name": "Makefile", "bytes": "851" }, { "name": "Objective-C", "bytes": "6879" }, { "name": "PLSQL", "bytes": "1526" }, { "name": "Shell", "bytes": "49899" } ], "symlink_target": "" }
<?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html> <head> <title>Seconds - ScalaTest 1.9.1 - org.scalatest.time.Seconds</title> <meta name="description" content="Seconds - ScalaTest 1.9.1 - org.scalatest.time.Seconds" /> <meta name="keywords" content="Seconds ScalaTest 1.9.1 org.scalatest.time.Seconds" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <link href="../../../lib/template.css" media="screen" type="text/css" rel="stylesheet" /> <link href="../../../lib/diagrams.css" media="screen" type="text/css" rel="stylesheet" id="diagrams-css" /> <script type="text/javascript" src="../../../lib/jquery.js" id="jquery-js"></script> <script type="text/javascript" src="../../../lib/jquery-ui.js"></script> <script type="text/javascript" src="../../../lib/template.js"></script> <script type="text/javascript" src="../../../lib/tools.tooltip.js"></script> <script type="text/javascript"> if(top === self) { var url = '../../../index.html'; var hash = 'org.scalatest.time.Seconds$'; var anchor = window.location.hash; var anchor_opt = ''; if (anchor.length >= 1) anchor_opt = '@' + anchor.substring(1); window.location.href = url + '#' + hash + anchor_opt; } </script> <!-- gtag [javascript] --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-71294502-1"></script> <script defer> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'UA-71294502-1'); </script> </head> <body class="value"> <!-- Top of doc.scalatest.org [javascript] --> <script type="text/javascript"> var rnd = window.rnd || Math.floor(Math.random()*10e6); var pid204546 = window.pid204546 || rnd; var plc204546 = window.plc204546 || 0; var abkw = window.abkw || ''; var absrc = 'http://ab167933.adbutler-ikon.com/adserve/;ID=167933;size=468x60;setID=204546;type=js;sw='+screen.width+';sh='+screen.height+';spr='+window.devicePixelRatio+';kw='+abkw+';pid='+pid204546+';place='+(plc204546++)+';rnd='+rnd+';click=CLICK_MACRO_PLACEHOLDER'; document.write('<scr'+'ipt src="'+absrc+'" type="text/javascript"></scr'+'ipt>'); </script> <div id="definition"> <img src="../../../lib/object_big.png" /> <p id="owner"><a href="../../package.html" class="extype" name="org">org</a>.<a href="../package.html" class="extype" name="org.scalatest">scalatest</a>.<a href="package.html" class="extype" name="org.scalatest.time">time</a></p> <h1>Seconds</h1> </div> <h4 id="signature" class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">object</span> </span> <span class="symbol"> <span class="name">Seconds</span><span class="result"> extends <a href="Units.html" class="extype" name="org.scalatest.time.Units">Units</a> with <span class="extype" name="scala.Product">Product</span> with <span class="extype" name="scala.Serializable">Serializable</span></span> </span> </h4> <div id="comment" class="fullcommenttop"><div class="comment cmt"><p>Indicates second units.</p><p>This singleton object may be passed to the constructor of <a href="Span.html"><code>Span</code></a> to specify second units of time. For example:</p><p><pre class="stHighlighted"> <span class="stType">Span</span>(<span class="stLiteral">10</span>, <span class="stType">Seconds</span>) </pre> </p></div><div class="toggleContainer block"> <span class="toggle">Linear Supertypes</span> <div class="superTypes hiddenContent"><span class="extype" name="scala.Serializable">Serializable</span>, <span class="extype" name="java.io.Serializable">Serializable</span>, <span class="extype" name="scala.Product">Product</span>, <span class="extype" name="scala.Equals">Equals</span>, <a href="Units.html" class="extype" name="org.scalatest.time.Units">Units</a>, <span class="extype" name="scala.AnyRef">AnyRef</span>, <span class="extype" name="scala.Any">Any</span></div> </div></div> <div id="mbrsel"> <div id="textfilter"><span class="pre"></span><span class="input"><input id="mbrsel-input" type="text" accesskey="/" /></span><span class="post"></span></div> <div id="order"> <span class="filtertype">Ordering</span> <ol> <li class="alpha in"><span>Alphabetic</span></li> <li class="inherit out"><span>By inheritance</span></li> </ol> </div> <div id="ancestors"> <span class="filtertype">Inherited<br /> </span> <ol id="linearization"> <li class="in" name="org.scalatest.time.Seconds"><span>Seconds</span></li><li class="in" name="scala.Serializable"><span>Serializable</span></li><li class="in" name="java.io.Serializable"><span>Serializable</span></li><li class="in" name="scala.Product"><span>Product</span></li><li class="in" name="scala.Equals"><span>Equals</span></li><li class="in" name="org.scalatest.time.Units"><span>Units</span></li><li class="in" name="scala.AnyRef"><span>AnyRef</span></li><li class="in" name="scala.Any"><span>Any</span></li> </ol> </div><div id="ancestors"> <span class="filtertype"></span> <ol> <li class="hideall out"><span>Hide All</span></li> <li class="showall in"><span>Show all</span></li> </ol> <a href="http://docs.scala-lang.org/overviews/scaladoc/usage.html#members" target="_blank">Learn more about member selection</a> </div> <div id="visbl"> <span class="filtertype">Visibility</span> <ol><li class="public in"><span>Public</span></li><li class="all out"><span>All</span></li></ol> </div> </div> <div id="template"> <div id="allMembers"> <div id="values" class="values members"> <h3>Value Members</h3> <ol><li name="scala.AnyRef#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:AnyRef):Boolean"></a> <a id="!=(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.Any#!=" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="!=(x$1:Any):Boolean"></a> <a id="!=(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $bang$eq" class="name">!=</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.AnyRef###" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="##():Int"></a> <a id="##():Int"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $hash$hash" class="name">##</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Int">Int</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:AnyRef):Boolean"></a> <a id="==(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.Any#==" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="==(x$1:Any):Boolean"></a> <a id="==(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span title="gt4s: $eq$eq" class="name">==</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.Any#asInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="asInstanceOf[T0]:T0"></a> <a id="asInstanceOf[T0]:T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">asInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Any.asInstanceOf.T0">T0</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.AnyRef#clone" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="clone():Object"></a> <a id="clone():AnyRef"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">clone</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.AnyRef">AnyRef</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<span class="extype" name="java.lang">java.lang</span>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">()</span> </dd></dl></div> </li><li name="scala.AnyRef#eq" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="eq(x$1:AnyRef):Boolean"></a> <a id="eq(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">eq</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#equals" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="equals(x$1:Any):Boolean"></a> <a id="equals(Any):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">equals</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Any">Any</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.AnyRef#finalize" visbl="prt" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="finalize():Unit"></a> <a id="finalize():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier"></span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">finalize</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Attributes</dt><dd>protected[<span class="extype" name="java.lang">java.lang</span>] </dd><dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">()</span> </dd></dl></div> </li><li name="scala.AnyRef#getClass" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="getClass():Class[_]"></a> <a id="getClass():Class[_]"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">getClass</span><span class="params">()</span><span class="result">: <span class="extype" name="java.lang.Class">Class</span>[_]</span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef → Any</dd></dl></div> </li><li name="scala.Any#isInstanceOf" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="isInstanceOf[T0]:Boolean"></a> <a id="isInstanceOf[T0]:Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">isInstanceOf</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>Any</dd></dl></div> </li><li name="scala.AnyRef#ne" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="ne(x$1:AnyRef):Boolean"></a> <a id="ne(AnyRef):Boolean"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">ne</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.AnyRef">AnyRef</span></span>)</span><span class="result">: <span class="extype" name="scala.Boolean">Boolean</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notify" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notify():Unit"></a> <a id="notify():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notify</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#notifyAll" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="notifyAll():Unit"></a> <a id="notifyAll():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">notifyAll</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#synchronized" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="synchronized[T0](x$1:=&gt;T0):T0"></a> <a id="synchronized[T0](⇒T0):T0"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">synchronized</span><span class="tparams">[<span name="T0">T0</span>]</span><span class="params">(<span name="arg0">arg0: ⇒ <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span>)</span><span class="result">: <span class="extype" name="java.lang.AnyRef.synchronized.T0">T0</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait():Unit"></a> <a id="wait():Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">()</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">()</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long,x$2:Int):Unit"></a> <a id="wait(Long,Int):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>, <span name="arg1">arg1: <span class="extype" name="scala.Int">Int</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">()</span> </dd></dl></div> </li><li name="scala.AnyRef#wait" visbl="pub" data-isabs="false" fullComment="yes" group="Ungrouped"> <a id="wait(x$1:Long):Unit"></a> <a id="wait(Long):Unit"></a> <h4 class="signature"> <span class="modifier_kind"> <span class="modifier">final </span> <span class="kind">def</span> </span> <span class="symbol"> <span class="name">wait</span><span class="params">(<span name="arg0">arg0: <span class="extype" name="scala.Long">Long</span></span>)</span><span class="result">: <span class="extype" name="scala.Unit">Unit</span></span> </span> </h4> <div class="fullcomment"><dl class="attributes block"> <dt>Definition Classes</dt><dd>AnyRef</dd><dt>Annotations</dt><dd> <span class="name">@throws</span><span class="args">()</span> </dd></dl></div> </li></ol> </div> </div> <div id="inheritedMembers"> <div class="parent" name="scala.Serializable"> <h3>Inherited from <span class="extype" name="scala.Serializable">Serializable</span></h3> </div><div class="parent" name="java.io.Serializable"> <h3>Inherited from <span class="extype" name="java.io.Serializable">Serializable</span></h3> </div><div class="parent" name="scala.Product"> <h3>Inherited from <span class="extype" name="scala.Product">Product</span></h3> </div><div class="parent" name="scala.Equals"> <h3>Inherited from <span class="extype" name="scala.Equals">Equals</span></h3> </div><div class="parent" name="org.scalatest.time.Units"> <h3>Inherited from <a href="Units.html" class="extype" name="org.scalatest.time.Units">Units</a></h3> </div><div class="parent" name="scala.AnyRef"> <h3>Inherited from <span class="extype" name="scala.AnyRef">AnyRef</span></h3> </div><div class="parent" name="scala.Any"> <h3>Inherited from <span class="extype" name="scala.Any">Any</span></h3> </div> </div> <div id="groupedMembers"> <div class="group" name="Ungrouped"> <h3>Ungrouped</h3> </div> </div> </div> <div id="tooltip"></div> <div id="footer"> </div> </body> </html>
{ "content_hash": "10721d9b6d7b1574fccaa1627e432f8d", "timestamp": "", "source": "github", "line_count": 436, "max_line_length": 538, "avg_line_length": 51.793577981651374, "alnum_prop": 0.5875476042865999, "repo_name": "scalatest/scalatest-website", "id": "92b528e69920343cfb2c8989090abc74196049e1", "size": "22592", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "public/scaladoc/1.9.1/org/scalatest/time/Seconds$.html", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "8401192" }, { "name": "HTML", "bytes": "4508833233" }, { "name": "JavaScript", "bytes": "12256885" }, { "name": "Procfile", "bytes": "62" }, { "name": "Scala", "bytes": "136544" } ], "symlink_target": "" }
package org.apache.ecs.wml; import org.apache.ecs.Element; import org.apache.ecs.SinglePartElement; /** This class implements the &lt;b&gt; element. @version $Id: B.java,v 1.2 2003/04/27 09:27:12 rdonkin Exp $ @author Written by <a href="mailto:Krzysztof.Zelazowski@cern.ch">Krzysztof Zelazowski</a> */ public class B extends org.apache.ecs.MultiPartElement { /** Basic constructor. */ public B() { setElementType("b"); } /** Adds an Element to the element. @param element the element to add */ public B addElement(Element element) { addElementToRegistry(element,getFilterState()); return(this); } /** Adds a String to the element. @param s the String to add. */ public B addElement(String s) { addElementToRegistry(s,getFilterState()); return(this); } }
{ "content_hash": "189816c34790db186964b420673dd86d", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 92, "avg_line_length": 19.65909090909091, "alnum_prop": 0.6462427745664739, "repo_name": "jjYBdx4IL/misc", "id": "30a74fcc7f6e2c21b01e3d29eba4dd390891cf13", "size": "3632", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "ecs/src/main/java/org/apache/ecs/wml/B.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "226" }, { "name": "CSS", "bytes": "14159" }, { "name": "HTML", "bytes": "204348" }, { "name": "Java", "bytes": "4400513" }, { "name": "JavaScript", "bytes": "43347" }, { "name": "Shell", "bytes": "9083" }, { "name": "Smarty", "bytes": "7140" } ], "symlink_target": "" }
import React from 'react'; import styled from 'styled-components'; import { FormattedMessage } from 'react-intl'; import messages from './messages'; import H1 from '../../components/H1/index'; import Text from '../../components/Text/index'; import Home1 from './images/home_01-min.jpg'; import Produzione from './images/produzione.jpg'; import Progettazione from './images/progettazione.jpg'; import Realizzazione from './images/realizzazione.jpg'; import Manutenzione from './images/manutenzione.jpg'; const Div = styled.div` `; function SectionServices() { return ( <Div> <div className="uk-cover-container uk-height-medium"> <img src={Home1} alt="" data-uk-cover/> </div> <div className="uk-section" id="section2"> <div className="uk-container"> <H1> <FormattedMessage {...messages.servicesTitle} /> </H1> <Text> <FormattedMessage {...messages.servicesContent} /> </Text> <div className="uk-child-width-1-4@m" data-uk-grid data-uk-scrollspy="cls: uk-animation-fade; target: > div > .uk-card; delay: 500; repeat: true"> <div> <div className="uk-card uk-card-body"> <div className="uk-text-center"> <img src={Produzione} alt=""/> </div> <p className="uk-text-center color-primary"> <FormattedMessage {...messages.servicesProduction} /> </p> </div> </div> <div> <div className="uk-card uk-card-body"> <div className="uk-text-center"> <img src={Progettazione} alt=""/> </div> <p className="uk-text-center color-primary"> <FormattedMessage {...messages.servicesPlanning} /> </p> </div> </div> <div> <div className="uk-card uk-card-body"> <div className="uk-text-center"> <img src={Realizzazione} alt=""/> </div> <p className="uk-text-center color-primary"> <FormattedMessage {...messages.servicesRealization} /> </p> </div> </div> <div> <div className="uk-card uk-card-body"> <div className="uk-text-center"> <img src={Manutenzione} alt=""/> </div> <p className="uk-text-center color-primary"> <FormattedMessage {...messages.servicesMainteinance} /> </p> </div> </div> </div> </div> </div> </Div> ); } export default SectionServices;
{ "content_hash": "8b6c59833474ff4c9d57c2148a6a8ed2", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 110, "avg_line_length": 33.416666666666664, "alnum_prop": 0.5105094406840043, "repo_name": "frascata/vivaifrappi", "id": "cbb7ce10bf29299df58d91ece179ad2fc764547f", "size": "2807", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "app/containers/HomePage/SectionServices.js", "mode": "33188", "license": "mit", "language": [ { "name": "HTML", "bytes": "1164" }, { "name": "Handlebars", "bytes": "8472" }, { "name": "JavaScript", "bytes": "151497" } ], "symlink_target": "" }
#ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_ACTIVEMQTOPICMARSHALLER_H_ #define _ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_ACTIVEMQTOPICMARSHALLER_H_ // Turn off warning message for ignored exception specification #ifdef _MSC_VER #pragma warning( disable : 4290 ) #endif #include <activemq/wireformat/openwire/marshal/generated/ActiveMQDestinationMarshaller.h> #include <decaf/io/DataInputStream.h> #include <decaf/io/DataOutputStream.h> #include <decaf/io/IOException.h> #include <activemq/util/Config.h> #include <activemq/commands/DataStructure.h> #include <activemq/wireformat/openwire/OpenWireFormat.h> #include <activemq/wireformat/openwire/utils/BooleanStream.h> namespace activemq { namespace wireformat { namespace openwire { namespace marshal { namespace generated { /** * Marshaling code for Open Wire Format for ActiveMQTopicMarshaller * * NOTE!: This file is auto generated - do not modify! * if you need to make a change, please see the Java Classes * in the activemq-openwire-generator module */ class AMQCPP_API ActiveMQTopicMarshaller : public ActiveMQDestinationMarshaller { public: ActiveMQTopicMarshaller() {} virtual ~ActiveMQTopicMarshaller() {} virtual commands::DataStructure* createObject() const; virtual unsigned char getDataStructureType() const; virtual void tightUnmarshal(OpenWireFormat* wireFormat, commands::DataStructure* dataStructure, decaf::io::DataInputStream* dataIn, utils::BooleanStream* bs); virtual int tightMarshal1(OpenWireFormat* wireFormat, commands::DataStructure* dataStructure, utils::BooleanStream* bs); virtual void tightMarshal2(OpenWireFormat* wireFormat, commands::DataStructure* dataStructure, decaf::io::DataOutputStream* dataOut, utils::BooleanStream* bs); virtual void looseUnmarshal(OpenWireFormat* wireFormat, commands::DataStructure* dataStructure, decaf::io::DataInputStream* dataIn); virtual void looseMarshal(OpenWireFormat* wireFormat, commands::DataStructure* dataStructure, decaf::io::DataOutputStream* dataOut); }; }}}}} #endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_MARSAHAL_GENERATED_ACTIVEMQTOPICMARSHALLER_H_*/
{ "content_hash": "7fcc3220ab22e42e31f20be9fa6b5aad", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 89, "avg_line_length": 37.605633802816904, "alnum_prop": 0.6400749063670412, "repo_name": "apache/activemq-cpp", "id": "a757777cfe1f0d88af66a5f41f515fabbe39c77a", "size": "3467", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "activemq-cpp/src/main/activemq/wireformat/openwire/marshal/generated/ActiveMQTopicMarshaller.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "447207" }, { "name": "C++", "bytes": "12024283" }, { "name": "Java", "bytes": "251150" }, { "name": "M4", "bytes": "72135" }, { "name": "Makefile", "bytes": "114773" }, { "name": "Objective-C", "bytes": "14815" }, { "name": "Shell", "bytes": "7934" } ], "symlink_target": "" }
[#]: subject: "10 Best Open Source Bots for Your Discord Server" [#]: via: "https://itsfoss.com/open-source-discord-bots/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lkxed" [#]: translator: " " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " 10 Best Open Source Bots for Your Discord Server ====== Discord started as a platform where gamers and friends could hang out. **[Discord][1] has over 150 million users** in **2022**, even after [turning down][2] a **$12 billion offer from Microsoft**. If it is your first time hearing about it, consider it something like Slack, but with countless fun functionalities to create communities (i.e., servers). Among all the features, Discord bots allow automating things or spice up your server. But most of them are proprietary. So, in this list, I suggest some of the **best open-source Discord bots**. **Note:**Bots can spread malware and affect your entire Discord server. You must ensure that you do not add bots you do not know about. And this is why you might want to trust open-source Discord bots more than other options. ### 1. MonitoRSS ![monitorss itsfoss][3] Highlights: - **RSS Feed** - **Filters and Subscriptions** - **Hosted** [MonitoRSS][4] is a useful Discord bot that enables your community to receive news from any sources that support RSS. It is a reasonably popular bot that works as expected. You can add it to a particular channel, customize its look, and start getting news updates on your Discord server. It also lets you filter articles for your feed and allow users to subscribe to an article as per their liking. This can be managed and customized using a web interface control panel. Explore more on its [GitHub page][5]. ### 2. ModMail ![modmail discord][6] Highlights: - **Enables users to contact server staff** - **Self-host** - **Hosted version** - **Optional premium** [ModMail][7] is a simple open-source Discord bot that seamlessly lets a user contact the staff/admins/moderators of a Discord channel. Traditionally, you have to reach out to multiple people via DMs to expect help on something you want to know. However, some servers have many users, so it may be difficult for the server staff to get back to you. ModMail creates a separate channel when you send a message to the bot. And this channel acts as a shared inbox to all the administrators, mods, and you. ![modmail bot][8] Not only does easy messaging, but it also helps the server staff to conveniently read past transcripts, enable automated replies, save snippets of them, respond anonymously, and more. Some features are premium-only. You can check out its [official website][9] and [GitHub page][10] for more info. It also gives you all the necessary information to self-host it. ### 3. Red Discord Bot (Self-Hosted) ![red discord bot][11] Highlights: - **Highly Customizable** - **Moderation****tasks** - **Good documentation** - **Multipurpose** [Red][12] is an entirely modular bot that provides you with many functions, including music, moderation, trivia, stream alerts, and more. Red should be useful whether you want it to send welcome messages or help moderate the server. Unlike some others, you cannot add the bot directly to your server. You will have to self-host it, configure it, and then get the ability to add it to your server. The installation does not need any sort of coding; you have to follow the [documentation][13]. ### 4. Discord Music Bot (Self-Hosted) ![discord music bot][14] Highlights: - **It****supports Spotify, SoundCloud, and YouTube**. - **It offers shuffling, volume control, and a web dashboard to manage it all**. [Discord Music Bot][15] (not a unique name, I know) is a pretty popular Discord bot that you can self-host. It supports Spotify, SoundCloud, and YouTube. Some features include shuffling, volume control, and a web dashboard. You can follow the instructions on its [GitHub page][15] to install and configure it for your server. ### 5. Discord Tickets (Self-Hosted) ![discord tickets][16] Highlights: - **Ticket management** - **Add custom branding for free** Do you have customers for your services/products on Discord? You can use [Discord Tickets][17] to manage/create tickets and add your branding for free. Most of the Discord’s popular ticket management bots are proprietary and require a premium subscription to add your brand logo. With Discord Tickets, you can self-host and customize as per your requirements. Explore more about it on its [GitHub page][18]. ### 6. EvoBot (Self-Hosted) ![evobot][19] Highlights: - **Highly customizable** - **Search for music or use a URL to play** [EvoBot][20] is yet another open-source music Discord bot with lots of customization options. You can play music from YouTube and SoundCloud using its URL or search/play. Explore more about its installation and configuration on its [GitHub page][20]. ### 7. Atlanta Bot ![atlanta bot][21] Highlights: - **Hosted version** - **Self-host option** - **Web dashboard** - **Multipurpose** [AtlantaBot][22] is yet another all-in-one bot that provides functionalities for moderation, music, fun commands, and several commands. Furthermore, it features its dashboard with valuable options. You can set up the dashboard and manage your server/configuration through it. You can also perform limited translations using the bot. It can be self-hosted, but if you would rather not make an effort, you can invite a hosted version of the bot. ### 8. YAGPDB (Self-Hosted) ![reddit feed yagpdb][23] Highlights: - **Custom commands** - **Automatic moderator** - **Reddit/YouTube feed** - **Moderation****tasks** [YAGPDB][24] stands for **Yet Another General Purpose Discord Bot**. With this bot, you can quickly perform general moderation tasks, add custom commands, create an automatic moderator, manage/create roles, and pull Reddit/YouTube feeds. It is configurable. So, you can do more with it than what I just mentioned. Explore more about it on its [GitHub page][25]. ### 9. Loritta ![loritta][26] Highlights: - **Hosted version** - **Self-host option** - **Engagement and Moderation features.** If you are looking for a multipurpose Discord bot with an interesting character, [Loritta][27] would be a good pick. It supports moderation, entertainment, and automation features. You can self-host it or use the hosted version. The developer presents the bot as a girl who helps you moderate, entertain, and engage the members of your server. Additionally, it offers a premium plan for some extra perks. Explore more about it on its [GitHub page][28]. ### 10. Melijn ![melijn][29] Highlights: - **Hosted version** - **Self-host option** - **Moderation features.** [Melijn][30] is yet another multipurpose bot for Discord servers. You can interact with audio commands, moderate, perform user verifications, and create role groups. It offers a hosted version and lets you self-host it, following the instructions on its [GitHub page][31]. ### What’s Your Favorite Discord Bot? If you are a Discord server moderator or admin, what bot do you like to use for your community? Do you focus on moderation features or engagement features? What are the standard features that you look for in a Discord bot? Share your thoughts in the comments below. -------------------------------------------------------------------------------- via: https://itsfoss.com/open-source-discord-bots/ 作者:[Ankush Das][a] 选题:[lkxed][b] 译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://itsfoss.com/author/ankush/ [b]: https://github.com/lkxed [1]: https://discord.com/company [2]: https://www.bloomberg.com/news/articles/2021-04-20/chat-app-discord-is-said-to-end-takeover-talks-with-microsoft [3]: https://itsfoss.com/wp-content/uploads/2022/11/monitorss-itsfoss.jpg [4]: https://monitorss.xyz [5]: https://github.com/synzen/MonitoRSS [6]: https://itsfoss.com/wp-content/uploads/2022/11/modmail-discord.jpg [7]: https://modmail.xyz/ [8]: https://itsfoss.com/wp-content/uploads/2022/11/modmail-bot.png [9]: https://modmail.xyz/premium [10]: https://github.com/chamburr/modmail [11]: https://itsfoss.com/wp-content/uploads/2022/11/red-discord-bot.png [12]: https://github.com/Cog-Creators/Red-DiscordBot [13]: https://docs.discord.red/en/stable/ [14]: https://itsfoss.com/wp-content/uploads/2022/11/discord-music-bot.png [15]: https://github.com/SudhanPlayz/Discord-MusicBot [16]: https://itsfoss.com/wp-content/uploads/2022/11/discord-tickets.jpg [17]: https://discordtickets.app [18]: https://github.com/discord-tickets/bot [19]: https://itsfoss.com/wp-content/uploads/2022/11/evobot.png [20]: https://github.com/eritislami/evobot [21]: https://itsfoss.com/wp-content/uploads/2022/11/atlanta-bot.png [22]: https://github.com/Androz2091/AtlantaBot [23]: https://itsfoss.com/wp-content/uploads/2022/11/reddit-feed-yagpdb.png [24]: https://yagpdb.xyz [25]: https://github.com/botlabs-gg/yagpdb [26]: https://itsfoss.com/wp-content/uploads/2022/11/loritta.jpg [27]: https://loritta.website/us/ [28]: https://github.com/LorittaBot [29]: https://itsfoss.com/wp-content/uploads/2022/11/melijn.jpg [30]: https://melijn.com [31]: https://github.com/ToxicMushroom/Melijn
{ "content_hash": "1bae3c8023867c87a9ed108232284035", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 225, "avg_line_length": 38.21224489795918, "alnum_prop": 0.7383037812433241, "repo_name": "bestony/TranslateProject", "id": "1b94a3469215cec3798fe230f05739c22e1b97d7", "size": "9438", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "sources/tech/20221104.6 ⭐️⭐️ 10 Best Open Source Bots for Your Discord Server.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Shell", "bytes": "12332" } ], "symlink_target": "" }
// // PPEmotionListPageView.h // PPZone // // Created by jiaguanglei on 16/1/19. // Copyright © 2016年 roseonly. All rights reserved. // /** * 显示表情页面 -- 20 */ #import <UIKit/UIKit.h> // 一页中最多3行 #define PPEmotionListPageViewMaxRows 3 // 一行中最多7列 #define PPEmotionListPageViewMaxCols 7 // 每一页的表情个数 #define PPEmotionListPageViewMaxNum ((PPEmotionListPageViewMaxRows * PPEmotionListPageViewMaxCols) - 1) @interface PPEmotionListPageView : UIView /** * 表情模型 */ PROPERTYSTRONG(NSArray, datas) @end
{ "content_hash": "75bd0025b205762466a4fde0322eef16", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 103, "avg_line_length": 16.9, "alnum_prop": 0.7297830374753451, "repo_name": "Jiaguanglei0418/PPZone", "id": "1b2ba47330e5c4d078a68978e368fa8419abbaff", "size": "570", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "PPZone/PPZone/Classes/Compose/Views/PPEmotionKeyboard/PPEmotionScrollView/PPEmotionListPageView/PPEmotionListPageView.h", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Objective-C", "bytes": "469861" }, { "name": "Ruby", "bytes": "173" }, { "name": "Shell", "bytes": "4797" } ], "symlink_target": "" }
<?xml version="1.0" encoding="iso-8859-1"?> <!-- Description: atom entry content xhtml works Expect: var content = feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).content.text; content == "<b>test</b> content"; --> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:foo="http://www.example.org" foo:quux="quuux"> <title>hmm</title> <author> <email>hmm@example.com</email> <name>foo</name> </author> <generator version="1.1" uri="http://example.org">Hmm</generator> <author> <email>bar@example.com</email> <name>foo</name> </author> <rights type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div> </rights> <entry></entry> <entry foo:bar="baz"> <title>test</title> <content type="xhtml"> <div xmlns="http://www.w3.org/1999/xhtml"> <b>test</b> content </div> </content> </entry> </feed>
{ "content_hash": "caa8d9e7bc88d512532b433e2dd653be", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 134, "avg_line_length": 23.41025641025641, "alnum_prop": 0.619934282584885, "repo_name": "wilebeast/FireFox-OS", "id": "8cadef75e11e96c996ca92b579739c57cbe274b2", "size": "913", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "B2G/gecko/toolkit/components/feeds/test/xml/rfc4287/entry_content_xhtml_with_markup.xml", "mode": "33188", "license": "apache-2.0", "language": [], "symlink_target": "" }
package au.com.emberspring.ember; import java.util.concurrent.ConcurrentMap; public interface EmberLinks { ConcurrentMap<String, String> getLinks(); }
{ "content_hash": "7052cdb3e75797aa5b9899dd8b77e85b", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 42, "avg_line_length": 18.555555555555557, "alnum_prop": 0.7365269461077845, "repo_name": "jackmatt2/ember-spring", "id": "964fe9cbcaea051eab3d4d3720d63f3689fecfc9", "size": "167", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "src/main/java/au/com/emberspring/ember/EmberLinks.java", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "371" }, { "name": "Java", "bytes": "22176" }, { "name": "JavaScript", "bytes": "2387775" } ], "symlink_target": "" }
package de.matthiasmann.twl; import java.util.logging.Level; import java.util.logging.Logger; import de.matthiasmann.twl.model.AbstractListModel; import de.matthiasmann.twl.model.AbstractTreeTableModel; import de.matthiasmann.twl.model.AbstractTreeTableNode; import de.matthiasmann.twl.model.ListModel; import de.matthiasmann.twl.model.Property; import de.matthiasmann.twl.model.PropertyList; import de.matthiasmann.twl.model.SimplePropertyList; import de.matthiasmann.twl.model.TreeTableModel; import de.matthiasmann.twl.model.TreeTableNode; import de.matthiasmann.twl.utils.TypeMapping; /** * A property sheet class * * @author Matthias Mann */ public class PropertySheet extends TreeTable { public interface PropertyEditor { public Widget getWidget(); public void valueChanged(); public void preDestroy(); public void setSelected(boolean selected); /** * Can be used to position the widget in a cell. * <p> * If this method returns false, the table will position the widget * itself. * </p> * * <p> * This method is responsible to call setPosition and setSize on the * widget or return false. * </p> * * @param x * the left edge of the cell * @param y * the top edge of the cell * @param width * the width of the cell * @param height * the height of the cell * * @return true if the position was changed by this method. */ public boolean positionWidget(int x, int y, int width, int height); } public interface PropertyEditorFactory<T> { public PropertyEditor createEditor(Property<T> property); } private final SimplePropertyList rootList; private final PropertyListCellRenderer subListRenderer; private final CellRenderer editorRenderer; private final TypeMapping<PropertyEditorFactory<?>> factories; public PropertySheet() { this(new Model()); } @SuppressWarnings("OverridableMethodCallInConstructor") private PropertySheet(Model model) { super(model); this.rootList = new SimplePropertyList("<root>"); this.subListRenderer = new PropertyListCellRenderer(); this.editorRenderer = new EditorRenderer(); this.factories = new TypeMapping<PropertyEditorFactory<?>>(); rootList.addValueChangedCallback(new TreeGenerator(rootList, model)); registerPropertyEditorFactory(String.class, new StringEditorFactory()); } public SimplePropertyList getPropertyList() { return rootList; } public <T> void registerPropertyEditorFactory(Class<T> clazz, PropertyEditorFactory<T> factory) { if (clazz == null) { throw new NullPointerException("clazz"); } if (factory == null) { throw new NullPointerException("factory"); } factories.put(clazz, factory); } @Override public void setModel(TreeTableModel model) { if (model instanceof Model) { super.setModel(model); } else { throw new UnsupportedOperationException("Do not call this method"); } } @Override protected void applyTheme(ThemeInfo themeInfo) { super.applyTheme(themeInfo); applyThemePropertiesSheet(themeInfo); } protected void applyThemePropertiesSheet(ThemeInfo themeInfo) { applyCellRendererTheme(subListRenderer); applyCellRendererTheme(editorRenderer); } @Override protected CellRenderer getCellRenderer(int row, int col, TreeTableNode node) { if (node == null) { node = getNodeFromRow(row); } if (node instanceof ListNode) { if (col == 0) { PropertyListCellRenderer cr = subListRenderer; NodeState nodeState = getOrCreateNodeState(node); cr.setCellData(row, col, node.getData(col), nodeState); return cr; } else { return null; } } else if (col == 0) { return super.getCellRenderer(row, col, node); } else { CellRenderer cr = editorRenderer; cr.setCellData(row, col, node.getData(col)); return cr; } } @SuppressWarnings("unchecked") TreeTableNode createNode(TreeTableNode parent, Property<?> property) { if (property.getType() == PropertyList.class) { return new ListNode(parent, property); } else { Class<?> type = property.getType(); PropertyEditorFactory factory = factories.get(type); if (factory != null) { PropertyEditor editor = factory.createEditor(property); if (editor != null) { return new LeafNode(parent, property, editor); } } else { Logger.getLogger(PropertySheet.class.getName()).log( Level.WARNING, "No property editor factory for type {0}", type); } return null; } } interface PSTreeTableNode extends TreeTableNode { public void addChild(TreeTableNode parent); public void removeAllChildren(); } static abstract class PropertyNode extends AbstractTreeTableNode implements Runnable, PSTreeTableNode { protected final Property<?> property; @SuppressWarnings("LeakingThisInConstructor") public PropertyNode(TreeTableNode parent, Property<?> property) { super(parent); this.property = property; property.addValueChangedCallback(this); } protected void removeCallback() { property.removeValueChangedCallback(this); } @Override public void removeAllChildren() { super.removeAllChildren(); } public void addChild(TreeTableNode parent) { insertChild(parent, getNumChildren()); } } class TreeGenerator implements Runnable { private final PropertyList list; private final PSTreeTableNode parent; public TreeGenerator(PropertyList list, PSTreeTableNode parent) { this.list = list; this.parent = parent; } public void run() { parent.removeAllChildren(); addSubProperties(); } void removeChildCallbacks(PSTreeTableNode parent) { for (int i = 0, n = parent.getNumChildren(); i < n; ++i) { ((PropertyNode) parent.getChild(i)).removeCallback(); } } void addSubProperties() { for (int i = 0; i < list.getNumProperties(); ++i) { TreeTableNode node = createNode(parent, list.getProperty(i)); if (node != null) { parent.addChild(node); } } } } static class LeafNode extends PropertyNode { private final PropertyEditor editor; public LeafNode(TreeTableNode parent, Property<?> property, PropertyEditor editor) { super(parent, property); this.editor = editor; setLeaf(true); } public Object getData(int column) { switch (column) { case 0: return property.getName(); case 1: return editor; default: return "???"; } } public void run() { editor.valueChanged(); fireNodeChanged(); } } class ListNode extends PropertyNode { protected final TreeGenerator treeGenerator; public ListNode(TreeTableNode parent, Property<?> property) { super(parent, property); this.treeGenerator = new TreeGenerator( (PropertyList) property.getPropertyValue(), this); treeGenerator.run(); } public Object getData(int column) { return property.getName(); } public void run() { treeGenerator.run(); } @Override protected void removeCallback() { super.removeCallback(); treeGenerator.removeChildCallbacks(this); } } class PropertyListCellRenderer extends TreeNodeCellRenderer { private final Widget bgRenderer; private final Label textRenderer; public PropertyListCellRenderer() { bgRenderer = new Widget(); textRenderer = new Label(bgRenderer.getAnimationState()); textRenderer.setAutoSize(false); bgRenderer.add(textRenderer); bgRenderer.setTheme(getTheme()); } @Override public int getColumnSpan() { return 2; } @Override public Widget getCellRenderWidget(int x, int y, int width, int height, boolean isSelected) { bgRenderer.setPosition(x, y); bgRenderer.setSize(width, height); int indent = getIndentation(); textRenderer.setPosition(x + indent, y); textRenderer.setSize(Math.max(0, width - indent), height); bgRenderer.getAnimationState().setAnimationState(STATE_SELECTED, isSelected); return bgRenderer; } @Override public void setCellData(int row, int column, Object data, NodeState nodeState) { super.setCellData(row, column, data, nodeState); textRenderer.setText((String) data); } @Override protected void setSubRenderer(int row, int column, Object colData) { } } static class EditorRenderer implements CellRenderer, TreeTable.CellWidgetCreator { private PropertyEditor editor; public void applyTheme(ThemeInfo themeInfo) { } public Widget getCellRenderWidget(int x, int y, int width, int height, boolean isSelected) { editor.setSelected(isSelected); return null; } public int getColumnSpan() { return 1; } public int getPreferredHeight() { return editor.getWidget().getPreferredHeight(); } public String getTheme() { return "PropertyEditorCellRender"; } public void setCellData(int row, int column, Object data) { editor = (PropertyEditor) data; } public Widget updateWidget(Widget existingWidget) { return editor.getWidget(); } public void positionWidget(Widget widget, int x, int y, int w, int h) { if (!editor.positionWidget(x, y, w, h)) { widget.setPosition(x, y); widget.setSize(w, h); } } } static class Model extends AbstractTreeTableModel implements PSTreeTableNode { public String getColumnHeaderText(int column) { switch (column) { case 0: return "Name"; case 1: return "Value"; default: return "???"; } } public int getNumColumns() { return 2; } @Override public void removeAllChildren() { super.removeAllChildren(); } public void addChild(TreeTableNode parent) { insertChild(parent, getNumChildren()); } } static class StringEditor implements PropertyEditor, EditField.Callback { private final EditField editField; private final Property<String> property; @SuppressWarnings("LeakingThisInConstructor") public StringEditor(Property<String> property) { this.property = property; this.editField = new EditField(); editField.addCallback(this); resetValue(); } public Widget getWidget() { return editField; } public void valueChanged() { resetValue(); } public void preDestroy() { editField.removeCallback(this); } public void setSelected(boolean selected) { } public void callback(int key) { if (key == Event.KEY_ESCAPE) { resetValue(); } else if (!property.isReadOnly()) { try { property.setPropertyValue(editField.getText()); editField.setErrorMessage(null); } catch (IllegalArgumentException ex) { editField.setErrorMessage(ex.getMessage()); } } } private void resetValue() { editField.setText(property.getPropertyValue()); editField.setErrorMessage(null); editField.setReadOnly(property.isReadOnly()); } public boolean positionWidget(int x, int y, int width, int height) { return false; } } static class StringEditorFactory implements PropertyEditorFactory<String> { public PropertyEditor createEditor(Property<String> property) { return new StringEditor(property); } } public static class ComboBoxEditor<T> implements PropertyEditor, Runnable { protected final ComboBox<T> comboBox; protected final Property<T> property; protected final ListModel<T> model; @SuppressWarnings({ "LeakingThisInConstructor", "OverridableMethodCallInConstructor" }) public ComboBoxEditor(Property<T> property, ListModel<T> model) { this.property = property; this.comboBox = new ComboBox<T>(model); this.model = model; comboBox.addCallback(this); resetValue(); } public Widget getWidget() { return comboBox; } public void valueChanged() { resetValue(); } public void preDestroy() { comboBox.removeCallback(this); } public void setSelected(boolean selected) { } public void run() { if (property.isReadOnly()) { resetValue(); } else { int idx = comboBox.getSelected(); if (idx >= 0) { property.setPropertyValue(model.getEntry(idx)); } } } protected void resetValue() { comboBox.setSelected(findEntry(property.getPropertyValue())); } protected int findEntry(T value) { for (int i = 0, n = model.getNumEntries(); i < n; i++) { if (model.getEntry(i).equals(value)) { return i; } } return -1; } public boolean positionWidget(int x, int y, int width, int height) { return false; } } public static class ComboBoxEditorFactory<T> implements PropertyEditorFactory<T> { private final ModelForwarder modelForwarder; public ComboBoxEditorFactory(ListModel<T> model) { this.modelForwarder = new ModelForwarder(model); } public ListModel<T> getModel() { return modelForwarder.getModel(); } public void setModel(ListModel<T> model) { modelForwarder.setModel(model); } public PropertyEditor createEditor(Property<T> property) { return new ComboBoxEditor<T>(property, modelForwarder); } class ModelForwarder extends AbstractListModel<T> implements ListModel.ChangeListener { private ListModel<T> model; @SuppressWarnings("OverridableMethodCallInConstructor") public ModelForwarder(ListModel<T> model) { setModel(model); } public int getNumEntries() { return model.getNumEntries(); } public T getEntry(int index) { return model.getEntry(index); } public Object getEntryTooltip(int index) { return model.getEntryTooltip(index); } public boolean matchPrefix(int index, String prefix) { return model.matchPrefix(index, prefix); } public ListModel<T> getModel() { return model; } public void setModel(ListModel<T> model) { if (this.model != null) { this.model.removeChangeListener(this); } this.model = model; this.model.addChangeListener(this); fireAllChanged(); } public void entriesInserted(int first, int last) { fireEntriesInserted(first, last); } public void entriesDeleted(int first, int last) { fireEntriesDeleted(first, last); } public void entriesChanged(int first, int last) { fireEntriesChanged(first, last); } public void allChanged() { fireAllChanged(); } } } }
{ "content_hash": "2acb407e9ace31809e57c9d29bc54ae7", "timestamp": "", "source": "github", "line_count": 577, "max_line_length": 79, "avg_line_length": 24.429809358752166, "alnum_prop": 0.7035329171396141, "repo_name": "ShadowLordAlpha/TWL", "id": "a08c78ad1323d6b89aaef9d4b370f5072b81e005", "size": "15698", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/de/matthiasmann/twl/PropertySheet.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "694" }, { "name": "HTML", "bytes": "33765" }, { "name": "Java", "bytes": "2190896" }, { "name": "Lex", "bytes": "4243" } ], "symlink_target": "" }
package com.google.samples.apps.iosched.ui.widget; import android.content.Context; import android.content.res.Resources; import android.text.Spannable; import android.text.Spanned; import android.text.style.ForegroundColorSpan; import android.text.style.StyleSpan; import android.util.AttributeSet; import android.widget.TextView; import com.google.samples.apps.iosched.R; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * A custom TextView that uses some custom logic to highlight typical * items in a tweet's body (hashtags, URLs, etc). * * @author Daniele Bonaldo, Sebastiano Poggi */ public class TweetTextView extends TextView { public static final Pattern PATTERN_HASHTAGS = Pattern.compile("\\B(#\\w{2,})"); public static final Pattern PATTERN_USER_HANDLES = Pattern.compile("\\B(@\\w{2,})"); public static final Pattern PATTERN_URLS = Pattern.compile("\\b((?:(?:https?|ftp)://)[\\w\\-+&@#/%=~_|$?!:,.]*[\\w+&@#/%=~_|\\$])\\b"); private int mHighlightColor, mUrlHighlightColor; public TweetTextView(Context context) { super(context); init(); } public TweetTextView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public TweetTextView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } private void init() { if (isInEditMode()) { // PREVIEW-ONLY hardcoded values (for in-IDE usage) mHighlightColor = 0xff4d90fe; mUrlHighlightColor = 0xff000000; } else { final Resources resources = getResources(); mHighlightColor = resources.getColor(R.color.stream_accent); mUrlHighlightColor = resources.getColor(R.color.body_text_1); } } @Override public void setText(CharSequence text, BufferType type) { // We better use a copy of the text, to avoid messing up with its spans (if any) Spannable textSpannable = Spannable.Factory.getInstance().newSpannable(text); textSpannable = highlightHashtags(textSpannable); textSpannable = highlightUserHandles(textSpannable); textSpannable = highlightUrls(textSpannable); super.setText(textSpannable, BufferType.SPANNABLE); } /** * Highlights all the hashtag in the passed text. * * @param text The text to highlight the hashtags within. * Must have already been "cleaned up" from spans. */ private Spannable highlightHashtags(Spannable text) { if (text == null) { return null; } // Note that this assumes the View's text has already been cleaned up // and that the text passed along is already a working copy // (see TextView#setText() javadocs...) final Matcher matcher = PATTERN_HASHTAGS.matcher(text); while (matcher.find()) { final int start = matcher.start(1); final int end = matcher.end(1); // We have to create a new span for each token we want to highlight // or it will just be moved around. No optimization possible? text.setSpan(new ForegroundColorSpan(mHighlightColor), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); text.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } return text; } /** * Highlights all the user handles in the passed text. * * @param text The text to highlight the user handles within. * Must have already been "cleaned up" from spans. */ private Spannable highlightUserHandles(Spannable text) { if (text == null) { return null; } // Note that this assumes the View's text has already been cleaned up // and that the text passed along is already a working copy // (see TextView#setText() javadocs...) final Matcher matcher = PATTERN_USER_HANDLES.matcher(text); while (matcher.find()) { final int start = matcher.start(1); final int end = matcher.end(1); // We have to create a new span for each token we want to highlight // or it will just be moved around. No optimization possible? text.setSpan(new ForegroundColorSpan(mHighlightColor), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); text.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } return text; } /** * Highlights all the URLs in the passed text. * * @param text The text to highlight the URLs within. * Must have already been "cleaned up" from spans. */ private Spannable highlightUrls(Spannable text) { if (text == null) { return null; } // Note that this assumes the View's text has already been cleaned up // and that the text passed along is already a working copy // (see TextView#setText() javadocs...) final Matcher matcher = PATTERN_URLS.matcher(text); while (matcher.find()) { final int start = matcher.start(1); final int end = matcher.end(1); // We have to create a new span for each token we want to highlight // or it will just be moved around. No optimization possible? text.setSpan(new ForegroundColorSpan(mUrlHighlightColor), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } return text; } }
{ "content_hash": "4b71fbff111818e2a24d833930b3ecb3", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 118, "avg_line_length": 36.29032258064516, "alnum_prop": 0.6359111111111111, "repo_name": "SferaDev/XDADevCon", "id": "1367cb8ccef7139ac8ca6d65f9d20b9cd364524d", "size": "5625", "binary": false, "copies": "1", "ref": "refs/heads/devcon14", "path": "android/src/main/java/com/google/samples/apps/iosched/ui/widget/TweetTextView.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "2105" }, { "name": "Groovy", "bytes": "9198" }, { "name": "Java", "bytes": "1273717" }, { "name": "Shell", "bytes": "5453" } ], "symlink_target": "" }
var GetOpt = require("node-getopt"); var path = require("path"); var fs = require("fs"); var binDir = path.dirname(fs.realpathSync(__filename)); var libDir = path.join(binDir, "../lib"); var pjson = require(path.join(binDir, "../package.json")); var getopt = GetOpt .create([ ["h", "help", "Display this help"], ["v", "verbose", "Enable debug output"] ]) .setHelp([ "Hashcat version " + pjson.version, "", "Usage: node " + path.basename(__filename) + " [OPTION] inputFile [outputFile]", "", "[[OPTIONS]]", "", "http://github.com/mendhak/node-hashcat/" ].join("\n")) .bindHelp(); var opt = getopt.parseSystem(); if (opt.argv.length < 1) { getopt.showHelp(); process.exit(1); } if (opt.options.verbose) { process.env.DEBUG = "*"; } var hcat = require(libDir + "/libhashcat.js"); var htmlFile = opt.argv[0]; var outputHtmlFile = opt.argv[1] || htmlFile; hcat.hashcatify({ htmlFile: htmlFile, outputHtmlFile: outputHtmlFile });
{ "content_hash": "defdff11129d9d5988e44055e39a98fc", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 92, "avg_line_length": 26.214285714285715, "alnum_prop": 0.5549500454132607, "repo_name": "kyroskoh/lets_code_javascript", "id": "94bf1b4ee7602bcd1d45e64c689228b42203ad63", "size": "1122", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "node_modules/hashcat/bin/hashcat.js", "mode": "33261", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "104" }, { "name": "CSS", "bytes": "3371" }, { "name": "HTML", "bytes": "4544" }, { "name": "JavaScript", "bytes": "111741" }, { "name": "Shell", "bytes": "141" } ], "symlink_target": "" }
@ECHO OFF for %%B in (%~dp0\.) do set c=%%~dpB ECHO This script will launch OS.js in node using: `node src\server\node\server.js dist-dev` ECHO To stop node server, press CTRL+C pause node "%c%\src\server\node\server.js" dist-dev
{ "content_hash": "342131b49c651d1602d4ecf6e909f49c", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 91, "avg_line_length": 38.333333333333336, "alnum_prop": 0.7130434782608696, "repo_name": "marcinlimanski/OS.js-v2", "id": "6703e725676a86635ea67d437390bd7fa74514ba", "size": "230", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "bin/win-start-node-dev.cmd", "mode": "33188", "license": "bsd-2-clause", "language": [ { "name": "ApacheConf", "bytes": "4358" }, { "name": "Batchfile", "bytes": "701" }, { "name": "C", "bytes": "3008" }, { "name": "CSS", "bytes": "162645" }, { "name": "HTML", "bytes": "72468" }, { "name": "JavaScript", "bytes": "1360785" }, { "name": "Makefile", "bytes": "589" }, { "name": "NSIS", "bytes": "765" }, { "name": "Nginx", "bytes": "1047" }, { "name": "PHP", "bytes": "45263" }, { "name": "PowerShell", "bytes": "5582" }, { "name": "Shell", "bytes": "7853" } ], "symlink_target": "" }
autoSim.TransitionMenus = function ($scope) { var self = this; self.edit = {}; self.edit.isOpen = false; self.edit.transitionGroup = null; self.edit.watcher = []; self.edit.open = function (transitionGroup) { $scope.core.closeMenus(); if (d3.event != null && d3.event.stopPropagation !== undefined) d3.event.stopPropagation(); if (transitionGroup === undefined) { transitionGroup = $scope.transitions.getTransitionGroup( $scope.states.getById(parseInt(d3.select(this).attr("from-state-id"))), $scope.states.getById(parseInt(d3.select(this).attr("to-state-id")))); } else { //perhaps we got a wrong reference if the transition was deleted transitionGroup = $scope.transitions.getTransitionGroup(transitionGroup.fromState, transitionGroup.toState); } if (transitionGroup !== undefined) { $scope.transitions.selectTransitionGroup(transitionGroup); self.prepareTransitionMenuData(transitionGroup); self.edit.addWatcher(); self.edit.isOpen = true; $scope.saveApply(); } }; self.prepareTransitionMenuData = function (transitionGroup) { self.edit.transitionGroup = _.cloneDeep(transitionGroup); _.forEach(self.edit.transitionGroup, function (transition) { var tmpInputSymbol = transition.inputSymbol; transition.inputSymbol = {}; transition.inputSymbol.value = tmpInputSymbol; transition.inputSymbol.error = false; }) }; self.edit.close = function () { _.forEach(self.edit.watcher, function (value) { value(); }); self.edit.watcher = []; self.edit.transitionGroup = null; $scope.transitions.selectTransitionGroup(null); self.edit.isOpen = false; }; self.edit.addWatcher = function () { for (var i = 0; i < self.edit.transitionGroup.length; i++) { self.edit.watcher.push($scope.$watch("transitions.menu.edit.transitionGroup['" + i + "']", function (newValue, oldValue) { var inputSymbolErrorFound = false; if (newValue.inputSymbol.value !== oldValue.inputSymbol.value) { newValue.inputSymbol.error = false; if (newValue.inputSymbol.value !== "" && !$scope.transitions.exists($scope.states.getById(newValue.fromState.id), $scope.states.getById(newValue.toState.id), newValue.inputSymbol.value)) { $scope.transitions.modify($scope.transitions.getById(newValue.id), newValue.inputSymbol.value); } else { if (newValue.inputSymbol.value === "") { newValue.inputSymbol.error = true; inputSymbolErrorFound = true; } } } if ($scope.transitions.exists($scope.states.getById(newValue.fromState.id), $scope.states.getById(newValue.toState.id), newValue.inputSymbol.value, newValue.id)) { newValue.isUnique = false; newValue.inputSymbol.error = true; } else { if (!newValue.isUnique) { newValue.inputSymbol.error = inputSymbolErrorFound; } newValue.isUnique = true; } $scope.saveApply(); }, true)); } }; self.close = function () { self.edit.close(); }; self.isOpen = function () { return self.edit.isOpen; }; };
{ "content_hash": "f69e962bf04b5d9c7e7980aff7930291", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 134, "avg_line_length": 40.58064516129032, "alnum_prop": 0.5553789083200847, "repo_name": "resterle/master-ti-praxis", "id": "229cee18429d46ca54f9e3dd30bfbfa7ef92858b", "size": "3774", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "app/components/automata/dfa/js/dfa.transitions.menu.js", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "159890" }, { "name": "HTML", "bytes": "28272" }, { "name": "JavaScript", "bytes": "231225" } ], "symlink_target": "" }
package br.ufba.dcc.mata62.ufbaboards.old.jogoxadrez; /** * * @author Jeferson Lima */ public class Jogador { private String nome; private String peca; public Jogador() { } public Jogador(String nome) { this.nome = nome; } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getPeca() { return peca; } public void setPeca(String peca) { this.peca = peca; } }
{ "content_hash": "916fe355bac245efb5dd2542e0fb19e1", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 53, "avg_line_length": 15, "alnum_prop": 0.5695238095238095, "repo_name": "jefersonla/Trabalho-MATA62", "id": "37b85d14979e993c786cb59e09eb76bdbf740b41", "size": "525", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/br/ufba/dcc/mata62/ufbaboards/old/jogoxadrez/Jogador.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "240588" } ], "symlink_target": "" }
package org.openkilda.messaging.info.switches; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import java.io.Serializable; import java.util.List; @Data @Builder @AllArgsConstructor public class GroupSyncEntry implements Serializable { private List<GroupInfoEntry> missing; private List<GroupInfoEntry> misconfigured; private List<GroupInfoEntry> proper; private List<GroupInfoEntry> excess; private List<GroupInfoEntry> installed; private List<GroupInfoEntry> modified; private List<GroupInfoEntry> removed; }
{ "content_hash": "c96ad113e7c417b42168749ff92cd9d8", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 53, "avg_line_length": 24.91304347826087, "alnum_prop": 0.7923211169284468, "repo_name": "telstra/open-kilda", "id": "cc7828683a2bf40f55636e6b91977323e6cc723e", "size": "1190", "binary": false, "copies": "1", "ref": "refs/heads/develop", "path": "src-java/base-topology/base-messaging/src/main/java/org/openkilda/messaging/info/switches/GroupSyncEntry.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C++", "bytes": "89798" }, { "name": "CMake", "bytes": "4314" }, { "name": "CSS", "bytes": "233390" }, { "name": "Dockerfile", "bytes": "30541" }, { "name": "Groovy", "bytes": "2234079" }, { "name": "HTML", "bytes": "362166" }, { "name": "Java", "bytes": "14631453" }, { "name": "JavaScript", "bytes": "369015" }, { "name": "Jinja", "bytes": "937" }, { "name": "Makefile", "bytes": "20500" }, { "name": "Python", "bytes": "367364" }, { "name": "Shell", "bytes": "62664" }, { "name": "TypeScript", "bytes": "867537" } ], "symlink_target": "" }
package com.frc2879.newcomen; import java.util.HashMap; public class SettingsRegister { private HashMap<String, Object> settings; public SettingsRegister(HashMap<String, Object> defaults) { // TODO Auto-generated constructor stub this.settings = defaults; } public SettingsRegister() { settings = new HashMap<String, Object>(); } public Object getObject(String name) { return settings.get(name); } public void put(String name, Object value) { settings.put(name, value); } public Object getOrDefault(String name, Object def) { return settings.getOrDefault(name, def); } public int getInt(String name, int def) { return (int) getOrDefault(name, def); } public double getDouble(String name, double def) { return (double) getOrDefault(name, def); } public String getString(String name, String def) { return (String) getOrDefault(name, def); } public boolean getBoolean(String name, boolean def) { return (boolean) getOrDefault(name, def); } public Object get(String name, Object def) { return getOrDefault(name, def); } }
{ "content_hash": "ca55baadf2ce157c8f7178f84a796483", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 60, "avg_line_length": 22.653061224489797, "alnum_prop": 0.7, "repo_name": "frc2879/2017-newcomen", "id": "44903b4945e362b5ffcb8a6553780f6b45f6e003", "size": "1110", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/com/frc2879/newcomen/SettingsRegister.java", "mode": "33188", "license": "mit", "language": [ { "name": "Java", "bytes": "27733" } ], "symlink_target": "" }
<?php namespace Czim\VanDomburgApiClient\Data\Parameters\QuotationCreate; use Czim\VanDomburgApiClient\Data\AbstractDataObject; /** * @property string $unit4_id if you know it (leave all other fields blank in that case) * @property string $ean if you know it (leave all other fields blank in that case) * @property string $street * @property string $number * @property string $zipcode * @property string $city * @property string $country * @property string $unit4_country_id * @property string $extra_lines * @property string $name * @property string $line_1 * @property string $line_2 * @property string $line_3 * @property string $line_4 * @property string $line_5 * @property string $line_6 * @property boolean $is_oneoff */ class InvoiceAddress extends AbstractDataObject { }
{ "content_hash": "561f608e51e4a72da5d3f418984c2eeb", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 94, "avg_line_length": 30.77777777777778, "alnum_prop": 0.7111913357400722, "repo_name": "czim/van-domburg-api-client", "id": "04ac5d981cb702ea2fa650bae7e147fd99357a1e", "size": "831", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Data/Parameters/QuotationCreate/InvoiceAddress.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "174977" } ], "symlink_target": "" }
{% load static %} {% load compress %} <!DOCTYPE html> <html lang="en"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <head> <link rel="icon" type="image/png" href="/static/img/glyphicons-question-sign.png"> <title>MPS-Db Help</title> {% compress js %} <!-- Load JQuery --> <script src="{% static "js/jquery-1.11.2.min.js" %}"></script> <!-- Incorporate the Bootstrap JavaScript plugins --> <script src="{% static "js/bootstrap.min.js" %}"></script> <!-- DataTables --> <script type="text/javascript" charset="utf-8" src="{% static "js/datatables.min.js" %}"></script> {% comment %} <script type="text/javascript" charset="utf-8" src="{% static "js/jquery.dataTables.min.js" %}"></script> <script type="text/javascript" charset="utf-8" src="{% static "js/dataTables.responsive.min.js" %}"></script> <script type="text/javascript" charset="utf-8" src="{% static "js/dataTables.buttons.min.js" %}"></script> <script type="text/javascript" charset="utf-8" src="{% static "js/dataTables.fixedHeader.min.js" %}"></script> <script type="text/javascript" charset="utf-8" src="{% static "js/buttons.colVis.min.js" %}"></script> {% endcomment %} {# We will just be using html5 for buttons (no fallback) #} {# <script type="text/javascript" charset="utf-8" src="{% static "js/buttons.flash.min.js" %}"></script>#} <script type="text/javascript" charset="utf-8" src="{% static "js/buttons.html5.min.js" %}"></script> <script type="text/javascript" charset="utf-8" src="{% static "js/buttons.print.min.js" %}"></script> <script type="text/javascript" charset="utf-8" src="{% static "js/datatable_options.js" %}"></script> <script type="text/javascript" charset="utf-8" src="{% static "js/jquery.mark.min.js" %}"></script> <script type="text/javascript" charset="utf-8" src="{% static "js/help.js" %}"></script> <!-- Help JS --> {% endcompress %} {% compress css %} <!-- Latest compiled and minified CSS --> <link rel="stylesheet" href="{% static "css/bootstrap.min.css" %}"> <link rel="stylesheet" href="{% static "css/bootstrap-theme.min.css" %}"> <!-- DataTables CSS --> <link rel="stylesheet" type="text/css" href="{% static "css/datatables.min.css" %}"> {% comment %} <link rel="stylesheet" type="text/css" href="{% static "css/jquery.dataTables.min.css" %}"> <link rel="stylesheet" type="text/css" href="{% static "css/buttons.dataTables.min.css" %}"> <link rel="stylesheet" type="text/css" href="{% static "css/fixedHeader.dataTables.min.css" %}"> <link rel="stylesheet" type="text/css" href="{% static "css/responsive.dataTables.min.css" %}"> {% endcomment %} <!-- Custom CSS Rules --> <link rel="stylesheet" href="{% static "css/bootstrap-overrides.css" %}"> {% endcompress %} {% if GOOGLE_ANALYTICS %} <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id={{ GOOGLE_ANALYTICS }}"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '{{ GOOGLE_ANALYTICS }}'); </script> {% endif %} </head> <body> {#<body data-spy="scroll" data-target=".navbar" data-offset="80">#} {#The help is set up to pull from the glossary as much as possible#} {#{{ glossary_dict.assaytarget_term }}#} {#note that, if Assay Target gets changed to, for example Target Assay, global search and replace all the help html files as shown above#} {#a few had to be entered manually, eg Assay Categories, since the glossary term is Assay Category and I could not just add the s#} {#watch the singler and plural studycomponent vrs studycomponents #} <nav class="navbar navbar-inverse navbar-fixed-top"> {# HANDY Open class container - use Ctrl+Shift+M to jump to close#} <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar"> <span class="icon-bar"></span> {# <span class="icon-bar"></span>#} {# <span class="icon-bar"></span>#} </button> </div> <div class="collapse navbar-collapse" id="myNavbar"> <ul class="nav navbar-nav"> <li> {# home icon #} <li> <a class="navbar-brand" href={{ glossary_dict.mpsdatabasempsdb_ref }}> <img alt="MPS Database Logo" src="/static/img/brand.png" style="margin-top:-10px;"> </a> </li> {# home text #} <li> <a href={{ glossary_dict.mpsdatabasempsdb_ref }}>Home</a> </li> {# overview #} <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Overview <span class="caret"></span> </a> <ul class="dropdown-menu"> <li class="dropdown-header navi-special-2"><b>Overview</b></li> <li><a href="#help_overview_background">Database Background</a></li> <li><a href="#help_overview_components">Study Components</a></li> <li><a href="#help_overview_organization">Study Organization</a></li> <li><a href="#help_overview_sources">Reference Data Sources</a></li> <li><a href="#help_overview_features">Database Features</a></li> <li><a href="#help_overview_permission">Permission Structure</a></li> <li class="divider"></li> <li class="dropdown-header navi-special-2"><b>Global Database Tools</b></li> <li><a href="#help_global_search">Global Database Search</a></li> <li><a href="#help_table_search">Table Searching and Exporting</a></li> <li><a href="#help_download_button">Download Buttons</a></li> </ul> </li> {# presentations #} <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Presentations <span class="caret"></span> </a> <ul class="dropdown-menu"> <li class="dropdown-header navi-special-2"><b>Webinars</b></li> <li><a href="#video_demo_w1">Introduction to the MPS-Db - Oct 6, 20 </a></li> <li><a href="#video_demo_w2">Study Design, Set-up and Test Compound Selection Using the MPS-Db - Nov 10, 20 </a></li> <li><a href="#video_demo_w3">Study Workflow and Data Entry in the MPS-Db - Dec 15, 20 </a></li> <li><a href="#video_demo_w4">Data Analysis in the MPS-Db - Jan 26, 21 </a></li> <li class="divider"></li> <li class="dropdown-header navi-special-2"><b>NCATS Meeting Presentations</b></li> <li><a href="#video_demo_9">Omic Data in the MPS-Db (Omics Integration Phase 1: Log 2 Fold Change Data) - Nov 19, 20 </a></li> <li><a href="#video_demo_8">Plate Reader Data Integration Tool (during development) - May 21, 20 </a></li> <li><a href="#video_demo_7">Physiologically Based Pharmacokinetic (PBPK) Modeling (during development) - Apr 16, 20</a></li> {# <li><a href="#video_demo_6">Power Analysis by Larry - don't post - 20200220 </a></li>#} <li><a href="#video_demo_5">Study Sets, Controlled Sharing, References - Jun 20, 19</a></li> <li><a href="#video_demo_4">NCATS Data Sharing Workflow - Jun 20, 19</a></li> <li><a href="#video_demo_3">Looking at Kidney Study Data - Apr 18, 19</a></li> <li><a href="#video_demo_2">Reproducibility, Customized Plots - Feb 21, 19</a></li> <li><a href="#video_demo_1">Adverse Events Analysis - Jan 17, 19</a></li> <li><a href="#video_demo_0">Study Data Loading - Dec 20, 18</a></li> </ul> </li> {# study data #} <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Study Data <span class="caret"></span> </a> <ul class="dropdown-menu"> <li class="dropdown-header navi-special-2"><b>Features that Use Study Data</b></li> <li><a href="#help_study_component">Study Components</a></li> <li><a href="#help_assay_data_viz">Assay Data Visualization</a></li> <li><a href="#help_omic_data_viz">Omic Data Visualization</a></li> <li><a href="#help_image_and_video">Assay Images and Videos</a></li> <li><a href="#help_power_analysis">Power Analysis</a></li> <li><a href="#help_reproducibility_analysis">Reproducibility Analysis</a></li> <li><a href="#help_study_set">Study Sets</a></li> <li><a href="#help_collaborator_group">Collaborators (Collaborator Groups)</a></li> <li><a href="#help_access_group">Accessors (Access Groups)</a></li> <li><a href="#help_pbpk_analysis">PBPK Analysis</a></li> <li><a href="#help_disease_portal">Disease Portal</a></li> <li><a href="#help_compound_report">Compound Report</a></li> <li><a href="#help_reference">References</a></li> <li><a href="#help_api">API</a></li> <li class="divider"></li> <li class="dropdown-header navi-special-2"><b> Customization Options</b></li> <li><a href="#help_custom_filtering_sidebar">Customizing Grouping and Filtering (sidebar)</a></li> <li><a href="#help_custom_graphing_sidebar">Customizing Visualizations (sidebar)</a></li> <li><a href="#help_custom_graphing_individual">Customizing Individual Graphs</a></li> </ul> </li> {# reference data #} <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Reference Data <span class="caret"></span> </a> <ul class="dropdown-menu"> <li class="dropdown-header navi-special-2"><b>Features that Use Only Reference Data</b></li> <li><a href="#help_chemical_data">Chemical Data</a></li> <li><a href="#help_bioactivities">Bioactivities</a></li> <li><a href="#help_drug_trials">Drug Trials</a></li> <li><a href="#help_adverse_events">Adverse Events</a></li> <li><a href="#help_compare_adverse_events">Compare Adverse Events</a></li> <li><a href="#help_heatmap_bioactivities">Heatmap (Bioactivities)</a></li> <li><a href="#help_cluster_chemicals">Cluster Chemicals</a></li> </ul> </li> {# providing data #} <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Providing Data <span class="caret"></span> </a> <ul class="dropdown-menu"> <li class="dropdown-header navi-special-2"><b>Steps for Providing Study Data</b></li> <li><a href="#help_join_group">1. Request to Join a Data Group</a></li> <li><a href="#help_study_component_pointer">2. Review Study Components</a></li> <li><a href="#help_add_study">3. Add a Study</a></li> <li><a href="#help_study_detail">4. Enter Study Details</a></li> <li><a href="#help_study_treatment_group">5. Make Study Treatment Groups</a></li> <li><a href="#help_chip_and_plate">6. Define Chips and Plates</a></li> <li><a href="#help_target_and_method">7. Add Assay Targets and Methods</a></li> <li><a href="#help_data_upload">8. Upload Assay Data</a></li> <li><a href="#help_image_video">9. Prepare Images and Videos</a></li> <li><a href="#help_flags_and_notes">10. Validation, Flags and Notes (optional) </a></li> <li><a href="#help_study_signoff">11. Data Sharing (optional) </a></li> </ul> </li> {# admins #} {% if user.is_superuser %} <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">MPS Admins Only <span class="caret"></span> </a> <ul class="dropdown-menu"> {# <li class="divider"></li>#} {# <li class="dropdown-header"><b>Controlling Access</b></li>#} <li><a href="#access_overview_admin">Sharing Study Data Overview</a></li> <li><a href="#add_groups_admin">Adding New Data Groups</a></li> <li><a href="#study_groups_admin">Assigning Groups to Studies</a></li> <li><a href="#user_groups_admin">Assigning Users To Groups</a></li> <li><a href="#special_permission_admin">Study Component Editing</a></li> <li><a href="#add_new_center">Add New Center</a></li> <li><a href="#computational_targets">Preparing for New Omic Data Types</a></li> <li><a href="#help_page_and_glossary">The Intersection Between the Help Page and the Glossary</a></li> </ul> </li> {% endif %} {# glossary #} <li> <a href="#glossary">Glossary</a> </li> {# search table #} <li> <div> <table id="search_table" class="table-condensed"> <thead> </thead> <tbody> <tr> <td> <input id="search_term" type="search" name="keyword" class="form-control input-sm" placeholder="enter search term (e.g., study component)"> </td> <td> <button id="search_gooo" type="button" class="btn btn-primary">Search</button> </td> <td> <button id="search_prev" data-search="prev" type="button" class="btn btn-primary"><span class="glyphicon glyphicon-chevron-up" aria-hidden="true"></span></button> <button id="search_next" data-search="next" type="button" class="btn btn-primary"><span class="glyphicon glyphicon-chevron-down" aria-hidden="true"></span></button> <button id="search_clear" data-search="clear" type="button" class="btn btn-primary">✖</button> </td> <td> <input id="caseSensitive" type="checkbox" name="opt[]" value="caseSensitive" class="plate-map-bigger-radio" > </td> <td> <label for="caseSensitive" class="navi-special-1">Match Case</label> </td> </tr> </tbody> </table> </div> </li> </li> </ul> </div> </div> {# Close class container #} </nav> <div class="offset-help-navbar"> <div class="container"> <br><br><br> <div id="realTimeContents" class="content"> <div id="expand_help_page_section" class="hidden"> {# a search will expand them all and a reset will close them all - keep here for people who use the inspector and know the buttons are there#} <h1 class="h1-level-0">Show and Hide Help</h1> <div id="help_expand_page"> {# <button name="help_button" type="button" class="btn btn-primary help-collapsible">Show and Hide on the Help Page</button>#} {# <div class="help-content-1">#} <ul class="list-group"> <li class="list-group-item"> {# <h1 class="h1-level-1">Show and Hide on the Help Page</h1>#} {# do not name the same, do not want in colapsibles#} <button id="expand_all" type="button" class="btn btn-primary"> Click to Expand All Sections of Help</button> <button id="close_all" type="button" class="btn btn-primary"> Click to Collapse All Sections of Help</button> </li> </ul> {# </div>#} </div> <br><br> </div> <div id="search_help_page_section" class="hidden"> <h1 class="h1-level-1">Try using <b>Search</b> above {# <span class="glyphicon glyphicon-arrow-up"></span>#} to find the information here in the Help page. </h1> <br> </div> <div id="overview_section" class="stop-point"> <h1 class="h1-level-0">Overview of the MPS-Db</h1> <div id="help_overview_background"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Database Background</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">The Database - Background</h1> <span class="gse0">{{ glossary_dict.mpsdatabasempsdb_def|linebreaks }}</span> Many of the terms used in the MPS-GUI and here in the <b>MPS-Db Help</b> page are defined in the glossary. It is recommended that users rely heavily on the glossary to assist in understanding how to appropriately review, edit, and/or add data to the MPS-Db. </li> </ul> </div> </div> <div id="help_overview_components"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Study Components</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Study Components</h1> {# HANDY accessing a dictionary in html dictionary python to java #} <span class="gse0">{{ glossary_dict.studycomponent_def|linebreaks }}</span> These are the terms that are selected in dropdowns when setting up a Study in the MPS-Db. All registered users can review <span class="gse0">{{ glossary_dict.studycomponent_term }}s</span> by <span class="gse0"><a href={{ glossary_dict.studycomponent_ref }}>clicking here</a></span>. <span class="gse0">{{ glossary_dict.dataprovider_term }}s</span> (users who are assigned to, at least one, <span class="gse0">{{ glossary_dict.datagroup_term }}</span>) can add new <span class="gse0">{{ glossary_dict.studycomponent_term }}s</span> by <span class="gse0"><a href={{ glossary_dict.studycomponent_ref }}>clicking here</a></span>, or by clicking the <span class="glyphicon glyphicon-plus text-success" aria-hidden="true"></span> provided throughout the <span class="gse0">{{ glossary_dict.studysetup_term }}</span> workflow. <br> <br> <h1 class="h1-level-2">Assay Components</h1> <table id="source_table" class="table table-bordered table-condensed small"> <thead> <tr> <th>Component</th> <th>Description</th> <th>Go to Component</th> <th>More Help</th> </tr> </thead> <tbody> {% for term in component_assay %} <tr> <td><span class="gse1"> {{ term.term }} </span></td> <td><span class="gse1"> {{ term.definition|linebreaks }} </span></td> {# these will be final links, not change with development - only do that in glossary #} <td><span class="gse1"> {{ term.show_url }} </span></td> <td><span class="gse1"> {{ term.show_anchor }} </span></td> </tr> {% endfor %} </tbody> </table> <h1 class="h1-level-2">Model Components</h1> <table id="source_table" class="table table-bordered table-condensed small"> <thead> <tr> <th>Component</th> <th>Description</th> <th>Go to Component</th> <th>More Help</th> </tr> </thead> <tbody> {% for term in component_model %} <tr> <td><span class="gse1"> {{ term.term }} </span></td> <td><span class="gse1"> {{ term.definition|linebreaks }} </span></td> {# these will be final links, not change with development - only do that in glossary #} <td><span class="gse1"> {{ term.show_url }} </span></td> <td><span class="gse1"> {{ term.show_anchor }} </span></td> </tr> {% endfor %} </tbody> </table> <h1 class="h1-level-2">Compound Components</h1> <table id="source_table" class="table table-bordered table-condensed small"> <thead> <tr> <th>Component</th> <th>Description</th> <th>Go to Component</th> <th>More Help</th> </tr> </thead> <tbody> {% for term in component_compound %} <tr> <td><span class="gse1"> {{ term.term }} </span></td> <td><span class="gse1"> {{ term.definition|linebreaks }} </span></td> {# these will be final links, not change with development - only do that in glossary #} <td><span class="gse1"> {{ term.show_url }} </span></td> <td><span class="gse1"> {{ term.show_anchor }} </span></td> </tr> {% endfor %} </tbody> </table> <h1 class="h1-level-2">Cell Components</h1> <table id="source_table" class="table table-bordered table-condensed small"> <thead> <tr> <th>Component</th> <th>Description</th> <th>Go to Component List</th> <th>More Help</th> </tr> </thead> <tbody> {% for term in component_cell %} <tr> <td><span class="gse1"> {{ term.term }} </span></td> <td><span class="gse1"> {{ term.definition|linebreaks }} </span></td> {# these will be final links, not change with development - only do that in glossary #} <td><span class="gse1"> {{ term.show_url }} </span></td> <td><span class="gse1"> {{ term.show_anchor }} </span></td> </tr> {% endfor %} </tbody> </table> </li> </ul> </div> </div> <div id="help_overview_organization"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Study Organization</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Study Organization</h1> <span class="gse0">{{ glossary_dict.studyorganization_def|linebreaks }}</span> <table id="source_table" class="table table-bordered table-condensed small"> <thead> <tr> <th>Study Organization Terms</th> <th>Description</th> </tr> </thead> <tbody> {% for term in organization_study %} <tr> <td><span class="gse1"> {{ term.term }} </span></td> <td><span class="gse1"> {{ term.definition|linebreaks }} </span></td> </tr> {% endfor %} </tbody> </table> </li> </ul> </div> </div> <div id="help_overview_sources"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Reference Data Sources</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Reference Data Sources</h1> <span class="gse0">{{ glossary_dict.referencedatasource_def|linebreaks }}</span> <table id="source_table" class="table table-bordered table-condensed small"> <thead> <tr> <th>Reference Data #</th> <th>Source</th> <th>Description</th> </tr> </thead> <tbody> {% for term in source %} <tr> <td><span class="gse1"> {{ term.help_order }} </span></td> <td><span class="gse1"> {{ term.url_term }} </span></td> <td><span class="gse1"> {{ term.definition|linebreaks }} </span></td> </tr> {% endfor %} </tbody> </table> </li> </ul> </div> </div> <div id="help_overview_features"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Database Features</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">MPS-Db Features</h1> <span class="gse0">{{ glossary_dict.mpsdbfeatures_def|linebreaks }}</span> <table id="features_table" class="table table-bordered table-condensed small"> <thead> <tr> <th>Feature</th> <th>Description</th> <th>Reference Data Source(s)</th> <th>Go to Feature</th> <th>More Help</th> </tr> </thead> <tbody> {% for term in feature %} <tr> <td><span class="gse1"> {{ term.term }} </span></td> <td><span class="gse1"> {{ term.definition|linebreaks }} </span></td> <td><span class="gse1"> {{ term.source_list }} </span></td> {# these will be final links, not change with development - only do that in glossary #} <td><span class="gse1"> {{ term.show_url }} </span></td> <td><span class="gse1"> {{ term.show_anchor }} </span></td> {# <th>{% for source in term.data_sources.all %}{{ source }}<br/>{% endfor %}</th>#} </tr> {% endfor %} </tbody> </table> </li> </ul> </div> </div> <div id="help_overview_permission"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Permission Structure</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Permission Structure</h1> <span class="gse0">{{ glossary_dict.permissionstructure_def|linebreaks }}</span> <table id="source_table" class="table table-bordered table-condensed small"> <thead> <tr> <th>User Type</th> <th>Permission Description</th> </tr> </thead> <tbody> {% for term in permission %} <tr> <td><span class="gse1"> {{ term.term }} </span></td> <td><span class="gse1"> {{ term.definition|linebreaks }} </span></td> </tr> {% endfor %} </tbody> </table> </li> </ul> </div> </div> </div> <div id="global_database_tools_section" class="stop-point"> <h1 class="h1-level-0">Global Database Tools</h1> <div id="help_global_search"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Global Database Search</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Global Database Search</h1> <ul class="list-unstyled"> <li>Use a <b>Global Database Search</b> tool to search the whole MPS-Db from the <b>MPS Database Home</b> page. To search: <ul class="help-filled-circle"> <li>Go to the <b>MPS Database Home</b> page </li> <li>Type a search term into the global search bar</li> <li>Type a space and add an additional term(s) (optional)</li> <li>Make preliminary selection (hit enter, click the blue <b>Search</b> button, or mouse down the options list to item of interest and click the left mouse button)</li> <li>Wait for a list of matching information to appear</li> <li>Click to check (or uncheck) filter boxes in the filter section to further restrict (or unrestrict) matching results (optional)</li> <li>Click on provided link to be routed to desired location</li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_table_search"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Table Searching and Exporting</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Table Searching and Exporting</h1> <ul class="list-unstyled"> <li>In many places throughout the database, there are lists/tables with a search bar located at the top. To search: <ul class="help-filled-circle"> <li>Type a search term in the search bar</li> <li>Type a space and add an additional term(s) (optional)</li> <li>From the list, click on the <b>View/Edit</b> button or click an active link to be routed to desired location</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>Above search bar are options to copy the table to the clipboard, download the table to CSV, or print the table</li> <li>The <b>Column visibility</b> button can be used to turn columns on/off in the list/table</li> <li>To sort the list/table, click on the arrow in the column header </li> <li>To sort on multiple columns, click on the arrow on the primary sort column, then hold the shift key and click on additional column arrows</li> <li class="dtr-control">Click the blue <span class="glyphicon glyphicon-plus-sign text-primary"></span> to see hidden fields </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_download_button" class="stop-point"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Download Button</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Download Button</h1> <ul class="list-unstyled"> <li>There are many locations in the database where a <b>Download</b> button is provided. To download: <ul class="help-filled-circle"> <li>Click the <b>Download</b> button to download data</li> <li>If shown, check/uncheck box for changing data filtering options (optional)</li> <li>Use options for filtering, if provided (optional)</li> </ul> </li> </ul> </li> </ul> </div> </div> </div> <div id="video_webinar_section" class="stop-point"> <h1 class="h1-level-0">Webinars</h1> <div id="video_demo_w1"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Introduction to the Microphysiology Systems Database - recorded Oct 6, 20 </button> <div class="help-content-1"> <ul class="list-group"> <div class="list-group-item"> <h1 class="h1-level-1">Introduction to the Microphysiology Systems Database (Oct 6, 20) </h1> UPDDI's Mark Schurdak presents the webinar, <i>Introduction to the Microphysiology Systems Database (MPS-Db) - A Critical Tool for Managing, Analyzing, and Modeling MPS Experimental Data</i>. This webinar is a great place to start for new MPS-Db users and those considering using the MPS-Db. Webinar was recorded on October 6, 2020 and is approximately 60 minutes long. Questions asked during the webinar, along with answers, are available below. {% include "help_webinar_20201006_qanda_table.html" %} <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> {# in panopto, select Share, then click on Embed and copy the Embeded Code, then change the end part ...width on..#} <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=e4e34656-b14a-4af5-ac43-ac4c01253690&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&start=0&interactivity=all" height="405" width="720" style="border: 1px solid #464646;" allowfullscreen allow="autoplay"></iframe> </div> </div> </div> </ul> </div> </div> <div id="video_demo_w2"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Study Design, Set-up and Test Compound Selection Using the MPS-Db - recorded Nov 10, 20 </button> <div class="help-content-1"> <ul class="list-group"> <div class="list-group-item"> <h1 class="h1-level-1">Study Design, Set-up and Test Compound Selection Using the MPS-Db (Nov 10, 20) </h1> UPDDI's Dr. Lawrence Vernetti presents the webinar, <i>Study Design, Set-up and Test Compound Selection Using the MPS-Db</i>. This webinar demonstrates the process of designing an MPS-based toxicology Study using the MPS-Db. Dr. Vernetti demonstrates how to use multiple features to review preclinical, clinical and adverse event data that are available in the MPS-Db, and show how those data can be used to guide the selection of clinical drug control compounds to test in an MPS experimental model. Webinar was recorded on November 10, 2020 and is approximately 60 minutes long. Questions asked during the webinar, along with answers, are available below. <button name="help_button" type="button" class="btn btn-success help-collapsible">Questions from the Attendees - with Answers </button> <div class="help-content-2"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-2"> Questions and Answers </h1> <table class="table table-bordered table-condensed small table-components"> <thead> <tr class="active"> <th> Question </th> <th> Answer </th> </tr> </thead> <tbody> <tr> <td> Is all the data in the MPS database for small molecules or even biologics/antibodies included? </td> <td> Presently, it is predominantly small molecules. We add compounds as they are used in designing studies and are very interested in adding biologics/antibodies as they are used in Study designs. </td> </tr> <tr> <td> Are recent clinical compounds or one's which were stopped in different phase trails also included in this database? </td> <td> It is easy to add any compound to the database, which automatically retrieves the compound properties Dr. Vernetti indicated. We don't currently add all compounds, rather we add them as needed. However, the compound list in the Adverse Events feature comes from the FDA FAERS database, so there are more compounds in that data, but it is post marketing. We are working on an interface to automatically pull in Clinical Trial data and when that is complete it will include an expanded list of recent and failed clinical compounds. </td> </tr> </tbody> </table> </li> </ul> </div> <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> {# in panopto, select Share, then click on Embed and copy the Embeded Code, then change the end part ...width on..#} <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=08ed98da-53b6-4c49-a476-ac6f017be2a0&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&start=0&interactivity=all" height="405" width="720" style="border: 1px solid #464646;" allowfullscreen allow="autoplay"></iframe> </div> </div> </div> </ul> </div> </div> <div id="video_demo_w3"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Study Workflow and Data Entry in the MPS-Db - recorded Dec 15, 20 </button> <div class="help-content-1"> <ul class="list-group"> <div class="list-group-item"> <h1 class="h1-level-1">Study Workflow and Data Entry in the MPS-Db (Dec 15, 20) </h1> UPDDI's Dr. Mark Schurdak presents the webinar, <i>Study Workflow and Data Entry in the MPS-Db</i>. This webinar demonstrates the process of adding a Study to the MPS-Db and adding <span class="gse0">{{ glossary_dict.processeddata_term }}</span>, <span class="gse0">{{ glossary_dict.rawdata_term }}</span>, and <span class="gse0">{{ glossary_dict.omicdata_term }}</span> to the Study. Webinar was recorded on December 15, 2020 and is approximately 60 minutes long. Questions asked during the webinar, along with answers, are available below. <button name="help_button" type="button" class="btn btn-success help-collapsible">Questions from the Attendees - with Answers </button> <div class="help-content-2"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-2"> Questions and Answers </h1> <table class="table table-bordered table-condensed small table-components"> <thead> <tr class="active"> <th> Question </th> <th> Answer </th> </tr> </thead> <tbody> <tr> <td>Is it possible to add cell morphology (images, video...) in the assay panel?</td> <td>Yes. There are predefined assays in the database for cell morphology, and you can upload the data and the images, but we do not currently have image analysis functions. This is also the case for videos. You can upload the data and the videos, but the analysis has to be done offline. For more information on adding images and videos, <a href="#help_image_video">click here</a></td> </tr> <tr> <td>Would the platform allow us to stop and save during data upload?</td> <td>All of the setup procedures demonstrated today can be done in advance, and the data file uploaded whenever it is available.</td> </tr> </tbody> </table> </li> </ul> </div> <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> {# in panopto, select Share, then click on Embed and copy the Embeded Code, then change the end part ...width on..#} <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=35afae50-f1d2-42c9-8133-ac92013c6a66&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&start=0&interactivity=all" height="405" width="720" style="border: 1px solid #464646;" allowfullscreen allow="autoplay"></iframe> </div> </div> </div> </ul> </div> </div> <div id="video_demo_w4"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Data Analysis in the MPS-Db - recorded Jan 26, 21 </button> <div class="help-content-1"> <ul class="list-group"> <div class="list-group-item"> <h1 class="h1-level-1">Data Analysis in the MPS-Db (Jan 26, 21) </h1> UPDDI's Dr. Bert Gough presents the webinar, <i>Data Analysis in the MPS-Db</i>. This webinar demonstrates the use of the <span class="gse0">{{ glossary_dict.reproducibilityanalysis_term }}</span>, <span class="gse0">{{ glossary_dict.poweranalysis_term }}</span>, and <span class="gse0">{{ glossary_dict.pbpkanalysis_term }}</span> features of the MPS-Db. Webinar was recorded on January 26, 2021 and is approximately 60 minutes long. <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> {# in panopto, select Share, then click on Embed and copy the Embeded Code, then change the end part ...width on..#} <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=10f5c6f3-55af-4895-a2bf-acbd010d27a0&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&start=0&interactivity=all" height="405" width="720" style="border: 1px solid #464646;" allowfullscreen allow="autoplay"></iframe> </div> </div> </div> </ul> </div> </div> </div> <div id="video_presentation_section" class="stop-point"> <h1 class="h1-level-0">Recorded Videos Demonstrating Database Features</h1> <p class="h1-level-3">Due to ongoing development of the MPS-Db, older recordings may diverge from the current version of the MPS-Db. </p> <div id="video_demo_9"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Omic Data in the MPS-Db (Omics Integration Phase 1: Log 2 Fold Change Data) - recorded Nov 19, 20</button> <div class="help-content-1"> <ul class="list-group"> <div class="list-group-item"> <h1 class="h1-level-1">Omic Data in the MPS-Db (Omics Integration Phase 1: Log 2 Fold Change Data) - Nov 19, 20 </h1> UPDDI's Mark Schurdak introduces the <span class="gse0">{{ glossary_dict.omicdata_term }}</span> integration feature. This feature allows users to enter and visualize gene expression data when added as log 2 fold change values with some associated statistics that are typically calculated when using DESeq2. Video was recorded on November 19, 2020 and is approximately 20 minutes long. <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> {# in panopto, select Share, then click on Embed and copy the Embeded Code, then change the end part ...width on..#} <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=7e881e50-f6b4-45cd-86f9-ac9100df7bd6&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&start=0&interactivity=all" height="405" width="720" style="border: 1px solid #464646;" allowfullscreen allow="autoplay"></iframe> </div> </div> </div> </ul> </div> </div> <div id="video_demo_8"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Plate Reader Data Integration Tool - recorded May 21, 20 using Stage/Development Server</button> <div class="help-content-1"> <ul class="list-group"> <div class="list-group-item"> <h1 class="h1-level-1">Plate Reader Data Integration Tool (May 21, 20) </h1> UPDDI's Mark Schurdak introduces the <span class="gse0">{{ glossary_dict.platereaderdata_term }}</span> integration tool. This tool allows users to setup <span class="gse0">{{ glossary_dict.assayplatemap_term }}s</span>, upload assay data, calibrate and process data, and add data to the <span class="gse0">{{ glossary_dict.studysummary_term }}</span>. The demo begins at 4:30. Video was recorded on May 21, 2020 and is approximately 42 minutes long (demo is about 30 minutes). This demo was recorded using the stage/development server for the purpose of soliciting user feedback. <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> {# in panopto, select Share, then click on Embed and copy the Embeded Code, then change the end part ...width on..#} <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=efa29f51-e3e9-4561-b98a-abeb0187e749&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&start=0&interactivity=all" width="720" height="405" style="padding: 0px; border: 1px solid #464646;" frameborder="0" allowfullscreen allow="autoplay"></iframe> </div> </div> </div> </ul> </div> </div> <div id="video_demo_7"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Physiologically Based Pharmacokinetic (PBPK) Modeling - recorded Apr 16, 20 using Stage/Development Server</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">PBPK Modeling (Apr 16, 20) </h1> UPDDI's Mark Schurdak walks through an early version of the <span class="gse0">{{ glossary_dict.pbpkanalysis_term }}</span> feature that is being integrated into the MPS-Db. Video was recorded on April 16, 2020 and is approximately 21 minutes long. This demo was recorded using the stage/development server for the purpose of soliciting user feedback. <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=13bef78f-5982-4c3a-b606-abec0111ae06&autoplay=false&offerviewer=true&showtitle=true&showbrand=false&start=0&interactivity=all" width="720" height="405" style="padding: 0px; border: 1px solid #464646;" frameborder="0" allowfullscreen allow="autoplay"></iframe> </div> </div> </li> </ul> </div> </div> {# <li><a href="#video_demo_6">Power Analysis by Larry - don't post - 20200220 - leave spot in case change mind</a></li>#} <div id="video_demo_5"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Study Sets, Controlled Sharing, and References - recorded Jun 20, 19</button> <div class="help-content-1"> <ul class="list-group"> <div class="list-group-item"> <h1 class="h1-level-1">Study Sets, Controlled Sharing, and References (Jun 20, 19) </h1> UPDDI's Albert Gough shows how <span class="gse0">{{ glossary_dict.studyset_term }}s</span> can be used to share data with external collaborators and how <span class="gse0">{{ glossary_dict.studyset_term }}s</span> can be assigned URLs that can be referenced in publications. Video was recorded on June 20, 2019 and is approximately 25 minutes long. <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=d60edd40-c668-417d-9c66-aab7016bcb36&v=1" width="720" height="405" style="padding: 0px; border: 1px solid #464646;" frameborder="0" allowfullscreen allow="autoplay"></iframe> </div> </div> </div> </ul> </div> </div> <div id="video_demo_4"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">NCATS Data Sharing Workflow - recorded Jun 20, 19</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">NCATS Data Sharing Workflow (Jun 20, 19) </h1> NCATS explains their data release workflow. Video was recorded on June 20, 2019 and is approximately 3 minutes long. <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=15ab44cb-8f16-4df4-a14f-aab7016aba8b&v=1" width="720" height="405" style="padding: 0px; border: 1px solid #464646;" frameborder="0" allowfullscreen allow="autoplay"></iframe> </div> </div> </li> </ul> </div> </div> <div id="video_demo_3"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Exploring Kidney Study Data - recorded Apr 18, 19</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Exploring Kidney Study Data (Apr 18, 19) </h1> UPDDI toxicologist Larry Vernetti explores data associated with kidney tissue chips. Video was recorded on April 18, 2019 and is approximately 30 minutes long. <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=68a51114-b2a0-4d77-8b88-aab7016aba2b&v=1" width="720" height="405" style="padding: 0px; border: 1px solid #464646;" frameborder="0" allowfullscreen allow="autoplay"></iframe> </div> </div> </li> </ul> </div> </div> <div id="video_demo_2"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Reproducibility and Customized Plots - recorded Feb 21, 19</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Reproducibility and Customized Plots (Feb 21, 19) </h1> UPDDI's Albert Gough shows how to use the inter- and intra-study <span class="gse0">{{ glossary_dict.reproducibilityanaylsis_term }}</span> feature and how to use customize queries and plots. Video was recorded on February 21, 2019 and is approximately 30 minutes long. <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=79a38a9c-697b-49af-8c29-aab7016aba5d&v=1" width="720" height="405" style="padding: 0px; border: 1px solid #464646;" frameborder="0" allowfullscreen allow="autoplay"></iframe> </div> </div> </li> </ul> </div> </div> <div id="video_demo_1"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Adverse Events Analysis - recorded Jan 17, 19</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Adverse Events Analysis (Jan 17, 19) </h1> UPDDI toxicologist Larry Vernetti walks through the process of using the MPS-Db to help design an <i>in-vitro</i>toxicology Study for liver toxicity. Video was recorded on January 17, 2019 and is approximately 30 minutes long. <br><br> Dr. Vernetti presents an update of this demonstration in the webinar: <a href="#video_demo_w2">Study Design, Set-up and Test Compound Selection Using the MPS-Db</a>. <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=90d94705-ba7b-452e-a17a-aab7016f60ba&v=1" width="720" height="405" style="padding: 0px; border: 1px solid #464646;" frameborder="0" allowfullscreen allow="autoplay"></iframe> </div> </div> </li> </ul> </div> </div> <div id="video_demo_0"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Study Data Loading - recorded Dec 20, 18</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Study Data Loading (Dec 20, 18) </h1> Members of the UPDDI Database Center and Texas A&M University tissue chip team demonstrate the process used to transfer and upload data into the MPS-Db used from 2016 to 2018. Video was recorded on December 20, 2018 and is approximately 40 minutes long. <br><br> <button name="video_button" type="button" class="btn btn-default video-collapsible">Open Video Window</button> <div class="help-content-2"> <div class="myIframe"> <iframe src="https://pitt.hosted.panopto.com/Panopto/Pages/Embed.aspx?id=9e71a7c0-0349-4d10-87f2-aab7016ab9f1&v=1" width="720" height="405" style="padding: 0px; border: 1px solid #464646;" frameborder="0" allowfullscreen allow="autoplay"></iframe> </div> </div> </li> </ul> </div> </div> </div> <div id="study_data_feature_section" class="stop-point"> <h1 class="h1-level-0">Database Features Based on Study Data</h1> <div id="help_study_component"> <button id="help2_study_component_feature" name="help_button" type="button" class="btn btn-primary help-collapsible">Study Components</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Study Components</h1> <span class="gse0">{{ glossary_dict.studycomponent_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To see a list and brief description of the <span class="gse0">{{ glossary_dict.studycomponent_term }}s,</span> <a href="#help_overview_components">click here</a> </li> <li> To review/add <span class="gse0">{{ glossary_dict.studycomponent_term }}s</span> in the MPS-Db, <span class="gse0"><a href={{ glossary_dict.studycomponent_ref }}>click here</a></span> </li> </ul> <br> Guidance on adding/updating more complicated components is provided below: <div id="help_assay_components"> {% include "help_review_study_components_assay.html" %} </div> <div id="help_model_components"> {% include "help_review_study_components_model.html" %} </div> <div id="help_compound_components"> {% include "help_review_study_components_compound.html" %} </div> <div id="help_cell_components"> {% include "help_review_study_components_cell.html" %} </div> </li> </ul> </div> </div> <div id="help_assay_data_viz"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Assay Data Visualization</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Assay Data Visualization</h1> <span class="gse0">{{ glossary_dict.assaydatavisualizationexcludingomic_def|linebreaks }}</span> <br> <h1 class="h1-level-2">Assay Data Visualization (Intra-Study) </h1> The <b>Assay Data Visualization (Intra-Study)</b> feature is accessed from within an individual Study, pre-filtered as follows: <br>1) each <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span>, <br>2) each plate (if using a plate), <br>3) each chip or well, and <br>4) the whole Study. <br><br> <ul class="list-unstyled"> <li>Assay Data Visualization - Each Treatment Group: <ul class="help-filled-circle"> <li>Go to the <b>Studies</b> tab/icon</li> <li>Click on the <b>View/Edit</b> button next to the Study of interest</li> <li>Click on the <b>View</b> button next to the group of interest</li> <li>Review metadata and, if displayed, the <span class="gse0">{{ glossary_dict.assaydatapoint_term }}</span> graphs </li> </ul> </li> <br> <li>Assay Data Visualization - Each Plate: <ul class="help-filled-circle"> <li>Go to the <b>Studies</b> tab/icon</li> <li>Click on the <b>View/Edit</b> button next to the Study of interest</li> <li>Scroll down to the <b>Plates</b> section and click on the <b>View/Edit</b> button next to the plate of interest</li> <li>Review metadata and, if displayed, the <span class="gse0">{{ glossary_dict.assaydatapoint_term }}</span> graphs </li> </ul> </li> <br> <li>Assay Data Visualization - Each Chip or Well: <ul class="help-filled-circle"> <li>Go to the <b>Studies</b> tab/icon</li> <li>Click on the <b>View/Edit</b> button next to the Study of interest</li> <li>Scroll down to the <b>Chips and Wells</b> section and click on the <b>View/Edit</b> button next to the chip/well of interest</li> <li>Review metadata and, if displayed, the <span class="gse0">{{ glossary_dict.assaydatapoint_term }}</span> graphs </li> <li>Review the <span class="gse0">{{ glossary_dict.assaydatapoint_term }}</span> table </li> <li>Note: The <span class="gse0">{{ glossary_dict.assaydatapoint_term }}</span> table offers the <span class="gse0">{{ glossary_dict.datagroupeditor_term }}</span> and <span class="gse0">{{ glossary_dict.datagroupadministrator_term }}</span> of the Study the ability to include/Exclude an <span class="gse0">{{ glossary_dict.assaydatapoint_term }}</span> from being included/Excluded from graphs and analyses by default </li> </ul> </li> <br><br> <li>Assay Data Visualization - Whole Study: <ul class="help-filled-circle"> <li>Go to the <b>Studies</b> tab/icon</li> <li>Click on the <b>View/Edit</b> button next to the Study of interest</li> <li>Click the <b>Analyze/Edit</b> button and select the <b>Study Summary</b> option</li> <li>Review metadata and, if displayed, the <span class="gse0">{{ glossary_dict.assaydatapoint_term }}</span> graphs </li> </ul> </li> <br> <li>There are many options available for customizing graphs, to learn more, click on a link below: <ul class="help-filled-circle"> <li><a href="#help_custom_filtering_sidebar">Custom Filtering for Data Visualization (sidebar)</a></li> <li><a href="#help_custom_graphing_sidebar">Custom Graphing for Data Visualization (sidebar)</a></li> <li><a href="#help_custom_graphing_individual">Customizing Individual Graphs</a></li> </ul> </li> </ul> <br> <h1 class="h1-level-2">Assay Data Visualization (Inter-Study) </h1> <ul class="list-unstyled"> <li>To perform inter-study visualization: <ul class="help-filled-circle"> <li>Go to the <b>Data Analysis</b> tab/icon</li> <li>Select the <b>Graphing/Reproducibility</b> option</li> <li>Check at least one box in each list (work left to right, top to bottom) <ul class="help-open-circle"> <li>Notice how checking and unchecking boxes changes the number of points (<span class="gse0">{{ glossary_dict.assaydatapoint_term }}s</span>) that are selected for inclusion </li> </ul> </li> <li>Click on the <b>Show Plots</b> button</li> <li>Scroll down the page to see plots data</li> <li>Keep scrolling down the page to see the group metadata</li> </li> </ul> </li> <br> <li>There are many options available for customizing graphs, to learn more, click on a link below: <ul class="help-filled-circle"> <li><a href="#help_custom_filtering_sidebar">Custom Filtering for Data Visualization (sidebar)</a></li> <li><a href="#help_custom_graphing_sidebar">Custom Graphing for Data Visualization (sidebar)</a></li> <li><a href="#help_custom_graphing_individual">Customizing Individual Graphs</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_omic_data_viz"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Omic Data Visualization</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Omic Data Visualization</h1> <span class="gse0">{{ glossary_dict.omicdatavisualization_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To visualize differential expressed genomic data: <ul class="help-filled-circle"> <li>Go to the <b>Studies</b> tab/icon</li> <li>Click on the <b>View/Edit</b> button next to the Study of interest</li> <li>Click on the <b>Analyze/Edit</b> button</li> <li>Select <b>Gene Expression Analysis</b> option <li>Use the sidebar to change plot type, thresholds, and/or filters (optional)</li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_image_and_video"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Assay Images and Videos</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Assay Images and Videos</h1> <span class="gse0">{{ glossary_dict.assayimagesandvideos_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To view images and video uploaded to a Study: <ul class="help-filled-circle"> <li>Go to the <b>Studies</b> tab/icon</li> <li>Click on the <b>View/Edit</b> button next to the Study of interest</li> <li>Click on the <b>Analyze/Edit</b> button</li> <li>Select the <b>Images and Video</b> option</li> <li>To see metadata, play a video, or download an unaltered media file, click on the thumbnail of interest (videos have a 'play' icon on the thumbnail) </li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>Media files (images and videos) have been altered for appearance in a web browser</li> <li>To perform comparative analysis between media files, downloading the unaltered media file is recommended</li> <li><a href="#video_demo_9">For a demonstration of this feature, see the demonstration on Omic Data in the MPS-Db (Omics Integration Phase 1: Log 2 Fold Change Data) - recorded Nov 19, 20 </a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_power_analysis"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Power Analysis</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Power Analysis</h1> <span class="gse0">{{ glossary_dict.poweranalysis_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To perform <span class="gse0">{{ glossary_dict.poweranalysis_term }}</span>: <ul class="help-filled-circle"> <li>Go to the <b>Studies</b> tab/icon</li> <li>Click on the <b>View/Edit</b> button next to the Study of interest</li> <li>Click on the <b>Analyze/Edit</b> button</li> <li>Select the <b>Power Analysis</b> option</li> <li>Use the <a href="#help_custom_filtering_sidebar">Custom Filtering for Data Visualization (sidebar)</a> to change grouping or filtering of data </li> <li>Check the box next to the set of interest to see the results of interest</li> <li>Select one or two sample <span class="gse0">{{ glossary_dict.poweranalysis_term }}</span> </li> <li>Scroll down and select two <span class="gse0">{{ glossary_dict.compound_term }}</span> groups for two sample or one <span class="gse0">{{ glossary_dict.compound_term }}</span> group for one sample </li> <li>Scroll down to see additional options (Effect Size Methods and Significance Level) <li>Make desired changes to effective size and significance level selections (optional) </li> <li>Click the <b>Run Analysis</b> button</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>Customized properties for <span class="gse0">{{ glossary_dict.poweranalysis_term }}</span> are available in the MPS-Db via a sidebar on the <span class="gse0">{{ glossary_dict.poweranalysis_term }} </span> page <ul class="help-open-circle"> <li>If the <b>Run Analysis</b> button is disabled, read the page prompts to see if a required selection has been omitted</li> </ul> </li> <li>For demonstration of how to use this feature, watch webinar 4, <a href="#video_demo_w3">Data Analysis in the MPS-Db - recorded Jan 26, 21</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_reproducibility_analysis"> <button name="help_button" type="button" class="btn btn-primary help-collapsible"> Reproducibility</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Reproducibility Analysis </h1> <span class="gse0">{{ glossary_dict.reproducibilityanalysis_def|linebreaks }}</span> <br> <h1 class="h1-level-2">Reproducibility Analysis (Intra-Study) </h1> <ul class="list-unstyled"> <li>To perform intra-study reproducibility analysis: <ul class="help-filled-circle"> <li>Go to the <b>Studies</b> tab/icon</li> <li>Click on the <b>View/Edit</b> button next to the Study of interest</li> <li>Click the <b>Analyze/Edit</b> button and select the <b>Reproducibility</b> option</li> <li>Use the <a href="#help_custom_filtering_sidebar">Custom Filtering for Data Visualization (sidebar)</a> to change grouping or filtering of data </li> <li>Check the box next to the set of interest to see the results of interest</li> <li>Scroll down page to detailed results section of interest (including chips, studies and each Study's reproducibility status, Max CV, ICC, and graphs)</li> </ul> </li> </ul> <br> <h1 class="h1-level-2"> Reproducibility Analysis (Inter-Study) </h1> <ul class="list-unstyled"> <li>To perform inter-study reproducibility analysis: <ul class="help-filled-circle"> <li>Go to the <b>Data Analysis</b> tab/icon</li> <li>Select the <b>Graphing/Reproducibility</b> option</li> <li>Check at least one box in each list (work left to right, top to bottom) <ul class="help-open-circle"> <li>Notice how checking and unchecking boxes changes the number of <span class="gse0">{{ glossary_dict.assaydatapoint_term }}s</span> selected for inclusion </li> </ul> </li> <li>Click on the <b>Show Reproducibility</b> button</li> <li>Use the <a href="#help_custom_filtering_sidebar">Custom Filtering for Data Visualization (sidebar)</a> to change grouping or filtering of data </li> <li>Check the box next to the set of interest to see the results of interest</li> <li>Scroll down page to detailed results section of interest (including chips, studies and each Study's reproducibility status, Max CV, ICC, and graphs)</li> <li>Explore the <b>Reproducibility Properties</b> options in the sidebar (optional)</li> <li>Customized properties for <span class="gse0">{{ glossary_dict.reproducibilityanalysis_term }}</span> are available in the MPS-Db via a sidebar on the inter-study <span class="gse0">{{ glossary_dict.reproducibilityanalysis_term }}</span> page </li> <li>To perform <span class="gse0">{{ glossary_dict.reproducibilityanalysis_term }}</span>: <ul class="help-open-circle"> <li>Reproducibility Comparison within Selected Data Sets - By Center (Center to Center) or By Study (Study to Study)</li> <li>Normalize by Median - helpful if trends are similar but values are on different scales</li> <li>Maximum Interpolation Size - maximum number of data points that can be interpolated, between experimental measurements, to allow for comparison within selected data sets, center to center or Study to Study (shown as stars on the reproducibility plots)</li> </ul> </li> </ul> </li> </ul> <br> <ul class="list-unstyled"> <li>Help Notes: <ul class="help-filled-circle"> <li>By default, the screen will automatically refresh, to refresh manually, check the <b>Manually Refresh</b> box, make the desired changes, then click on the <b>Refresh</b> button to apply changes</li> <li>For demonstration of how to use this feature, watch webinar 4, <a href="#video_demo_w3">Data Analysis in the MPS-Db - recorded Jan 26, 21</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_study_set"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Study Sets</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Study Sets</h1> <span class="gse0">{{ glossary_dict.studyset_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To add a <span class="gse0">{{ glossary_dict.studyset_term }}</span>: <ul class="help-filled-circle"> <li>Go to the <b>Studies</b> tab/icon</li> <li>Select the <b>Add Study Set</b> option</li> <li>Select the studies to include in the set by putting a check mark in the box</li> <li>Click the <b>Continue</b> button</li> <li>Fill out the form</li> <li>Click the <b>Select Assays</b> button to limit data to include in the <span class="gse0">{{ glossary_dict.studyset_term }}</span> (optional) </li> <li>Click the <b>Submit</b> button to save</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>A <span class="gse0">{{ glossary_dict.studyset_term }}</span> is conceptually similar to an inter-study analysis, with the added functionality to: <ul class="help-open-circle"> <li>Save the selection of the <span class="gse0">{{ glossary_dict.studyset_term }}</span> for later retrieval </li> <li>Assign the <span class="gse0">{{ glossary_dict.studyset_term }}</span> a URL for easy sharing (e.g., inclusion in a publication) </li> <li>Data from each Study in the <span class="gse0">{{ glossary_dict.studyset_term }}</span> can be limited to a subset of one or more <span class="gse0">{{ glossary_dict.assaytarget_term }}s</span> </li> </ul> </li> <li>Viewers of a <span class="gse0">{{ glossary_dict.studyset_term }}</span> created by another user will only see data from Studies to which they have access (i.e. a <span class="gse0">{{ glossary_dict.studyset_term }}</span> does NOT override existing permissions to Studies) </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_collaborator_group"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Collaborators (Collaborator Groups)</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Collaborators (Collaborator Groups)</h1> <span class="gse0">{{ glossary_dict.collaboratorgroup_def|linebreaks }}</span> <ul class="list-unstyled"> <li>About <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span>: <ul class="help-filled-circle"> <li>A <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}</span> is a means of allowing data from a private Study (a Study that has not been signed off) to be shared with another user who is not a member of the same <span class="gse0">{{ glossary_dict.datagroup_term }}</span> (e.g., someone from another lab) </li> <li>Using a <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}</span> is currently the only way to allow someone from another data team to see data contained in a Study prior to either signing off a Study or opening the Study to the public </li> <li>For more information on how to share data using <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> <a href="#help_study_signoff">click here </a> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_access_group"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Accessors (Access Groups)</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Accessors (Access Groups)</h1> <span class="gse0">{{ glossary_dict.accessgroup_def|linebreaks }}</span> <ul class="list-unstyled"> <li>About <span class="gse0">{{ glossary_dict.accessgroup_term }}s</span>: <ul class="help-filled-circle"> <li>An <span class="gse0">{{ glossary_dict.accessgroup_term }}</span> is a means of sharing data from a Study during the year embargo period (after sign-off and before public release) with colleagues who are not members of the same <span class="gse0">{{ glossary_dict.datagroup_term }}</span> (e.g., someone from another lab) </li> <li>For more information on how to share data using <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> <a href="#help_study_signoff">click here </a> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_pbpk_analysis"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">PBPK Analysis</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">PBPK Analysis</h1> <span class="gse0">{{ glossary_dict.pbpkanalysis_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To perform <span class="gse0">{{ glossary_dict.pbpkanalysis_term }}</span>: <ul class="help-filled-circle"> <li>Go to the <b>Data Analysis</b> tab/icon</li> <li>Select the <b>PBPK</b> option</li> <li>Check at least one box in each list (work left to right, top to bottom) <ul class="help-open-circle"> <li>Notice how checking and unchecking boxes changes the number of <span class="gse0">{{ glossary_dict.assaydatapoint_term }}s</span> selected for inclusion </li> </ul> </li> <li>Click the <b>Show PBPK</b> button</li> <li>Use the <a href="#help_custom_filtering_sidebar">Custom Filtering for Data Visualization (sidebar)</a> to change filtering of data (optional) </li> <li>Check the box next to the set of interest to see the results of interest</li> <li>The analyses that can be performed are: <ul class="help-open-circle"> <li>Calculate the clearance of a <span class="gse0">{{ glossary_dict.compound_term }}</span> </li> <li>Predict the plasma concentration given a dose and dose interval</li> <li>Predict the dose and dose interval to reach a specific plasma level</li> </ul> </li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>A significant amount of the information used in the <span class="gse0">{{ glossary_dict.pbpkanalysis_term }}</span> is manually curated into the database </li> <li>Currently, the required parameters and rates have been added to the database for the liver</li> <li>Parameters and rates in yellow can be changed while performing an analysis</li> <li>Depending on the analysis being performed, some yellow boxes can remain empty</li> <li>For a brief introduction to using this feature, see <a href="#video_demo_w2">Study Design, Set-up and Test Compound Selection Using the MPS-Db</a> (time 45:03 minutes)</li> <li>For demonstration of how to use this feature, watch webinar 4, <a href="#video_demo_w3">Data Analysis in the MPS-Db - recorded Jan 26, 21</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_disease_portal"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Disease Portal</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Disease Portal</h1> <span class="gse0">{{ glossary_dict.diseaseportal_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To access the <span class="gse0">{{ glossary_dict.diseaseportal_term }}</span>: <ul class="help-filled-circle"> <li>Go to the <b>Models</b> tab/icon</li> <li>Select the <b>View Diseases</b> option</li> <li>Click on the <b>View</b> button next to the disease of interest</li> <li>Review the table that summarizes disease related information available in the MPS-Db</li> <li>Click on one of the options for more information about the disease <ul class="help-open-circle"> <li>Disease Overview - disease basics</li> <li>Disease Biology - active links to relevant biology/genomic information</li> <li>Clinical Data - summarized findings from clinical trials.gov</li> <li>Disease Models &amp; Studies - list of disease related models and studies related to the disease that are in the MPS-Db</li> </ul> </li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>The Studies counted and/or listed on the <b>Diseases List</b> page and the <b>Disease Detail</b> page are permission specific </li> <li>For more information on <span class="gse0">{{ glossary_dict.referencedatasource_term }}s</span>, <a href="#help_overview_features">click here</a> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_compound_report"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Compound Report</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Compound Report</h1> <span class="gse0">{{ glossary_dict.compoundreport_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To access a <span class="gse0">{{ glossary_dict.compoundreport_term }}</span>: <ul class="help-filled-circle"> <li>Go to the <b>Compounds</b> tab/icon</li> <li>Select the <b>Compound Report</b> option</li> <li>As a precaution, click the <b>Clear Current Selections</b> button</li> <li>Use the search box to limit the <span class="gse0">{{ glossary_dict.compound_term }}</span> list (optional) </li> <li>Check the boxes for the <span class="gse0">{{ glossary_dict.compound_term }}s</span> to include </li> <li>If desired, use the search bar to get a different <span class="gse0">{{ glossary_dict.compound_term }}</span> list </li> <li>If desired, check additional <span class="gse0">{{ glossary_dict.compound_term }}s</span> to include </li> <li>Click <b>Generate Compound Report</b> button</li> <li>If a blue plus sign is present, click it to see aggregated assay Study data</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li> <span class="gse0">{{ glossary_dict.compound_term }}</span> selections are cumulative </li> <li>To start with a fresh search, click the <b>Clear Current Selections</b> button</li> <li>To save <span class="gse0">{{ glossary_dict.compound_term }}</span> selections, click the <b>Save Selections</b> button (when returning at a later time, click <b>Load Selections</b> button) </li> <li>Only studies that have been checked for inclusion in the <span class="gse0">{{ glossary_dict.compoundreport_term }}</span> will be included in the aggregation </li> <li>For more information on <span class="gse0">{{ glossary_dict.referencedatasource_term }}s</span>, <a href="#help_overview_features">click here</a> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_reference"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">References</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">References</h1> <span class="gse0">{{ glossary_dict.references_def|linebreaks }}</span> References can be added to the MPS-Db and then linked to Studies and/or <span class="gse0">{{ glossary_dict.studycomponents_term }}</span> (e.g., <span class="gse0">{{ glossary_dict.mpsmodel_term }}s</span>, <span class="gse0">{{ glossary_dict.device_term }}s)</span>. <br><br> <ul class="list-unstyled"> <li>To add a <span class="gse0">{{ glossary_dict.reference_term }}</span> to the MPS-Db: <ul class="help-filled-circle"> <li>Go to the <b>Studies</b> tab/icon</li> <li>Select the <b>Study Components</b> option</li> <li>Click the <b>Add References</b> button</li> <li>Fill out the form</li> <li>Click the <b>Submit</b> button to save</li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_api"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">API</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">API</h1> <span class="gse0">{{ glossary_dict.api_def|linebreaks }}</span> For more information and access to the API, <a href={{ glossary_dict.api_ref }}>click here</a>. </li> </ul> </div> </div> </div> <div id="study_data_customization_section" class="stop-point"> <h1 class="h1-level-0"> Customization Options</h1> <div id="help_custom_filtering_sidebar"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Custom Grouping and Filtering (sidebar) </button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Custom Grouping and Filtering (sidebar)</h1> <ul class="list-unstyled"> <p class="h1-level-3">Graph customization is not saved, it lasts only until the user navigates away from the page.</p> <li>Customized grouping and filtering is available in the MPS-Db via a sidebar where data are available for review. To customize: <ul class="help-filled-circle"> <li>If hidden, click the <b>Toggle Sidebar</b> button to show the sidebar</li> <li>Click on the parameter menus (Study Parameters, Cell Parameters, Compound Parameters, Setting Parameters) to see options </li> <li>To filter - click on the filter symbol <ul class="help-open-circle"> <li>To select data, check the box next to the data</li> <li>To omit data, uncheck the box next to the data</li> </ul> </li> <li>To group - check/uncheck the box in the <b>Group</b> column <ul class="help-open-circle"> <li>Check the box to include parameter in grouping</li> <li>Uncheck the box to remove parameter from grouping</li> </ul> </li> <li>Repeat for all attributes to override</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>In general, increasing the number of parameters selected for grouping will increase the number of <span class="gse0">{{ glossary_dict.dynamicdatagroup_term }}s</span> in the <span class="gse0">{{ glossary_dict.dynamicdatagroup_term }}</span> table </li> <li>In general, increasing the number of filters will decrease the number of <span class="gse0">{{ glossary_dict.dynamicdatagroup_term }}s</span> in the <span class="gse0">{{ glossary_dict.dynamicdatagroup_term }}</span> table (or decrease the number of <span class="gse0">{{ glossary_dict.assaydatapoint_term }}s</span> in a <span class="gse0">{{ glossary_dict.dynamicdatagroup_term }}</span>) </li> <li>By default, the screen will automatically refresh, to refresh manually, check the <b>Manually Refresh</b> box, make the desired changes, then click on the <b>Refresh</b> button to apply changes</li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_custom_graphing_sidebar"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Customizing Visualizations (sidebar) </button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Customizing Visualizations (sidebar)</h1> <ul class="list-unstyled"> <p class="h1-level-3">Graph customization is not saved, it lasts only until the user navigates away from the page.</p> <li>General graph customization is available via a sidebar where graphs are displayed. To customize: <ul class="help-filled-circle"> <li>If hidden, click the <b>Toggle Sidebar</b> button to show the sidebar</li> <li>Click on the property menus to see options</li> <li>To change the general graph properties, click on the menu of the property of interest in the <b>General Graph Properties</b> section</b> <ul class="help-open-circle"> <li>Plot Graph By - select By Chips (chips and wells), By Group (groups as defined based on choices made in the <b>Grouping/Filtering</b> section), or By Compound to indicate how to aggregate assay data</li> <li>Data Aggregation - select Arithmetic Mean, Geometric Mean, or Median (additional options available based on selection)</li> <li>Tooltip Display - select Each Data Point or Entire Time Point (when hovering over a point on a graph) </li> <li>Data Display - option to select Include Excluded Data and/or treat Negative Values as 0 </li> <li>Time Unit - select Day, Hour, or Minute for time unit of x-axis</li> </ul> </li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>By default, the screen will automatically refresh, to refresh manually, check the <b>Manually Refresh</b> box, make the desired changes, then click on the <b>Refresh</b> button to apply changes</li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_custom_graphing_individual"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Customizing Individual Graphs</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Customizing Individual Graphs</h1> <ul class="list-unstyled"> <p class="h1-level-3">Graph customization is not saved, it lasts only until the user navigates away from the page.</p> <li>Individualized graphing options are available via a graph popup where graphs are displayed. To customize: <ul class="help-filled-circle"> <li>Right-click on an individual graph (on touch screen - press and hold one finger while tapping with another) <li>Select the desired individualized graph options <ul class="help-open-circle"> <li>Show Plot - if uncheck and apply, graph will not be displayed on main page</li> <li>Percent Control - when box is checked, assays and time points without associated controls are removed and the y-axis units are changed to percent control</li> <li>Dose-Response - changes x-axis from time to dose</li> <li>X-axis to Log Scale - transforms x-axis</li> <li>Y-axis to Log Scale - transforms y-axis</li> </ul> </li> <li>Click the <b>View Preview</b> button</li> <li>Make changes to the general graph customization features as desired (optional)</li> <li>Click the <b>Apply to Plot</b> button to apply changes, the <b>Revert to Default</b> button to remove graph specific customization, or the <b>Cancel</b> to go back to the last applied version </ul> </li> </ul> </li> </ul> </div> </div> </div> <div id="non_study_data_feature_section" class="stop-point"> <h1 class="h1-level-0">Database Features Based on Curated Reference Data</h1> <div id="help_chemical_data"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Chemical Data</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Chemical Data</h1> <span class="gse0">{{ glossary_dict.chemicaldata_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To view chemical data: <ul class="help-filled-circle"> <li>Go to the <b>Compounds</b> tab/icon</li> <li>Select the <b>View Chemical Data</b> option</li> <li>Use the search box to limit the <span class="gse0">{{ glossary_dict.compound_term }}</span> list (optional) </li> <li>Click on the <b>View</b> button next to the <span class="gse0">{{ glossary_dict.compound_term }}</span> of interest to see <span class="gse0">{{ glossary_dict.compound_term }}</span> details </li> <li>Click on the <b>Previous</b> button or the <b>Next</b> button to scroll through the <span class="gse0">{{ glossary_dict.compound_term }}s</span> (optional) </li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>Medchem Alerts - indicates whether functional groups that are uncommon in drugs are present in the <span class="gse0">{{ glossary_dict.compound_term }}</span> </li> <li>If there are Medchem Alerts for a <span class="gse0">{{ glossary_dict.compound_term }}</span>, click on the flag to see a list of the functional groups </li> <li>For more information on <span class="gse0">{{ glossary_dict.referencedatasource_term }}s</span>, <a href="#help_overview_features">click here</a> </li> <li>To see a portion of this feature demonstrated, watch the webinar: <a href="#video_demo_w2">Study Design, Set-up and Test Compound Selection Using the Microphysiology Systems Database - Nov 10, 20 </a> (time 9:00 minutes) </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_bioactivities"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Bioactivities</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Bioactivities</h1> <span class="gse0">{{ glossary_dict.bioactivities_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To view bioactivities: <ul class="help-filled-circle"> <li>Go to the <b>Compounds</b> tab/icon</li> <li>Select the <b>View Bioactivities</b> option</li> </ul> </li> </ul> </li> </ul> <ul class="list-group"> <li class="list-group-item"> <ul class="list-unstyled"> <h1 class="h1-level-1">Option 1 - Quick Search</h1> <li>To perform quick search: <ul class="help-filled-circle"> <li>Enter at least one search string in one of the fields (Compound, Target, and/or Name) <ul class="help-open-circle"> <li>Notice that options appear as you type in the boxes, these can be selected from the dropdown</li> </ul> </li> <li>Click on the <b>Exclude ... </b> buttons to change data selection as indicated on the button (optional) </li> <li>Click on the <span class="glyphicon glyphicon-search" aria-hidden="true"></span> button to perform the search </li> </ul> </li> </ul> <button name="help_button" type="button" class="btn btn-success help-collapsible">See A Quick Search Example</button> <div class="help-content-2"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-2">Bioactivities Quick Search Example</h1> <ul class="list-unstyled"> <li>Follow these steps: <ul class="help-filled-circle"> <li>Enter Compound = "ASPIRIN"</li> <li>Enter Target = "Blood" </li> <li>Enter Name = "IC50" </li> <li>Click on the <span class="glyphicon glyphicon-search" aria-hidden="true"></span> </li> </ul> </li> </ul> </li> </ul> </div> </li> </ul> <ul class="list-group"> <li class="list-group-item"> <ul class="list-unstyled"> <h1 class="h1-level-2">Option 2 - Advanced Search</h1> <li>To perform an advanced search: <ul class="help-filled-circle"> <li>Click on the <b>Exclude ... </b> button or the <b>Use PubChem...</b> button to change data selection as indicated on the button (optional)</li> <li>Enter a search string in one or more of the filters (Bioactivities, Targets, Compounds) (optional)</li> <li>Check all the boxes needed to indicate desired selections</li> <li>Click the <b>Generate Table</b> button</li> </ul> </li> </ul> <button name="help_button" type="button" class="btn btn-success help-collapsible">See An Advanced Search Example</button> <div class="help-content-2"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Bioactivities Advanced Search Example</h1> <ul class="list-unstyled"> <li>Follow these steps: <ul class="help-filled-circle"> <li>Select Target Types - check the box in the top left to include all</li> <li>Select Organisms - check the box in the top left to include all</li> <li>Filter Compounds - check all boxes, leave LogP and Molecular Weight blank</li> <li>Bioactivities Filter - type in "IC50" </li> <li>Select Bioactivities - check the box in the top left to include all</li> <li>Targets Filter - type in "Blood" </li> <li>Select Targets - check the box in the top left to include all</li> <li>Compounds Filter - type in "ASPIRIN" </li> <li>Select Compounds - check the box in the top left to include all</li> <li>Click the button to <b>Generate Table</b></li> </ul> </li> </ul> </li> </ul> </div> </li> </ul> <ul class="list-group"> <li class="list-group-item"> <ul class="list-unstyled"> <li>Help Notes: <ul class="help-filled-circle"> <li>The <b>Data Validity</b> column of the results table/list indicates whether or not, and why, an entry was marked "questionable"</li> <li>Not every ChEMBL entry has a corresponding PubChem entry, and vice versa</li> <li>The following will clear <em>all</em>selections <ul class="help-open-circle"> <li>Changing between ChEMBL and PubChem; Changing whether questionable results are excluded or not; Changing the min feature count; Changing the Target Types or Organisms</li> </ul> </li> <li>The <b>Minimum Feature Count Per Record</b> field specifies the number of bioactivities that need to be linked to a given option for it to appear <ul class="help-open-circle"> <li>e.g. if the min feature count is 10, then the compound "ALDRIN" will not be an option because only 5 bioactivities link to "ALDRIN" </li> <li>Click the <b>Apply</b> button to confirm the change to the min feature count</li> </ul> </li> <li>For more information on <span class="gse0">{{ glossary_dict.referencedatasource_term }}s</span>, <a href="#help_overview_features">click here</a> </li> <li>To see this feature demonstrated, watch the webinar: <a href="#video_demo_w2">Study Design, Set-up and Test Compound Selection Using the Microphysiology Systems Database - Nov 10, 20 </a> (time 12:45 minutes) </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_drug_trials"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Drug Trials</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Drug Trials</h1> <span class="gse0">{{ glossary_dict.drugtrials_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To view drug trials data: <ul class="help-filled-circle"> <li>Go to the <b>Compounds</b> tab/icon</li> <li>Select the <b>View Drug Trials</b> option</li> <li>Use the search box to limit the list (optional)</li> <li>Click on the <b>View</b> button next to the drug trial of interest to see <span class="gse0">{{ glossary_dict.compound_term }}</span> details </li> <li>Click on the <b>Previous</b> button or the <b>Next</b> button to scroll through the drug trials (optional) </li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>For more information on <span class="gse0">{{ glossary_dict.referencedatasource_term }}s</span>, <a href="#help_overview_features">click here</a> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_adverse_events"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Adverse Events</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Adverse Events</h1> <span class="gse0">{{ glossary_dict.adverseevents_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To view adverse events: <ul class="help-filled-circle"> <li>Go to the <b>Compounds</b> tab/icon</li> <li>Select the <b>View Adverse Events</b> option</li> <li>Use the search box to limit the list (optional) <ul class="help-open-circle"> <li>Use a space in the search to include multiple terms (e.g, "EPINEPHRINE nausea") </li> </ul> </li> <li>Click on the <b>View</b> button to see details of the <span class="gse0">{{ glossary_dict.compound_term }}</span> and event of interest </li> <li>Click on the <b>Toggle Plot</b> button next to an event of interest to generate time plots of reported events <ul class="help-open-circle"> <li>Scroll down to the bottom of the page to see the plot</li> <li>Use the data boxes under the plot to control time frame of plot (optional)</li> </ul> </li> <li>Click on the <b>Previous</b> button or <b>Next</b> button to scroll through the <span class="gse0">{{ glossary_dict.compound_term }}s</span> (optional) </li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>Only top adverse events for <span class="gse0">{{ glossary_dict.compound_term }}s</span> are shown in the results of the search </li> <li>The <b>Number of Reports</b> column indicates the number of reports that list both the <span class="gse0">{{ glossary_dict.compound_term }}</span> and adverse event in the row </li> <li>The number of reports does not contain any information regarding the dose of the drug</li> <li>A <span class="gse0">{{ glossary_dict.compound_term }}</span> can be listed in a report even if it is not suspected of causing the adverse event </li> <li>For more information on <span class="gse0">{{ glossary_dict.referencedatasource_term }}s</span>, <a href="#help_overview_features">click here</a> </li> <li>To see this feature demonstrated, watch the webinar: <a href="#video_demo_w2">Study Design, Set-up and Test Compound Selection Using the Microphysiology Systems Database - Nov 10, 20 </a> (time 17:00 minutes) </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_compare_adverse_events"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Compare Adverse Events</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Compare Adverse Events</h1> <span class="gse0">{{ glossary_dict.compareadverseevents_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To compare adverse events: <ul class="help-filled-circle"> <li>Go to the <b>Compounds</b> tab/icon</li> <li>Select the <b>Compare Adverse Events</b> option</li> <li>As a precaution, click the <b>Clear Current Selections</b> button</li> <li>Use the search box to limit the list (optional)</li> <li>Check the boxes of the events to include</li> <li>Check the boxes of the <span class="gse0">{{ glossary_dict.compound_term }}s</span> to include <ul class="help-open-circle"> <li>At least one <span class="gse0">{{ glossary_dict.compound_term }}</span> and one event must be selected before data will show on the graph </li> </ul> </li> <li>If desired, use the search bar to get different lists</li> <li>If desired, check additional <span class="gse0">{{ glossary_dict.compound_term }}s</span> and/or events to include </li> <li>Scroll down to see the graph comparing events</li> <li>If desired, click on the <b>Show Raw Counts/Hide Raw Counts</b> button to toggle from Number of Reports and Number of Reports per 10,000 Mentions</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>Selections are cumulative</li> <li>To start with a fresh search, click the <b>Clear Current Selections</b> button</li> <li>To save selections, click the <b>Save Selections</b> button (when returning at a later time, click <b>Load Selections</b> button)</li> <li>Hover over the <span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> to learn more about data presented </li> <li>For more information on <span class="gse0">{{ glossary_dict.referencedatasource_term }}s</span>, <a href="#help_overview_features">click here</a> </li> <li>To see this feature demonstrated, watch the webinar: <a href="#video_demo_w2">Study Design, Set-up and Test Compound Selection Using the Microphysiology Systems Database - Nov 10, 20 </a> (time 19:50 minutes) </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_heatmap_bioactivities"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Heatmap of Bioactivities</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Heatmap of Bioactivities</h1> <span class="gse0">{{ glossary_dict.heatmapofbioactivities_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To generate a heatmap: <ul class="help-filled-circle"> <li>Go to the <b>Data Analysis</b> tab/icon</li> <li>Select the <b>Heatmap</b> option</li> <li>Click on the <b>Exclude ... </b> button or the <b>Use PubChem...</b> button to change data selection as indicated on the button (optional)</li> <li>Enter a search string in one or more of the filters (Bioactivities, Targets, Compounds, Drug Trials) (optional)</li> <li>Check all the boxes needed to indicate desired selections</li> <li>The <b>Minimum Feature Count Per Record</b> field specifies the number of bioactivities that need to be linked to a given option for it to appear <ul class="help-open-circle"> <li>e.g. if the min feature count is 10, then the compound "ALDRIN" will not be an option because only 5 bioactivities link to "ALDRIN" </li> <li>Click the <b>Apply</b> button to confirm the change to the min feature count</li> </ul> </li> <li>Click the button to <b>Generate Heatmap</b></li> <li>If desired, click on a row or column label to sort the heatmap such that entries in the selection are ordered from highest to lowest</li> <li>If desired, click the <b>Download the Heatmap</b> button (downloads data used in heatmap to csv)</li> <li>Scroll to the bottom of the heatmap to see the legend of colors used </li> <li>Clicking on a specific square in the heatmap will show that particular value in a pop-up window</li> </ul> </li> </ul> <button name="help_button" type="button" class="btn btn-success help-collapsible">See An Example</button> <div class="help-content-2"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Heatmap of Bioactivities - Example</h1> <ul class="list-unstyled"> <li>Follow these steps: <ul class="help-filled-circle"> <li>Select Target Types - check the box in the top left to include all</li> <li>Select Organisms - check the box in the top left to include all</li> <li>Filter Compounds - check all boxes, leave LogP and Molecular Weight blank</li> <li>Bioactivities Filter - type in "IC50" </li> <li>Select Bioactivities - check the box in the top left to include all</li> <li>Select Targets - check the box in the top left to include all</li> <li>Compounds Filter - type in "ASPIRIN" </li> <li>Select Compounds - check the box in the top left to include all</li> <li>Select Drug Trials - check the box in the top left to include all</li> <li>Click the <b>Generate Heatmap</b> button</li> </ul> </li> </ul> </li> </ul> </div> </li> </ul> <ul class="list-group"> <li class="list-group-item"> <ul class="list-unstyled"> <li>Help Notes: <ul class="help-filled-circle"> <li>Not every ChEMBL entry has a corresponding PubChem entry, and vice versa</li> <li>The following will clear all selections <ul class="help-open-circle"> <li>Changing between ChEMBL and PubChem; Changing whether questionable results are excluded or not; Changing the min feature count; Changing the Target Types or Organisms </li> </ul> </li> <li>For more information on <span class="gse0">{{ glossary_dict.referencedatasource_term }}s</span>, <a href="#help_overview_features">click here</a> </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_cluster_chemicals"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">Cluster Chemicals</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Cluster Chemicals</h1> <span class="gse0">{{ glossary_dict.clusterchemicals_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To perform <span class="gse0">{{ glossary_dict.compound_term }}</span> clustering: <ul class="help-filled-circle"> <li>Go to the <b>Data Analysis</b> tab/icon</li> <li>Select the <b>Cluster</b> option</li> <li>Click on the <b>Exclude ... </b> button or the <b>Use PubChem...</b> button to change data selection as indicated on the button (optional)</li> <li>Enter a search string in one or more of the filters (Bioactivities, Targets, Compounds, Drug Trials) (optional)</li> <li>Check all the boxes needed to indicate desired selections</li> <li>The <b>Minimum Feature Count Per Record</b> field specifies the number of bioactivities that need to be linked to a given option for it to appear <ul class="help-open-circle"> <li>e.g. if the min feature count is 10, then the compound "ALDRIN" will not be an option because only 5 bioactivities link to "ALDRIN" </li> <li>Click the <b>Apply</b> button to confirm the change to the min feature count</li> </ul> </li> <li>Click the <b>Generate Dendrogram</b> button</li> <li>The table on the left shows the bioactivities and drug trial data used in clustering (optional) </li> <li>Click on a node to see information about the <span class="gse0">{{ glossary_dict.compound_term }}</span> (click the red X button to close) (optional) </li> </ul> </li> <button name="help_button" type="button" class="btn btn-success help-collapsible">See An Example</button> <div class="help-content-2"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Compound Clustering - Example</h1> <ul class="list-unstyled"> <li>Follow these steps: <ul class="help-filled-circle"> <li>Select Target Types - check the box "Single Protein" </li> <li>Select Organisms - check the box "Homo sapiens" </li> <li>Filter Compounds - check all boxes, leave LogP and Molecular Weight blank</li> <li>Select Bioactivities - check the box in the top left to include all</li> <li>Select Targets - check the box "!No Target" </li> <li>Select Compounds - check the box in the top left to include all</li> <li>Select Drug Trials - check the box in the top left to include all</li> <li>Click the <b>Generate Dendrogram</b> button</li> </ul> </li> </ul> </li> </ul> </div> </ul> </li> </ul> <ul class="list-group"> <li class="list-group-item"> <ul class="list-unstyled"> <li>Help Notes: <ul class="help-filled-circle"> <li>Not every ChEMBL entry has a corresponding PubChem entry, and vice versa</li> <li>The following will clear all selections <ul class="help-open-circle"> <li>Changing between ChEMBL and PubChem; Changing whether questionable results are excluded or not; Changing the min feature count; Changing the Target Types or Organisms </li> </ul> </li> <li>For more information on <span class="gse0">{{ glossary_dict.referencedatasource_term }}s</span>, <a href="#help_overview_features">click here</a> </li> </ul> </li> </ul> </li> </ul> </div> </div> </div> <div id="study_editor_section" class="stop-point"> <h1 class="h1-level-0">Providing Data</h1> <div id="help_join_group"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">1. Request to Join a Data Group</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Join a Data Group</h1> <span class="gse0">{{ glossary_dict.datagroup_def|linebreaks }}</span> To enter Study data, you must be a member of a <span class="gse0">{{ glossary_dict.datagroup_term }}</span> and your <span class="gse0">{{ glossary_dict.datagroup_term }}</span> must be linked to your <span class="gse0">{{ glossary_dict.microphysiologycenter_term }}</span>. <br> <br> <ul class="list-unstyled"> <li>To join an existing <span class="gse0">{{ glossary_dict.datagroup_term }}</span>: <ul class="help-filled-circle"> <li>Contact the <span class="gse0">{{ glossary_dict.datagroupadministrator_term }}</span> (your team data leader) and ask them to request you be added to their <span class="gse0">{{ glossary_dict.datagroup_term }}</span> </li> </ul> </li> <br> <li>To have a new <span class="gse0">{{ glossary_dict.datagroup_term }}</span> added to the MPS-Db, contact an <span class="gse0">{{ glossary_dict.mpsdbadministrator_term }}</span> and ask for your <span class="gse0">{{ glossary_dict.datagroup_term }}</span> to be added (provide the following information): <ul class="help-filled-circle"> <li>Data Group Name - Taylor_MPS</li> <li> <span class="gse0">{{ glossary_dict.datagroupviewer_term }}s</span> - list of users </li> <li> <span class="gse0">{{ glossary_dict.datagroupeditor_term }}s</span> - list of users </li> <li> <span class="gse0">{{ glossary_dict.datagroupadministrator_term }}s</span> - list of users </li> </ul> </li> <br> <li>To have a new <span class="gse0">{{ glossary_dict.microphysiologycenter_term }}</span> added to the database, contact an <span class="gse0">{{ glossary_dict.mpsdbadministrator_term }}</span> and ask for your center to be added (provide the following information): <ul class="help-filled-circle"> <li>Center Name - University of Pittsburgh Drug Discovery Institute</li> <li>Center ID - UPDDI</li> <li>Institution - University of Pittsburgh</li> <li>Description of Center (optional) </li> <li>Contact Person</li> <li>Contact Email</li> <li>Project PI (optional) </li> <li>PI Email (optional) </li> <li>Contact Webpage</li> <li>Center Webpage</li> </ul> </li> <br> <li>For more information on <span class="gse0">{{ glossary_dict.datagroup_term }}</span> roles, <a href="#help_overview_permission">click here</a> </li> </ul> </li> </ul> </div> </div> <div id="help_study_component_pointer"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">2. Review Study Components</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Review Study Components</h1> <span class="gse0">{{ glossary_dict.studycomponents_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To see a list and brief description of the <span class="gse0">{{ glossary_dict.studycomponent_term }}s,</span> <a href="#help_overview_components">click here</a> </li> <li>To learn more about adding some of the more complex <span class="gse0">{{ glossary_dict.studycomponent_term }}s,</span> <a href="#help_study_component">click here</a> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li> <span class="gse0">{{ glossary_dict.studycomponent_term }}s</span> can be added in various locations in the MPS-Db by clicking on the provided plus signs </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_add_study"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">3. Add a Study</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Add a Study</h1> A Study is <span class="gse0">{{ glossary_dict.study_def }}</span> <br><br> <ul class="list-unstyled"> <li>To add a Study: <ul class="help-filled-circle"> <li>Click on the <b>Add Study</b> button <ul class="help-open-circle"> <li>If the Study already exists, click the <b>View All Studies</b> option, then click on the <b>View/Edit</b> button next to the </li> </ul> </li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>You must be a registered user and be assigned to at least one <span class="gse0">{{ glossary_dict.datagroup_term }}</span> to add a Study </li> <li>Everything in the Study can be edited until the Study <span class="gse0">{{ glossary_dict.datagroupadministrator_term }}</span> signs off the Study (after sign-off, a Study is locked) </li> <li>Data contained in files attached as <span class="gse0">{{ glossary_dict.supportingdata_term }}</span> (as opposed to data uploaded into the database from files listed in the Data File Uploads or the Current Data Files) are not available for visualization, analysis, or used in calculations within the MPS-GUI </li> <li>To edit a Study, go to the Study of interest and click on the <b>Analyze/Edit</b> button and select <b>Edit This Study</b></li> <li>For an overview of the Study setup process, watch webinar 3, <a href="#video_demo_w3">Study Workflow and Data Entry in the MPS-Db - Dec 15, 20</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_study_detail"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">4. Enter Study Details</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Enter Study Details - Details Tab</h1> <span class="gse0">{{ glossary_dict.studydetails_def|linebreaks }}</span> <ul class="list-unstyled"> <li>Add the required information as follows: <ul class="help-filled-circle"> <li>Group – select a Data Group (the team performing the Study) </li> <li>Study Type – indicate the general purpose of the Study (one is required; check all that apply) </li> <li>Study Name – use an informative name (e.g., "Kidney-Liver Vitamin C Metabolism" is more informative than "Study-1") </li> <li>Start Date - start of experiment (typically the day the first cells are added to the <span class="gse0">{{ glossary_dict.device_term }}</span>) </li> <li>Description - informative description (purpose, methods, results)</li> <li>Use in <span class="gse0">{{ glossary_dict.compound_term }} Report</span> - checking this box tells the MPS-Db to use this <span class="gse0">{{ glossary_dict.studydetails_term }}</span> data in the <span class="gse0">{{ glossary_dict.compoundreport_term }}</span> feature </li> <li>Protocol File – a Word or pdf file containing the Study protocol</li> <li>Supporting Data - information about the Study that the <span class="gse0">{{ glossary_dict.dataprovider_term }}</span> wants to store with the study, but that is not captured anywhere else in the MPS-Db</li> <li>Image to Illustrate A Study – recommend a picture of the setup or an illustration of the experimental protocol</li> <!-- <li>For Integrated Chip Studies – select configuration if performing an integrated <b>Study</b> </li>--> <li>References - add references relating to the this Study </li> <li>Click the <b>Submit</b> button to save or the <b>Next</b> button to continue</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>Data contained in files attached as <span class="gse0">{{ glossary_dict.supportingdata_term }}</span> (as opposed to data uploaded into the database from files listed in the Data File Uploads or the Current Data Files) are not available for visualization, analysis, or used in calculations within the MPS-GUI </li> <li>For an overview of the Study setup process, watch webinar 3, <a href="#video_demo_w3">Study Workflow and Data Entry in the MPS-Db - Dec 15, 20</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_study_treatment_group"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">5. Make Study Treatment Groups</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Make Study Treatment Groups - Groups Tab</h1> <span class="gse0">{{ glossary_dict.studytreatmentgroup_def|linebreaks }}</span> <ul class="list-unstyled"> <li>Add the required information as follows: <ul class="help-filled-circle"> <li>Select an <span class="gse0">{{ glossary_dict.mpsmodel_term }}</span> </li> <li>Select an <span class="gse0">{{ glossary_dict.mpsmodelversion_term }}</span> (information about cells and settings will be pulled from the <span class="gse0">{{ glossary_dict.mpsmodelversion_term }}</span>, if available) </li> <li>Apply to the Group</li> <li>The Type is set based on the <span class="gse0">{{ glossary_dict.device_term }}</span> used in the <span class="gse0">{{ glossary_dict.mpsmodel_term }}</span> (plate or chip device) </li> <li>Enter the <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> Name </li> <li>Enter the Number of Chips in the <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> </li> <li>Change the Test Type for each <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span>, as needed </li> <li>Add compounds, additional cells, and additional settings by clicking on the <b>Add Compound</b>, <b>Add Cell</b>, or <b>Add Setting</b> button, respectively</li> <li>Click on the <b>Add Group</b> button or click the <b>Copy</b> button (in a Group) to make a new <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> </li> <li>Review differences between groups in the <b>Group Difference Display</b> table</li> <li>Click the <b>Submit</b> button to save or the <b>Next</b> button to continue</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>There are many options for the order of adding <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> (e.g., a <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> can be copied at any time as many times as needed) </li> <li>If an <span class="gse0">{{ glossary_dict.mpsmodelversion_term }}</span> has not been made and/or has not been populated correctly, cells and settings will not be automatically pulled into the <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> setup </li> <li>An <span class="gse0">{{ glossary_dict.mpsmodelversion_term }}</span> is a starting point for a <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> (if changes are made to cells, settings, and/or compounds, an <span class="gse0">{{ glossary_dict.mpsmodelversion_term }}</span> will no longer fully describe the condition of the chip) </li> <li>Treatment <span class="gse0">{{ glossary_dict.compound_term }}s</span> will need to be added as they are not part of the <span class="gse0">{{ glossary_dict.mpsmodelversion_term }}</span> (<span class="gse0">{{ glossary_dict.compound_term }}s</span> cannot be saved as part of a <span class="gse0">{{ glossary_dict.mpsmodelversion_term }}</span>) </li> <li>Chips are numbered sequentially, starting from 1 (these can be changed in the next step)</li> <li>Remove cells, settings, and/or <span class="gse0">{{ glossary_dict.compound_term }}s</span> by clicking the red X's (click on individual X's or, to remove a column, click on the red X in the column header, and to remove a row, click on the red X in the row label) </li> <li>Enter a <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> for each treatment condition (for wells in a plate and for chips) </li> <li> <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}s</span> will be applied to plates (if a plate device was selected) in subsequent steps </li> <li>For an overview the Study setup process, watch webinar 3, <a href="#video_demo_w3">Study Workflow and Data Entry in the MPS-Db - Dec 15, 20</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_chip_and_plate"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">6. Define Chips and Plates</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Define Chips and Plates Tabs (Study Items)</h1> <span class="gse0">{{ glossary_dict.studyitem_def|linebreaks }}</span> <br> <h1 class="h1-level-2">Define Chips and Plates - Chips Tab</h1> <ul class="list-unstyled"> <li>To edit chip names (optional): <ul class="help-filled-circle"> <li>Click on one of the Rename Chips By buttons (all or for a group)</li> <li>Fill out the popup form</li> <li>Click Apply</li> <li>Click the <b>Submit</b> button to save or the <b>Next</b> button to continue</li> </ul> </li> <br> <li>To edit chip <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> association (optional): <ul class="help-filled-circle"> <li>Click on the dropdown in the <b>Group</b> column</li> <li>Select a different <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> </li> <li>Click Apply</li> <li>Click the <b>Submit</b> button to save or the <b>Next</b> button to continue</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>Changes can be made to the names and the <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> in the same edit session</li> <li>A Chip Tab is displayed only if a device Type = Chip was selected in the Groups Tab</li> <li>This is all optional</li> <li>For an overview of the Study setup process, watch webinar 3, <a href="#video_demo_w3">Study Workflow and Data Entry in the MPS-Db - Dec 15, 20</a></li> </ul> </li> </ul> </li> </ul> <br> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-2">Define Chips and Plates - Plates Tab </h1> <ul class="list-unstyled"> <li>If one or more Type = Plate was selected in the Groups tab, wells must be added to a plate as follows (required): <ul class="help-filled-circle"> <li>Click the <b>Add Plate</b> button</li> <li>Fill in the plate Name</li> <li>Select the <span class="gse0">{{ glossary_dict.mpsmodel_term }}</span> </li> <li>Fill in a Well Prefix (optional)</li> <li>Drag in the plate over the wells to assign a treatment group</li> <li>Fill in the form and click the <b>Apply</b> button</li> <li>Rename all wells on the plate using an Apply Default button (optional) </li> <li>Click the <b>Submit</b> button to save or the <b>Next</b> button to continue</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>A Plate Tab is displayed only if a device Type = Plate was selected in the Groups Tab</li> <li>Add as many plates as needed</li> <li>A plate can contain one or more <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}s</span> </li> <li>A <span class="gse0">{{ glossary_dict.studytreatmentgroup_term }}</span> can span plates </li> <li>Well names must be unique to the Study, not to a plate (i.e., well A1 cannot exist on more than one plate in a Study - use a prefix like P1-A1 and P2-A1) </li> <li>For an overview of the Study setup process, watch webinar 3, <a href="#video_demo_w3">Study Workflow and Data Entry in the MPS-Db - Dec 15, 20</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_target_and_method"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">7. Add Assay Targets and Methods to a Study</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Add Assay Targets and Assay Methods to a Study - Assays Tab</h1> <span class="gse0">{{ glossary_dict.assaytarget_term }}</span> - <span class="gse0">{{ glossary_dict.assaytarget_def }}</span> <br><br> <span class="gse0">{{ glossary_dict.assaymethod_term }}</span> - <span class="gse0">{{ glossary_dict.assaymethod_def }}</span> <br><br> <ul class="list-unstyled"> <li>Add Assays to a Study as follows: <ul class="help-filled-circle"> <li>Click in the <span class="gse0">{{ glossary_dict.assaycategory_term }}</span> box and select an <span class="gse0">{{ glossary_dict.assaycategory_term }}</span> (optional, but narrows the choices of <span class="gse0">{{ glossary_dict.assaytarget_term }}s</span> and <span class="gse0">{{ glossary_dict.assaymethod_term }}s</span> if selected) </li> <li>Click in the <span class="gse0">{{ glossary_dict.assaytarget_term }}</span> box and select a <span class="gse0">{{ glossary_dict.assaytarget_term }}</span> </li> <li>Click in the <span class="gse0">{{ glossary_dict.assaymethod_term }}</span> box and select a <span class="gse0">{{ glossary_dict.assaymethod_term }}</span> </li> <li>Click in the <span class="gse0">{{ glossary_dict.readoutunit_term }}</span> and select the <span class="gse0">{{ glossary_dict.unit_term }}</span> to be used for uploading data </li> <li>Click the <b>Submit</b> button to save or the <b>Next</b> button to continue</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>All combinations of <span class="gse0">{{ glossary_dict.assaymethod_term }}</span>, <span class="gse0">{{ glossary_dict.assaytarget_term }}</span>, and <span class="gse0">{{ glossary_dict.unit_term }}</span> must be listed prior to uploading assay data </li> <li>For an overview of the Study setup process, watch webinar 3, <a href="#video_demo_w3">Study Workflow and Data Entry in the MPS-Db - Dec 15, 20</a></li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_data_upload"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">8. Upload Assay Data</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Upload Assay Data - Upload Data Tab</h1> There are multiple ways of uploading data into the MPS-Db, including: <br>1) uploading a <span class="gse0">{{ glossary_dict.mifc_term }}</span> file of processed assay data (non-omic), <br>2) uploading raw data exported from a plate reader, and <br>3) uploading omic formatted data in specific omic data format(s). <br><br> For an overview of setting up a study and adding all three types of data to the Study, watch webinar 3, <a href="#video_demo_w3">Study Workflow and Data Entry in the MPS-Db - Dec 15, 20</a>. <br><br> <div> <h1 class="h1-level-2">Processed MIF-C-a Format</h1> <span class="gse0">{{ glossary_dict.mpsdbimportfriendlycolumnar_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To add processed data in <span class="gse0">{{ glossary_dict.mifc_term }}</span>-a format: <ul class="help-filled-circle"> <li>Prepare a data file (<span class="gse0">{{ glossary_dict.mifc_term }}</span>-a) <ul class="help-open-circle"> <li>To get an example template file, <a href="{% url "assays-currentuploadtemplate" %}">click here</a> </li> </ul> </li> <li>Make sure that the <span class="gse0">{{ glossary_dict.assaymethod_term }}</span>, <span class="gse0">{{ glossary_dict.assaytarget_term }}</span>, <span class="gse0">{{ glossary_dict.unit_term }}</span>, and Chip and Well Ids all match, exactly, what was entered as part of the <span class="gse0">{{ glossary_dict.studyset_term }}up</span> </li> <li>In the Upload Data tab, click the button to add processed data files</li> <li>Follow online instructions</li> </ul> </li> <br> <li>Processed Data Help Notes: <ul class="help-filled-circle"> <li>The ONLY assay data that are editable in the MPS-GUI is the <b>Exclude</b> field (editable on the Study item edit page) </li> <li>Changes made to the <b>Exclude</b> field using the MPS-GUI will be lost when data are re-uploaded </li> <li>To replace assay data values with new values, remove the data file from the Current Data Files, then correct the values in the <span class="gse0">{{ glossary_dict.mifc_term }}</span>-a file and re-upload that file </li> <li>Chip and well Ids must be unique within a Study</li> <li>Each file (and each workbook if using Excel) should contain data for only one Study</li> <li>Data for one Study may be submitted in multiple files (and/or multiple tabs of an Excel workbook) </li> <li>If uploading an Excel workbook, a workbook can contain multiple tabs</li> <li>All files (or tabs) with correct headers (i.e. column names) will be evaluated for upload, others will be ignored</li> <li>Correct headers must be placed in one of the first three rows to be considered valid</li> </ul> </li> <button name="help_button" type="button" class="btn btn-success help-collapsible">More Details on the MIF-C File Format</button> <div class="help-content-2"> {% include "help_mifc_file_details_table.html" %} </div> </ul> </div> <br> <div> <h1 class="h1-level-2">Raw Plate Reader Data</h1> <span class="gse0">{{ glossary_dict.platereaderdata_def|linebreaks }}</span> Raw data, exported from a plate reader, can be added to the MPS-Db, processed, an added to the main Study using the <span class="gse0">{{ glossary_dict.platereaderdata_term }}</span> processing tool. The tool is available on the <a href="#help_data_upload">Upload Assay Data</a> tab of the add/edit Study page. <br><br>Using the <span class="gse0">{{ glossary_dict.platereaderdata_term }}</span> processing tool is a three-step process: <br>1) Add an <span class="gse0">{{ glossary_dict.assayplatemap_term }}</span>, <br>2) Upload a file exported from a plate reader and associate an <span class="gse0">{{ glossary_dict.assayplatemap_term }}</span> to the file, <br>3) Process/Calibrate the <span class="gse0">{{ glossary_dict.platereaderdata_term }}</span> and Send Averages to the Study Summary. <br><br> <ul class="list-unstyled"> <li>Step 1) To make a <span class="gse0">{{ glossary_dict.assayplatemap_term }}</span>: <ul class="help-filled-circle"> <li>In the Upload Data tab, click the button to add an <span class="gse0">{{ glossary_dict.assayplatemap_term }}</span> </li> <li>Click the <b>Add Plate Map</b> button</li> <li>Follow online instructions</li> <li>Click the <b>Submit</b> button to save</li> </ul> </li> <br> <li>Step 2) To add raw <span class="gse0">{{ glossary_dict.platereaderdata_term }}</span> exported from directly from a plate reader: <ul class="help-filled-circle"> <li>In the Upload Data tab, click the button to add raw <span class="gse0">{{ glossary_dict.platereaderdata_term }}</span> file <br> - or - <br> From the Assay Plate Map List page, click the <b>Assay Plate Reader File List</b> button </li> <li>Click the <b>Add Assay Plate Reader File</b> button</li> <li>Select a file</li> <li>Click the <b>Submit</b> button to the file</li> <li>Follow online instructions (do not forget to select an <span class="gse0">{{ glossary_dict.assayplatemap_term }}</span>) </li> <li>Click the <b>Submit</b> button to file selections</li> </ul> </li> <br> <li>Step 3) To process the raw data: <ul class="help-filled-circle"> <li>In the Upload Data tab, click the button to process or calibrate <span class="gse0">{{ glossary_dict.platereaderdata_term }}</span> <br> - or - <br> From the Assay Plate Reader File List page, click the <b>Assay Plate Map List</b> button </li> <li>Next to the plate map of interest, click the <b>Calibrate</b> button</li> <li>Follow online instructions</li> <li>To send data to the Study Summary, check the <b>Send Averages to Study Summary</b> box</li> <li>Click the <b>Submit</b> button to save changes, and, to send processed data to the Study Summary (occurs only if the box is checked)</li> </ul> </li> <br> <li>Raw Plate Reader Data Help Notes: <ul class="help-filled-circle"> <li>To see this tool demonstrated, watch the video <a href="#video_demo_8">Plate Reader Data Integration Tool</a> (this was recorded while still in development and there some differences from the current version of the MPS-Db) <li>The same <span class="gse0">{{ glossary_dict.assayplatemap_term }}</span> can be used for multiple files </li> <li>The <span class="gse0">{{ glossary_dict.assayplatemap_term }}'s</span> sample time can be overwritten when adding the <span class="gse0">{{ glossary_dict.assayplatemap_term }}</span> to a data file (in Step 2)</li> <li><span class="gse0">{{ glossary_dict.assayplatemap_term }}'s</span> that have been assigned to a <span class="gse0">{{ glossary_dict.platereaderdata_term }}</span> file are not editable </li> <li>To edit a <span class="gse0">{{ glossary_dict.assayplatemap_term }}</span>, make sure all <span class="gse0">{{ glossary_dict.platereaderdata_term }}</span> files have been detached from the <span class="gse0">{{ glossary_dict.assayplatemap_term }}</span> </li> </ul> </li> </ul> </div> <br> <div> <h1 class="h1-level-2">Omic Data</h1> <span class="gse0">{{ glossary_dict.omicdata_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To add <span class="gse0">{{ glossary_dict.omicdata_term }}</span> to the MPS-Db: <ul class="help-filled-circle"> <li>In the Upload Data tab, click the button to add omic data files</li> <li>Click the <b>Add Omic Data File</b> button</li> <li>Follow online instructions</li> <li>Click <b>Submit</b> to save</li> </ul> </li> <br> <li>Omic Data Help Notes: <ul class="help-filled-circle"> <li>From the Omic Data File Upload List, click the <b>Visualization</b> button to see the uploaded data</li> </ul> </li> </ul> </div> </li> </ul> </div> </div> <div id="help_image_video"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">9. Prepare Images and Videos</button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Prepare Images and Videos</h1> <span class="gse0">{{ glossary_dict.assayimagesandvideos_def }}</span> <br><br> <ul class="list-unstyled"> <li>To add images and/or videos: <ul class="help-filled-circle"> <li>Prepare the image/video file</li> <li>Prepare an image/video metadata file (<span class="gse0">{{ glossary_dict.mifc_term }}</span>-i) <ul class="help-open-circle"> <li>To get an example partial template file, <a href="{% url "assays-currentuploadtemplate" %}">click here</a> </li> </ul> <li>Contact an <span class="gse0">{{ glossary_dict.mpsdbadministrator_term }}</span> to make arrangements for submitting the files </li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>To see how images are display, review them in this public study <a href="https://mps.csb.pitt.edu/assays/assaystudy/135/images/">click here</a> </li> <li>To remove media files, contact an <span class="gse0">{{ glossary_dict.mpsdbadministrator_term }}</span> for assistance </li> </ul> </li> <button name="help_button" type="button" class="btn btn-success help-collapsible">More Details on the MIF-C File Format</button> <div class="help-content-2"> {% include "help_mifc_file_details_table.html" %} </div> </ul> </li> </ul> </div> </div> <div id="help_flags_and_notes"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">10. Validation - Flags and Notes (optional) </button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Validation, Flags and Notes (optional) </h1> To facilitate data review and validation, the database offers the option to flag and add notes to a 1) Study, 2) <span class="gse0">{{ glossary_dict.studyitem_term }}</span> (i.e. a chip or a well), and 3) plate. When a Study is flagged, a flag is display in the <b>Review</b> column for that Study in the Study list (the note is displayed as a hover tip). When a <span class="gse0">{{ glossary_dict.studyitem_term }}</span> is flagged, the flag is displayed in the <b>Review</b> column for that <span class="gse0">{{ glossary_dict.studyitem_term }}</span> in the <span class="gse0">{{ glossary_dict.studyitem_term }}</span> list. In addition, a <span class="gse0">{{ glossary_dict.studyitem_term }}</span> can be 'validated' (a check mark will show in the <b>Review</b> column for the <span class="gse0">{{ glossary_dict.studyitem_term }}</span> in the <span class="gse0">{{ glossary_dict.studyitem_term }}</span> list). <br><br> <h1 class="h1-level-2">Study Flags and Notes</h1> <ul class="list-unstyled"> <li>To add flags and or notes to a Study: <ul class="help-filled-circle"> <li>Go to the Study of interest</li> <li>Click the <b>Analyze/Edit</b> button</li> <li>Select the <b>Edit This Study</b> option</li> <li>Click on the <span class="glyphicon glyphicon-flag" aria-hidden="true"></span> at the bottom of the page (the Details Tab) </li> <li>Click on the <b>Notes</b> button to add a note (adding a note is optional)</li> <li>Click <b>Submit</b> to save</li> </ul> </li> </ul> <br> <h1 class="h1-level-2">Study Item Flags and Notes</h1> <ul class="list-unstyled"> <li>To add flags and or notes to a <span class="gse0">{{ glossary_dict.studyitem_term }}</span>: <ul class="help-filled-circle"> <li>Go to the Study of interest</li> <li>Scroll down to the <b>Chips and Wells</b> section of the page</li> <li>Click the <b>View/Edit</b> button for the <span class="gse0">{{ glossary_dict.studyitem_term }}</span> (chip or well) of interest </li> <li>Click on the <span class="glyphicon glyphicon-flag" aria-hidden="true"></span> at the bottom of the page </li> <li>Click on the <b>Notes</b> button to add a note (adding a note is optional)</li> <li>Click <b>Submit</b> to save</li> </ul> </li> </ul> <br> <h1 class="h1-level-2">Study Item Validation</h1> <ul class="list-unstyled"> <li>To add a validation check mark to a <span class="gse0">{{ glossary_dict.studyitem_term }}</span>: <ul class="help-filled-circle"> <li>Go to the Study of interest</li> <li>Scroll down to the <b>Chips and Wells</b> section of the page</li> <li>Click the <b>View/Edit</b> button for the <span class="gse0">{{ glossary_dict.studyitem_term }}</span> (chip or well) of interest </li> <li>Click on the <b>Click Here to Mark this Entry as Validated</b> button near the top of the page</li> <li>Click <b>Submit</b> to save</li> </ul> </li> </ul> <br> <ul class="list-unstyled"> <li>Help Notes: <ul class="help-filled-circle"> <li>Validation check marks, flags, and notes are visible to all users who have permission to view a Study</li> <li>Validation, flags, and notes can be used during the validation process, and removed prior to sharing a Study (i.e. <span class="gse0">{{ glossary_dict.studysignoff_term }}</span>) </li> <li> <span class="gse0">{{ glossary_dict.studyitem_term }}</span> validation is designed to be part of the <span class="gse0">{{ glossary_dict.dataprovider_term }}'s</span> QC process (it is optional and is not required to be completed prior to <span class="gse0">{{ glossary_dict.studysignoff_term }}</span>) </li> </ul> </li> </ul> </li> </ul> </div> </div> <div id="help_study_signoff"> <button name="help_button" type="button" class="btn btn-primary help-collapsible">11. Data Sharing (optional) </button> <div class="help-content-1"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Data Sharing (optional)</h1> The way data are shared is tied to the <span class="gse0">{{ glossary_dict.permissionstructure_term }}</span> used in the MPS-Db. For details on the <span class="gse0">{{ glossary_dict.permissionstructure_term }}</span> <a href="#help_overview_permission">click here</a>. <br><br> <span class="gse0">{{ glossary_dict.datagroupadministrator_term }}s</span> change data access by going to the <b>Study Overview</b> page, then clicking the <b>Sign Off/Permission</b> button, and selecting to: <br>1) Change Study Access (to add/change <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> and <span class="gse0">{{ glossary_dict.assaygroup_term }}s)</span> or <br>2) View/Edit Sign Off Status of this Study (to add/change the Release Date and <span class="gse0">{{ glossary_dict.studysignoff_term }}</span> a Study). <br><br> <div> <h1 class="h1-level-2">Change Study Access</h1> <span class="gse0">{{ glossary_dict.datagroupadministrator_term }}s</span> can assign <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> and/or <span class="gse0">{{ glossary_dict.accessgroup_term }}s</span> to a Study. <br><br> <ul class="list-unstyled"> <li>To add <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> and/or <span class="gse0">{{ glossary_dict.accessgroup_term }}s</span> to a Study: <ul class="help-filled-circle"> <li>Go to the Study of interest</li> <li>Click on the <b>Sign Off/Permission</b> button</li> <li>Select the <b>Change Study Access</b> option</li> <li>Add/Remove <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> and/or <span class="gse0">{{ glossary_dict.accessgroup_term }}s</span> </li> <li>Click the <b>Submit</b> button to save</li> </ul> </li> </ul> </div> <br> <div> <h1 class="h1-level-2">View/Edit Sign Off Status of this Study</h1> <span class="gse0">{{ glossary_dict.studysignoff_def|linebreaks }}</span> <ul class="list-unstyled"> <li>To sign-off a Study: <ul class="help-filled-circle"> <li>Go to the Study of interest</li> <li>Click on the <b>Sign Off/Permission</b> button</li> <li>Select the <b>View/Edit Sign Off Status of this Study</b> option</li> <li>Add a Release Date (if left null, Study will remain private unless part of the TCTC project)</li> <li>Add a note in the Notes box (optional)</li> <li>Click the <b>Click Here to Sign Off on this Study</b> button</li> <li>Click the <b>Submit</b> button to save</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li>For Studies associated with the TCTC project, <span class="gse0">{{ glossary_dict.studysignoff_term }}</span> starts an optional one year embargo period after which the Study will be open to the broader scientific community (publicly accessible) regardless of the Release Date provided </li> <li> <span class="gse0">{{ glossary_dict.studysignoff_term }}</span> is optional unless required by project funder </li> <li>During the <span class="gse0">{{ glossary_dict.studysignoff_term }}</span> process, notes can be added that will be displayed in the Study List when hovering over the check mark in the <b>Review</b> column</li> <li>To learn more about options for sharing data with selected colleagues prior to <span class="gse0">{{ glossary_dict.studysignoff_term }}</span>, see <a href="#help_collaborator_group">Collaborators</a> </li> <li>To learn more about options for sharing data with selected colleagues after <span class="gse0">{{ glossary_dict.studysignoff_term }}</span> and prior to the Release Date provided, see <a href="#help_access_group">Accessors</a> </li> <li>After <span class="gse0">{{ glossary_dict.studysignoff_term }}</span>, <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> will function like <span class="gse0">{{ glossary_dict.accessgroup_term }}s</span> (members of <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> will still be able to see the Study data) </li> <li> <span class="gse0">{{ glossary_dict.datagroupadministrator_term }}s</span> can change the <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> and/or <span class="gse0">{{ glossary_dict.accessgroup_term }}s</span> and/or the Release Date before AND after <span class="gse0">{{ glossary_dict.studysignoff_term }}</span> </li> <li>Change/Set the Release Date to the current date to open the Study on the following day</li> <li>If a needed <span class="gse0">{{ glossary_dict.datagroup_term }}</span> if not available in the list of <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> and/or <span class="gse0">{{ glossary_dict.accessgroup_term }}s</span>, contact an <span class="gse0">{{ glossary_dict.mpsdbadministrator_term }}</span> </li> </ul> </li> </ul> </div> </li> <li class="list-group-item"> <ul class="list-unstyled"> <button name="help_button" type="button" class="btn btn-success help-collapsible">Stakeholder Review (optional)</button> <div class="help-content-2"> <ul class="list-group"> <li class="list-group-item"> <h1 class="h1-level-1">Stakeholder Review</h1> <span class="gse0">{{ glossary_dict.stakeholder_def|linebreaks }}</span> Stakehold groups are managed by <span class="gse0">{{ glossary_dict.mpsdbadministrator_term }}s</span>, however, moving forward, <span class="gse0">{{ glossary_dict.dataprovider_term }}s</span> will manage access to their data using <span class="gse0">{{ glossary_dict.collaboratorgroup_term }}s</span> and <span class="gse0">{{ glossary_dict.accessgroup_term }}s</span>. <br><br> <ul class="list-unstyled"> <li>Follow these steps: <ul class="help-filled-circle"> <li>Login to the MPS-Db</li> <li>Go to the <b>Studies</b> tab/icon and click on the <b>View/Edit</b> button next to the Study of interest or <a href={{ glossary_dict.studylist_ref }}>click here</a> </li> <li>Look for studies with a check mark, but without an 'eye' or a 'pencil' in the <b>Review</b> column</li> <li>Click the <b>View/Edit</b> button next to the Study to review</li> <li>Click the <b>View/Edit Approval Status of this Study</b> button near the top of the page</li> <li>Add a Note (optional)</li> <li>Click the <b>Click Here to Approve this Study for Release</b> button</li> <li>Click Yes</li> <li>Click Submit</li> <li>Click Overwrite</li> </ul> </li> <br> <li>Help Notes: <ul class="help-filled-circle"> <li> <span class="gse0">{{ glossary_dict.dataprovider_term }}s</span> and/or project funders designate <span class="gse0">{{ glossary_dict.stakeholder_term }}s</span> </li> <li> Designating a <span class="gse0">{{ glossary_dict.stakeholder_term }}</span> is optional (unless required by the funder) </li> <li> <span class="gse0">{{ glossary_dict.stakeholder_term }}s</span> must be <span class="gse0">{{ glossary_dict.registeredmpsdbuser_term }}s</span> with permission to access to the Study data </li> </ul> </li> </ul> </li> </ul> </div> </ul> </li> </ul> </div> </div> </div> {% if user.is_superuser %} <div id="component_admin_section" class="stop-point"> <h1 class="h1-level-0">Information for MPS Database Administrators</h1> {% include "help_superuser_content.html" %} </div> {% endif %} </div> <div id="glossaryContents"> <div id="glossary" class="padded-bottom"> <h1 class="h1-level-0">Glossary</h1> <table hidden id="glossary_table" class="display table table-striped" cellspacing="0" width="100%"> <thead> <tr> <th>Term</th> <th>Definition</th> <th>Reference</th> <th>Get Help</th> {# letting the user see the help category is going to open up a can of worms (these are for HELP page function, not user display) #} <th>Primary Category</th> </tr> </thead> <tbody> {% for term in glossary %} <tr> <td><span class="gse1"> {{ term.term }} </span></td> <td><span class="gse1"> {{ term.definition|linebreaks }} </span></td> {# do this way for development**change-star #} {# {% if term.reference %}#} {# <td><span class="gse1">#} {# <a target="_blank" rel="noreferrer noopener" href={{ term.reference }}>#} {# <span class="glyphicon glyphicon-link"></span>#} {# </a>#} {# </span></td>#} {# {% else %}#} {# <td></td>#} {# {% endif %}#} {# do this way for production**change-star #} <td><span class="gse1"> {{ term.show_url }} </span></td> <td><span class="gse1"> {{ term.show_anchor }} </span></td> <td><span class="gse1"> {{ term.help_category_display }} </span></td> </tr> {% endfor %} </tbody> </table> </div> </div> </div> </div> </body> </html>
{ "content_hash": "cf93a2d85467c87dbca1d4515377510d", "timestamp": "", "source": "github", "line_count": 3520, "max_line_length": 590, "avg_line_length": 72.18125, "alnum_prop": 0.3790922472626516, "repo_name": "UPDDI/mps-database-server", "id": "139a9e372a2b6ab8ac46b7f88e700a08e02ee58a", "size": "254092", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "mps/templates/help.html", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "14194" }, { "name": "HTML", "bytes": "1128291" }, { "name": "JavaScript", "bytes": "701549" }, { "name": "Python", "bytes": "1735408" }, { "name": "Shell", "bytes": "1535" }, { "name": "TSQL", "bytes": "41508" } ], "symlink_target": "" }
package com.ShoppingCart.Project.springbootshoppingcart.shoppingcartappcontroller; import java.util.ArrayList; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import com.ShoppingCart.Project.springbootshoppingcart.piqcallbackhandler.piqtx.PiqTx; import com.ShoppingCart.Project.springbootshoppingcart.piqcallbackhandler.piqtx.service.PiqTxService; import com.ShoppingCart.Project.springbootshoppingcart.siteuser.SiteUser; import com.ShoppingCart.Project.springbootshoppingcart.siteuser.service.UserService; @Controller public class ViewController { @Autowired UserService userService; @Autowired PiqTxService piqTxService; @RequestMapping(value="/", method = RequestMethod.GET) public String homePage() { return "index"; } @RequestMapping(value="/about", method = RequestMethod.GET) public String about() { return "about"; } @RequestMapping(value="/contact", method = RequestMethod.GET) public String contact() { return "contact"; } //----------------------------------------- @RequestMapping(value="/managefunds", method = RequestMethod.GET) public String informationInputMapping(Model model, HttpServletRequest request,HttpServletResponse response) { SiteUser siteUser = userService.getCurrentSiteUser(); String merchantMid = "1992"; String sessionId = request.getSession().getId(); String piqCashierDepositUrl = "https://test-cashier.paymentiq.io:443/#/merchant/"+ merchantMid+ "/user/"+ siteUser.getUserId().toString()+ "/method/"+ "deposit?selectlastusedtxmethod=false&showconfirmation=false&showmenu=true&locale=en&container=iframe&iframeWidth=400&iframeHeight=700&sessionid="+ sessionId; String piqCashierWithdrawUrl = "https://test-cashier.paymentiq.io:443/#/merchant/"+ merchantMid+ "/user/"+ siteUser.getUserId().toString()+ "/method/"+ "withdrawal?selectlastusedtxmethod=false&showconfirmation=false&showmenu=true&locale=en&container=iframe&iframeWidth=400&iframeHeight=700&sessionid="+ sessionId; model.addAttribute("piqwithdrawurl", piqCashierWithdrawUrl); model.addAttribute("piqdepositurl", piqCashierDepositUrl); return "paymentpage"; } @RequestMapping(value="/txhistory", method = RequestMethod.GET) public String showTxHistory(Model model, HttpServletRequest request,HttpServletResponse response) { SiteUser siteUser = userService.getCurrentSiteUser(); ArrayList<PiqTx> txHistory = new ArrayList<PiqTx>(); txHistory = piqTxService.getTxHistory(siteUser.getUserId().toString()); model.addAttribute("txHistory", txHistory); return "txhistory"; } }
{ "content_hash": "78b9a6bfaad69acd732b9e7a3d7598d6", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 158, "avg_line_length": 29.801980198019802, "alnum_prop": 0.7491694352159468, "repo_name": "GabrielAcostaEngler/Shoppingcartproject-V2.0", "id": "7f0622129b7ab9cbc1756ccd61c6469b55992d08", "size": "3010", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Source/src/main/java/com/ShoppingCart/Project/springbootshoppingcart/shoppingcartappcontroller/ViewController.java", "mode": "33188", "license": "mit", "language": [ { "name": "Batchfile", "bytes": "4994" }, { "name": "CSS", "bytes": "4279" }, { "name": "HTML", "bytes": "9969" }, { "name": "Java", "bytes": "50764" }, { "name": "JavaScript", "bytes": "1290" }, { "name": "Shell", "bytes": "6468" } ], "symlink_target": "" }
<?php declare(strict_types=1); namespace Picodexter\ParameterEncryptionBundle\Tests\Console\Dispatcher; use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Picodexter\ParameterEncryptionBundle\Console\Dispatcher\EncryptDispatcher; use Picodexter\ParameterEncryptionBundle\Console\Helper\HiddenInputQuestionAskerGeneratorInterface; use Picodexter\ParameterEncryptionBundle\Console\Helper\QuestionAskerInterface; use Picodexter\ParameterEncryptionBundle\Console\Processor\EncryptProcessorInterface; use Picodexter\ParameterEncryptionBundle\Console\Request\EncryptRequest; use Picodexter\ParameterEncryptionBundle\Console\Request\EncryptRequestFactoryInterface; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class EncryptDispatcherTest extends TestCase { /** * @var EncryptDispatcher */ private $dispatcher; /** * @var EncryptProcessorInterface|MockObject */ private $processor; /** * @var HiddenInputQuestionAskerGeneratorInterface|MockObject */ private $questionAskerGenerator; /** * @var EncryptRequestFactoryInterface|MockObject */ private $requestFactory; /** * PHPUnit: setUp. */ public function setUp() { $this->processor = $this->createEncryptProcessorInterfaceMock(); $this->questionAskerGenerator = $this->createHiddenInputQuestionAskerGeneratorInterfaceMock(); $this->requestFactory = $this->createEncryptRequestFactoryInterfaceMock(); $this->dispatcher = new EncryptDispatcher( $this->requestFactory, $this->processor, $this->questionAskerGenerator ); } /** * PHPUnit: tearDown. */ public function tearDown() { $this->dispatcher = null; $this->requestFactory = null; $this->questionAskerGenerator = null; $this->processor = null; } public function testDispatchToProcessorSuccess() { $input = $this->createInputInterfaceMock(); $output = $this->createOutputInterfaceMock(); $request = $this->createEncryptRequestMock(); $questionAsker = $this->createQuestionAskerInterfaceMock(); $this->requestFactory->expects($this->once()) ->method('createEncryptRequest') ->will($this->returnValue($request)); $this->questionAskerGenerator->expects($this->once()) ->method('generateHiddenInputQuestionAsker') ->will($this->returnValue($questionAsker)); $this->processor->expects($this->once()) ->method('renderEncryptOutput') ->with( $this->identicalTo($request), $this->identicalTo($output) ); $this->dispatcher->dispatchToProcessor($input, $output); } /** * Create mock for EncryptProcessorInterface. * * @return EncryptProcessorInterface|MockObject */ private function createEncryptProcessorInterfaceMock() { return $this->getMockBuilder(EncryptProcessorInterface::class)->getMock(); } /** * Create mock for EncryptRequestFactoryInterface. * * @return EncryptRequestFactoryInterface|MockObject */ private function createEncryptRequestFactoryInterfaceMock() { return $this->getMockBuilder(EncryptRequestFactoryInterface::class)->getMock(); } /** * Create mock for EncryptRequest. * * @return EncryptRequest|MockObject */ private function createEncryptRequestMock() { return $this->getMockBuilder(EncryptRequest::class)->disableOriginalConstructor()->getMock(); } /** * Create mock for HiddenInputQuestionAskerGeneratorInterface. * * @return HiddenInputQuestionAskerGeneratorInterface|MockObject */ private function createHiddenInputQuestionAskerGeneratorInterfaceMock() { return $this->getMockBuilder(HiddenInputQuestionAskerGeneratorInterface::class)->getMock(); } /** * Create mock for InputInterface. * * @return InputInterface|MockObject */ private function createInputInterfaceMock() { return $this->getMockBuilder(InputInterface::class)->getMock(); } /** * Create mock for OutputInterface. * * @return OutputInterface|MockObject */ private function createOutputInterfaceMock() { return $this->getMockBuilder(OutputInterface::class)->getMock(); } /** * Create mock for QuestionAskerInterface. * * @return QuestionAskerInterface|MockObject */ private function createQuestionAskerInterfaceMock() { return $this->getMockBuilder(QuestionAskerInterface::class)->getMock(); } }
{ "content_hash": "5cc842fa8631deef0a9919c3ca34396b", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 102, "avg_line_length": 29.56441717791411, "alnum_prop": 0.6791865532268105, "repo_name": "picodexter/PcdxParameterEncryptionBundle", "id": "29aa3c8ab6268189a513a4d63b6517d7452ad478", "size": "5068", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Tests/Console/Dispatcher/EncryptDispatcherTest.php", "mode": "33188", "license": "mit", "language": [ { "name": "PHP", "bytes": "718821" } ], "symlink_target": "" }
<?php /** * XmlConnect tabs form element * * @category Mage * @package Mage_XmlConnect * @author Magento Core Team <core@magentocommerce.com> */ class Mage_XmlConnect_Block_Adminhtml_Mobile_Form_Element_Tabs extends Varien_Data_Form_Element_Text { /** * Generate application tabs html * * @return string */ public function getHtml() { if ((bool)Mage::getSingleton('adminhtml/session')->getNewApplication()) { return ''; } $blockClassName = Mage::getConfig()->getBlockClassName('adminhtml/template'); $block = Mage::getModel($blockClassName); $device = Mage::helper('xmlconnect')->getDeviceType(); if (array_key_exists($device, Mage::helper('xmlconnect')->getSupportedDevices())) { $template = 'xmlconnect/form/element/app_tabs_' . strtolower($device) . '.phtml'; } else { Mage::throwException($this->__('Device doesn\'t recognized. Unable to load a template.')); } $block->setTemplate($template); $tabs = Mage::getModel('xmlconnect/tabs', $this->getValue()); $block->setTabs($tabs); $block->setName($this->getName()); return $block->toHtml(); } }
{ "content_hash": "b8a9210e9dc047cbd7d6a0678f0ef3c3", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 102, "avg_line_length": 31.923076923076923, "alnum_prop": 0.6032128514056225, "repo_name": "portchris/NaturalRemedyCompany", "id": "283b4a6807227b2fbf658aa309451982f026b8a4", "size": "2184", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/app/code/core/Mage/XmlConnect/Block/Adminhtml/Mobile/Form/Element/Tabs.php", "mode": "33188", "license": "mit", "language": [ { "name": "ActionScript", "bytes": "20009" }, { "name": "Batchfile", "bytes": "1036" }, { "name": "CSS", "bytes": "2584823" }, { "name": "Dockerfile", "bytes": "828" }, { "name": "HTML", "bytes": "8762252" }, { "name": "JavaScript", "bytes": "2932806" }, { "name": "PHP", "bytes": "66466458" }, { "name": "PowerShell", "bytes": "1028" }, { "name": "Ruby", "bytes": "576" }, { "name": "Shell", "bytes": "40066" }, { "name": "XSLT", "bytes": "2135" } ], "symlink_target": "" }
import sqlite3 from datetime import datetime from pprint import pprint import sys import os from datetime import datetime import pickle import hk_new start_analysis_at = datetime.strptime('20120406','%Y%m%d') end_analysis_at = datetime.strptime('20120531','%Y%m%d') conn = sqlite3.connect('C:/projects/dbs/SP2_data.db') c = conn.cursor() c.execute('''CREATE TABLE if not exists SP2_coating_analysis( id INTEGER PRIMARY KEY AUTOINCREMENT, sp2b_file TEXT, file_index INT, instr TEXT, instr_locn TEXT, particle_type TEXT, particle_dia FLOAT, UTC_datetime TIMESTAMP, actual_scat_amp FLOAT, actual_peak_pos INT, FF_scat_amp FLOAT, FF_peak_pos INT, FF_gauss_width FLOAT, zeroX_to_peak FLOAT, LF_scat_amp FLOAT, incand_amp FLOAT, lag_time_fit_to_incand FLOAT, LF_baseline_pct_diff FLOAT, UNIQUE (sp2b_file, file_index, instr) )''') #**********parameters dictionary********** parameters = { 'acq_rate': 5000000, #date and time 'timezone':-8, #will be set by hk analysis 'avg_flow':120, #in vccm #parameter to find bad flow durations 'flow_min' : 115, 'flow_max' : 125, 'YAG_min' : 4, 'YAG_max' : 6, 'min_good_points' : 10, #show plots? 'show_plot':False, } data_dir = 'D:/2012/WHI_UBCSP2/Binary/' os.chdir(data_dir) for directory in os.listdir(data_dir): if os.path.isdir(directory) == True and directory.startswith('20'): folder_date = datetime.strptime(directory, '%Y%m%d') parameters['folder']= directory if folder_date >= start_analysis_at and folder_date <= end_analysis_at: parameters['directory']=os.path.abspath(directory) os.chdir(os.path.abspath(directory)) #*******HK ANALYSIS************ ##use for hk files with timestamp (this is for the UBCSP2 after 20120405) avg_flow = hk_new.find_bad_hk_durations(parameters) parameters['avg_flow'] = avg_flow #grab the pickled bad_durations file generated by the HK analysis for hk_file in os.listdir('.'): if hk_file.endswith('.hkpckl'): hk_data = open(hk_file, 'r') bad_durations = pickle.load(hk_data) hk_data.close() for row in bad_durations: duration_start = datetime.utcfromtimestamp(row[0]) duration_end = datetime.utcfromtimestamp(row[1]) print duration_start, duration_end os.chdir(data_dir) conn.close() #c.execute('''ALTER TABLE SP2_coating_analysis ADD COLUMN rbcmass FLOAT''') conn.close()
{ "content_hash": "4ac22a71486e761daad94d016a13bda9", "timestamp": "", "source": "github", "line_count": 105, "max_line_length": 76, "avg_line_length": 22.895238095238096, "alnum_prop": 0.6830282861896838, "repo_name": "annahs/atmos_research", "id": "98bb4c169488140869105af9d5557716122d54ed", "size": "2404", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "util_remove_records_from_bad_hk_durations_from_db.py", "mode": "33188", "license": "mit", "language": [ { "name": "Python", "bytes": "1677056" } ], "symlink_target": "" }
template <typename matType, typename vecType> static void test_mat_mul_vec(matType const& M, std::vector<vecType> const& I, std::vector<vecType>& O) { for (std::size_t i = 0, n = I.size(); i < n; ++i) O[i] = M * I[i]; } template <typename matType, typename vecType> static int launch_mat_mul_vec(std::vector<vecType>& O, matType const& Transform, vecType const& Scale, std::size_t Samples) { typedef typename matType::value_type T; std::vector<vecType> I(Samples); O.resize(Samples); for(std::size_t i = 0; i < Samples; ++i) I[i] = Scale * static_cast<T>(i); std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now(); test_mat_mul_vec<matType, vecType>(Transform, I, O); std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now(); return static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(t2 - t1).count()); } template <typename packedMatType, typename packedVecType, typename alignedMatType, typename alignedVecType> static int comp_mat2_mul_vec2(std::size_t Samples) { typedef typename packedMatType::value_type T; int Error = 0; packedMatType const Transform(1, 2, 3, 4); packedVecType const Scale(0.01, 0.02); std::vector<packedVecType> SISD; printf("- SISD: %d us\n", launch_mat_mul_vec<packedMatType, packedVecType>(SISD, Transform, Scale, Samples)); std::vector<alignedVecType> SIMD; printf("- SIMD: %d us\n", launch_mat_mul_vec<alignedMatType, alignedVecType>(SIMD, Transform, Scale, Samples)); for(std::size_t i = 0; i < Samples; ++i) { packedVecType const A = SISD[i]; packedVecType const B = packedVecType(SIMD[i]); Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1; } return Error; } template <typename packedMatType, typename packedVecType, typename alignedMatType, typename alignedVecType> static int comp_mat3_mul_vec3(std::size_t Samples) { typedef typename packedMatType::value_type T; int Error = 0; packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9); packedVecType const Scale(0.01, 0.02, 0.05); std::vector<packedVecType> SISD; printf("- SISD: %d us\n", launch_mat_mul_vec<packedMatType, packedVecType>(SISD, Transform, Scale, Samples)); std::vector<alignedVecType> SIMD; printf("- SIMD: %d us\n", launch_mat_mul_vec<alignedMatType, alignedVecType>(SIMD, Transform, Scale, Samples)); for(std::size_t i = 0; i < Samples; ++i) { packedVecType const A = SISD[i]; packedVecType const B = SIMD[i]; Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1; } return Error; } template <typename packedMatType, typename packedVecType, typename alignedMatType, typename alignedVecType> static int comp_mat4_mul_vec4(std::size_t Samples) { typedef typename packedMatType::value_type T; int Error = 0; packedMatType const Transform(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16); packedVecType const Scale(0.01, 0.02, 0.03, 0.05); std::vector<packedVecType> SISD; printf("- SISD: %d us\n", launch_mat_mul_vec<packedMatType, packedVecType>(SISD, Transform, Scale, Samples)); std::vector<alignedVecType> SIMD; printf("- SIMD: %d us\n", launch_mat_mul_vec<alignedMatType, alignedVecType>(SIMD, Transform, Scale, Samples)); for(std::size_t i = 0; i < Samples; ++i) { packedVecType const A = SISD[i]; packedVecType const B = SIMD[i]; Error += glm::all(glm::equal(A, B, static_cast<T>(0.001))) ? 0 : 1; } return Error; } int main() { std::size_t const Samples = 100000; int Error = 0; printf("mat2 * vec2:\n"); Error += comp_mat2_mul_vec2<glm::mat2, glm::vec2, glm::aligned_mat2, glm::aligned_vec2>(Samples); printf("dmat2 * dvec2:\n"); Error += comp_mat2_mul_vec2<glm::dmat2, glm::dvec2,glm::aligned_dmat2, glm::aligned_dvec2>(Samples); printf("mat3 * vec3:\n"); Error += comp_mat3_mul_vec3<glm::mat3, glm::vec3, glm::aligned_mat3, glm::aligned_vec3>(Samples); printf("dmat3 * dvec3:\n"); Error += comp_mat3_mul_vec3<glm::dmat3, glm::dvec3, glm::aligned_dmat3, glm::aligned_dvec3>(Samples); printf("mat4 * vec4:\n"); Error += comp_mat4_mul_vec4<glm::mat4, glm::vec4, glm::aligned_mat4, glm::aligned_vec4>(Samples); printf("dmat4 * dvec4:\n"); Error += comp_mat4_mul_vec4<glm::dmat4, glm::dvec4, glm::aligned_dmat4, glm::aligned_dvec4>(Samples); return Error; } #else int main() { return 0; } #endif
{ "content_hash": "c4084f6bef5bc8c43ecee4484c147cd1", "timestamp": "", "source": "github", "line_count": 138, "max_line_length": 123, "avg_line_length": 31.63768115942029, "alnum_prop": 0.6864406779661016, "repo_name": "jlukacs/aqua", "id": "3dc9d74c2c35f214fb16396a01994e512e8c06ad", "size": "4871", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "lib/glm/test/perf/perf_matrix_mul_vector.cpp", "mode": "33188", "license": "mit", "language": [ { "name": "Ada", "bytes": "89079" }, { "name": "Assembly", "bytes": "138199" }, { "name": "Batchfile", "bytes": "10385" }, { "name": "C", "bytes": "1793320" }, { "name": "C#", "bytes": "54013" }, { "name": "C++", "bytes": "16282798" }, { "name": "CMake", "bytes": "307574" }, { "name": "COBOL", "bytes": "2921725" }, { "name": "CSS", "bytes": "30394" }, { "name": "D", "bytes": "175405" }, { "name": "DIGITAL Command Language", "bytes": "901" }, { "name": "GLSL", "bytes": "5111" }, { "name": "HLSL", "bytes": "620" }, { "name": "HTML", "bytes": "15024192" }, { "name": "Inno Setup", "bytes": "7722" }, { "name": "Java", "bytes": "311787" }, { "name": "JavaScript", "bytes": "285639" }, { "name": "M4", "bytes": "19880" }, { "name": "Makefile", "bytes": "20288" }, { "name": "Objective-C", "bytes": "112041" }, { "name": "Objective-C++", "bytes": "29142" }, { "name": "Pascal", "bytes": "55467" }, { "name": "Python", "bytes": "601980" }, { "name": "RPC", "bytes": "2952312" }, { "name": "Roff", "bytes": "3323" }, { "name": "Ruby", "bytes": "4830" }, { "name": "ShaderLab", "bytes": "718" }, { "name": "Shell", "bytes": "22444" }, { "name": "Smarty", "bytes": "169" }, { "name": "UnrealScript", "bytes": "1273" } ], "symlink_target": "" }
namespace OrdersSystem.Services { using System; using System.Linq; using Data.Repository; using OrdersSystem.Models; using OrdersSystem.Services.Contracts; public class CustomersServices : ICustomersServices { private IRepository<Customer> customers; public CustomersServices(IRepository<Customer> customers) { this.customers = customers; } public Customer Add(Customer customer) { this.customers.Add(customer); this.customers.SaveChanges(); return customer; } public void Delete(int id) { this.customers.Delete(id); this.customers.SaveChanges(); } public IQueryable<Customer> GetAll() { return this.customers.All().OrderBy(x => x.Name); } public Customer Update(int id, Customer customer) { var customerToUpdate = this.customers.GetById(id); customerToUpdate.Name = customer.Name; customerToUpdate.Address = customer.Address; this.customers.SaveChanges(); return customerToUpdate; } } }
{ "content_hash": "91a41477e085943d45ee17d97849769b", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 65, "avg_line_length": 25.5531914893617, "alnum_prop": 0.5903413821815154, "repo_name": "petyodelta/ASP-NET-MVC", "id": "9548bf5832101b303dd9e288fafec6527cf76eaf", "size": "1203", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "Orders/OrdersSystem/Services/OrdersSystem.Services/CustomersServices.cs", "mode": "33188", "license": "mit", "language": [ { "name": "ASP", "bytes": "107" }, { "name": "C#", "bytes": "236299" }, { "name": "CSS", "bytes": "118879" }, { "name": "HTML", "bytes": "5127" }, { "name": "JavaScript", "bytes": "35942" } ], "symlink_target": "" }
package org.apache.hadoop.mapred; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.LinkedHashMap; import java.util.TreeMap; import java.util.jar.JarOutputStream; import java.util.zip.ZipEntry; import junit.framework.TestCase; import org.junit.Ignore; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.filecache.TrackerDistributedCacheManager; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileUtil; import org.apache.hadoop.fs.LocalDirAllocator; import org.apache.hadoop.fs.Path; import org.apache.hadoop.mapred.JvmManager.JvmEnv; import org.apache.hadoop.mapred.QueueManager.QueueACL; import org.apache.hadoop.mapred.TaskTracker.RunningJob; import org.apache.hadoop.mapred.TaskTracker.TaskInProgress; import org.apache.hadoop.mapred.UtilsForTests.InlineCleanupQueue; import org.apache.hadoop.mapreduce.JobContext; import org.apache.hadoop.mapreduce.security.TokenCache; import org.apache.hadoop.mapreduce.server.tasktracker.Localizer; import org.apache.hadoop.security.Credentials; import org.apache.hadoop.security.UserGroupInformation; import org.apache.hadoop.util.Shell; /** * Test to verify localization of a job and localization of a task on a * TaskTracker. * */ @Ignore // test relies on deprecated functionality/lifecycle public class TestTaskTrackerLocalization extends TestCase { private File TEST_ROOT_DIR; private File ROOT_MAPRED_LOCAL_DIR; private File HADOOP_LOG_DIR; private int numLocalDirs = 6; private static final Log LOG = LogFactory.getLog(TestTaskTrackerLocalization.class); protected TaskTracker tracker; protected UserGroupInformation taskTrackerUGI; protected TaskController taskController; protected JobConf trackerFConf; private JobConf localizedJobConf; protected JobID jobId; protected TaskAttemptID taskId; protected Task task; protected String[] localDirs; protected static LocalDirAllocator lDirAlloc = new LocalDirAllocator("mapred.local.dir"); protected Path attemptWorkDir; protected File[] attemptLogFiles; protected JobConf localizedTaskConf; private TaskInProgress tip; private JobConf jobConf; private File jobConfFile; /** * Dummy method in this base class. Only derived classes will define this * method for checking if a test can be run. */ protected boolean canRun() { return true; } @Override protected void setUp() throws Exception { if (!canRun()) { return; } TEST_ROOT_DIR = new File(System.getProperty("test.build.data", "/tmp"), getClass() .getSimpleName()); if (!TEST_ROOT_DIR.exists()) { TEST_ROOT_DIR.mkdirs(); } ROOT_MAPRED_LOCAL_DIR = new File(TEST_ROOT_DIR, "mapred/local"); ROOT_MAPRED_LOCAL_DIR.mkdirs(); HADOOP_LOG_DIR = new File(TEST_ROOT_DIR, "logs"); HADOOP_LOG_DIR.mkdir(); System.setProperty("hadoop.log.dir", HADOOP_LOG_DIR.getAbsolutePath()); trackerFConf = new JobConf(); trackerFConf.set("fs.default.name", "file:///"); localDirs = new String[numLocalDirs]; for (int i = 0; i < numLocalDirs; i++) { localDirs[i] = new File(ROOT_MAPRED_LOCAL_DIR, "0_" + i).getPath(); } trackerFConf.setStrings("mapred.local.dir", localDirs); trackerFConf.setBoolean(JobConf.MR_ACLS_ENABLED, true); // Create the job configuration file. Same as trackerConf in this test. jobConf = new JobConf(trackerFConf); // Set job view ACLs in conf sothat validation of contents of jobACLsFile // can be done against this value. Have both users and groups String jobViewACLs = "user1,user2, group1,group2"; jobConf.set(JobContext.JOB_ACL_VIEW_JOB, jobViewACLs); jobConf.setInt("mapred.userlog.retain.hours", 0); jobConf.setUser(getJobOwner().getShortUserName()); // set job queue name in job conf String queue = "default"; jobConf.setQueueName(queue); // Set queue admins acl in job conf similar to what JobClient does jobConf.set(QueueManager.toFullPropertyName(queue, QueueACL.ADMINISTER_JOBS.getAclName()), "qAdmin1,qAdmin2 qAdminsGroup1,qAdminsGroup2"); String jtIdentifier = "200907202331"; jobId = new JobID(jtIdentifier, 1); // JobClient uploads the job jar to the file system and sets it in the // jobConf. uploadJobJar(jobConf); // JobClient uploads the jobConf to the file system. jobConfFile = uploadJobConf(jobConf); // create jobTokens file uploadJobTokensFile(); taskTrackerUGI = UserGroupInformation.getCurrentUser(); startTracker(); // Set up the task to be localized taskId = new TaskAttemptID(jtIdentifier, jobId.getId(), true, 1, 0); createTask(); // mimic register task // create the tip tip = tracker.new TaskInProgress(task, trackerFConf); } private void startTracker() throws IOException { // Set up the TaskTracker tracker = new TaskTracker(); tracker.setConf(trackerFConf); tracker.setUserLogManager(new UtilsForTests.InLineUserLogManager( trackerFConf)); initializeTracker(); } private void initializeTracker() throws IOException { tracker.setIndexCache(new IndexCache(trackerFConf)); tracker.setTaskMemoryManagerEnabledFlag(); // for test case system FS is the local FS tracker.systemFS = FileSystem.getLocal(trackerFConf); tracker.systemDirectory = new Path(TEST_ROOT_DIR.getAbsolutePath()); tracker.setLocalFileSystem(tracker.systemFS); tracker.runningTasks = new LinkedHashMap<TaskAttemptID, TaskInProgress>(); tracker.runningJobs = new TreeMap<JobID, RunningJob>(); trackerFConf.deleteLocalFiles(TaskTracker.SUBDIR); // setup task controller taskController = getTaskController(); taskController.setConf(trackerFConf); taskController.setup(lDirAlloc); tracker.setTaskController(taskController); tracker.setLocalizer(new Localizer(tracker.getLocalFileSystem(),localDirs)); } protected TaskController getTaskController() { return new DefaultTaskController(); } private void createTask() throws IOException { task = new MapTask(jobConfFile.toURI().toString(), taskId, 1, null, 1); task.setConf(jobConf); // Set conf. Set user name in particular. task.setUser(jobConf.getUser()); } protected UserGroupInformation getJobOwner() throws IOException { return UserGroupInformation.getCurrentUser(); } /** * @param jobConf * @throws IOException * @throws FileNotFoundException */ private void uploadJobJar(JobConf jobConf) throws IOException, FileNotFoundException { File jobJarFile = new File(TEST_ROOT_DIR, "jobjar-on-dfs.jar"); JarOutputStream jstream = new JarOutputStream(new FileOutputStream(jobJarFile)); ZipEntry ze = new ZipEntry("lib/lib1.jar"); jstream.putNextEntry(ze); jstream.closeEntry(); ze = new ZipEntry("lib/lib2.jar"); jstream.putNextEntry(ze); jstream.closeEntry(); jstream.finish(); jstream.close(); jobConf.setJar(jobJarFile.toURI().toString()); } /** * @param jobConf * @return * @throws FileNotFoundException * @throws IOException */ protected File uploadJobConf(JobConf jobConf) throws FileNotFoundException, IOException { File jobConfFile = new File(TEST_ROOT_DIR, "jobconf-on-dfs.xml"); FileOutputStream out = new FileOutputStream(jobConfFile); jobConf.writeXml(out); out.close(); return jobConfFile; } /** * create fake JobTokens file * @return * @throws IOException */ protected void uploadJobTokensFile() throws IOException { File dir = new File(TEST_ROOT_DIR, jobId.toString()); if(!dir.exists()) assertTrue("faild to create dir="+dir.getAbsolutePath(), dir.mkdirs()); // writing empty file, we don't need the keys for this test new Credentials().writeTokenStorageFile(new Path("file:///" + dir, TokenCache.JOB_TOKEN_HDFS_FILE), new Configuration()); } @Override protected void tearDown() throws Exception { if (!canRun()) { return; } FileUtil.fullyDelete(TEST_ROOT_DIR); } protected static String[] getFilePermissionAttrs(String path) throws IOException { String output = Shell.execCommand("stat", path, "-c", "%A:%U:%G"); return output.split(":|\n"); } static void checkFilePermissions(String path, String expectedPermissions, String expectedOwnerUser, String expectedOwnerGroup) throws IOException { String[] attrs = getFilePermissionAttrs(path); assertTrue("File attrs length is not 3 but " + attrs.length, attrs.length == 3); assertTrue("Path " + path + " has the permissions " + attrs[0] + " instead of the expected " + expectedPermissions, attrs[0] .equals(expectedPermissions)); assertTrue("Path " + path + " is user owned not by " + expectedOwnerUser + " but by " + attrs[1], attrs[1].equals(expectedOwnerUser)); assertTrue("Path " + path + " is group owned not by " + expectedOwnerGroup + " but by " + attrs[2], attrs[2].equals(expectedOwnerGroup)); } /** * Verify the task-controller's setup functionality * * @throws IOException */ public void testTaskControllerSetup() throws IOException { if (!canRun()) { return; } // Task-controller is already set up in the test's setup method. Now verify. for (String localDir : localDirs) { // Verify the local-dir itself. File lDir = new File(localDir); assertTrue("localDir " + lDir + " doesn't exists!", lDir.exists()); checkFilePermissions(lDir.getAbsolutePath(), "drwxr-xr-x", task .getUser(), taskTrackerUGI.getGroupNames()[0]); } // Verify the pemissions on the userlogs dir File taskLog = TaskLog.getUserLogDir(); checkFilePermissions(taskLog.getAbsolutePath(), "drwxr-xr-x", task .getUser(), taskTrackerUGI.getGroupNames()[0]); } /** * Test the localization of a user on the TT. * * @throws IOException */ public void testUserLocalization() throws IOException { if (!canRun()) { return; } // /////////// The main method being tested tracker.getLocalizer().initializeUserDirs(task.getUser()); // /////////// // Check the directory structure and permissions checkUserLocalization(); // For the sake of testing re-entrancy of initializeUserDirs(), we remove // the user directories now and make sure that further calls of the method // don't create directories any more. for (String dir : localDirs) { File userDir = new File(dir, TaskTracker.getUserDir(task.getUser())); if (!FileUtil.fullyDelete(userDir)) { throw new IOException("Uanble to delete " + userDir); } } // Now call the method again. tracker.getLocalizer().initializeUserDirs(task.getUser()); // Files should not be created now and so shouldn't be there anymore. for (String dir : localDirs) { File userDir = new File(dir, TaskTracker.getUserDir(task.getUser())); assertFalse("Unexpectedly, user-dir " + userDir.getAbsolutePath() + " exists!", userDir.exists()); } } protected void checkUserLocalization() throws IOException { for (String dir : localDirs) { File localDir = new File(dir); assertTrue("mapred.local.dir " + localDir + " isn'task created!", localDir.exists()); File taskTrackerSubDir = new File(localDir, TaskTracker.SUBDIR); assertTrue("taskTracker sub-dir in the local-dir " + localDir + "is not created!", taskTrackerSubDir.exists()); File userDir = new File(taskTrackerSubDir, task.getUser()); assertTrue("user-dir in taskTrackerSubdir " + taskTrackerSubDir + "is not created!", userDir.exists()); checkFilePermissions(userDir.getAbsolutePath(), "drwx------", task .getUser(), taskTrackerUGI.getGroupNames()[0]); File jobCache = new File(userDir, TaskTracker.JOBCACHE); assertTrue("jobcache in the userDir " + userDir + " isn't created!", jobCache.exists()); checkFilePermissions(jobCache.getAbsolutePath(), "drwx------", task .getUser(), taskTrackerUGI.getGroupNames()[0]); // Verify the distributed cache dir. File distributedCacheDir = new File(localDir, TaskTracker .getPrivateDistributedCacheDir(task.getUser())); assertTrue("distributed cache dir " + distributedCacheDir + " doesn't exists!", distributedCacheDir.exists()); checkFilePermissions(distributedCacheDir.getAbsolutePath(), "drwx------", task.getUser(), taskTrackerUGI.getGroupNames()[0]); } } /** * Test job localization on a TT. Tests localization of job.xml, job.jar and * corresponding setting of configuration. Also test * {@link TaskController#initializeJob(JobInitializationContext)} * * @throws IOException */ public void testJobLocalization() throws Exception { if (!canRun()) { return; } TaskTracker.RunningJob rjob = tracker.localizeJob(tip); localizedJobConf = rjob.getJobConf(); checkJobLocalization(); } /** * Test that, if the job log dir can't be created, the job will fail * during localization rather than at the time when the task itself * tries to write into it. */ public void testJobLocalizationFailsIfLogDirUnwritable() throws Exception { if (!canRun()) { return; } File logDir = TaskLog.getJobDir(jobId); File logDirParent = logDir.getParentFile(); try { assertTrue(logDirParent.mkdirs() || logDirParent.isDirectory()); FileUtil.fullyDelete(logDir); FileUtil.chmod(logDirParent.getAbsolutePath(), "000"); tracker.localizeJob(tip); fail("No exception"); } catch (IOException ioe) { LOG.info("Got exception", ioe); assertTrue(ioe.getMessage().contains("Could not create job user log")); } finally { // Put it back just to be safe FileUtil.chmod(logDirParent.getAbsolutePath(), "755"); } } protected void checkJobLocalization() throws IOException { // Check the directory structure for (String dir : localDirs) { File localDir = new File(dir); File taskTrackerSubDir = new File(localDir, TaskTracker.SUBDIR); File userDir = new File(taskTrackerSubDir, task.getUser()); File jobCache = new File(userDir, TaskTracker.JOBCACHE); File jobDir = new File(jobCache, jobId.toString()); assertTrue("job-dir in " + jobCache + " isn't created!", jobDir.exists()); // check the private permissions on the job directory checkFilePermissions(jobDir.getAbsolutePath(), "drwx------", task .getUser(), taskTrackerUGI.getGroupNames()[0]); } // check the localization of job.xml assertTrue("job.xml is not localized on this TaskTracker!!", lDirAlloc .getLocalPathToRead(TaskTracker.getLocalJobConfFile(task.getUser(), jobId.toString()), trackerFConf) != null); // check the localization of job.jar Path jarFileLocalized = lDirAlloc.getLocalPathToRead(TaskTracker.getJobJarFile(task.getUser(), jobId.toString()), trackerFConf); assertTrue("job.jar is not localized on this TaskTracker!!", jarFileLocalized != null); assertTrue("lib/lib1.jar is not unjarred on this TaskTracker!!", new File( jarFileLocalized.getParent() + Path.SEPARATOR + "lib/lib1.jar") .exists()); assertTrue("lib/lib2.jar is not unjarred on this TaskTracker!!", new File( jarFileLocalized.getParent() + Path.SEPARATOR + "lib/lib2.jar") .exists()); // check the creation of job work directory assertTrue("job-work dir is not created on this TaskTracker!!", lDirAlloc .getLocalPathToRead(TaskTracker.getJobWorkDir(task.getUser(), jobId .toString()), trackerFConf) != null); // Check the setting of job.local.dir and job.jar which will eventually be // used by the user's task boolean jobLocalDirFlag = false, mapredJarFlag = false; String localizedJobLocalDir = localizedJobConf.get(TaskTracker.JOB_LOCAL_DIR); String localizedJobJar = localizedJobConf.getJar(); for (String localDir : localizedJobConf.getStrings("mapred.local.dir")) { if (localizedJobLocalDir.equals(localDir + Path.SEPARATOR + TaskTracker.getJobWorkDir(task.getUser(), jobId.toString()))) { jobLocalDirFlag = true; } if (localizedJobJar.equals(localDir + Path.SEPARATOR + TaskTracker.getJobJarFile(task.getUser(), jobId.toString()))) { mapredJarFlag = true; } } assertTrue(TaskTracker.JOB_LOCAL_DIR + " is not set properly to the target users directory : " + localizedJobLocalDir, jobLocalDirFlag); assertTrue( "mapred.jar is not set properly to the target users directory : " + localizedJobJar, mapredJarFlag); // check job user-log directory permissions File jobLogDir = TaskLog.getJobDir(jobId); assertTrue("job log directory " + jobLogDir + " does not exist!", jobLogDir .exists()); checkFilePermissions(jobLogDir.toString(), "drwx------", task.getUser(), taskTrackerUGI.getGroupNames()[0]); // Make sure that the job ACLs file job-acls.xml exists in job userlog dir File jobACLsFile = new File(jobLogDir, TaskTracker.jobACLsFile); assertTrue("JobACLsFile is missing in the job userlog dir " + jobLogDir, jobACLsFile.exists()); // With default task controller, the job-acls.xml file is owned by TT and // permissions are 700 checkFilePermissions(jobACLsFile.getAbsolutePath(), "-rwx------", taskTrackerUGI.getShortUserName(), taskTrackerUGI.getGroupNames()[0]); validateJobACLsFileContent(); } // Validate the contents of jobACLsFile ( i.e. user name, job-view-acl, queue // name and queue-admins-acl ). protected void validateJobACLsFileContent() { JobConf jobACLsConf = TaskLogServlet.getConfFromJobACLsFile(jobId); assertTrue(jobACLsConf.get("user.name").equals( localizedJobConf.getUser())); assertTrue(jobACLsConf.get(JobContext.JOB_ACL_VIEW_JOB). equals(localizedJobConf.get(JobContext.JOB_ACL_VIEW_JOB))); String queue = localizedJobConf.getQueueName(); assertTrue(queue.equalsIgnoreCase(jobACLsConf.getQueueName())); String qACLName = QueueManager.toFullPropertyName(queue, QueueACL.ADMINISTER_JOBS.getAclName()); assertTrue(jobACLsConf.get(qACLName).equals( localizedJobConf.get(qACLName))); } /** * Test task localization on a TT. * * @throws IOException */ public void testTaskLocalization() throws Exception { if (!canRun()) { return; } TaskTracker.RunningJob rjob = tracker.localizeJob(tip); localizedJobConf = rjob.getJobConf(); initializeTask(); checkTaskLocalization(); } protected void checkTaskLocalization() throws IOException { // Make sure that the mapred.local.dir is sandboxed for (String childMapredLocalDir : localizedTaskConf .getStrings("mapred.local.dir")) { assertTrue("Local dir " + childMapredLocalDir + " is not sandboxed !!", childMapredLocalDir.endsWith(TaskTracker.getLocalTaskDir(task .getUser(), jobId.toString(), taskId.toString(), task.isTaskCleanupTask()))); } // Make sure task task.getJobFile is changed and pointed correctly. assertTrue(task.getJobFile().endsWith( TaskTracker.getTaskConfFile(task.getUser(), jobId.toString(), taskId .toString(), task.isTaskCleanupTask()))); // Make sure that the tmp directories are created assertTrue("tmp dir is not created in workDir " + attemptWorkDir.toUri().getPath(), new File(attemptWorkDir.toUri() .getPath(), "tmp").exists()); // Make sure that the logs are setup properly File logDir = TaskLog.getAttemptDir(taskId, task.isTaskCleanupTask()); assertTrue("task's log dir " + logDir.toString() + " doesn't exist!", logDir.exists()); checkFilePermissions(logDir.getAbsolutePath(), "drwx------", task .getUser(), taskTrackerUGI.getGroupNames()[0]); File expectedStdout = new File(logDir, TaskLog.LogName.STDOUT.toString()); assertTrue("stdout log file is improper. Expected : " + expectedStdout.toString() + " Observed : " + attemptLogFiles[0].toString(), expectedStdout.toString().equals( attemptLogFiles[0].toString())); File expectedStderr = new File(logDir, Path.SEPARATOR + TaskLog.LogName.STDERR.toString()); assertTrue("stderr log file is improper. Expected : " + expectedStderr.toString() + " Observed : " + attemptLogFiles[1].toString(), expectedStderr.toString().equals( attemptLogFiles[1].toString())); } /** * Create a file in the given dir and set permissions r_xr_xr_x sothat no one * can delete it directly(without doing chmod). * Creates dir/subDir and dir/subDir/file */ static void createFileAndSetPermissions(JobConf jobConf, Path dir) throws IOException { Path subDir = new Path(dir, "subDir"); FileSystem fs = FileSystem.getLocal(jobConf); fs.mkdirs(subDir); Path p = new Path(subDir, "file"); java.io.DataOutputStream out = fs.create(p); out.writeBytes("dummy input"); out.close(); // no write permission for subDir and subDir/file int ret = 0; try { if((ret = FileUtil.chmod(subDir.toUri().getPath(), "a=rx", true)) != 0) { LOG.warn("chmod failed for " + subDir + ";retVal=" + ret); } } catch (InterruptedException ie) { // This exception is never actually thrown, but the signature says // it is, and we can't make the incompatible change within CDH throw new IOException("Interrupted while chmodding", ie); } } /** * Validates the removal of $taskid and $tasid/work under mapred-local-dir * in cases where those directories cannot be deleted without adding * write permission to the newly created directories under $taskid and * $taskid/work * Also see createFileAndSetPermissions for details */ void validateRemoveTaskFiles(boolean needCleanup, boolean jvmReuse, TaskInProgress tip) throws IOException { // create files and set permissions 555. Verify if task controller sets // the permissions for TT to delete the taskDir or workDir String dir = (!needCleanup || jvmReuse) ? TaskTracker.getTaskWorkDir(task.getUser(), task.getJobID().toString(), taskId.toString(), task.isTaskCleanupTask()) : TaskTracker.getLocalTaskDir(task.getUser(), task.getJobID().toString(), taskId.toString(), task.isTaskCleanupTask()); Path[] paths = tracker.getLocalFiles(localizedJobConf, dir); assertTrue("No paths found", paths.length > 0); for (Path p : paths) { if (tracker.getLocalFileSystem().exists(p)) { createFileAndSetPermissions(localizedJobConf, p); } } InlineCleanupQueue cleanupQueue = new InlineCleanupQueue(); tracker.setCleanupThread(cleanupQueue); tip.removeTaskFiles(needCleanup); if (jvmReuse) { // work dir should still exist and cleanup queue should be empty assertTrue("cleanup queue is not empty after removeTaskFiles() in case " + "of jvm reuse.", cleanupQueue.isQueueEmpty()); boolean workDirExists = false; for (Path p : paths) { if (tracker.getLocalFileSystem().exists(p)) { workDirExists = true; } } assertTrue("work dir does not exist in case of jvm reuse", workDirExists); // now try to delete the work dir and verify that there are no stale paths JvmManager.deleteWorkDir(tracker, task); } assertTrue("Some task files are not deleted!! Number of stale paths is " + cleanupQueue.stalePaths.size(), cleanupQueue.stalePaths.size() == 0); } /** * Validates if task cleanup is done properly for a succeeded task * @throws IOException */ public void testTaskFilesRemoval() throws Exception { if (!canRun()) { return; } testTaskFilesRemoval(false, false);// no needCleanup; no jvmReuse } /** * Validates if task cleanup is done properly for a task that is not succeeded * @throws IOException */ public void testFailedTaskFilesRemoval() throws Exception { if (!canRun()) { return; } testTaskFilesRemoval(true, false);// needCleanup; no jvmReuse // initialize a cleanupAttempt for the task. task.setTaskCleanupTask(); // localize task cleanup attempt initializeTask(); checkTaskLocalization(); // verify the cleanup of cleanup attempt. testTaskFilesRemoval(true, false);// needCleanup; no jvmReuse } /** * Validates if task cleanup is done properly for a succeeded task * @throws IOException */ public void testTaskFilesRemovalWithJvmUse() throws Exception { if (!canRun()) { return; } testTaskFilesRemoval(false, true);// no needCleanup; jvmReuse } private void initializeTask() throws IOException { tip.setJobConf(localizedJobConf); // ////////// The central method being tested tip.localizeTask(task); // ////////// // check the functionality of localizeTask for (String dir : trackerFConf.getStrings("mapred.local.dir")) { File attemptDir = new File(dir, TaskTracker.getLocalTaskDir(task.getUser(), jobId .toString(), taskId.toString(), task.isTaskCleanupTask())); assertTrue("attempt-dir " + attemptDir + " in localDir " + dir + " is not created!!", attemptDir.exists()); } attemptWorkDir = lDirAlloc.getLocalPathToRead(TaskTracker.getTaskWorkDir( task.getUser(), task.getJobID().toString(), task.getTaskID() .toString(), task.isTaskCleanupTask()), trackerFConf); assertTrue("atttempt work dir for " + taskId.toString() + " is not created in any of the configured dirs!!", attemptWorkDir != null); RunningJob rjob = new RunningJob(jobId); TaskController taskController = new DefaultTaskController(); taskController.setConf(trackerFConf); rjob.distCacheMgr = new TrackerDistributedCacheManager(trackerFConf, taskController). newTaskDistributedCacheManager(jobId, trackerFConf); TaskRunner runner = task.createRunner(tracker, tip, rjob); tip.setTaskRunner(runner); // /////// Few more methods being tested runner.setupChildTaskConfiguration(lDirAlloc); TaskRunner.createChildTmpDir(new File(attemptWorkDir.toUri().getPath()), localizedJobConf, true); attemptLogFiles = runner.prepareLogFiles(task.getTaskID(), task.isTaskCleanupTask()); // Make sure the task-conf file is created Path localTaskFile = lDirAlloc.getLocalPathToRead(TaskTracker.getTaskConfFile(task .getUser(), task.getJobID().toString(), task.getTaskID() .toString(), task.isTaskCleanupTask()), trackerFConf); assertTrue("Task conf file " + localTaskFile.toString() + " is not created!!", new File(localTaskFile.toUri().getPath()) .exists()); // /////// One more method being tested. This happens in child space. localizedTaskConf = new JobConf(localTaskFile); TaskRunner.setupChildMapredLocalDirs(task, localizedTaskConf); // /////// } /** * Validates if task cleanup is done properly */ private void testTaskFilesRemoval(boolean needCleanup, boolean jvmReuse) throws Exception { // Localize job and localize task. TaskTracker.RunningJob rjob = tracker.localizeJob(tip); localizedJobConf = rjob.getJobConf(); if (jvmReuse) { localizedJobConf.setNumTasksToExecutePerJvm(2); } initializeTask(); // TODO: Let the task run and create files. // create files and set permissions 555. Verify if task controller sets // the permissions for TT to delete the task dir or work dir properly validateRemoveTaskFiles(needCleanup, jvmReuse, tip); } /** * Test userlogs cleanup. * * @throws IOException */ private void verifyUserLogsRemoval() throws IOException { // verify user logs cleanup File jobUserLogDir = TaskLog.getJobDir(jobId); // Logs should be there before cleanup. assertTrue("Userlogs dir " + jobUserLogDir + " is not present as expected!!", jobUserLogDir.exists()); tracker.purgeJob(new KillJobAction(jobId)); tracker.getUserLogManager().getUserLogCleaner().processCompletedJobs(); // Logs should be gone after cleanup. assertFalse("Userlogs dir " + jobUserLogDir + " is not deleted as expected!!", jobUserLogDir.exists()); } /** * Test job cleanup by doing the following * - create files with no write permissions to TT under job-work-dir * - create files with no write permissions to TT under task-work-dir */ public void testJobFilesRemoval() throws IOException, InterruptedException { if (!canRun()) { return; } LOG.info("Running testJobCleanup()"); // Set an inline cleanup queue InlineCleanupQueue cleanupQueue = new InlineCleanupQueue(); tracker.setCleanupThread(cleanupQueue); // Localize job and localize task. TaskTracker.RunningJob rjob = tracker.localizeJob(tip); localizedJobConf = rjob.getJobConf(); // Create a file in job's work-dir with 555 String jobWorkDir = TaskTracker.getJobWorkDir(task.getUser(), task.getJobID().toString()); Path[] jPaths = tracker.getLocalFiles(localizedJobConf, jobWorkDir); assertTrue("No paths found for job", jPaths.length > 0); for (Path p : jPaths) { if (tracker.getLocalFileSystem().exists(p)) { createFileAndSetPermissions(localizedJobConf, p); } } // Initialize task dirs tip.setJobConf(localizedJobConf); tip.localizeTask(task); // Create a file in task local dir with 555 // this is to simply test the case where the jvm reuse is enabled and some // files in task-attempt-local-dir are left behind to be cleaned up when the // job finishes. String taskLocalDir = TaskTracker.getLocalTaskDir(task.getUser(), task.getJobID().toString(), task.getTaskID().toString(), false); Path[] tPaths = tracker.getLocalFiles(localizedJobConf, taskLocalDir); assertTrue("No paths found for task", tPaths.length > 0); for (Path p : tPaths) { if (tracker.getLocalFileSystem().exists(p)) { createFileAndSetPermissions(localizedJobConf, p); } } // remove the job work dir tracker.removeJobFiles(task.getUser(), task.getJobID()); // check the task-local-dir boolean tLocalDirExists = false; for (Path p : tPaths) { if (tracker.getLocalFileSystem().exists(p)) { tLocalDirExists = true; } } assertFalse("Task " + task.getTaskID() + " local dir exists after cleanup", tLocalDirExists); // Verify that the TaskTracker (via the task-controller) cleans up the dirs. // check the job-work-dir boolean jWorkDirExists = false; for (Path p : jPaths) { if (tracker.getLocalFileSystem().exists(p)) { jWorkDirExists = true; } } assertFalse("Job " + task.getJobID() + " work dir exists after cleanup", jWorkDirExists); // Test userlogs cleanup. verifyUserLogsRemoval(); // Check that the empty $mapred.local.dir/taskTracker/$user dirs are still // there. for (String localDir : localDirs) { Path userDir = new Path(localDir, TaskTracker.getUserDir(task.getUser())); assertTrue("User directory " + userDir + " is not present!!", tracker.getLocalFileSystem().exists(userDir)); } } /** * Tests TaskTracker restart after the localization. * * This tests the following steps: * * Localize Job, initialize a task. * Then restart the Tracker. * launch a cleanup attempt for the task. * * @throws IOException * @throws InterruptedException */ public void testTrackerRestart() throws IOException, InterruptedException { if (!canRun()) { return; } // Localize job and localize task. TaskTracker.RunningJob rjob = tracker.localizeJob(tip); localizedJobConf = rjob.getJobConf(); initializeTask(); // imitate tracker restart startTracker(); // create a task cleanup attempt createTask(); task.setTaskCleanupTask(); // register task tip = tracker.new TaskInProgress(task, trackerFConf); // localize the job again. rjob = tracker.localizeJob(tip); localizedJobConf = rjob.getJobConf(); checkJobLocalization(); // localize task cleanup attempt initializeTask(); checkTaskLocalization(); } /** * Tests TaskTracker re-init after the localization. * * This tests the following steps: * * Localize Job, initialize a task. * Then reinit the Tracker. * launch a cleanup attempt for the task. * * @throws IOException * @throws InterruptedException */ public void testTrackerReinit() throws IOException, InterruptedException { if (!canRun()) { return; } // Localize job and localize task. TaskTracker.RunningJob rjob = tracker.localizeJob(tip); localizedJobConf = rjob.getJobConf(); initializeTask(); // imitate tracker reinit initializeTracker(); // create a task cleanup attempt createTask(); task.setTaskCleanupTask(); // register task tip = tracker.new TaskInProgress(task, trackerFConf); // localize the job again. rjob = tracker.localizeJob(tip); localizedJobConf = rjob.getJobConf(); checkJobLocalization(); // localize task cleanup attempt initializeTask(); checkTaskLocalization(); } /** * Localizes a cleanup task and validates permissions. * * @throws InterruptedException * @throws IOException */ public void testCleanupTaskLocalization() throws IOException, InterruptedException { if (!canRun()) { return; } task.setTaskCleanupTask(); // register task tip = tracker.new TaskInProgress(task, trackerFConf); // localize the job again. RunningJob rjob = tracker.localizeJob(tip); localizedJobConf = rjob.getJobConf(); checkJobLocalization(); // localize task cleanup attempt initializeTask(); checkTaskLocalization(); } }
{ "content_hash": "a31f26d00357449490e0577eda251b87", "timestamp": "", "source": "github", "line_count": 991, "max_line_length": 82, "avg_line_length": 35.25428859737639, "alnum_prop": 0.6774766007384722, "repo_name": "InMobi/hadoop", "id": "5b0e24b8f3f6eaff2b2d028eb0e36569a5520fee", "size": "35743", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "src/test/org/apache/hadoop/mapred/TestTaskTrackerLocalization.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "387493" }, { "name": "C++", "bytes": "401532" }, { "name": "CSS", "bytes": "106092" }, { "name": "Java", "bytes": "14731385" }, { "name": "JavaScript", "bytes": "112012" }, { "name": "Objective-C", "bytes": "119767" }, { "name": "PHP", "bytes": "152555" }, { "name": "Perl", "bytes": "149888" }, { "name": "Python", "bytes": "1217631" }, { "name": "Ruby", "bytes": "28485" }, { "name": "Shell", "bytes": "1539412" }, { "name": "Smalltalk", "bytes": "56562" }, { "name": "XSLT", "bytes": "235231" } ], "symlink_target": "" }
<?php namespace Phalcon\Cli\Dispatcher { class Exception extends \Phalcon\Exception { } }
{ "content_hash": "fb526a978c2dc64405406c43f6668a60", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 46, "avg_line_length": 13.75, "alnum_prop": 0.6272727272727273, "repo_name": "hu2008yinxiang/phalcon-pure-php", "id": "c4182511c1cc7f920305f5140ccd0b9855a78551", "size": "110", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Phalcon/Cli/Dispatcher/Exception.php", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "PHP", "bytes": "920301" } ], "symlink_target": "" }
package com.blazebit.blazefaces.apt.model; public class Function { private String name; private String clazz; private String signature; private Description description; public Function() { } public Function(String name, String clazz, String signature, Description description) { this.name = name; this.clazz = clazz; this.signature = signature; this.description = description; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClazz() { return clazz; } public void setClazz(String clazz) { this.clazz = clazz; } public String getSignature() { return signature; } public void setSignature(String signature) { this.signature = signature; } public Description getDescription() { return description; } public void setDescription(Description description) { this.description = description; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((clazz == null) ? 0 : clazz.hashCode()); result = prime * result + ((description == null) ? 0 : description.hashCode()); result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + ((signature == null) ? 0 : signature.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Function)) { return false; } Function other = (Function) obj; if (clazz == null) { if (other.clazz != null) { return false; } } else if (!clazz.equals(other.clazz)) { return false; } if (description == null) { if (other.description != null) { return false; } } else if (!description.equals(other.description)) { return false; } if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; } if (signature == null) { if (other.signature != null) { return false; } } else if (!signature.equals(other.signature)) { return false; } return true; } }
{ "content_hash": "647300f0817a19832cb168749a26dbf7", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 69, "avg_line_length": 20, "alnum_prop": 0.6407407407407407, "repo_name": "Blazebit/blaze-faces", "id": "0a864d75b4d79a03eb940e94a76fa7ccb7f57919", "size": "2160", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "blaze-faces-apt/src/main/java/com/blazebit/blazefaces/apt/model/Function.java", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "41571" }, { "name": "Java", "bytes": "725192" }, { "name": "JavaScript", "bytes": "403830" } ], "symlink_target": "" }
include_recipe "jetty::default" ::Chef::Recipe.send(:include, Opscode::OpenSSL::Password) if Chef::Config[:solo] if node['jetty']['cargo']['password'].nil? Chef::Application.fatal!([ 'For chef-solo execution, you must set ', ' { ', ' "jetty": {', ' "cargo": {', ' "password": "temporarypassword"', ' }', ' }', ' }', ' in the json_attributes that are passed into chef-solo.'].join(' ')) else node['jetty']['cargo']['password'] = node['jetty']['cargo']['password'].crypt('Zz') end else node.set_unless['jetty']['cargo']['password'] = secure_password end template "/etc/jetty/realm.properties" do source "realm.properties.erb" variables( :username => node['jetty']['cargo']['username'], :password => node['jetty']['cargo']['password'] ) mode 0644 owner "root" group "root" notifies :restart, "service[jetty]" end web_xml = node['jetty']['webapp_dir'] + "/cargo-jetty-6/WEB-INF/web.xml" cookbook_file web_xml do source "web.xml" mode 0644 owner "jetty" group "jetty" action :nothing notifies :restart, "service[jetty]" end script "extract war" do interpreter "bash" user "jetty" cwd "/usr/share/jetty/webapps/" code <<-EOH mkdir cargo-jetty-6 cd cargo-jetty-6 jar xf ../cargo-jetty-6-and-earlier-deployer-1.2.2.war EOH notifies :restart, "service[jetty]" action :nothing end remote_file "/usr/share/jetty/webapps/cargo-jetty-6-and-earlier-deployer-1.2.2.war" do source node['jetty']['cargo']['jetty6']['source']['url'] checksum node['jetty']['cargo']['jetty6']['source']['checksum'] mode 0644 owner "jetty" group "jetty" notifies :run, "script[extract war]", :immediately notifies :create, "cookbook_file[web_xml]", :immediately notifies :restart, "service[jetty]" end
{ "content_hash": "02c87342032cddfdddaef0f493fd3eb1", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 104, "avg_line_length": 29.493150684931507, "alnum_prop": 0.5369252206223873, "repo_name": "hardtke/jetty", "id": "5032f678814adea19318947bef3c49aa721b6606", "size": "2777", "binary": false, "copies": "5", "ref": "refs/heads/master", "path": "recipes/cargo.rb", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "Ruby", "bytes": "7249" } ], "symlink_target": "" }
This is an example of integrating DGL(https://github.com/dmlc/dgl) and RaySGD for distributed graph neural network training. Original scripts are taken from: https://github.com/dmlc/dgl/blob/master/examples/pytorch/ogb/ogbn-products/gat/main.py. In order to overwrite the train_epoch and validate methods in the custom class, we adjusted the execution logic of the original code to make it easier to extend to training on multiple GPUs. ## Packages required - ray: 1.1.0 - DGL: 0.6.0 - torch: 1.8.1+cu102 ## Run ``` python gat_dgl.py --lr 0.001 --num-epochs 20 --use-gpu True ``` To leverage multiple GPUs (beyond a single node), be sure to add an `address` parameter: ``` python gat_dgl.py --args="--address='auto' --lr 0.001 ..." ``` ## Note Ray will set OMP_NUM_THREADS=1 by default when running, but we found that this will cause data sampling and loading to the GPU in the train_epoch/validate method to become very slow. Therefore, it is necessary to manually set this parameter to the number of cpu cores of the machine, so that the training time of each epoch will be reduced a lot. For the setting description of this parameter, please refer https://docs.ray.io/en/master/configure.html.
{ "content_hash": "9d84e3315e1cc16bf614016f4133deaf", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 346, "avg_line_length": 50.25, "alnum_prop": 0.7512437810945274, "repo_name": "pcmoritz/ray-1", "id": "7485f09b6d93644a7161031a8e73eae3c16a5f02", "size": "1273", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "python/ray/util/sgd/torch/examples/deep_graph/README.md", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "C", "bytes": "70670" }, { "name": "C++", "bytes": "4670851" }, { "name": "CSS", "bytes": "10912" }, { "name": "Dockerfile", "bytes": "14159" }, { "name": "HTML", "bytes": "30414" }, { "name": "Java", "bytes": "1338604" }, { "name": "JavaScript", "bytes": "914" }, { "name": "Jupyter Notebook", "bytes": "1615" }, { "name": "Makefile", "bytes": "234" }, { "name": "Python", "bytes": "10523389" }, { "name": "Shell", "bytes": "117557" }, { "name": "Smarty", "bytes": "239" }, { "name": "Starlark", "bytes": "238506" }, { "name": "TypeScript", "bytes": "259269" } ], "symlink_target": "" }
def tweet_length(tweet) if tweet.length > 140 "Too many characters!" end end
{ "content_hash": "f6c82ab5caa2804840a7b7ecba020524", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 26, "avg_line_length": 17, "alnum_prop": 0.6823529411764706, "repo_name": "Bloc/workshop-curriculum", "id": "7e03ae3171caf5e50736a6beb931bad423724ac2", "size": "85", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "courses/ruby-primer/03-level-conditionals/01-if/solution.rb", "mode": "33188", "license": "mit", "language": [ { "name": "GCC Machine Description", "bytes": "254" }, { "name": "JavaScript", "bytes": "72788" }, { "name": "Ruby", "bytes": "56448" } ], "symlink_target": "" }
jquery-snappish ===============
{ "content_hash": "c03913f1ccbea860c7ed689626f6d987", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 15, "avg_line_length": 16, "alnum_prop": 0.4375, "repo_name": "EdwardRees/EdwardRees.github.io", "id": "5159027fb2014dc9b7fda2ac0788f4d6aa897b68", "size": "32", "binary": false, "copies": "2", "ref": "refs/heads/master", "path": "static/ChainDimenxxion/bower_components/jquery-snappish/README.md", "mode": "33261", "license": "mit", "language": [ { "name": "CSS", "bytes": "187033" }, { "name": "HTML", "bytes": "535902" }, { "name": "Java", "bytes": "113" }, { "name": "JavaScript", "bytes": "1189425" }, { "name": "Vue", "bytes": "593" } ], "symlink_target": "" }
#include <benchmark/benchmark.h> #include <osquery/core.h> #include <osquery/registry.h> #include <osquery/sql.h> #include <osquery/tables.h> #include "osquery/sql/virtual_table.h" namespace osquery { class BenchmarkTablePlugin : public TablePlugin { private: TableColumns columns() const { return {{"test_int", "INTEGER"}, {"test_text", "TEXT"}}; } QueryData generate(QueryContext& ctx) { QueryData results; results.push_back({{"test_int", "0"}}); results.push_back({ {"test_int", "0"}, {"test_text", "hello"}, }); return results; } }; static void SQL_virtual_table_registry(benchmark::State& state) { // Add a sample virtual table plugin. // Profile calling the plugin's column data. Registry::add<BenchmarkTablePlugin>("table", "benchmark"); while (state.KeepRunning()) { PluginResponse res; Registry::call("table", "benchmark", {{"action", "generate"}}, res); } } BENCHMARK(SQL_virtual_table_registry); static void SQL_select_metadata(benchmark::State& state) { auto dbc = SQLiteDBManager::get(); while (state.KeepRunning()) { QueryData results; queryInternal("select count(*) from sqlite_temp_master;", results, dbc.db()); } } BENCHMARK(SQL_select_metadata); static void SQL_virtual_table_internal(benchmark::State& state) { Registry::add<BenchmarkTablePlugin>("table", "benchmark"); PluginResponse res; Registry::call("table", "benchmark", {{"action", "columns"}}, res); // Attach a sample virtual table. auto dbc = SQLiteDBManager::get(); attachTableInternal("benchmark", columnDefinition(res), dbc.db()); while (state.KeepRunning()) { QueryData results; queryInternal("select * from benchmark", results, dbc.db()); } } BENCHMARK(SQL_virtual_table_internal); static void SQL_select_basic(benchmark::State& state) { // Profile executing a query against an internal, already attached table. while (state.KeepRunning()) { auto results = SQLInternal("select * from benchmark"); } } BENCHMARK(SQL_select_basic); }
{ "content_hash": "32759a3e80703c383c530a62f59db3dd", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 75, "avg_line_length": 26.384615384615383, "alnum_prop": 0.6793002915451894, "repo_name": "mofarrell/osquery", "id": "c88d6f652335feb2a15ddd4495a5c314ec138047", "size": "2365", "binary": false, "copies": "3", "ref": "refs/heads/master", "path": "osquery/sql/benchmarks/sql_benchmarks.cpp", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "C", "bytes": "44898" }, { "name": "C++", "bytes": "1206514" }, { "name": "CMake", "bytes": "69447" }, { "name": "Makefile", "bytes": "3286" }, { "name": "Objective-C++", "bytes": "32900" }, { "name": "Shell", "bytes": "2030" }, { "name": "Thrift", "bytes": "2879" } ], "symlink_target": "" }
title: Components overview eleventyNavigation: key: Overview parent: Components order: 0 versionLinks: v1: components/templates/ --- A Lit component is a reusable piece of UI. You can think of a Lit component as a container that has some state and that displays a UI based on its state. It can also react to user input, fire events—anything you'd expect a UI component to do. And a Lit component is an HTML element, so it has all of the standard element APIs. Creating a Lit component involves a number of concepts: * [Defining a component](/docs/components/defining/). A Lit component is implemented as a *custom element*, registered with the browser. * [Rendering](/docs/components/rendering/). A component has *render method* that's called to render the component's contents. In the render method, you define a *template* for the component. * [Reactive properties](/docs/components/properties/). Properties hold the state of the component. Changing one or more of the components' _reactive properties_ triggers an update cycle, re-rendering the component. * [Styles](/docs/components/styles/). A component can define _encapsulated styles_ to control its own appearance. * [Lifecycle](/docs/components/lifecycle/). Lit defines a set of callbacks that you can override to hook into the component's lifecycle—for example, to run code when the element's added to a page, or whenever the component updates. Here's a sample component: {% playground-example "docs/components/overview/simple-greeting" "simple-greeting.ts" %}
{ "content_hash": "cec759eec30b893a28af74bc119f0fd1", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 326, "avg_line_length": 59.65384615384615, "alnum_prop": 0.7685364281108962, "repo_name": "lit/lit.dev", "id": "87ddcdc2245d84f422cc6015caf0f5fcf4d326ab", "size": "1559", "binary": false, "copies": "1", "ref": "refs/heads/main", "path": "packages/lit-dev-content/site/docs/components/overview.md", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "CSS", "bytes": "69183" }, { "name": "Dockerfile", "bytes": "3173" }, { "name": "HTML", "bytes": "155464" }, { "name": "JavaScript", "bytes": "91667" }, { "name": "Nunjucks", "bytes": "1916" }, { "name": "TypeScript", "bytes": "706588" } ], "symlink_target": "" }
FM_ID: '' name: Santa Clarita Farmers Market address_1: College of the Canyons Valencia Campus address_2: 26455 Rockwell Canyon Rd. city: Valencia state: California zip: '91355' phone: (805)529-6266 latitude: '34.4042' longitude: '-118.5683' website: >- http://visitsantaclarita.com/dining/farmers-markets/santa-clarita-farmers-market/ daycode1: Sun day1_open: '830' day1_close: '1200' daycode2: '' day2_open: '' day2_close: '' category: Farmers Market title: 'Santa Clarita Farmers Market, Food Oasis Los Angeles' uri: /farmers-market/santa-clarita/ formatted_daycode1: Sunday formatted_day1_open: '8:30am' formatted_day1_close: 12pm ---
{ "content_hash": "d33801f55d6eb618e55319382cdd2a1a", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 83, "avg_line_length": 24.692307692307693, "alnum_prop": 0.7538940809968847, "repo_name": "kathwang21/site", "id": "f6e81d0cf0c138d05b2e24aa99c6970b60798804", "size": "646", "binary": false, "copies": "4", "ref": "refs/heads/master", "path": "_farmers-market/santa-clarita.md", "mode": "33188", "license": "mit", "language": [ { "name": "CSS", "bytes": "49342" }, { "name": "HTML", "bytes": "127480" }, { "name": "JavaScript", "bytes": "89465" } ], "symlink_target": "" }
tinyMCELang['lang_iespell_desc'] = 'Kör rättstavningskontroll'; tinyMCELang['lang_iespell_download'] = "ieSpell verkar inte vara installerad. Klicka OK f&ouml;r att ladda hem."
{ "content_hash": "bf623982b40a816ef7e856b8fe760474", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 112, "avg_line_length": 88.5, "alnum_prop": 0.7740112994350282, "repo_name": "qlwu/svnmanager", "id": "f77b39ffdd646ae849ea3974b06ba5610200afb0", "size": "199", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "js/tiny_mce/plugins/iespell/langs/sv.js", "mode": "33261", "license": "bsd-3-clause", "language": [], "symlink_target": "" }
// Copyright 2015 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Algorithms for distributing the literals and commands of a metablock between // block types and contexts. #include "./metablock.h" #include "./block_splitter.h" #include "./cluster.h" #include "./histogram.h" namespace brotli { void BuildMetaBlock(const uint8_t* ringbuffer, const size_t pos, const size_t mask, uint8_t prev_byte, uint8_t prev_byte2, const Command* cmds, size_t num_commands, int literal_context_mode, bool enable_context_modeling, MetaBlockSplit* mb) { SplitBlock(cmds, num_commands, &ringbuffer[pos & mask], &mb->literal_split, &mb->command_split, &mb->distance_split); std::vector<int> literal_context_modes(mb->literal_split.num_types, literal_context_mode); int num_literal_contexts = mb->literal_split.num_types << kLiteralContextBits; int num_distance_contexts = mb->distance_split.num_types << kDistanceContextBits; std::vector<HistogramLiteral> literal_histograms(num_literal_contexts); mb->command_histograms.resize(mb->command_split.num_types); std::vector<HistogramDistance> distance_histograms(num_distance_contexts); BuildHistograms(cmds, num_commands, mb->literal_split, mb->command_split, mb->distance_split, ringbuffer, pos, mask, prev_byte, prev_byte2, literal_context_modes, &literal_histograms, &mb->command_histograms, &distance_histograms); // Histogram ids need to fit in one byte. static const int kMaxNumberOfHistograms = 256; mb->literal_histograms = literal_histograms; if (enable_context_modeling) { ClusterHistograms(literal_histograms, 1 << kLiteralContextBits, mb->literal_split.num_types, kMaxNumberOfHistograms, &mb->literal_histograms, &mb->literal_context_map); } else { ClusterHistogramsTrivial(literal_histograms, 1 << kLiteralContextBits, mb->literal_split.num_types, kMaxNumberOfHistograms, &mb->literal_histograms, &mb->literal_context_map); } mb->distance_histograms = distance_histograms; if (enable_context_modeling) { ClusterHistograms(distance_histograms, 1 << kDistanceContextBits, mb->distance_split.num_types, kMaxNumberOfHistograms, &mb->distance_histograms, &mb->distance_context_map); } else { ClusterHistogramsTrivial(distance_histograms, 1 << kDistanceContextBits, mb->distance_split.num_types, kMaxNumberOfHistograms, &mb->distance_histograms, &mb->distance_context_map); } } // Greedy block splitter for one block category (literal, command or distance). template<typename HistogramType> class BlockSplitter { public: BlockSplitter(int alphabet_size, int min_block_size, double split_threshold, int num_symbols, BlockSplit* split, std::vector<HistogramType>* histograms) : alphabet_size_(alphabet_size), min_block_size_(min_block_size), split_threshold_(split_threshold), num_blocks_(0), split_(split), histograms_(histograms), target_block_size_(min_block_size), block_size_(0), curr_histogram_ix_(0), merge_last_count_(0) { int max_num_blocks = num_symbols / min_block_size + 1; // We have to allocate one more histogram than the maximum number of block // types for the current histogram when the meta-block is too big. int max_num_types = std::min(max_num_blocks, kMaxBlockTypes + 1); split_->lengths.resize(max_num_blocks); split_->types.resize(max_num_blocks); histograms_->resize(max_num_types); last_histogram_ix_[0] = last_histogram_ix_[1] = 0; } // Adds the next symbol to the current histogram. When the current histogram // reaches the target size, decides on merging the block. void AddSymbol(int symbol) { (*histograms_)[curr_histogram_ix_].Add(symbol); ++block_size_; if (block_size_ == target_block_size_) { FinishBlock(/* is_final = */ false); } } // Does either of three things: // (1) emits the current block with a new block type; // (2) emits the current block with the type of the second last block; // (3) merges the current block with the last block. void FinishBlock(bool is_final) { if (block_size_ < min_block_size_) { block_size_ = min_block_size_; } if (num_blocks_ == 0) { // Create first block. split_->lengths[0] = block_size_; split_->types[0] = 0; last_entropy_[0] = BitsEntropy(&(*histograms_)[0].data_[0], alphabet_size_); last_entropy_[1] = last_entropy_[0]; ++num_blocks_; ++split_->num_types; ++curr_histogram_ix_; block_size_ = 0; } else if (block_size_ > 0) { double entropy = BitsEntropy(&(*histograms_)[curr_histogram_ix_].data_[0], alphabet_size_); HistogramType combined_histo[2]; double combined_entropy[2]; double diff[2]; for (int j = 0; j < 2; ++j) { int last_histogram_ix = last_histogram_ix_[j]; combined_histo[j] = (*histograms_)[curr_histogram_ix_]; combined_histo[j].AddHistogram((*histograms_)[last_histogram_ix]); combined_entropy[j] = BitsEntropy( &combined_histo[j].data_[0], alphabet_size_); diff[j] = combined_entropy[j] - entropy - last_entropy_[j]; } if (split_->num_types < kMaxBlockTypes && diff[0] > split_threshold_ && diff[1] > split_threshold_) { // Create new block. split_->lengths[num_blocks_] = block_size_; split_->types[num_blocks_] = split_->num_types; last_histogram_ix_[1] = last_histogram_ix_[0]; last_histogram_ix_[0] = split_->num_types; last_entropy_[1] = last_entropy_[0]; last_entropy_[0] = entropy; ++num_blocks_; ++split_->num_types; ++curr_histogram_ix_; block_size_ = 0; merge_last_count_ = 0; target_block_size_ = min_block_size_; } else if (diff[1] < diff[0] - 20.0) { // Combine this block with second last block. split_->lengths[num_blocks_] = block_size_; split_->types[num_blocks_] = split_->types[num_blocks_ - 2]; std::swap(last_histogram_ix_[0], last_histogram_ix_[1]); (*histograms_)[last_histogram_ix_[0]] = combined_histo[1]; last_entropy_[1] = last_entropy_[0]; last_entropy_[0] = combined_entropy[1]; ++num_blocks_; block_size_ = 0; (*histograms_)[curr_histogram_ix_].Clear(); merge_last_count_ = 0; target_block_size_ = min_block_size_; } else { // Combine this block with last block. split_->lengths[num_blocks_ - 1] += block_size_; (*histograms_)[last_histogram_ix_[0]] = combined_histo[0]; last_entropy_[0] = combined_entropy[0]; if (split_->num_types == 1) { last_entropy_[1] = last_entropy_[0]; } block_size_ = 0; (*histograms_)[curr_histogram_ix_].Clear(); if (++merge_last_count_ > 1) { target_block_size_ += min_block_size_; } } } if (is_final) { (*histograms_).resize(split_->num_types); split_->types.resize(num_blocks_); split_->lengths.resize(num_blocks_); } } private: static const int kMaxBlockTypes = 256; // Alphabet size of particular block category. const int alphabet_size_; // We collect at least this many symbols for each block. const int min_block_size_; // We merge histograms A and B if // entropy(A+B) < entropy(A) + entropy(B) + split_threshold_, // where A is the current histogram and B is the histogram of the last or the // second last block type. const double split_threshold_; int num_blocks_; BlockSplit* split_; // not owned std::vector<HistogramType>* histograms_; // not owned // The number of symbols that we want to collect before deciding on whether // or not to merge the block with a previous one or emit a new block. int target_block_size_; // The number of symbols in the current histogram. int block_size_; // Offset of the current histogram. int curr_histogram_ix_; // Offset of the histograms of the previous two block types. int last_histogram_ix_[2]; // Entropy of the previous two block types. double last_entropy_[2]; // The number of times we merged the current block with the last one. int merge_last_count_; }; void BuildMetaBlockGreedy(const uint8_t* ringbuffer, size_t pos, size_t mask, const Command *commands, size_t n_commands, MetaBlockSplit* mb) { int num_literals = 0; for (int i = 0; i < n_commands; ++i) { num_literals += commands[i].insert_len_; } BlockSplitter<HistogramLiteral> lit_blocks( 256, 512, 400.0, num_literals, &mb->literal_split, &mb->literal_histograms); BlockSplitter<HistogramCommand> cmd_blocks( kNumCommandPrefixes, 1024, 500.0, n_commands, &mb->command_split, &mb->command_histograms); BlockSplitter<HistogramDistance> dist_blocks( 64, 512, 100.0, n_commands, &mb->distance_split, &mb->distance_histograms); for (int i = 0; i < n_commands; ++i) { const Command cmd = commands[i]; cmd_blocks.AddSymbol(cmd.cmd_prefix_); for (int j = 0; j < cmd.insert_len_; ++j) { lit_blocks.AddSymbol(ringbuffer[pos & mask]); ++pos; } pos += cmd.copy_len_; if (cmd.copy_len_ > 0 && cmd.cmd_prefix_ >= 128) { dist_blocks.AddSymbol(cmd.dist_prefix_); } } lit_blocks.FinishBlock(/* is_final = */ true); cmd_blocks.FinishBlock(/* is_final = */ true); dist_blocks.FinishBlock(/* is_final = */ true); } void OptimizeHistograms(int num_direct_distance_codes, int distance_postfix_bits, MetaBlockSplit* mb) { for (int i = 0; i < mb->literal_histograms.size(); ++i) { OptimizeHuffmanCountsForRle(256, &mb->literal_histograms[i].data_[0]); } for (int i = 0; i < mb->command_histograms.size(); ++i) { OptimizeHuffmanCountsForRle(kNumCommandPrefixes, &mb->command_histograms[i].data_[0]); } int num_distance_codes = kNumDistanceShortCodes + num_direct_distance_codes + (48 << distance_postfix_bits); for (int i = 0; i < mb->distance_histograms.size(); ++i) { OptimizeHuffmanCountsForRle(num_distance_codes, &mb->distance_histograms[i].data_[0]); } } } // namespace brotli
{ "content_hash": "790220c93ef6e8572b99fd78da696ef8", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 80, "avg_line_length": 37.83699059561128, "alnum_prop": 0.5826014913007457, "repo_name": "glonlas/onmetal-dashboard", "id": "19f4d4af91aab0d0ee55deabf56308a4bbd92ead", "size": "12070", "binary": false, "copies": "10", "ref": "refs/heads/master", "path": "node_modules/gulp-iconfont/node_modules/gulp-ttf2woff2/node_modules/ttf2woff2/csrc/enc/metablock.cc", "mode": "33188", "license": "apache-2.0", "language": [ { "name": "CSS", "bytes": "3614" }, { "name": "HTML", "bytes": "19447" }, { "name": "JavaScript", "bytes": "69467" } ], "symlink_target": "" }
module Types where import qualified Data.Text.Lazy as L data Element = HR | H Int XText | P XText | PRE XText | UOL Xlist | DL [Def] | IMG [Image] | TABLE [[XText]] | DIV DivAttr [Element] deriving (Eq,Show) type URL = L.Text type Title = L.Text data PText = Null | R Char | E Char | L [L.Text] | A Title URL deriving (Eq,Show) type XText = [PText] data Xlist = Ulist [Xitem] | Olist [Xitem] | Nil deriving (Eq,Show) data Xitem = Item XText Xlist deriving (Eq,Show) data Def = Def XText XText deriving (Eq,Show) data Image = Image Title URL (Maybe URL) deriving (Eq,Show) data DivAttr = Class L.Text | Id L.Text deriving (Eq,Show) getTitle :: [Element] -> XText getTitle elems = case filter isH elems of [] -> [] h:_ -> fromH h isH :: Element -> Bool isH (H _ _) = True isH _ = False fromH :: Element -> XText fromH (H _ title) = title fromH _ = []
{ "content_hash": "1341fe9db51d710495480738b245acdd", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 81, "avg_line_length": 25.871794871794872, "alnum_prop": 0.5619425173439049, "repo_name": "kazu-yamamoto/piki", "id": "3db44d4c24bc553d584f4969ad411038abcaeb8e", "size": "1009", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/Types.hs", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "Haskell", "bytes": "20049" } ], "symlink_target": "" }
package org.jfree.chart3d.fx.demo; import static javafx.application.Application.launch; import java.awt.BasicStroke; import java.awt.Color; import javafx.application.Application; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.layout.StackPane; import javafx.stage.Stage; import org.jfree.chart3d.Chart3D; import org.jfree.chart3d.Chart3DFactory; import org.jfree.chart3d.Colors; import org.jfree.chart3d.Orientation; import org.jfree.chart3d.axis.NumberAxis3D; import org.jfree.chart3d.axis.StandardCategoryAxis3D; import org.jfree.chart3d.data.DefaultKeyedValues; import org.jfree.chart3d.data.category.CategoryDataset3D; import org.jfree.chart3d.data.category.StandardCategoryDataset3D; import org.jfree.chart3d.fx.Chart3DViewer; import org.jfree.chart3d.label.StandardCategoryItemLabelGenerator; import org.jfree.chart3d.legend.LegendAnchor; import org.jfree.chart3d.plot.CategoryPlot3D; import org.jfree.pdf.PDFHints; /** * A 3D bar chart demo for JavaFX. */ public class BarChart3DFXDemo2 extends Application { /** * Creates a bar chart with the supplied dataset. * * @param dataset the dataset. * * @return A bar chart. */ private static Chart3D createChart(CategoryDataset3D<String, String, String> dataset) { Chart3D chart = Chart3DFactory.createBarChart( "Average Maximum Temperature", "http://www.worldclimateguide.co.uk/climateguides/", dataset, null, null, "Temp °C"); // we use the following hint to render text as vector graphics // rather than text when exporting to PDF...otherwise the degree // symbol on the axis title does not display correctly. chart.getRenderingHints().put(PDFHints.KEY_DRAW_STRING_TYPE, PDFHints.VALUE_DRAW_STRING_TYPE_VECTOR); chart.setLegendPosition(LegendAnchor.BOTTOM_RIGHT, Orientation.VERTICAL); chart.getViewPoint().panLeftRight(-Math.PI / 60); CategoryPlot3D plot = (CategoryPlot3D) chart.getPlot(); StandardCategoryAxis3D xAxis = (StandardCategoryAxis3D) plot.getColumnAxis(); NumberAxis3D yAxis = (NumberAxis3D) plot.getValueAxis(); StandardCategoryAxis3D zAxis = (StandardCategoryAxis3D) plot.getRowAxis(); plot.setGridlineStrokeForValues(new BasicStroke(0.0f)); xAxis.setLineColor(new Color(0, 0, 0, 0)); yAxis.setLineColor(new Color(0, 0, 0, 0)); zAxis.setLineColor(new Color(0, 0, 0, 0)); plot.getRenderer().setColors(Colors.createPastelColors()); plot.setToolTipGenerator(new StandardCategoryItemLabelGenerator( "%2$s (%3$s) = %4$s degrees")); return chart; } /** * Creates a sample dataset (hard-coded for the purpose of keeping the * demo self-contained - in practice you would normally read your data * from a file, database or other source). * * @return A sample dataset. */ private static CategoryDataset3D<String, String, String> createDataset() { StandardCategoryDataset3D<String, String, String> dataset = new StandardCategoryDataset3D<>(); DefaultKeyedValues<String, Number> s3 = new DefaultKeyedValues<>(); s3.put("Jan", 7); s3.put("Feb", 7); s3.put("Mar", 10); s3.put("Apr", 13); s3.put("May", 17); s3.put("Jun", 20); s3.put("Jul", 22); s3.put("Aug", 21); s3.put("Sep", 19); s3.put("Oct", 15); s3.put("Nov", 10); s3.put("Dec", 8); dataset.addSeriesAsRow("London", s3); DefaultKeyedValues<String, Number> s1 = new DefaultKeyedValues<>(); s1.put("Jan", 3); s1.put("Feb", 5); s1.put("Mar", 9); s1.put("Apr", 14); s1.put("May", 18); s1.put("Jun", 22); s1.put("Jul", 25); s1.put("Aug", 24); s1.put("Sep", 20); s1.put("Oct", 14); s1.put("Nov", 8); s1.put("Dec", 4); dataset.addSeriesAsRow("Geneva", s1); DefaultKeyedValues<String, Number> s2 = new DefaultKeyedValues<>(); s2.put("Jan", 9); s2.put("Feb", 11); s2.put("Mar", 13); s2.put("Apr", 16); s2.put("May", 20); s2.put("Jun", 23); s2.put("Jul", 26); s2.put("Aug", 26); s2.put("Sep", 24); s2.put("Oct", 19); s2.put("Nov", 13); s2.put("Dec", 9); dataset.addSeriesAsRow("Bergerac", s2); DefaultKeyedValues<String, Number> s4 = new DefaultKeyedValues<>(); s4.put("Jan", 22); s4.put("Feb", 22); s4.put("Mar", 20); s4.put("Apr", 17); s4.put("May", 14); s4.put("Jun", 11); s4.put("Jul", 11); s4.put("Aug", 12); s4.put("Sep", 14); s4.put("Oct", 17); s4.put("Nov", 19); s4.put("Dec", 21); dataset.addSeriesAsRow("Christchurch", s4); DefaultKeyedValues<String, Number> s5 = new DefaultKeyedValues<>(); s5.put("Jan", 20); s5.put("Feb", 20); s5.put("Mar", 19); s5.put("Apr", 17); s5.put("May", 14); s5.put("Jun", 12); s5.put("Jul", 11); s5.put("Aug", 12); s5.put("Sep", 13); s5.put("Oct", 15); s5.put("Nov", 17); s5.put("Dec", 19); dataset.addSeriesAsRow("Wellington", s5); return dataset; } /** * Creates and returns a node for the demo chart. * * @return A node for the demo chart. */ public static Node createDemoNode() { CategoryDataset3D<String, String, String> dataset = createDataset(); Chart3D chart = createChart(dataset); return new Chart3DViewer(chart); } @Override public void start(Stage stage) { StackPane sp = new StackPane(); sp.getChildren().add(createDemoNode()); Scene scene = new Scene(sp, 768, 512); stage.setScene(scene); stage.setTitle("Orson Charts: BarChart3DFXDemo2.java"); stage.show(); } /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } }
{ "content_hash": "0ba8f9466ec98507ca3bfcf20ed22389", "timestamp": "", "source": "github", "line_count": 185, "max_line_length": 102, "avg_line_length": 34.12972972972973, "alnum_prop": 0.5926512511878366, "repo_name": "jfree/jfree-fxdemos", "id": "9794a9bb0c3435f0d3862c699a7618177bf27e97", "size": "8113", "binary": false, "copies": "1", "ref": "refs/heads/master", "path": "src/main/java/org/jfree/chart3d/fx/demo/BarChart3DFXDemo2.java", "mode": "33188", "license": "bsd-3-clause", "language": [ { "name": "HTML", "bytes": "16648" }, { "name": "Java", "bytes": "244059" } ], "symlink_target": "" }