{ // 获取包含Hugging Face文本的span元素 const spans = link.querySelectorAll('span.whitespace-nowrap, span.hidden.whitespace-nowrap'); spans.forEach(span => { if (span.textContent && span.textContent.trim().match(/Hugging\s*Face/i)) { span.textContent = 'AI快站'; } }); }); // 替换logo图片的alt属性 document.querySelectorAll('img[alt*="Hugging"], img[alt*="Face"]').forEach(img => { if (img.alt.match(/Hugging\s*Face/i)) { img.alt = 'AI快站 logo'; } }); } // 替换导航栏中的链接 function replaceNavigationLinks() { // 已替换标记,防止重复运行 if (window._navLinksReplaced) { return; } // 已经替换过的链接集合,防止重复替换 const replacedLinks = new Set(); // 只在导航栏区域查找和替换链接 const headerArea = document.querySelector('header') || document.querySelector('nav'); if (!headerArea) { return; } // 在导航区域内查找链接 const navLinks = headerArea.querySelectorAll('a'); navLinks.forEach(link => { // 如果已经替换过,跳过 if (replacedLinks.has(link)) return; const linkText = link.textContent.trim(); const linkHref = link.getAttribute('href') || ''; // 替换Spaces链接 - 仅替换一次 if ( (linkHref.includes('/spaces') || linkHref === '/spaces' || linkText === 'Spaces' || linkText.match(/^s*Spacess*$/i)) && linkText !== 'OCR模型免费转Markdown' && linkText !== 'OCR模型免费转Markdown' ) { link.textContent = 'OCR模型免费转Markdown'; link.href = 'https://fast360.xyz'; link.setAttribute('target', '_blank'); link.setAttribute('rel', 'noopener noreferrer'); replacedLinks.add(link); } // 删除Posts链接 else if ( (linkHref.includes('/posts') || linkHref === '/posts' || linkText === 'Posts' || linkText.match(/^s*Postss*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } // 替换Docs链接 - 仅替换一次 else if ( (linkHref.includes('/docs') || linkHref === '/docs' || linkText === 'Docs' || linkText.match(/^s*Docss*$/i)) && linkText !== '模型下载攻略' ) { link.textContent = '模型下载攻略'; link.href = '/'; replacedLinks.add(link); } // 删除Enterprise链接 else if ( (linkHref.includes('/enterprise') || linkHref === '/enterprise' || linkText === 'Enterprise' || linkText.match(/^s*Enterprises*$/i)) ) { if (link.parentNode) { link.parentNode.removeChild(link); } replacedLinks.add(link); } }); // 查找可能嵌套的Spaces和Posts文本 const textNodes = []; function findTextNodes(element) { if (element.nodeType === Node.TEXT_NODE) { const text = element.textContent.trim(); if (text === 'Spaces' || text === 'Posts' || text === 'Enterprise') { textNodes.push(element); } } else { for (const child of element.childNodes) { findTextNodes(child); } } } // 只在导航区域内查找文本节点 findTextNodes(headerArea); // 替换找到的文本节点 textNodes.forEach(node => { const text = node.textContent.trim(); if (text === 'Spaces') { node.textContent = node.textContent.replace(/Spaces/g, 'OCR模型免费转Markdown'); } else if (text === 'Posts') { // 删除Posts文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } else if (text === 'Enterprise') { // 删除Enterprise文本节点 if (node.parentNode) { node.parentNode.removeChild(node); } } }); // 标记已替换完成 window._navLinksReplaced = true; } // 替换代码区域中的域名 function replaceCodeDomains() { // 特别处理span.hljs-string和span.njs-string元素 document.querySelectorAll('span.hljs-string, span.njs-string, span[class*="hljs-string"], span[class*="njs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换hljs-string类的span中的域名(移除多余的转义符号) document.querySelectorAll('span.hljs-string, span[class*="hljs-string"]').forEach(span => { if (span.textContent && span.textContent.includes('huggingface.co')) { span.textContent = span.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 替换pre和code标签中包含git clone命令的域名 document.querySelectorAll('pre, code').forEach(element => { if (element.textContent && element.textContent.includes('git clone')) { const text = element.innerHTML; if (text.includes('huggingface.co')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 处理特定的命令行示例 document.querySelectorAll('pre, code').forEach(element => { const text = element.innerHTML; if (text.includes('huggingface.co')) { // 针对git clone命令的专门处理 if (text.includes('git clone') || text.includes('GIT_LFS_SKIP_SMUDGE=1')) { element.innerHTML = text.replace(/huggingface.co/g, 'aifasthub.com'); } } }); // 特别处理模型下载页面上的代码片段 document.querySelectorAll('.flex.border-t, .svelte_hydrator, .inline-block').forEach(container => { const content = container.innerHTML; if (content && content.includes('huggingface.co')) { container.innerHTML = content.replace(/huggingface.co/g, 'aifasthub.com'); } }); // 特别处理模型仓库克隆对话框中的代码片段 try { // 查找包含"Clone this model repository"标题的对话框 const cloneDialog = document.querySelector('.svelte_hydration_boundary, [data-target="MainHeader"]'); if (cloneDialog) { // 查找对话框中所有的代码片段和命令示例 const codeElements = cloneDialog.querySelectorAll('pre, code, span'); codeElements.forEach(element => { if (element.textContent && element.textContent.includes('huggingface.co')) { if (element.innerHTML.includes('huggingface.co')) { element.innerHTML = element.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { element.textContent = element.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); } // 更精确地定位克隆命令中的域名 document.querySelectorAll('[data-target]').forEach(container => { const codeBlocks = container.querySelectorAll('pre, code, span.hljs-string'); codeBlocks.forEach(block => { if (block.textContent && block.textContent.includes('huggingface.co')) { if (block.innerHTML.includes('huggingface.co')) { block.innerHTML = block.innerHTML.replace(/huggingface.co/g, 'aifasthub.com'); } else { block.textContent = block.textContent.replace(/huggingface.co/g, 'aifasthub.com'); } } }); }); } catch (e) { // 错误处理但不打印日志 } } // 当DOM加载完成后执行替换 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', () => { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); }); } else { replaceHeaderBranding(); replaceNavigationLinks(); replaceCodeDomains(); // 只在必要时执行替换 - 3秒后再次检查 setTimeout(() => { if (!window._navLinksReplaced) { console.log('[Client] 3秒后重新检查导航链接'); replaceNavigationLinks(); } }, 3000); } // 增加一个MutationObserver来处理可能的动态元素加载 const observer = new MutationObserver(mutations => { // 检查是否导航区域有变化 const hasNavChanges = mutations.some(mutation => { // 检查是否存在header或nav元素变化 return Array.from(mutation.addedNodes).some(node => { if (node.nodeType === Node.ELEMENT_NODE) { // 检查是否是导航元素或其子元素 if (node.tagName === 'HEADER' || node.tagName === 'NAV' || node.querySelector('header, nav')) { return true; } // 检查是否在导航元素内部 let parent = node.parentElement; while (parent) { if (parent.tagName === 'HEADER' || parent.tagName === 'NAV') { return true; } parent = parent.parentElement; } } return false; }); }); // 只在导航区域有变化时执行替换 if (hasNavChanges) { // 重置替换状态,允许再次替换 window._navLinksReplaced = false; replaceHeaderBranding(); replaceNavigationLinks(); } }); // 开始观察document.body的变化,包括子节点 if (document.body) { observer.observe(document.body, { childList: true, subtree: true }); } else { document.addEventListener('DOMContentLoaded', () => { observer.observe(document.body, { childList: true, subtree: true }); }); } })(); \n\n"},"meta":{"kind":"string","value":"{'content_hash': '9d19ef07cede800f4136339bbbf4ac9c', 'timestamp': '', 'source': 'github', 'line_count': 180, 'max_line_length': 159, 'avg_line_length': 42.19444444444444, 'alnum_prop': 0.5526003949967083, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': '0bd65c7ab53c8d08a01c5fdb9c461c1801589ce5', 'size': '7620', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.06.1-2.0.5/released/8.15.0/gappa/1.4.4.html', 'mode': '33188', 'license': 'mit', 'language': []}"}}},{"rowIdx":849706,"cells":{"text":{"kind":"string","value":"using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Web.UI.HtmlControls;\nusing System.Web.UI.WebControls;\nusing System.Web.UI;\nusing System.Web;\nusing System.Data;\nusing System.IO;\nusing Zenntrix_Silverlight_Toolkit;\n\n[assembly: TagPrefix(\"Zenntrix\", \"Zenntrix\")]\nnamespace Zenntrix_Toolkit\n{\n /// \n /// To Do:\n /// \n /// 1. Create Context menu with the items as shown below\n /// 1. Download\n /// 2. New Foler\n /// 3. Upload Document\n /// 4. Rename\n /// 5. Move\n /// 6. Delete\n /// 2. Create file uploader control\n /// 3. Reduce Viewstate usage\n /// \n\n [ToolboxData(\"<{0}:Zenntrix_Directory_View ID=\\\"ZDV_{0}\\\" runat=\\\"server\\\" ShowFoldersInViewer=\\\"true\\\">\")]\n public class Zenntrix_Directory_Viewer : System.Web.UI.Control\n {\n public event FileSelectedEventHandler FileSelected;\n public event FolderSelectedEventHandler FolderSelected;\n #region /* Controls */\n HtmlGenericControl DivDirectoryContainer = new HtmlGenericControl();\n Panel PanelFolderStructureContainer = new Panel();\n HtmlGenericControl DivFolderStructureContainerContainer = new HtmlGenericControl();\n HtmlGenericControl DivClear = new HtmlGenericControl();\n TreeView TreeViewFolderView = new TreeView();\n Panel PanelFileContainer = new Panel();\n Repeater RepeaterFiles = new Repeater();\n Zenntrix_File_Uploader FileUploader = new Zenntrix_File_Uploader();\n\n HtmlGenericControl DivContextMenuTitle = new HtmlGenericControl();\n Button ContextButtonUploadFiles = new Button();\n Button ContextButtonNewFolder = new Button();\n Panel PanelContextMenu = new Panel();\n Zenntrix_ContextMenu_Extender ZCE_ContextMenu = new Zenntrix_ContextMenu_Extender();\n #endregion\n\n #region /* Variables */\n private Files FilesMapping\n {\n get\n {\n Files FilesSaved = new Files();\n FilesSaved.DataSource = ((DataSet)ViewState[\"DsFiles\"]).Tables[0];\n FilesSaved.Name = ViewState[\"DsFilesName\"].ToString();\n FilesSaved.Size = ViewState[\"DsFilesSize\"].ToString();\n FilesSaved.DateCreated = ViewState[\"DsFilesDateCreated\"].ToString();\n FilesSaved.DateModified = ViewState[\"DsFilesDateModified\"].ToString();\n FilesSaved.StructureId = ViewState[\"DsFilesStructureID\"].ToString();\n return FilesSaved;\n }\n set\n {\n Files FilesSaved = new Files();\n FilesSaved = value;\n DataSet DsFiles = new DataSet();\n DsFiles.Tables.Add(FilesSaved.DataSource);\n ViewState[\"DsFiles\"] = DsFiles;\n ViewState[\"DsFilesName\"] = FilesSaved.Name;\n ViewState[\"DsFilesSize\"] = FilesSaved.Size;\n ViewState[\"DsFilesDateCreated\"] = FilesSaved.DateCreated;\n ViewState[\"DsFilesDateModified\"] = FilesSaved.DateModified;\n ViewState[\"DsFilesStructureID\"] = FilesSaved.StructureId;\n }\n }\n private Directories DirectoriesMapping\n {\n get\n {\n Directories DirectoriesSaved = new Directories();\n DirectoriesSaved.DataSource = ((DataSet)ViewState[\"DsDirs\"]).Tables[0];\n DirectoriesSaved.Name = ViewState[\"DsDirsName\"].ToString();\n DirectoriesSaved.StructureId = ViewState[\"DsDirsStructureId\"].ToString();\n DirectoriesSaved.ParentStructureId = ViewState[\"DsDirsParentStructureId\"].ToString();\n DirectoriesSaved.Path = ViewState[\"DsDirsPath\"].ToString();\n return DirectoriesSaved;\n }\n set\n {\n Directories DirectoriesSaved = new Directories();\n DirectoriesSaved = value;\n DataSet DsDirs = new DataSet();\n DsDirs.Tables.Add(DirectoriesSaved.DataSource);\n ViewState[\"DsDirs\"] = DsDirs;\n ViewState[\"DsDirsName\"] = DirectoriesSaved.Name;\n ViewState[\"DsDirsStructureId\"] = DirectoriesSaved.StructureId;\n ViewState[\"DsDirsParentStructureId\"] = DirectoriesSaved.ParentStructureId;\n ViewState[\"DsDirsPath\"] = DirectoriesSaved.Path;\n }\n }\n private string currentPath\n {\n get\n {\n if (ViewState[\"_currentPath\"] != null)\n {\n return ViewState[\"_currentPath\"].ToString();\n }\n else\n {\n return rootPath;\n }\n }\n set\n {\n ViewState[\"_currentPath\"] = value;\n }\n }\n private string rootPath\n {\n get\n {\n if (ViewState[\"_rootPath\"] != null)\n {\n return ViewState[\"_rootPath\"].ToString();\n }\n else\n {\n return \"\";\n }\n }\n set\n {\n ViewState[\"_rootPath\"] = value;\n }\n }\n private string SortDirection\n {\n get\n {\n if (ViewState[\"_SortDirection\"] != null)\n {\n return ViewState[\"_SortDirection\"].ToString();\n }\n else\n {\n return \"ASC\";\n }\n }\n set\n {\n ViewState[\"_SortDirection\"] = value;\n }\n }\n private string SortOrder\n {\n get\n {\n if (ViewState[\"_SortOrder\"] != null)\n {\n return ViewState[\"_SortOrder\"].ToString();\n }\n else\n {\n return \"LinkButtonSortName\";\n }\n }\n set\n {\n ViewState[\"_SortOrder\"] = value;\n }\n }\n private string CurrentFolderId\n {\n get\n {\n if (ViewState[\"_CurrentFolderId\"] != null)\n {\n return ViewState[\"_CurrentFolderId\"].ToString();\n }\n else\n {\n return \"\";\n }\n }\n set\n {\n ViewState[\"_CurrentFolderId\"] = value;\n }\n }\n public string Width\n {\n get\n {\n if (ViewState[\"_Width\"] != null)\n {\n return ViewState[\"_Width\"].ToString();\n }\n else\n {\n return Unit.Pixel(900).ToString() + \"px\";\n }\n }\n set\n {\n if (Unit.Parse(value).Type == UnitType.Pixel)\n {\n if (int.Parse(value.ToLower().Replace(\"px\", \"\")) < 600)\n {\n ViewState[\"_Width\"] = \"600px\";\n }\n else\n {\n ViewState[\"_Width\"] = value;\n }\n }\n else\n {\n ViewState[\"_Width\"] = value;\n }\n }\n }\n public Unit Height\n {\n get\n {\n if (ViewState[\"_height\"] != null)\n {\n return ((Unit)ViewState[\"_height\"]);\n }\n else\n {\n return Unit.Pixel(440);\n }\n }\n set\n {\n ViewState[\"_height\"] = value;\n }\n }\n\n public bool ShowFoldersInViewer\n {\n get\n {\n if (ViewState[\"_ShowFoldersInView\"] != null)\n {\n return ((bool)ViewState[\"_ShowFoldersInView\"]);\n }\n else\n {\n return false;\n }\n }\n set\n {\n ViewState[\"_ShowFoldersInView\"] = value;\n }\n }\n #endregion\n\n protected void Format_Controls()\n {\n FileUploader.ID = \"ZFU_FileUpload\";\n FileUploader.UploadCompleted += new UploadCompletedHandler(FileUploader_Completed);\n FileUploader.Title = \"Zenntrix File Uploader\";\n FileUploader.FileTypes = \"*\";\n FileUploader.UploadFileSizeLimit = 0;\n FileUploader.TotalUploadSizeLimit = 0;\n FileUploader.FileSaveDirectory = currentPath;\n\n DivDirectoryContainer.TagName = \"div\";\n DivDirectoryContainer.Style[\"width\"] = Width;\n DivDirectoryContainer.Attributes.Add(\"class\", \"ZDV_DirectoryContainer\");\n\n PanelFolderStructureContainer.Style.Value = \"height:\" + Height.Value + \"px;\";\n PanelFolderStructureContainer.ID = \"PanelFolderStructureContainer\";\n PanelFolderStructureContainer.CssClass = \"ZDV_FolderStructureContainer\";\n\n DivFolderStructureContainerContainer.TagName = \"div\";\n DivFolderStructureContainerContainer.Attributes.Add(\"class\", \"ZDV_Left ZDV_FolderStructureContainerWidth\");\n DivFolderStructureContainerContainer.ID = \"DivFolderStructureContainerContainer\";\n DivFolderStructureContainerContainer.Attributes.Add(\"oncontextmenu\", \"return false;\");\n\n TreeViewFolderView.ID = \"TreeViewFolderView\";\n TreeViewFolderView.SelectedNodeStyle.CssClass = \"Zenntrix_AdminTreeView_Selected\";\n TreeViewFolderView.SelectedNodeChanged += new EventHandler(TreeViewFolderView_SelectedNodeChanged);\n\n PanelFileContainer.ID = \"PanelFileContainer\";\n PanelFileContainer.CssClass = \"ZDV_Left ZDV_FileContainerWidth\";\n PanelFileContainer.Attributes.Add(\"oncontextmenu\", \"return false;\");\n\n RepeaterFiles.ID = \"RepeaterFiles\";\n Repeater_Files_ITemplate FilesITemplate = new Repeater_Files_ITemplate();\n FilesITemplate.FolderSelected += new FolderSelectedEventHandler(OnFolderSelected);\n FilesITemplate.FileSelected += new FileSelectedEventHandler(OnFileSelected);\n FilesITemplate.FileMap(FilesMapping);\n RepeaterFiles.ItemTemplate = FilesITemplate;\n Repeater_Files_HeaderITemplate FilesHeaderITemplate = new Repeater_Files_HeaderITemplate();\n FilesHeaderITemplate.ColumnSorted += new EventHandler(OnColumnSorted);\n FilesHeaderITemplate.Set_SortOrder(SortOrder, SortDirection);\n RepeaterFiles.HeaderTemplate = FilesHeaderITemplate;\n RepeaterFiles.FooterTemplate = new Repeater_Files_FooterITemplate();\n\n DivClear.TagName = \"div\";\n DivClear.Attributes.Add(\"class\", \"ZDV_Clear\");\n }\n\n protected void FileUploader_Completed(object sender, EventArgs e)\n {\n }\n\n protected void OnColumnSorted(object sender, EventArgs e)\n {\n if (SortDirection == \"ASC\" && SortOrder == ((LinkButton)sender).ID)\n SortDirection = \"DESC\";\n else\n SortDirection = \"ASC\";\n\n SortOrder = ((LinkButton)sender).ID;\n Format_Controls();\n\n Load_Files(CurrentFolderId);\n }\n\n protected void Add_Controls()\n {\n Literal LiteralCssLink = new Literal();\n LiteralCssLink.Text = \"\";\n this.Page.Header.Controls.Add(LiteralCssLink);\n\n PanelFolderStructureContainer.Controls.Add(TreeViewFolderView);\n PanelFileContainer.Controls.Add(RepeaterFiles);\n DivFolderStructureContainerContainer.Controls.Add(PanelFolderStructureContainer);\n\n DivDirectoryContainer.Controls.Add(DivFolderStructureContainerContainer);\n DivDirectoryContainer.Controls.Add(PanelFileContainer);\n DivDirectoryContainer.Controls.Add(DivClear);\n Controls.Add(DivDirectoryContainer);\n Controls.Add(FileUploader);\n }\n protected void CreateContextMenu()\n {\n #region /* Context Menu Formatting */\n DivContextMenuTitle.TagName = \"div\";\n DivContextMenuTitle.Attributes.Add(\"class\", \"ZDV_ContextMenu_Header\");\n DivContextMenuTitle.InnerText = \"Actions\";\n\n ZCE_ContextMenu.ID = \"ZCE_ContextMenu\";\n ZCE_ContextMenu.ContextMenu = \"PanelContextMenu\";\n ZCE_ContextMenu.TargetControl = \"PanelFileContainer\";\n ZCE_ContextMenu.ContextMenuShown += new Zenntrix_ContextMenu_Extender.ContextMenuShownEventHandler(ZCE_ContextMenu_ContextMenuShown);\n\n ContextButtonUploadFiles.ID = \"ContextButtonUploadFiles\";\n ContextButtonUploadFiles.Text = \"Upload file\";\n ContextButtonUploadFiles.CssClass = \"ZDV_ContextMenu_Full\";\n ContextButtonUploadFiles.Click += new EventHandler(ContextButtonUploadFiles_Click);\n\n ContextButtonNewFolder.ID = \"ContextButtonNewFolder\";\n ContextButtonNewFolder.Text = \"New folder\";\n ContextButtonNewFolder.CssClass = \"ZDV_ContextMenu_Full\";\n ContextButtonNewFolder.Click += new EventHandler(ContextButtonNewFolder_Click);\n\n\n PanelContextMenu.ID = \"PanelContextMenu\";\n PanelContextMenu.CssClass = \"ZDV_ContextMenu_Container\";\n #endregion\n\n PanelContextMenu.Controls.Add(DivContextMenuTitle);\n PanelContextMenu.Controls.Add(ContextButtonUploadFiles);\n PanelContextMenu.Controls.Add(ContextButtonNewFolder);\n Controls.Add(PanelContextMenu);\n Controls.Add(ZCE_ContextMenu);\n }\n\n protected override void OnInit(EventArgs e)\n {\n CreateContextMenu();\n base.OnInit(e);\n }\n protected override void OnLoad(EventArgs e)\n {\n Format_Controls();\n Add_Controls();\n base.OnLoad(e);\n }\n\n protected override void Render(HtmlTextWriter writer)\n {\n this.Page.ClientScript.RegisterForEventValidation(ContextButtonUploadFiles.UniqueID);\n base.Render(writer);\n }\n\n\n protected void ZCE_ContextMenu_ContextMenuShown(object sender, EventArgs e)\n {\n }\n protected void ContextButtonUploadFiles_Click(object sender, EventArgs e)\n {\n Upload();\n }\n protected void ContextButtonNewFolder_Click(object sender, EventArgs e)\n {\n //Show popup for new folder name entry\n }\n protected void Upload()\n {\n FileUploader.FileSaveDirectory = currentPath;\n FileUploader.Show();\n }\n\n public void Load_Structure(Directories Directories, Files Files, string RootPath)\n {\n if (RootPath.EndsWith(\"//\") == false)\n {\n rootPath = RootPath + \"//\";\n }\n else\n {\n rootPath = RootPath;\n }\n rootPath = RootPath;\n FilesMapping = Files;\n DataTable DataTableFiles = FilesMapping.DataSource;\n if (Files.DataSource.Columns[\"Zenntrix_Directory_Viewer_File_Type\"] == null)\n {\n DataTableFiles.Columns.Add(\"Zenntrix_Directory_Viewer_File_Type\");\n }\n FilesMapping.DataSource = DataTableFiles;\n Format_Controls();\n Add_Controls();\n Load_Directories(Directories);\n Load_Files(\"0\");\n }\n public void Load_Structure(string FullPath)\n {\n\n Directories GetDirectories = new Directories();\n GetDirectories.DataSource = Scan_Directory(FullPath);\n GetDirectories.Name = \"Name\";\n GetDirectories.ParentStructureId = \"Parent\";\n GetDirectories.StructureId = \"Location\";\n GetDirectories.Path = \"Location\";\n\n Files GetFiles = new Files();\n GetFiles.DataSource = Scan_Directory_For_Files(FullPath);\n GetFiles.Name = \"Name\";\n GetFiles.Size = \"Size\";\n GetFiles.StructureId = \"Location\";\n GetFiles.DateCreated = \"CreatedDate\";\n GetFiles.DateModified = \"ModifiedDate\";\n\n Load_Structure(GetDirectories, GetFiles, rootPath);\n }\n\n public DataTable Scan_Directory(string FileDirectory)\n {\n DataTable DataTableNewDirectory = new DataTable();\n DataTableNewDirectory.Columns.Add(\"Location\");\n DataTableNewDirectory.Columns.Add(\"Parent\");\n DataTableNewDirectory.Columns.Add(\"Name\");\n DataTableNewDirectory.Columns.Add(\"Status\");\n DirectoryInfo DirectoryToScan = new DirectoryInfo(FileDirectory);\n\n foreach (DirectoryInfo D in DirectoryToScan.GetDirectories())\n {\n DataRow NewDataRow = DataTableNewDirectory.NewRow();\n NewDataRow[\"Name\"] = D.Name;\n NewDataRow[\"Parent\"] = D.Parent.FullName.Replace(FileDirectory, \"\");\n NewDataRow[\"Location\"] = D.FullName.Replace(FileDirectory, \"\");\n DataTableNewDirectory.Rows.Add(NewDataRow);\n Get_Children_Directories(DataTableNewDirectory, D, FileDirectory);\n }\n\n return DataTableNewDirectory;\n }\n protected void Get_Children_Directories(DataTable DataTableToLoadInto, DirectoryInfo DirectoryToScan, string RootFileDirectory)\n {\n foreach (DirectoryInfo D in DirectoryToScan.GetDirectories())\n {\n DataRow NewDataRow = DataTableToLoadInto.NewRow();\n NewDataRow[\"Name\"] = D.Name;\n NewDataRow[\"Parent\"] = D.Parent.FullName.Replace(RootFileDirectory, \"\");\n NewDataRow[\"Location\"] = D.FullName.Replace(RootFileDirectory, \"\");\n DataTableToLoadInto.Rows.Add(NewDataRow);\n Get_Children_Directories(DataTableToLoadInto, D, RootFileDirectory);\n }\n }\n\n #region /* Directories */\n protected void Load_Directories(Directories Directories)\n {\n DataTable DirectoryStructure = Directories.DataSource;\n TreeViewFolderView.Nodes.Clear();\n DirectoryStructure.PrimaryKey = new DataColumn[] { DirectoryStructure.Columns[Directories.StructureId] };\n Directories.DataSource = DirectoryStructure;\n DirectoriesMapping = Directories;\n TreeNode TNRoot = new TreeNode();\n TNRoot.Text = \"..root\";\n TNRoot.Value = \"0\";\n TNRoot.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), \"Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Folder.png\");\n TNRoot.Selected = true;\n TNRoot.Expanded = true;\n TNRoot.SelectAction = TreeNodeSelectAction.SelectExpand;\n\n foreach (DataRow R in DirectoriesMapping.DataSource.Rows)\n {\n if (R[Directories.ParentStructureId].ToString() == \"0\" || R[Directories.ParentStructureId].ToString() == \"\")\n {\n TreeNode TNNodes = new TreeNode();\n TNNodes.Text = R[Directories.Name].ToString();\n TNNodes.Value = R[Directories.StructureId].ToString();\n TNNodes.Expanded = false;\n TNNodes.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), \"Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Folder.png\");\n TNNodes.SelectAction = TreeNodeSelectAction.SelectExpand;\n Add_Children_Structure(TNNodes, Directories);\n TNRoot.ChildNodes.Add(TNNodes);\n }\n }\n\n TreeViewFolderView.Nodes.Add(TNRoot);\n }\n protected void Add_Children_Structure(TreeNode Parent, Directories Directories)\n {\n DataTable DirectoryStructure = Directories.DataSource;\n\n foreach (DataRow R in DirectoryStructure.Rows)\n {\n if (R[Directories.ParentStructureId].ToString() == Parent.Value)\n {\n TreeNode TNChildNode = new TreeNode();\n TNChildNode.Text = R[Directories.Name].ToString();\n TNChildNode.Value = R[Directories.StructureId].ToString();\n TNChildNode.Expanded = false;\n TNChildNode.SelectAction = TreeNodeSelectAction.SelectExpand;\n TNChildNode.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), \"Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Folder.png\");\n Add_Children_Structure(TNChildNode, Directories);\n Parent.ChildNodes.Add(TNChildNode);\n }\n }\n }\n public class Directories\n {\n private DataTable _Directories;\n private string _Name;\n private string _Id;\n private string _Path;\n private string _ParentId;\n\n /// \n /// The datatable holding the directories\n /// \n public DataTable DataSource\n {\n get\n {\n return _Directories;\n }\n set\n {\n _Directories = value;\n }\n }\n /// \n /// The column name that contains the name to be displayed\n /// \n public string Name\n {\n get\n {\n return _Name;\n }\n set\n {\n _Name = value;\n }\n }\n public string Path\n {\n get\n {\n return _Path;\n }\n set\n {\n _Path = value;\n }\n }\n /// \n /// The Id of the current directory\n /// \n public string StructureId\n {\n get\n {\n return _Id;\n }\n set\n {\n _Id = value;\n }\n }\n /// \n /// The parent id of the current directory\n /// \n public string ParentStructureId\n {\n get\n {\n return _ParentId;\n }\n set\n {\n _ParentId = value;\n }\n }\n }\n #endregion\n\n #region /* Files */\n protected void Set_Selected_TreeNode(TreeView TV, string SelectedValue)\n {\n foreach (TreeNode TN in TV.Nodes)\n {\n if (TN.Value == SelectedValue)\n {\n TN.Parent.Expanded = true;\n TN.Select();\n TN.Selected = true;\n break;\n }\n else\n {\n Set_Selected_TreeNode(TN, SelectedValue);\n }\n\n }\n }\n public void Set_Selected_Directory(string SelectedValue)\n {\n foreach (TreeNode TN in TreeViewFolderView.Nodes)\n {\n if (TN.Value == SelectedValue)\n {\n TN.Parent.Expanded = true;\n TN.Select();\n TN.Selected = true;\n Load_Files(TN.Value);\n break;\n }\n else\n {\n Set_Selected_TreeNode(TN, SelectedValue);\n }\n\n }\n }\n protected void Set_Selected_TreeNode(TreeNode TN, string SelectedValue)\n {\n foreach (TreeNode CTN in TN.ChildNodes)\n {\n if (CTN.Value == SelectedValue)\n {\n CTN.Parent.Expanded = true;\n CTN.Select();\n CTN.Selected = true;\n break;\n }\n else\n {\n Set_Selected_TreeNode(CTN, SelectedValue);\n }\n }\n }\n protected void Load_Files(string ID)\n {\n DataTable DataTableFilesToOutput = FilesMapping.DataSource.Clone();\n DataTableFilesToOutput.Columns[FilesMapping.Size].DataType = typeof(int);\n #region /* Set Sort */\n string stringSort = string.Empty;\n switch (SortOrder)\n {\n case \"LinkButtonSortName\":\n stringSort = FilesMapping.Name + \" \" + SortDirection;\n break;\n case \"LinkButtonSortSize\":\n stringSort = FilesMapping.Size + \" \" + SortDirection;\n break;\n case \"LinkButtonSortCreated\":\n stringSort = FilesMapping.DateCreated + \" \" + SortDirection;\n break;\n case \"LinkButtonSortModified\":\n stringSort = FilesMapping.DateModified + \" \" + SortDirection;\n break;\n }\n #endregion\n\n #region /* Load Files */\n foreach (DataRow R in FilesMapping.DataSource.Rows)\n {\n if (ID == \"0\")\n {\n if (R[FilesMapping.StructureId].ToString() == \"\")\n {\n DataRow NewDataRow = DataTableFilesToOutput.NewRow();\n NewDataRow[FilesMapping.StructureId] = R[FilesMapping.StructureId];\n NewDataRow[FilesMapping.Name] = R[FilesMapping.Name];\n NewDataRow[FilesMapping.Size] = R[FilesMapping.Size];\n NewDataRow[FilesMapping.DateModified] = R[FilesMapping.DateModified];\n NewDataRow[FilesMapping.DateCreated] = R[FilesMapping.DateCreated];\n DataTableFilesToOutput.Rows.Add(NewDataRow);\n }\n }\n if (R[FilesMapping.StructureId].ToString() == ID)\n {\n DataRow NewDataRow = DataTableFilesToOutput.NewRow();\n NewDataRow[FilesMapping.StructureId] = R[FilesMapping.StructureId];\n NewDataRow[FilesMapping.Name] = R[FilesMapping.Name];\n NewDataRow[FilesMapping.Size] = R[FilesMapping.Size];\n NewDataRow[FilesMapping.DateModified] = R[FilesMapping.DateModified];\n NewDataRow[FilesMapping.DateCreated] = R[FilesMapping.DateCreated];\n DataTableFilesToOutput.Rows.Add(NewDataRow);\n }\n }\n #endregion\n\n #region /* Load Folders */\n if (ShowFoldersInViewer)\n {\n foreach (DataRow R in DirectoriesMapping.DataSource.Rows)\n {\n if (R[DirectoriesMapping.ParentStructureId].ToString() == ID)\n {\n DataRow NewDataRow = DataTableFilesToOutput.NewRow();\n NewDataRow[FilesMapping.StructureId] = R[DirectoriesMapping.StructureId];\n NewDataRow[FilesMapping.Name] = R[DirectoriesMapping.Name];\n NewDataRow[FilesMapping.Size] = Get_Folder_Size(R[DirectoriesMapping.StructureId].ToString());\n NewDataRow[\"Zenntrix_Directory_Viewer_File_Type\"] = \"Folder\";\n DataTableFilesToOutput.Rows.Add(NewDataRow);\n }\n else if (ID == \"0\" && R[DirectoriesMapping.ParentStructureId].ToString() == \"\")\n {\n DataRow NewDataRow = DataTableFilesToOutput.NewRow();\n NewDataRow[FilesMapping.StructureId] = R[DirectoriesMapping.StructureId];\n NewDataRow[FilesMapping.Name] = R[DirectoriesMapping.Name];\n NewDataRow[FilesMapping.Size] = Get_Folder_Size(R[DirectoriesMapping.StructureId].ToString());\n NewDataRow[\"Zenntrix_Directory_Viewer_File_Type\"] = \"Folder\";\n DataTableFilesToOutput.Rows.Add(NewDataRow);\n }\n }\n }\n #endregion\n\n DataTable DataTableSorted = FilesMapping.DataSource.Clone();\n foreach (DataRow R in DataTableFilesToOutput.Select(\"\", \"Zenntrix_Directory_Viewer_File_Type desc,\" + stringSort))\n {\n DataRow NewDataRow = DataTableSorted.NewRow();\n NewDataRow[FilesMapping.StructureId] = R[FilesMapping.StructureId];\n NewDataRow[FilesMapping.Name] = R[FilesMapping.Name];\n NewDataRow[FilesMapping.Size] = R[FilesMapping.Size];\n NewDataRow[FilesMapping.DateCreated] = R[FilesMapping.DateCreated];\n NewDataRow[FilesMapping.DateModified] = R[FilesMapping.DateModified];\n NewDataRow[\"Zenntrix_Directory_Viewer_File_Type\"] = R[\"Zenntrix_Directory_Viewer_File_Type\"];\n\n DataTableSorted.Rows.Add(NewDataRow);\n }\n\n RepeaterFiles.DataSource = DataTableSorted;\n RepeaterFiles.DataBind();\n }\n protected int Get_Folder_Size(string ID)\n {\n int intFolderSize = 0;\n foreach (DataRow R in FilesMapping.DataSource.Rows)\n {\n if (ID == \"0\")\n {\n if (R[FilesMapping.StructureId].ToString() == \"\")\n {\n intFolderSize += int.Parse(R[FilesMapping.Size].ToString());\n }\n }\n if (R[FilesMapping.StructureId].ToString() == ID)\n {\n intFolderSize += int.Parse(R[FilesMapping.Size].ToString());\n }\n }\n foreach (DataRow R in DirectoriesMapping.DataSource.Rows)\n {\n if (R[DirectoriesMapping.ParentStructureId].ToString() == ID)\n {\n intFolderSize += Get_Folder_Size(R[DirectoriesMapping.StructureId].ToString());\n }\n }\n return intFolderSize;\n\n }\n public DataTable Scan_Directory_For_Files(string FileDirectory)\n {\n DataTable DataTableFiles = new DataTable();\n DataTableFiles.Columns.Add(\"Name\");\n DataTableFiles.Columns.Add(\"Extension\");\n DataTableFiles.Columns.Add(\"ModifiedDate\");\n DataTableFiles.Columns.Add(\"CreatedDate\");\n DataTableFiles.Columns.Add(\"Size\");\n DataTableFiles.Columns.Add(\"Location\");\n DataTableFiles.Columns.Add(\"LocationAndFile\");\n DataTableFiles.Columns.Add(\"Status\");\n\n DirectoryInfo DirectoryToSearch = new DirectoryInfo(FileDirectory);\n\n foreach (FileInfo Fi in DirectoryToSearch.GetFiles())\n {\n DataRow NewDataRow = DataTableFiles.NewRow();\n NewDataRow[\"Name\"] = Fi.Name;\n NewDataRow[\"Extension\"] = Fi.Extension;\n NewDataRow[\"ModifiedDate\"] = Fi.LastWriteTime;\n NewDataRow[\"CreatedDate\"] = Fi.CreationTime;\n NewDataRow[\"Size\"] = (Fi.Length / 1024);\n NewDataRow[\"Location\"] = Fi.Directory.FullName.Replace(FileDirectory, \"\");\n NewDataRow[\"LocationAndFile\"] = Fi.Directory.FullName.Replace(FileDirectory, \"\") + \"\\\\\" + Fi.Name;\n DataTableFiles.Rows.Add(NewDataRow);\n }\n foreach (DirectoryInfo D in DirectoryToSearch.GetDirectories())\n {\n Get_Children_Files(DataTableFiles, D, FileDirectory);\n }\n\n return DataTableFiles;\n }\n protected void Get_Children_Files(DataTable DataTableToLoadInto, DirectoryInfo DirectoryToScan, string RootFileDirectory)\n {\n foreach (FileInfo Fi in DirectoryToScan.GetFiles())\n {\n DataRow NewDataRow = DataTableToLoadInto.NewRow();\n NewDataRow[\"Name\"] = Fi.Name;\n NewDataRow[\"Extension\"] = Fi.Extension;\n NewDataRow[\"ModifiedDate\"] = Fi.LastWriteTime;\n NewDataRow[\"CreatedDate\"] = Fi.CreationTime;\n NewDataRow[\"Size\"] = (Fi.Length / 1024);\n NewDataRow[\"Location\"] = Fi.Directory.FullName.Replace(RootFileDirectory, \"\");\n NewDataRow[\"LocationAndFile\"] = Fi.Directory.FullName.Replace(RootFileDirectory, \"\") + \"\\\\\" + Fi.Name;\n DataTableToLoadInto.Rows.Add(NewDataRow);\n }\n foreach (DirectoryInfo D in DirectoryToScan.GetDirectories())\n {\n Get_Children_Files(DataTableToLoadInto, D, RootFileDirectory);\n }\n }\n public class Files\n {\n private DataTable _Files;\n private string _StructureId;\n private string _Name;\n private string _Size;\n private string _DateCreated;\n private string _DateModified;\n\n /// \n /// The datatable holding the files\n /// \n public DataTable DataSource\n {\n get\n {\n return _Files;\n }\n set\n {\n _Files = value;\n }\n }\n /// \n /// The column that contains the structure id it is linked to.\n /// \n public string StructureId\n {\n get\n {\n return _StructureId;\n }\n set\n {\n _StructureId = value;\n }\n }\n /// \n /// The column name that contains the name to be displayed\n /// \n public string Name\n {\n get\n {\n return _Name;\n }\n set\n {\n _Name = value;\n }\n }\n /// \n /// The column that contains the file size in KiloBytes. (Interger Field)\n /// \n public string Size\n {\n get\n {\n return _Size;\n }\n set\n {\n _Size = value;\n }\n }\n /// \n /// The column that contains the date created (DateTime Field)\n /// \n public string DateCreated\n {\n get\n {\n return _DateCreated;\n }\n set\n {\n _DateCreated = value;\n }\n }\n /// \n /// The column that contains the date modified (DateTime Field)\n /// \n public string DateModified\n {\n get\n {\n return _DateModified;\n }\n set\n {\n _DateModified = value;\n }\n }\n }\n #endregion\n\n protected void OnFileSelected(object sender, ZentrixDirectoryViewFileSelected e)\n {\n if (FileSelected != null)\n {\n foreach (DataRow R in FilesMapping.DataSource.Rows)\n {\n if (e.FileName == R[FilesMapping.Name].ToString() && e.FileStructureID == R[FilesMapping.StructureId].ToString())\n {\n e.FileSize = int.Parse(R[FilesMapping.Size].ToString());\n e.FileCreated = DateTime.Parse(R[FilesMapping.DateCreated].ToString());\n e.FileModified = DateTime.Parse(R[FilesMapping.DateModified].ToString());\n string stringFolderPath = \"\";\n if (e.FileStructureID != \"\")\n stringFolderPath = DirectoriesMapping.DataSource.Rows.Find(e.FileStructureID)[DirectoriesMapping.Path].ToString();\n\n e.FilePath = rootPath + \"\\\\\" + stringFolderPath + \"\\\\\" + e.FileName;\n\n FileStream MyFileStream = new FileStream(e.FilePath, FileMode.Open);\n byte[] Buffer = new byte[(int)MyFileStream.Length];\n MyFileStream.Read(Buffer, 0, (int)MyFileStream.Length);\n MyFileStream.Close();\n this.Page.Response.ContentType = \"application/octet-stream\";\n this.Page.Response.AddHeader(\"content-disposition\", \"attachment; filename=\\\"\" + e.FileName + \"\\\"\");\n this.Page.Response.BinaryWrite(Buffer);\n this.Page.Response.End();\n break;\n }\n }\n FileSelected(sender, e);\n }\n }\n protected void SetCurrentFilePath(string stringCurrentFolderId)\n {\n if (stringCurrentFolderId != \"0\" && stringCurrentFolderId != \"\")\n {\n DataTable DataTableFolders = DirectoriesMapping.DataSource;\n DataTableFolders.PrimaryKey = new DataColumn[] { DataTableFolders.Columns[DirectoriesMapping.StructureId] };\n currentPath = rootPath + DataTableFolders.Rows.Find(CurrentFolderId)[DirectoriesMapping.Path].ToString();\n }\n else\n {\n currentPath = rootPath;\n }\n FileUploader.FileSaveDirectory = currentPath;\n }\n\n protected void OnFolderSelected(object sender, ZentrixDirectoryViewFolderSelected e)\n {\n CurrentFolderId = ((LinkButton)sender).CommandArgument.ToString();\n Set_Selected_TreeNode(TreeViewFolderView, CurrentFolderId);\n SetCurrentFilePath(CurrentFolderId);\n Load_Files(CurrentFolderId);\n if (FolderSelected != null)\n {\n e.FolderSize = Get_Folder_Size(CurrentFolderId);\n FolderSelected(sender, e);\n }\n }\n protected void TreeViewFolderView_SelectedNodeChanged(object sender, EventArgs e)\n {\n CurrentFolderId = TreeViewFolderView.SelectedNode.Value;\n ZentrixDirectoryViewFolderSelected Event = new ZentrixDirectoryViewFolderSelected();\n Event.FolderName = TreeViewFolderView.SelectedNode.Text;\n Event.FolderId = CurrentFolderId;\n Event.FolderSize = Get_Folder_Size(CurrentFolderId);\n SetCurrentFilePath(CurrentFolderId);\n FolderSelected(sender, Event);\n Load_Files(TreeViewFolderView.SelectedNode.Value);\n }\n\n protected class Repeater_Files_ITemplate : ITemplate\n {\n private Zenntrix_Directory_Viewer.Files FileMapping;\n public void FileMap(Zenntrix_Directory_Viewer.Files FileMap)\n {\n FileMapping = FileMap;\n }\n public void InstantiateIn(Control ControlSender)\n {\n RepeaterItem RepeaterItemContainer = ((RepeaterItem)ControlSender);\n HtmlGenericControl Container = new HtmlGenericControl();\n Container.TagName = \"div\";\n Container.Attributes.Add(\"class\", \"ZDV_RepeaterFilesContainer\");\n if (RepeaterItemContainer.ItemType == ListItemType.Item || RepeaterItemContainer.ItemType == ListItemType.AlternatingItem)\n {\n #region /* File Name Column */\n HtmlGenericControl DivNameColumn = new HtmlGenericControl();\n DivNameColumn.TagName = \"div\";\n DivNameColumn.Attributes.Add(\"class\", \"ZDV_Left ZDV_RepeaterFilesNameContainer\");\n HtmlGenericControl DivImageContainer = new HtmlGenericControl();\n DivImageContainer.TagName = \"div\";\n DivImageContainer.Attributes.Add(\"class\", \"ZDV_Left ZDV_RepeaterFilesImage\");\n HtmlImage FileImage = new HtmlImage();\n FileImage.Attributes.Add(\"FileNameColumn\", FileMapping.Name);\n FileImage.DataBinding += new EventHandler(FileImage_Bound);\n HtmlGenericControl DivFileNameContainer = new HtmlGenericControl();\n DivFileNameContainer.TagName = \"div\";\n DivFileNameContainer.Attributes.Add(\"class\", \"ZDV_Left ZDV_RepeaterFilesName\");\n LinkButton LinkButtonFilename = new LinkButton();\n LinkButtonFilename.ID = \"LinkButtonFilename\";\n LinkButtonFilename.Attributes.Add(\"ColumnName\", FileMapping.Name);\n LinkButtonFilename.Attributes.Add(\"IdColumnName\", FileMapping.StructureId);\n LinkButtonFilename.DataBinding += new EventHandler(LinkButtonFilename_Bound);\n LinkButtonFilename.Click += new EventHandler(LinkButtonFilename_Click);\n\n DivImageContainer.Controls.Add(FileImage);\n DivFileNameContainer.Controls.Add(LinkButtonFilename);\n DivNameColumn.Controls.Add(DivImageContainer);\n DivNameColumn.Controls.Add(DivFileNameContainer);\n Container.Controls.Add(DivNameColumn);\n #endregion\n #region /* Size Column */\n HtmlGenericControl DivSizeColumn = new HtmlGenericControl();\n DivSizeColumn.TagName = \"div\";\n DivSizeColumn.Attributes.Add(\"class\", \"ZDV_Left ZDV_RepeaterFilesSize\");\n DivSizeColumn.Attributes.Add(\"ColumnName\", FileMapping.Size);\n DivSizeColumn.DataBinding += new EventHandler(Size_Bound);\n Container.Controls.Add(DivSizeColumn);\n #endregion\n #region /* Date Created Column */\n HtmlGenericControl DivDateCreatedColumn = new HtmlGenericControl();\n DivDateCreatedColumn.TagName = \"div\";\n DivDateCreatedColumn.Attributes.Add(\"class\", \"ZDV_Left ZDV_RepeaterFilesDateCreated\");\n DivDateCreatedColumn.Attributes.Add(\"ColumnName\", FileMapping.DateCreated);\n DivDateCreatedColumn.DataBinding += new EventHandler(Field_Bound);\n Container.Controls.Add(DivDateCreatedColumn);\n #endregion\n #region /* Date Modified Column */\n HtmlGenericControl DivDateModifiedColumn = new HtmlGenericControl();\n DivDateModifiedColumn.TagName = \"div\";\n DivDateModifiedColumn.Attributes.Add(\"class\", \"ZDV_Left ZDV_RepeaterFilesDateModified\");\n DivDateModifiedColumn.Attributes.Add(\"ColumnName\", FileMapping.DateModified);\n DivDateModifiedColumn.DataBinding += new EventHandler(Field_Bound);\n Container.Controls.Add(DivDateModifiedColumn);\n #endregion\n #region /* Div Cleaner */\n HtmlGenericControl DivClean = new HtmlGenericControl();\n DivClean.TagName = \"div\";\n DivClean.Attributes.Add(\"class\", \"ZDV_Clear\");\n Container.Controls.Add(DivClean);\n #endregion\n RepeaterItemContainer.Controls.Add(Container);\n }\n }\n public event FolderSelectedEventHandler FolderSelected;\n public event FileSelectedEventHandler FileSelected;\n\n protected void Size_Bound(object sender, EventArgs e)\n {\n HtmlGenericControl DivColumn = (HtmlGenericControl)sender;\n RepeaterItem RepeaterItemContainer = ((RepeaterItem)DivColumn.NamingContainer);\n string stringFileSize = string.Empty;\n int intFileSize = 0;\n int.TryParse(DataBinder.Eval(RepeaterItemContainer.DataItem, DivColumn.Attributes[\"ColumnName\"].ToString()).ToString(), out intFileSize);\n\n if (intFileSize >= 1048576)\n stringFileSize = (intFileSize / 1048576).ToString() + \" GB\";\n else if (intFileSize >= 1024)\n stringFileSize = (intFileSize / 1024).ToString() + \" MB\";\n else stringFileSize = intFileSize.ToString() + \" KB\";\n\n DivColumn.InnerText = stringFileSize;\n }\n protected void Field_Bound(object sender, EventArgs e)\n {\n string ControlType = sender.GetType().Name;\n RepeaterItem RepeaterItemContainer = ((RepeaterItem)((Control)sender).NamingContainer);\n\n switch (ControlType)\n {\n case \"HtmlGenericControl\":\n HtmlGenericControl Column = (HtmlGenericControl)sender;\n if (Column.Attributes[\"ColumnName\"] != null)\n {\n Column.InnerText = DataBinder.Eval(RepeaterItemContainer.DataItem, Column.Attributes[\"ColumnName\"].ToString()).ToString();\n }\n break;\n case \"LinkButton\":\n LinkButton LinkButtonColumn = (LinkButton)sender;\n if (LinkButtonColumn.Attributes[\"ColumnName\"] != null)\n {\n LinkButtonColumn.Text = DataBinder.Eval(RepeaterItemContainer.DataItem, LinkButtonColumn.Attributes[\"ColumnName\"].ToString()).ToString();\n }\n break;\n }\n }\n protected void LinkButtonFilename_Bound(object sender, EventArgs e)\n {\n RepeaterItem RepeaterItemContainer = ((RepeaterItem)((LinkButton)sender).NamingContainer);\n LinkButton Column = (LinkButton)sender;\n if (Column.Attributes[\"ColumnName\"] != null)\n {\n Column.ToolTip = DataBinder.Eval(RepeaterItemContainer.DataItem, Column.Attributes[\"ColumnName\"].ToString()).ToString();\n Column.Text = DataBinder.Eval(RepeaterItemContainer.DataItem, Column.Attributes[\"ColumnName\"].ToString()).ToString();\n Column.CommandArgument = DataBinder.Eval(RepeaterItemContainer.DataItem, Column.Attributes[\"IdColumnName\"].ToString()).ToString();\n Column.CommandName = DataBinder.Eval(RepeaterItemContainer.DataItem, \"Zenntrix_Directory_Viewer_File_Type\").ToString();\n }\n }\n protected void FileImage_Bound(object sender, EventArgs e)\n {\n RepeaterItem RepeaterItemContainer = ((RepeaterItem)((HtmlImage)sender).NamingContainer);\n HtmlImage Column = (HtmlImage)sender;\n string stringFileExtension = string.Empty;\n if (Column.Attributes[\"FileNameColumn\"] != null && DataBinder.Eval(RepeaterItemContainer.DataItem, \"Zenntrix_Directory_Viewer_File_Type\").ToString() == \"\")\n {\n FileInfo FileInfoGetExtension = new FileInfo(DataBinder.Eval(RepeaterItemContainer.DataItem, Column.Attributes[\"FileNameColumn\"].ToString()).ToString());\n stringFileExtension = FileInfoGetExtension.Extension.ToString();\n }\n string stringImageLocation = string.Empty;\n if (stringFileExtension == \"\" && DataBinder.Eval(RepeaterItemContainer.DataItem, \"Zenntrix_Directory_Viewer_File_Type\").ToString() == \"Folder\")\n {\n stringImageLocation = RepeaterItemContainer.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), \"Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Folder.png\");\n }\n else\n {\n stringImageLocation = stringFileExtension;\n if (!File.Exists(stringImageLocation))\n {\n stringImageLocation = RepeaterItemContainer.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), \"Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.File.png\");\n }\n }\n\n Column.Src = stringImageLocation;\n }\n\n protected void LinkButtonFilename_Click(object sender, EventArgs e)\n {\n if (((LinkButton)sender).CommandName == \"Folder\")\n {\n if (FolderSelected != null)\n {\n ZentrixDirectoryViewFolderSelected Event = new ZentrixDirectoryViewFolderSelected();\n Event.FolderName = ((LinkButton)sender).Text;\n Event.FolderId = ((LinkButton)sender).CommandArgument;\n FolderSelected(sender, Event);\n }\n }\n else\n {\n if (FileSelected != null)\n {\n ZentrixDirectoryViewFileSelected Event = new ZentrixDirectoryViewFileSelected();\n Event.FileName = ((LinkButton)sender).Text;\n Event.FileStructureID = ((LinkButton)sender).CommandArgument;\n FileSelected(sender, Event);\n }\n }\n }\n\n }\n protected class Repeater_Files_HeaderITemplate : ITemplate\n {\n public event EventHandler ColumnSorted;\n public string SortOrder = \"\";\n public string SortDirection = \"\";\n public void Set_SortOrder(string Order, string Direction)\n {\n SortOrder = Order;\n SortDirection = Direction;\n }\n public void InstantiateIn(Control ControlSender)\n {\n RepeaterItem RepeaterItemContainer = ((RepeaterItem)ControlSender);\n HtmlGenericControl Container = new HtmlGenericControl();\n Container.TagName = \"div\";\n Container.Attributes.Add(\"class\", \"ZDV_RepeaterFilesHeaderContainer\");\n if (RepeaterItemContainer.ItemType == ListItemType.Header)\n {\n LinkButton LinkButtonSortName = new LinkButton();\n LinkButtonSortName.Text = \"Name\";\n LinkButtonSortName.ID = \"LinkButtonSortName\";\n LinkButtonSortName.CssClass = \"ZDV_RepeaterFilesSortButton\";\n LinkButtonSortName.Click += new EventHandler(Column_Sort);\n LinkButtonSortName.DataBinding += new EventHandler(ColumnHeader_Bound);\n HtmlGenericControl NameContainer = new HtmlGenericControl();\n NameContainer.TagName = \"div\";\n NameContainer.Attributes.Add(\"class\", \"ZDV_Left ZDV_RepeaterFilesHeaderName\");\n NameContainer.Controls.Add(LinkButtonSortName);\n\n LinkButton LinkButtonSortSize = new LinkButton();\n LinkButtonSortSize.Text = \"Size\";\n LinkButtonSortSize.ID = \"LinkButtonSortSize\";\n LinkButtonSortSize.CssClass = \"ZDV_RepeaterFilesSortButton\";\n LinkButtonSortSize.Click += new EventHandler(Column_Sort);\n LinkButtonSortSize.DataBinding += new EventHandler(ColumnHeader_Bound);\n HtmlGenericControl SizeContainer = new HtmlGenericControl();\n SizeContainer.TagName = \"div\";\n SizeContainer.Attributes.Add(\"class\", \"ZDV_Left ZDV_RepeaterFilesHeaderSize\");\n SizeContainer.Controls.Add(LinkButtonSortSize);\n\n LinkButton LinkButtonSortCreated = new LinkButton();\n LinkButtonSortCreated.Text = \"Date Created\";\n LinkButtonSortCreated.ID = \"LinkButtonSortCreated\";\n LinkButtonSortCreated.CssClass = \"ZDV_RepeaterFilesSortButton\";\n LinkButtonSortCreated.Click += new EventHandler(Column_Sort);\n LinkButtonSortCreated.DataBinding += new EventHandler(ColumnHeader_Bound);\n HtmlGenericControl DateCreatedContainer = new HtmlGenericControl();\n DateCreatedContainer.TagName = \"div\";\n DateCreatedContainer.Attributes.Add(\"class\", \"ZDV_Left ZDV_RepeaterFilesHeaderDateCreated\");\n DateCreatedContainer.Controls.Add(LinkButtonSortCreated);\n\n LinkButton LinkButtonSortModified = new LinkButton();\n LinkButtonSortModified.Text = \"Date Modified\";\n LinkButtonSortModified.ID = \"LinkButtonSortModified\";\n LinkButtonSortModified.CssClass = \"ZDV_RepeaterFilesSortButton\";\n LinkButtonSortModified.Click += new EventHandler(Column_Sort);\n LinkButtonSortModified.DataBinding += new EventHandler(ColumnHeader_Bound);\n HtmlGenericControl DateModifiedContainer = new HtmlGenericControl();\n DateModifiedContainer.TagName = \"div\";\n DateModifiedContainer.Attributes.Add(\"class\", \"ZDV_Left ZDV_RepeaterFilesHeaderDateModified\");\n DateModifiedContainer.Controls.Add(LinkButtonSortModified);\n\n HtmlGenericControl DivClear = new HtmlGenericControl();\n DivClear.TagName = \"div\";\n DivClear.Attributes.Add(\"class\", \"ZDV_Clear\");\n\n Literal DivOpenItems = new Literal();\n DivOpenItems.Text = \"
\";\n\n Container.Controls.Add(NameContainer);\n Container.Controls.Add(SizeContainer);\n Container.Controls.Add(DateCreatedContainer);\n Container.Controls.Add(DateModifiedContainer);\n Container.Controls.Add(DivClear);\n RepeaterItemContainer.Controls.Add(Container);\n RepeaterItemContainer.Controls.Add(DivOpenItems);\n }\n }\n\n protected void ColumnHeader_Bound(object sender, EventArgs e)\n {\n LinkButton LinkButtonSelected = (LinkButton)sender;\n if (LinkButtonSelected.ID == SortOrder)\n {\n if (SortDirection == \"ASC\")\n LinkButtonSelected.Style[\"background-image\"] = \"url('\" + LinkButtonSelected.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), \"Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Arrow_Down.png\") + \"');\";\n else\n LinkButtonSelected.Style[\"background-image\"] = \"url('\" + LinkButtonSelected.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), \"Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Arrow_Up.png\") + \"');\";\n\n LinkButtonSelected.Style[\"background-position\"] = \"right\";\n LinkButtonSelected.Style[\"background-repeat\"] = \"no-repeat\";\n }\n else\n {\n LinkButtonSelected.Style.Remove(\"background-image\");\n }\n }\n\n public void Column_Sort(object sender, EventArgs e)\n {\n if (ColumnSorted != null)\n {\n ColumnSorted(sender, e);\n }\n }\n }\n protected class Repeater_Files_FooterITemplate : ITemplate\n {\n public void InstantiateIn(Control ControlSender)\n {\n RepeaterItem RepeaterItemContainer = ((RepeaterItem)ControlSender);\n if (RepeaterItemContainer.ItemType == ListItemType.Footer)\n {\n Literal DivCloseItems = new Literal();\n DivCloseItems.Text = \"
\";\n RepeaterItemContainer.Controls.Add(DivCloseItems);\n }\n }\n }\n }\n\n public delegate void FolderSelectedEventHandler(object sender, ZentrixDirectoryViewFolderSelected e);\n public class ZentrixDirectoryViewFolderSelected : EventArgs\n {\n new public static ZentrixDirectoryViewFolderSelected Empty = new ZentrixDirectoryViewFolderSelected();\n public string FolderName = \"\";\n public string FolderId = \"\";\n public string FolderPath = \"\";\n\n /// \n /// Returns the selected folder size in KB\n /// \n public int FolderSize;\n public ZentrixDirectoryViewFolderSelected()\n {\n }\n }\n\n public delegate void FileSelectedEventHandler(object sender, ZentrixDirectoryViewFileSelected e);\n public class ZentrixDirectoryViewFileSelected : EventArgs\n {\n new public static ZentrixDirectoryViewFileSelected Empty = new ZentrixDirectoryViewFileSelected();\n public string FileName = \"\";\n public string FileStructureID = \"\";\n public string FilePath = \"\";\n public DateTime FileCreated;\n public DateTime FileModified;\n /// \n /// Returns the selected file size in KB\n /// \n public int FileSize;\n public ZentrixDirectoryViewFileSelected()\n {\n }\n }\n\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '4347d99f6d0b389143bc192a032529a4', 'timestamp': '', 'source': 'github', 'line_count': 1355, 'max_line_length': 253, 'avg_line_length': 43.29594095940959, 'alnum_prop': 0.5418470664439369, 'repo_name': 'zenntrix/Web_Toolkit', 'id': '0966ef9e1efb933ad7fb54ca7ea1366ce11c8e6d', 'size': '58668', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Zenntrix_Directory_Viewer/Zenntrix_Directory_Viewer/Zenntrix_Directory_Viewer.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '223786'}, {'name': 'CSS', 'bytes': '3785'}, {'name': 'JavaScript', 'bytes': '6077'}, {'name': 'Shell', 'bytes': '780'}]}"}}},{"rowIdx":849707,"cells":{"text":{"kind":"string","value":"from test_framework.test_framework import PresidentielcoinTestFramework\nfrom test_framework.util import *\nimport zmq\nimport struct\n\nimport http.client\nimport urllib.parse\n\nclass ZMQTest (PresidentielcoinTestFramework):\n\n def __init__(self):\n super().__init__()\n self.num_nodes = 4\n\n port = 28370\n\n def setup_nodes(self):\n self.zmqContext = zmq.Context()\n self.zmqSubSocket = self.zmqContext.socket(zmq.SUB)\n self.zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b\"hashblock\")\n self.zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b\"hashtx\")\n self.zmqSubSocket.connect(\"tcp://127.0.0.1:%i\" % self.port)\n return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[\n ['-zmqpubhashtx=tcp://127.0.0.1:'+str(self.port), '-zmqpubhashblock=tcp://127.0.0.1:'+str(self.port)],\n [],\n [],\n []\n ])\n\n def run_test(self):\n self.sync_all()\n\n genhashes = self.nodes[0].generate(1)\n self.sync_all()\n\n print(\"listen...\")\n msg = self.zmqSubSocket.recv_multipart()\n topic = msg[0]\n assert_equal(topic, b\"hashtx\")\n body = msg[1]\n nseq = msg[2]\n msgSequence = struct.unpack('\n\n\n\n {% include head.html %}\n\n \n\n {% include navigation.html %}\n\n {% include post.html %}\n\n {% include footer.html %}\n\n {% include js.html %}\n\n \n\n\n"},"meta":{"kind":"string","value":"{'content_hash': 'a94c7f6c08bb6d143eb92331c6eb4f15', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 91, 'avg_line_length': 18.894736842105264, 'alnum_prop': 0.5766016713091922, 'repo_name': 'alexandrucoman/labs.cloudbase.it', 'id': 'a8624a85632860c4e813ea6e4f098f0dc1d7cca2', 'size': '359', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_layouts/post.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '442014'}, {'name': 'HTML', 'bytes': '39852'}, {'name': 'Ruby', 'bytes': '3280'}]}"}}},{"rowIdx":849709,"cells":{"text":{"kind":"string","value":"require 'OpenNebulaJSON/JSONUtils'\n\nmodule OpenNebulaJSON\n class HostJSON < OpenNebula::Host\n include JSONUtils\n\n def create(template_json)\n host_hash = parse_json(template_json, 'host')\n if OpenNebula.is_error?(host_hash)\n return host_hash\n end\n\n self.allocate(host_hash['name'],\n host_hash['im_mad'],\n host_hash['vm_mad'],\n host_hash['vnm_mad'],\n host_hash['cluster_id'].to_i)\n end\n\n def delete\n if self['HOST_SHARE/RUNNING_VMS'].to_i != 0\n OpenNebula::Error.new(\"Host still has associated VMs, aborting delete.\")\n else\n super\n end\n end\n\n def perform_action(template_json)\n action_hash = parse_json(template_json, 'action')\n if OpenNebula.is_error?(action_hash)\n return action_hash\n end\n\n rc = case action_hash['perform']\n when \"enable\" then self.enable\n when \"disable\" then self.disable\n when \"update\" then self.update(action_hash['params'])\n else\n error_msg = \"#{action_hash['perform']} action not \" <<\n \" available for this resource\"\n OpenNebula::Error.new(error_msg)\n end\n end\n\n def update(params=Hash.new)\n super(params['template_raw'])\n end\n\n end\nend\n"},"meta":{"kind":"string","value":"{'content_hash': '2ce28e507ce682fd8ec9a07879a6a050', 'timestamp': '', 'source': 'github', 'line_count': 50, 'max_line_length': 88, 'avg_line_length': 31.22, 'alnum_prop': 0.4875080076873799, 'repo_name': 'bcec/opennebula3.4.1', 'id': '3ca11ecb0beb20deb3efb30614255bd048174eb5', 'size': '2747', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/sunstone/models/OpenNebulaJSON/HostJSON.rb', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '721757'}, {'name': 'C++', 'bytes': '1502569'}, {'name': 'Java', 'bytes': '262511'}, {'name': 'JavaScript', 'bytes': '906638'}, {'name': 'Python', 'bytes': '2832'}, {'name': 'Ruby', 'bytes': '1090866'}, {'name': 'Shell', 'bytes': '154875'}]}"}}},{"rowIdx":849710,"cells":{"text":{"kind":"string","value":"sendNewAdminEmail();\n }\n }\n\n // Relations :\n\n /**\n * @return \\yii\\db\\ActiveQuery\n */\n public function getAuthLogs()\n {\n return $this->hasMany(AdminAuthLog::class, ['adminId' => 'id']);\n }\n\n // Logic :\n\n /**\n * Sends email notification about account creation.\n * @return boolean success.\n */\n public function sendNewAdminEmail()\n {\n return Yii::$app->mailer->compose('newAdmin', ['admin' => $this])\n ->setTo($this->email)\n ->setFrom([Yii::$app->params['appEmail'] => Yii::$app->name])\n ->setSubject(Yii::t('admin', 'Your administration account at {appName}', ['appName' => Yii::$app->name]))\n ->send();\n }\n\n /**\n * {@inheritdoc}\n */\n public function sendSuspendEmail()\n {\n return Yii::$app->mailer->compose('suspendAdmin', ['admin' => $this])\n ->setTo($this->email)\n ->setFrom([Yii::$app->params['appEmail'] => Yii::$app->name])\n ->setSubject(Yii::t('admin', 'Your administration account at {appName} has been suspended', ['appName' => Yii::$app->name]))\n ->send();\n }\n}"},"meta":{"kind":"string","value":"{'content_hash': 'e29b32bbd9d866a4980930d1a12a9882', 'timestamp': '', 'source': 'github', 'line_count': 89, 'max_line_length': 136, 'avg_line_length': 22.235955056179776, 'alnum_prop': 0.5194542698332492, 'repo_name': 'yii2tech/project-template', 'id': 'bae26ca8f13866d10ddabb939a95ec78e145b1e7', 'size': '1979', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'models/db/Admin.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '1030'}, {'name': 'CSS', 'bytes': '3244'}, {'name': 'PHP', 'bytes': '188077'}]}"}}},{"rowIdx":849711,"cells":{"text":{"kind":"string","value":"request('GET', '/rolopcionsistema/');\n $this->assertEquals(200, $client->getResponse()->getStatusCode(), \"Unexpected HTTP status code for GET /rolopcionsistema/\");\n $crawler = $client->click($crawler->selectLink('Create a new entry')->link());\n\n // Fill in the form and submit it\n $form = $crawler->selectButton('Create')->form(array(\n 'hnr_sircimbundle_rolopcionsistematype[field_name]' => 'Test',\n // ... other fields to fill\n ));\n\n $client->submit($form);\n $crawler = $client->followRedirect();\n\n // Check data in the show view\n $this->assertGreaterThan(0, $crawler->filter('td:contains(\"Test\")')->count(), 'Missing element td:contains(\"Test\")');\n\n // Edit the entity\n $crawler = $client->click($crawler->selectLink('Edit')->link());\n\n $form = $crawler->selectButton('Edit')->form(array(\n 'hnr_sircimbundle_rolopcionsistematype[field_name]' => 'Foo',\n // ... other fields to fill\n ));\n\n $client->submit($form);\n $crawler = $client->followRedirect();\n\n // Check the element contains an attribute with value equals \"Foo\"\n $this->assertGreaterThan(0, $crawler->filter('[value=\"Foo\"]')->count(), 'Missing element [value=\"Foo\"]');\n\n // Delete the entity\n $client->submit($crawler->selectButton('Delete')->form());\n $crawler = $client->followRedirect();\n\n // Check the entity has been delete on the list\n $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent());\n }\n\n */\n}"},"meta":{"kind":"string","value":"{'content_hash': '657d1849d76ae5513769e287effdda8a', 'timestamp': '', 'source': 'github', 'line_count': 55, 'max_line_length': 132, 'avg_line_length': 36.07272727272727, 'alnum_prop': 0.6129032258064516, 'repo_name': 'B9lly/TG2013', 'id': '0b6aed5d9f94c8636efb3f2614a1e3896dc7ca9b', 'size': '1984', 'binary': False, 'copies': '1', 'ref': 'refs/heads/billy', 'path': 'src/hnr/sircimBundle/Tests/Controller/RolOpcionSistemaControllerTest.php', 'mode': '33188', 'license': 'mit', 'language': []}"}}},{"rowIdx":849712,"cells":{"text":{"kind":"string","value":"\n\n\n\n\n\nUses of Interface org.wildfly.swarm.undertow.WARArchive (BOM: * : All 2.5.0.Final API)\n\n\n\n\n\n\n\n\n
\n\n\n\n\n\n\n\n
Thorntail API, 2.5.0.Final
\n
\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n
\n

Uses of Interface
org.wildfly.swarm.undertow.WARArchive

\n
\n
No usage of org.wildfly.swarm.undertow.WARArchive
\n\n
\n\n\n\n\n\n\n\n
Thorntail API, 2.5.0.Final
\n
\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n

Copyright &#169; 2019 JBoss by Red Hat. All rights reserved.

\n\n\n"},"meta":{"kind":"string","value":"{'content_hash': '6614f195380ee557c977bb58296d80ba', 'timestamp': '', 'source': 'github', 'line_count': 128, 'max_line_length': 145, 'avg_line_length': 37.546875, 'alnum_prop': 0.614856429463171, 'repo_name': 'wildfly-swarm/wildfly-swarm-javadocs', 'id': 'fc3422d3d78bece4bddf2a92af35725c9165c445', 'size': '4806', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': '2.5.0.Final/apidocs/org/wildfly/swarm/undertow/class-use/WARArchive.html', 'mode': '33188', 'license': 'apache-2.0', 'language': []}"}}},{"rowIdx":849713,"cells":{"text":{"kind":"string","value":"!External articles\n\n * [[Retail example|http://philip.greenspun.com/sql/data-warehousing.html]]\n * [[Star vs Snowflake|http://www.simple-talk.com/content/print.aspx?article=592]]\n\n *[[Download|http://sourceforge.net/projects/pentaho/files/]]\n *[[Dashboard Tools - Webdetails|http://www.webdetails.pt/]]\n *[[Pentaho HTML5 Integration|http://forums.pentaho.com/archive/index.php/t-78268.html]]\n *[[Classic dashboards|http://wiki.pentaho.com/display/COM/A+Dashboard+Framework+for+the+Pentaho+BI+Platform]]\n *[[Run Kettle Job for each Row|http://type-exit.org/adventures-with-open-source-bi/2010/06/run-kettle-job-for-each-row/]]\n *[[Loops in Kettle Jobs|http://type-exit.org/adventures-with-open-source-bi/2010/06/kettle-quick-hint-loops-in-kettle-jobs/]]\n *[[Develop Dashboards with CDE|http://www.tikalk.com/incubator/blog/creating-bugzilla-dashboard-%E2%80%93-hands-cde-tutorial-%E2%80%93-fuse-day-3-session-summary]]\n\n !My cheat sheets\n [[Install-Pentaho|install-pentaho-server]]\n [[Manual configuration Hibernate|pentaho-hibernate-configuration]]\n [[Publish Mondrian Schemas|publish-pentaho-mondrian-schemes]]\n [[Change Password in Admin Console|change-pentaho-password-admin-console]]\n\n# getting started #\nSet your directories of work `/opt/pentaho/administration-console/resource/config/console.xml`\n\n \n ../biserver-ce/pentaho-solutions\n ../biserver-ce/tomcat/webapps/pentaho\n ...\n\nAdd your IP server in /opt/pentaho/biserver-ce/tomcat/webapps/pentaho/WEB-INF/web.xml\n\n solution-path\n /opt/pentaho/biserver-ce/pentaho-solutions/\n ...\n fully-qualified-server-url\n http://localhost:8080/pentaho/\n ...\n TrustedIpAddrs\n 10.0.0.138,127.0.0.1\n ...\n\nYou have to login with the same user/pass on both bi-server and admin-console\n\nConfig MySQL Driver/URL in `/opt/pentaho/biserver-ce/pentaho-solutions/system/applicationContext-spring-security-jdbc.xml`\n\n org.hsqldb.jdbcDriver --> com.mysql.jdbc.Driver\n jdbc:hsqldb:hsql://localhost:9001/hibernate --> jdbc:mysql://localhost:3306/hibernate\n\nAt the end it should look like this:\n\n \n \n \n \n \n \n \n\nChange the file `/opt/pentaho/biserver-ce/pentaho-solutions/system/applicationContext-spring-security-hibernate.properties`\n\n jdbc.driver==com.mysql.jdbc.Driver\n jdbc.url=jdbc:mysql://localhost:3306/hibernate\n jdbc.username=hibuser\n jdbc.password=password\n hibernate.dialect=org.hibernate.dialect.MySQLDialect\n\nChange to MySQL driver in `/opt/pentaho/biserver-ce/pentaho-solutions/system/hibernate/hibernate-settings.xml`\n\n system/hibernate/mysql5.hibernate.cfg.xml\n\nChange `/opt/pentaho/biserver-ce/tomcat/webapps/pentaho/META-INF/context.xml`\n\n \n \n \n\n \n \n\nConfig Email in `/opt/pentaho/bi-server/pentaho-solutions/system/smtp-email/email_config.xml`\n\nDisable HSQLDB: Comment in `/opt/pentaho/biserver-ce/tomcat/webapps/pentaho/WEB-INF/web.xml`\n\n \n hsqldb-databases\n sampledata@../../data/hsqldb/sampledata,hibernate@../../data/hsqldb/hibernate,quartz@../../data/hsqldb/quartz\n \n ...\n \n org.pentaho.platform.web.http.context.HsqldbStartupListener\n \n ...\n\n* Disable Login List\n1. In the file `/opt/pentaho/biserver-ce/tomcat/webapps/pentaho/mantleLogin/loginsettings.properties`\n2. Change `#showUsersList=true` to `showUsersList=false`\n"},"meta":{"kind":"string","value":"{'content_hash': '819026d309d585f16ef578f8eb570378', 'timestamp': '', 'source': 'github', 'line_count': 104, 'max_line_length': 167, 'avg_line_length': 49.81730769230769, 'alnum_prop': 0.7006369426751592, 'repo_name': 'iwxfer/wikitten', 'id': '84da2393b51f727661d3329343bd2795d5e347a8', 'size': '5181', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'library/pentaho/pentaho.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '168'}, {'name': 'C', 'bytes': '2393'}, {'name': 'C++', 'bytes': '6927'}, {'name': 'CSS', 'bytes': '12370'}, {'name': 'CoffeeScript', 'bytes': '1043'}, {'name': 'Erlang', 'bytes': '2982'}, {'name': 'HTML', 'bytes': '2410'}, {'name': 'JavaScript', 'bytes': '24553'}, {'name': 'PHP', 'bytes': '139733'}, {'name': 'Python', 'bytes': '37939'}, {'name': 'Ruby', 'bytes': '2472'}, {'name': 'Shell', 'bytes': '43175'}]}"}}},{"rowIdx":849714,"cells":{"text":{"kind":"string","value":"package main\n\nimport (\n\t\"encoding/json\"\n\t\"log\"\n\t\"strings\"\n\t\"text/template\"\n\n\t\"../../../gen\"\n)\n\nfunc main() {\n\tt, err := template.New(\"\").Parse(tmpl)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tvar j js\n\tif err := gen.Gen(\"clock\", &j, t); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\n// The JSON structure we expect to be able to umarshal into\ntype js struct {\n\tGroups []testGroup `json:\"Cases\"`\n}\n\ntype testGroup struct {\n\tDescription string\n\tCases []json.RawMessage `property:\"RAW\"`\n\tCreateCases []struct {\n\t\tDescription string\n\t\tHour, Minute int\n\t\tExpected string\n\t} `property:\"create\"`\n\tAddCases []struct {\n\t\tDescription string\n\t\tHour, Minute, Add int\n\t\tExpected string\n\t} `property:\"add\"`\n\tEqCases []struct {\n\t\tDescription string\n\t\tClock1, Clock2 struct{ Hour, Minute int }\n\t\tExpected bool\n\t} `property:\"equal\"`\n}\n\nfunc (groups testGroup) GroupShortName() string {\n\treturn strings.ToLower(strings.Fields(groups.Description)[0])\n}\n\nvar tmpl = `package clock\n\n{{.Header}}\n\n{{range .J.Groups}}\n\t// {{ .Description }}\n\n\t{{- if .CreateCases }}\n\t\tvar timeTests = []struct {\n\t\t\th, m int\n\t\t\twant string\n\t\t}{\n\t\t\t{{- range .CreateCases }}\n\t\t\t\t{ {{.Hour}}, {{.Minute}}, {{.Expected | printf \"%#v\"}}}, // {{.Description}}\n\t\t\t{{- end }}\n\t\t}\n\t{{- end }}\n\n\t{{- if .AddCases }}\n\t\tvar {{ .GroupShortName }}Tests = []struct {\n\t\t\th, m, a int\n\t\t\twant string\n\t\t}{\n\t\t\t{{- range .AddCases }}\n\t\t\t\t{ {{.Hour}}, {{.Minute}}, {{.Add}}, {{.Expected | printf \"%#v\"}}}, // {{.Description}}\n\t\t\t{{- end }}\n\t\t}\n\t{{- end }}\n\n\t{{- if .EqCases }}\n\t\ttype hm struct{ h, m int }\n\t\tvar eqTests = []struct {\n\t\t\tc1, c2 hm\n\t\t\twant bool\n\t\t}{\n\t\t\t{{- range .EqCases }}\n\t\t\t\t// {{.Description}}\n\t\t\t\t{\n\t\t\t\t\thm{ {{.Clock1.Hour}}, {{.Clock1.Minute}}},\n\t\t\t\t\thm{ {{.Clock2.Hour}}, {{.Clock2.Minute}}},\n\t\t\t\t\t{{.Expected}},\n\t\t\t\t},\n\t\t\t{{- end }}\n\t\t}\n\t{{- end }}\n{{end}}\n`\n"},"meta":{"kind":"string","value":"{'content_hash': 'bb7b0b401de66b76b6cfa0ef23805741', 'timestamp': '', 'source': 'github', 'line_count': 98, 'max_line_length': 90, 'avg_line_length': 18.79591836734694, 'alnum_prop': 0.5564603691639523, 'repo_name': 'robphoenix/exercism-go', 'id': '0dc2dc73199a290ff3b1606c86cc185c563c396d', 'size': '1842', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'exercises/clock/.meta/gen.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '463409'}, {'name': 'Shell', 'bytes': '2482'}]}"}}},{"rowIdx":849715,"cells":{"text":{"kind":"string","value":"/* TEMPLATE GENERATED TESTCASE FILE\r\nFilename: CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_loop_66b.c\r\nLabel Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE805.string.label.xml\r\nTemplate File: sources-sink-66b.tmpl.c\r\n*/\r\n/*\r\n * @description\r\n * CWE: 122 Heap Based Buffer Overflow\r\n * BadSource: Allocate using malloc() and set data pointer to a small buffer\r\n * GoodSource: Allocate using malloc() and set data pointer to a large buffer\r\n * Sinks: loop\r\n * BadSink : Copy string to data using a loop\r\n * Flow Variant: 66 Data flow: data passed in an array from one function to another in different source files\r\n *\r\n * */\r\n\r\n#include \"std_testcase.h\"\r\n\r\n#include \r\n\r\n#ifndef OMITBAD\r\n\r\nvoid CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_loop_66b_badSink(wchar_t * dataArray[])\r\n{\r\n /* copy data out of dataArray */\r\n wchar_t * data = dataArray[2];\r\n {\r\n size_t i;\r\n wchar_t source[100];\r\n wmemset(source, L'C', 100-1); /* fill with L'C's */\r\n source[100-1] = L'\\0'; /* null terminate */\r\n /* POTENTIAL FLAW: Possible buffer overflow if source is larger than data */\r\n for (i = 0; i < 100; i++)\r\n {\r\n data[i] = source[i];\r\n }\r\n data[100-1] = L'\\0'; /* Ensure the destination buffer is null terminated */\r\n printWLine(data);\r\n free(data);\r\n }\r\n}\r\n\r\n#endif /* OMITBAD */\r\n\r\n#ifndef OMITGOOD\r\n\r\n/* goodG2B uses the GoodSource with the BadSink */\r\nvoid CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_loop_66b_goodG2BSink(wchar_t * dataArray[])\r\n{\r\n wchar_t * data = dataArray[2];\r\n {\r\n size_t i;\r\n wchar_t source[100];\r\n wmemset(source, L'C', 100-1); /* fill with L'C's */\r\n source[100-1] = L'\\0'; /* null terminate */\r\n /* POTENTIAL FLAW: Possible buffer overflow if source is larger than data */\r\n for (i = 0; i < 100; i++)\r\n {\r\n data[i] = source[i];\r\n }\r\n data[100-1] = L'\\0'; /* Ensure the destination buffer is null terminated */\r\n printWLine(data);\r\n free(data);\r\n }\r\n}\r\n\r\n#endif /* OMITGOOD */\r\n"},"meta":{"kind":"string","value":"{'content_hash': '86325c9a2431a8f268084112edb439cf', 'timestamp': '', 'source': 'github', 'line_count': 67, 'max_line_length': 109, 'avg_line_length': 31.91044776119403, 'alnum_prop': 0.5958840037418148, 'repo_name': 'JianpingZeng/xcc', 'id': '3c2d0b7dc0142206574e0faa702a37957bc110a3', 'size': '2138', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'xcc/test/juliet/testcases/CWE122_Heap_Based_Buffer_Overflow/s08/CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_loop_66b.c', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}"}}},{"rowIdx":849716,"cells":{"text":{"kind":"string","value":"\n\n\n\n\n\n\n\n This package presents a framework that allows application developers to\n make use of security services like authentication, data integrity and\n data confidentiality from a variety of underlying security mechanisms\n like Kerberos, using a unified API. The security mechanisms that an\n application can\n chose to use are identified with unique object identifiers. One example \n of such a mechanism is the Kerberos v5 GSS-API mechanism (object\n identifier 1.2.840.113554.1.2.2). This mechanism is available through\n the default instance of the GSSManager class.

\n\n The GSS-API is defined in a language independent way in \n RFC 2743. The Java\n language bindings are defined in \n RFC 2853

\n\n An application starts out by instantiating a GSSManager\n which then serves as a factory for a security context. An application\n can use specific principal names and credentials that are also created\n using the GSSManager; or it can instantiate a\n context with system defaults. It then goes through a context\n establishment loop. Once a context is established with the\n peer, authentication is complete. Data protection such as integrity\n and confidentiality can then be obtained from this context.

\n\n The GSS-API does not perform any communication with the peer. It merely \n produces tokens that the application must somehow transport to the\n other end.

\n\n

Credential Acquisition

\n\n The GSS-API itself does not dictate how an underlying mechanism\n obtains the credentials that are needed for authentication. It is\n assumed that prior to calling the GSS-API, these credentials are\n obtained and stored in a location that the mechanism provider is\n aware of. However, the default model in the Java platform will be\n that mechanism providers must obtain credentials only from the private\n or public credential sets associated with the\n {@link javax.security.auth.Subject Subject} in the\n current access control context. The Kerberos v5 \n mechanism will search for the required INITIATE and ACCEPT credentials \n ({@link javax.security.auth.kerberos.KerberosTicket KerberosTicket} and\n {@link javax.security.auth.kerberos.KerberosKey KerberosKey}) in\n the private credential set where as some other mechanism might look\n in the public set or in both. If the desired credential is not\n present in the appropriate sets of the current Subject, the GSS-API\n call must fail.

\n\n This model has the advantage that credential management\n is simple and predictable from the applications point of view. An\n application, given the right permissions, can purge the credentials in\n the Subject or renew them using standard Java API's. If it purged\n the credentials, it would be sure that the JGSS mechanism would fail,\n or if it renewed a time based credential it would be sure that a JGSS\n mechanism would succeed.

\n\n This model does require that a {@link\n javax.security.auth.login JAAS login} be performed in order to\n authenticate and populate a Subject that the JGSS mechnanism can later \n utilize. However, applications have the ability to relax this\n restiction by means of a system property:\n javax.security.auth.useSubjectCredsOnly. By default\n this system property will be assumed to be true (even when\n it is unset) indicating that providers must only use the credentials\n that are present in the current Subject. However, if this property is\n explicitly set to false by the application, then it indicates that\n the provider is free to use any credentials cache of its choice. Such\n a credential cache might be a disk cache, an in-memory cache, or even\n just the current Subject itself.\n\n\n

Related Documentation

\n

\nFor an online tutorial on using Java GSS-API, please see\nIntroduction to JAAS and Java GSS-API.\n

\n\n\n\n@since 1.4\n\n\n"},"meta":{"kind":"string","value":"{'content_hash': 'e2f1f80b36d1b0edf37304474f70c28a', 'timestamp': '', 'source': 'github', 'line_count': 127, 'max_line_length': 116, 'avg_line_length': 45.874015748031496, 'alnum_prop': 0.7518022657054583, 'repo_name': 'andreagenso/java2scala', 'id': '098b1cce4f2b4b237cd29accbfe7cf5f494d01e3', 'size': '5826', 'binary': False, 'copies': '34', 'ref': 'refs/heads/master', 'path': 'test/J2s/java/openjdk-6-src-b27/jdk/src/share/classes/org/ietf/jgss/package.html', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '8983'}, {'name': 'Awk', 'bytes': '26041'}, {'name': 'Batchfile', 'bytes': '1796'}, {'name': 'C', 'bytes': '20159882'}, {'name': 'C#', 'bytes': '7630'}, {'name': 'C++', 'bytes': '4513460'}, {'name': 'CSS', 'bytes': '5128'}, {'name': 'DTrace', 'bytes': '68220'}, {'name': 'HTML', 'bytes': '1302117'}, {'name': 'Haskell', 'bytes': '244134'}, {'name': 'Java', 'bytes': '129267130'}, {'name': 'JavaScript', 'bytes': '182900'}, {'name': 'Makefile', 'bytes': '711241'}, {'name': 'Objective-C', 'bytes': '66163'}, {'name': 'Python', 'bytes': '137817'}, {'name': 'Roff', 'bytes': '2630160'}, {'name': 'Scala', 'bytes': '25599'}, {'name': 'Shell', 'bytes': '888136'}, {'name': 'SourcePawn', 'bytes': '78'}]}"}}},{"rowIdx":849717,"cells":{"text":{"kind":"string","value":"\npackage com.networknt.eventuate.account.view.handler;\n\n\nimport com.networknt.exception.ApiException;\nimport com.networknt.exception.ClientException;\nimport org.junit.ClassRule;\nimport org.junit.Test;\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\n\n\npublic class HealthGetHandlerTest {\n @ClassRule\n public static TestServer server = TestServer.getInstance();\n\n static final Logger logger = LoggerFactory.getLogger(HealthGetHandlerTest.class);\n static final boolean enableHttp2 = server.getServerConfig().isEnableHttp2();\n static final boolean enableHttps = server.getServerConfig().isEnableHttps();\n static final int httpPort = server.getServerConfig().getHttpPort();\n static final int httpsPort = server.getServerConfig().getHttpsPort();\n static final String url = enableHttp2 || enableHttps ? \"https://localhost:\" + httpsPort : \"http://localhost:\" + httpPort;\n\n @Test\n public void testHealthGetHandlerTest() throws ClientException, ApiException {\n /*\n final Http2Client client = Http2Client.getInstance();\n final CountDownLatch latch = new CountDownLatch(1);\n final ClientConnection connection;\n try {\n connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get();\n } catch (Exception e) {\n throw new ClientException(e);\n }\n final AtomicReference reference = new AtomicReference<>();\n try {\n ClientRequest request = new ClientRequest().setPath(\"/v1/health\").setMethod(Methods.GET);\n\n connection.sendRequest(request, client.createClientCallback(reference, latch));\n\n latch.await();\n } catch (Exception e) {\n logger.error(\"Exception: \", e);\n throw new ClientException(e);\n } finally {\n IoUtils.safeClose(connection);\n }\n int statusCode = reference.get().getResponseCode();\n String body = reference.get().getAttachment(Http2Client.RESPONSE_BODY);\n Assert.assertEquals(200, statusCode);\n Assert.assertNotNull(body);\n */\n }\n}\n"},"meta":{"kind":"string","value":"{'content_hash': 'e0249668c295c19c90b2a3777bcb6ddf', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 207, 'avg_line_length': 41.166666666666664, 'alnum_prop': 0.692757534862798, 'repo_name': 'networknt/light-java-example', 'id': 'fa2588fb819283a1279e39d5491738fedddc5dc6', 'size': '2223', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'eventuate/account-management/account-view-service/src/test/java/com/networknt/eventuate/account/view/handler/HealthGetHandlerTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '1251'}, {'name': 'Java', 'bytes': '562730'}, {'name': 'JavaScript', 'bytes': '20118'}, {'name': 'PLSQL', 'bytes': '1936'}]}"}}},{"rowIdx":849718,"cells":{"text":{"kind":"string","value":"package com.s4game.server.io;\n/**\n * @Author zeusgooogle@gmail.com\n * @sine 2015年5月5日 下午9:56:13 \n *\n */\npublic class IoConstants {\n\n\tpublic static final String ROLE_KEY = \"role_key\";\n\t\n\tpublic static final String IP_KEY = \"ip_key\";\n\t\n\tpublic static final String SESSION_KEY = \"session_key\";\n\t\t\n\t\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '9d5e0fde805614002c565f6033dd76db', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 56, 'avg_line_length': 18.75, 'alnum_prop': 0.68, 'repo_name': 'zuesgooogle/HappyCard', 'id': 'e31212fd2a6a63f032dab541896d239d6828e3f3', 'size': '310', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'card-server/src/main/java/com/s4game/server/io/IoConstants.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '976104'}]}"}}},{"rowIdx":849719,"cells":{"text":{"kind":"string","value":"RubbishRelease::RubbishRelease(SSDB *ssdb){\n\tthis->ssdb = ssdb;\n\tthis->thread_quit = false;\n\tthis->list_name = RUBBISH_LIST_KEY;\n\tthis->queue_first_version = 0;\n\tthis->start();\n}\n\nRubbishRelease::~RubbishRelease(){\n\tLocking l(&this->mutex);\n\tthis->stop();\n\tssdb = NULL;\n}\n\nvoid RubbishRelease::start(){\n\tthread_quit = false;\n\tpthread_t tid;\n\tint err = pthread_create(&tid, NULL, &RubbishRelease::thread_func, this);\n\tif(err != 0){\n\t\tlog_fatal(\"can't create clear rubbishrelese thread: %s\", strerror(err));\n\t\texit(0);\n\t}\n}\n\nvoid RubbishRelease::stop(){\n\tthread_quit = true;\n\tfor(int i=0; i<100; i++){\n\t\tif(!thread_quit){\n\t\t\tbreak;\n\t\t}\n\t\tusleep(10 * 1000);\n\t}\n}\n\nint RubbishRelease::push_clear_queue(TMH &metainfo, const Bytes &name){\t\n\tstd::string s_ver = str(metainfo.version);\n\tstd::string s_key = encode_release_key(metainfo.datatype, name);\n\n\t//尝试将那么name加入垃圾收集队列中\n\tint ret = this->ssdb->hset_rubbish_queue(this->list_name, s_key, s_ver);\n\t//log_debug(\"push_clear_queue key:%s, hset_rubbish_queue ret:%d\", name.data(), ret);\n\tif(ret < 0){\n\t\treturn -1;\n\t}\n\n\t//成功就删除meta信息\n\tstd::string metalkey = EncodeMetaKey(name);\n\tssdb->getBinlog()->Delete(metalkey);\n\n\tstatic_cast(ssdb)->expiration->del_ttl(name);\n\n\t//是否发送同步信息,函数外配置TODO:slot不准\n\t//ssdb->calculateSlotRefer(Slots::encode_slot_id(name), -1);\n\n\tif(metainfo.version < queue_first_version){\n\t\tqueue_first_version = metainfo.version;\n\t}\n\treturn 1;\n}\n\nint RubbishRelease::push_clear_queue(const Bytes &name, const char log_type, \n\t\t\t\t\t\t\t\t\tconst char cmd_type, bool clearttl){\n\tTransaction trans(ssdb->getBinlog());\n\n\t//找出name的meta信息\n\tTMH metainfo = {0};\n\t//ignore ttl,del_ttl will called this function\n\tif (ssdb->loadobjectbyname(&metainfo, name, 0, false) <= 0){\n\t\treturn 0;\n\t}\n\n\tstd::string s_ver = str(metainfo.version);\n\tstd::string s_key = encode_release_key(metainfo.datatype, name);\n\n\t//尝试将那么name加入垃圾收集队列中\n\tint ret = this->ssdb->hset_rubbish_queue(this->list_name, s_key, s_ver);\n\t//log_debug(\"push_clear_queue key:%s, hset_rubbish_queue ret:%d\", name.data(), ret);\n\tif(ret < 0){\n\t\treturn -1;\n\t}\n\n\t//成功就删除meta信息\n\tstd::string metalkey = EncodeMetaKey(name);\n\tssdb->getBinlog()->Delete(metalkey);\n\tif (clearttl){\n\t\tstatic_cast(ssdb)->expiration->del_ttl(name);\n\t}\n\t//是否发送同步信息,函数外配置\n\tssdb->calculateSlotRefer(Slots::encode_slot_id(name), -1);\n\tssdb->getBinlog()->add_log(log_type, cmd_type, metalkey);\n\tleveldb::Status s = ssdb->getBinlog()->commit();\n\tif(!s.ok()){\n\t\treturn 0;\n\t}else if(!s.ok()){\n\t\treturn -1;\n\t}\n\tif(metainfo.version < queue_first_version){\n\t\tqueue_first_version = metainfo.version;\n\t}\n\n\t// //不为空才进入,否则还会操作一次,在load_expiration_keys_from_db中\n\t// if(!fast_queues.empty() && fast_queues.size() < BATCH_SIZE){\n\t// \t//因为是队列.不需要pop最后一个判断,后进入的肯定版本高\n\t// \tfast_queues.add(s_key, metainfo.version);\n\t// }\n\n\treturn 1;\n}\n\nvoid RubbishRelease::load_expiration_keys_from_db(int num){\n\tIterator *it = nullptr;\n\tint ret = ssdb->hscan(&it, this->list_name, \"\", \"\\xff\", num);\n\tint n = 0;\n\tif (ret > 0){\n\t\twhile(it->next()){\n\t\t\tn ++;\n\t\t\tconst std::string &key = it->key();\n\t\t\tint64_t version = str_to_int64(it->value());\n\t\t\n\t\t\tfast_queues.add(key, version);\n\t\t\tchar type = 0;\n\t\t\tstd::string name;\n\t\t\tdecode_release_key(key, &type, &name);\n\t\t\tlog_debug(\"add clear queue:%s:%c\", name.c_str(), type);\n\t\t}\n\t\tdelete it;\n\t}\n\tlog_debug(\"load %d keys into clear queue\", n);\n}\n\nvoid RubbishRelease::expire_loop(){\n\t//Locking l(&this->mutex);\n\tif(!this->ssdb){\n\t\treturn;\n\t}\n\n\tif(this->fast_queues.empty()){\n\t\tthis->load_expiration_keys_from_db(BATCH_SIZE);\n\t\tif(this->fast_queues.empty()){\n\t\t\tthis->queue_first_version = INT64_MAX;\n\t\t\treturn;\n\t\t}\n\t}\n\t\n\tint64_t version;\n\tstd::string key;\n\tif(this->fast_queues.front(&key, &version)){\n\t\tlog_debug(\"clear name: %s, version: %llu\", hexmem(key.c_str(), key.size()).data(), version);\n if (lazy_clear(key, version) > 0){\n \tlog_debug(\"continue clear key:%s,%llu\", key.c_str(), version);\n }else{\n \tfast_queues.pop_front();\n \tthis->ssdb->hdel(this->list_name, key, BinlogType::NONE);\n }\n\t}\n}\n\nvoid* RubbishRelease::thread_func(void *arg){\n\tRubbishRelease *handler = (RubbishRelease *)arg;\n\t\n\twhile(!handler->thread_quit){\n\t\tusleep(10000);\n\t\tif(handler->queue_first_version > time_us()){\n\t\t\tcontinue;\n\t\t}\n\t\thandler->expire_loop();\n\t}\n\t\n\tlog_debug(\"rubbishrelease thread quit\");\n\thandler->thread_quit = false;\n\treturn (void *)NULL;\n}\n\nint RubbishRelease::lazy_clear(const Bytes &raw_key, int64_t version)\n{\n\tchar type;\n\tstd::string name;\n\t\n\tif (decode_release_key(raw_key, &type, &name)){\n\t\treturn -1;\n\t}\n\n std::string key_start = encode_data_key_start(type, name, version); \n std::string key_end = encode_data_key_end(type, name, version);\n \n Iterator *it = IteratorFactory::iterator(this->ssdb, dataType2IterType2(type), name, \n version, key_start, key_end, 500);\n int num = 0;\n leveldb::WriteBatch batch;\n while(it->next()){\n \t//log_debug(\"-----------del:%s, %llu, value:%s\", it->key().c_str(), it->seq(), it->value().c_str());\n\t\tswitch(type){\n case DataType::ZSIZE:{\n batch.Delete(EncodeSortSetScoreKey(name, it->key(), it->score(), version));\n\t\t\t\tbatch.Delete(EncodeSortSetKey(name, it->key(), version));\n\t\t\t\tbreak;\n }\n case DataType::HSIZE:{\n batch.Delete(EncodeHashKey(name, it->key(), version));\n break;\n }\n case DataType::LSIZE:{\n batch.Delete(EncodeListKey(name, it->seq(), version));\n break;\n }\n case DataType::TABLE:{\n \tbatch.Delete(it->key());\n \t//log_debug(\"clear version: %lld, key: %s\", it->version(), hexmem(it->key().c_str(), it->key().size()).data());\n \tbreak;\n }\n }\n num++;\n }\n delete it;\n \n leveldb::Status s = ssdb->getlDb()->Write(leveldb::WriteOptions(), &batch);\n\tif(!s.ok()){\n\t\tlog_error(\"clear_rubbish_queue error:%s\", s.ToString().data());\n\t\treturn -1;\n\t}\n\n\t//清除数据应该CompactRange一次,但是如果CompactRange时间超过100毫秒就应该报警,并且可配停止CompactRange动作。\n\tint64_t ts = time_us();\n\tleveldb::Slice slice_s(key_start);\n\tleveldb::Slice slice_e(key_end);\n\tssdb->getlDb()->CompactRange(&slice_s, &slice_e);\n\tint64_t te = time_us();\n\tif ( te-ts > 100000 ) {\n\t\tlog_info(\"rubbish compactRange time to long :%s -> %lld\", key_start.data(), te - ts);\n\t}\n return num;\n}\n\nstd::string RubbishRelease::encode_data_key_start(const char type, const Bytes &name, int64_t version){\n\tstd::string key_s;\n\tswitch(type){\n\t\tcase DataType::ZSIZE:{\n\t\t\tkey_s = EncodeSortSetScoreKey(name, \"\", SSDB_SCORE_MIN, version);\n\t\t\tbreak;\n\t\t}\n\t\tcase DataType::LSIZE:{\n\t\t\tkey_s = EncodeListKey(name, \"\", version);\n\t\t\tbreak;\n\t\t}\n\t\tcase DataType::HSIZE:{\n\t\t\tkey_s = EncodeHashKey(name, \"\", version);\t\t\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn key_s;\n}\n\nstd::string RubbishRelease::encode_data_key_end(const char type, const Bytes &name, int64_t version){\n\tstd::string key_e;\n\tswitch(type){\n\t\tcase DataType::ZSIZE:{\n\t\t\tkey_e = EncodeSortSetScoreKey(name, \"\\xff\", SSDB_SCORE_MAX, version);\n\t\t\tbreak;\n\t\t}\n\t\tcase DataType::LSIZE:{\n\t\t\tkey_e = EncodeListKey(name, \"\\xff\", version);\n\t\t\tbreak;\n\t\t}\n\t\tcase DataType::HSIZE:{\n\t\t\tkey_e = EncodeHashKey(name, \"\\xff\", version);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn key_e;\n}\n\n"},"meta":{"kind":"string","value":"{'content_hash': '5125c0c945c527fb907c23e0952565b6', 'timestamp': '', 'source': 'github', 'line_count': 271, 'max_line_length': 124, 'avg_line_length': 26.800738007380073, 'alnum_prop': 0.6288035247143053, 'repo_name': 'carryLabs/carrydb', 'id': 'c76cc73a55b62edc8280c30ee4ff0468e9d8273a', 'size': '7695', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/db/rubbish_release.cpp', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '12538'}, {'name': 'C++', 'bytes': '575941'}, {'name': 'COBOL', 'bytes': '27584'}, {'name': 'Makefile', 'bytes': '6950'}, {'name': 'PHP', 'bytes': '36293'}, {'name': 'Python', 'bytes': '280578'}, {'name': 'Shell', 'bytes': '4898'}]}"}}},{"rowIdx":849720,"cells":{"text":{"kind":"string","value":"\"\"\"\nTest Manager / Suite Self Test #4 - Testing result overflow handling.\n\"\"\"\n\n__copyright__ = \\\n\"\"\"\nCopyright (C) 2010-2015 Oracle Corporation\n\nThis file is part of VirtualBox Open Source Edition (OSE), as\navailable from http://www.virtualbox.org. This file is free software;\nyou can redistribute it and/or modify it under the terms of the GNU\nGeneral Public License (GPL) as published by the Free Software\nFoundation, in version 2 as it comes in the \"COPYING\" file of the\nVirtualBox OSE distribution. VirtualBox OSE is distributed in the\nhope that it will be useful, but WITHOUT ANY WARRANTY of any kind.\n\nThe contents of this file may alternatively be used under the terms\nof the Common Development and Distribution License Version 1.0\n(CDDL) only, as it comes in the \"COPYING.CDDL\" file of the\nVirtualBox OSE distribution, in which case the provisions of the\nCDDL are applicable instead of those of the GPL.\n\nYou may elect to license modified versions of this file under the\nterms and conditions of either the GPL or the CDDL or both.\n\"\"\"\n__version__ = \"$Revision: 100880 $\"\n\n\n# Standard Python imports.\nimport os;\nimport sys;\n\n# Only the main script needs to modify the path.\ntry: __file__\nexcept: __file__ = sys.argv[0];\ng_ksValidationKitDir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))));\nsys.path.append(g_ksValidationKitDir);\n\n# Validation Kit imports.\nfrom testdriver import reporter;\nfrom testdriver.base import TestDriverBase, InvalidOption;\n\n\nclass tdSelfTest4(TestDriverBase):\n \"\"\"\n Test Manager / Suite Self Test #4 - Testing result overflow handling.\n \"\"\"\n\n ## Valid tests.\n kasValidTests = [ 'immediate-sub-tests', 'total-sub-tests', 'immediate-values', 'total-values', 'immediate-messages'];\n\n def __init__(self):\n TestDriverBase.__init__(self);\n self.sOptWhich = 'immediate-sub-tests';\n\n def parseOption(self, asArgs, iArg):\n if asArgs[iArg] == '--test':\n iArg = self.requireMoreArgs(1, asArgs, iArg);\n if asArgs[iArg] not in self.kasValidTests:\n raise InvalidOption('Invalid test name \"%s\". Must be one of: %s'\n % (asArgs[iArg], ', '.join(self.kasValidTests),));\n self.sOptWhich = asArgs[iArg];\n else:\n return TestDriverBase.parseOption(self, asArgs, iArg);\n return iArg + 1;\n\n def actionExecute(self):\n # Too many immediate sub-tests.\n if self.sOptWhich == 'immediate-sub-tests':\n reporter.testStart('Too many immediate sub-tests (negative)');\n for i in range(1024):\n reporter.testStart('subsub%d' % i);\n reporter.testDone();\n # Too many sub-tests in total.\n elif self.sOptWhich == 'total-sub-tests':\n reporter.testStart('Too many sub-tests (negative)');\n # 32 * 256 = 2^(5+8) = 2^13 = 8192.\n for i in range(32):\n reporter.testStart('subsub%d' % i);\n for j in range(256):\n reporter.testStart('subsubsub%d' % j);\n reporter.testDone();\n reporter.testDone();\n # Too many immediate values.\n elif self.sOptWhich == 'immediate-values':\n reporter.testStart('Too many immediate values (negative)');\n for i in range(512):\n reporter.testValue('value%d' % i, i, 'times');\n # Too many values in total.\n elif self.sOptWhich == 'total-values':\n reporter.testStart('Too many sub-tests (negative)');\n for i in range(256):\n reporter.testStart('subsub%d' % i);\n for j in range(64):\n reporter.testValue('value%d' % j, i * 10000 + j, 'times');\n reporter.testDone();\n # Too many failure reasons (only immediate since the limit is extremely low).\n elif self.sOptWhich == 'immediate-messages':\n reporter.testStart('Too many immediate messages (negative)');\n for i in range(16):\n reporter.testFailure('Detail %d' % i);\n else:\n reporter.testStart('Unknown test %s' % (self.sOptWhich,));\n reporter.error('Invalid test selected: %s' % (self.sOptWhich,));\n reporter.testDone();\n return True;\n\n\nif __name__ == '__main__':\n sys.exit(tdSelfTest4().main(sys.argv));\n\n"},"meta":{"kind":"string","value":"{'content_hash': '4e88c40e4ff25fa2e63c48472477c424', 'timestamp': '', 'source': 'github', 'line_count': 111, 'max_line_length': 122, 'avg_line_length': 39.630630630630634, 'alnum_prop': 0.6203682655148898, 'repo_name': 'egraba/vbox_openbsd', 'id': '3eccb9e73b5b7086e48ede6a0d1973d65acac46d', 'size': '4470', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'VirtualBox-5.0.0/src/VBox/ValidationKit/tests/selftests/tdSelfTest4.py', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Ada', 'bytes': '88714'}, {'name': 'Assembly', 'bytes': '4303680'}, {'name': 'AutoIt', 'bytes': '2187'}, {'name': 'Batchfile', 'bytes': '95534'}, {'name': 'C', 'bytes': '192632221'}, {'name': 'C#', 'bytes': '64255'}, {'name': 'C++', 'bytes': '83842667'}, {'name': 'CLIPS', 'bytes': '5291'}, {'name': 'CMake', 'bytes': '6041'}, {'name': 'CSS', 'bytes': '26756'}, {'name': 'D', 'bytes': '41844'}, {'name': 'DIGITAL Command Language', 'bytes': '56579'}, {'name': 'DTrace', 'bytes': '1466646'}, {'name': 'GAP', 'bytes': '350327'}, {'name': 'Groff', 'bytes': '298540'}, {'name': 'HTML', 'bytes': '467691'}, {'name': 'IDL', 'bytes': '106734'}, {'name': 'Java', 'bytes': '261605'}, {'name': 'JavaScript', 'bytes': '80927'}, {'name': 'Lex', 'bytes': '25122'}, {'name': 'Logos', 'bytes': '4941'}, {'name': 'Makefile', 'bytes': '426902'}, {'name': 'Module Management System', 'bytes': '2707'}, {'name': 'NSIS', 'bytes': '177212'}, {'name': 'Objective-C', 'bytes': '5619792'}, {'name': 'Objective-C++', 'bytes': '81554'}, {'name': 'PHP', 'bytes': '58585'}, {'name': 'Pascal', 'bytes': '69941'}, {'name': 'Perl', 'bytes': '240063'}, {'name': 'PowerShell', 'bytes': '10664'}, {'name': 'Python', 'bytes': '9094160'}, {'name': 'QMake', 'bytes': '3055'}, {'name': 'R', 'bytes': '21094'}, {'name': 'SAS', 'bytes': '1847'}, {'name': 'Shell', 'bytes': '1460572'}, {'name': 'SourcePawn', 'bytes': '4139'}, {'name': 'TypeScript', 'bytes': '142342'}, {'name': 'Visual Basic', 'bytes': '7161'}, {'name': 'XSLT', 'bytes': '1034475'}, {'name': 'Yacc', 'bytes': '22312'}]}"}}},{"rowIdx":849721,"cells":{"text":{"kind":"string","value":"pjlong-home\n===========\n\nMy Home Site\n"},"meta":{"kind":"string","value":"{'content_hash': 'ee9abe7ac1feb97e37c6114faa37d305', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 12, 'avg_line_length': 9.5, 'alnum_prop': 0.5263157894736842, 'repo_name': 'pjlong/pjlong-home', 'id': '28424dc1ac6d152367491ecc72ed0f65442e6abf', 'size': '38', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '17477'}, {'name': 'HTML', 'bytes': '11675'}, {'name': 'JavaScript', 'bytes': '8921'}, {'name': 'Python', 'bytes': '5855'}, {'name': 'Shell', 'bytes': '103'}]}"}}},{"rowIdx":849722,"cells":{"text":{"kind":"string","value":"\n\n\n\n\n\nUses of Class org.apache.solr.client.solrj.io.stream.TopicStream (Solr 6.3.0 API)\n\n\n\n\n\n\n\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n
\n

Uses of Class
org.apache.solr.client.solrj.io.stream.TopicStream

\n
\n
No usage of org.apache.solr.client.solrj.io.stream.TopicStream
\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n

\n Copyright &copy; 2000-2016 Apache Software Foundation. All Rights Reserved.\n \n \n

\n\n\n"},"meta":{"kind":"string","value":"{'content_hash': '4b4856dea8d67f9e39716e6f507bdd5c', 'timestamp': '', 'source': 'github', 'line_count': 140, 'max_line_length': 164, 'avg_line_length': 37.65, 'alnum_prop': 0.583760197306014, 'repo_name': 'johannesbraun/clm_autocomplete', 'id': '438536c289b8e661600b62baa023f8e4773d15bc', 'size': '5271', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/solr-solrj/org/apache/solr/client/solrj/io/stream/class-use/TopicStream.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AMPL', 'bytes': '291'}, {'name': 'Batchfile', 'bytes': '63061'}, {'name': 'CSS', 'bytes': '238996'}, {'name': 'HTML', 'bytes': '230318'}, {'name': 'JavaScript', 'bytes': '1224188'}, {'name': 'Jupyter Notebook', 'bytes': '638688'}, {'name': 'Python', 'bytes': '3829'}, {'name': 'Roff', 'bytes': '34741083'}, {'name': 'Shell', 'bytes': '96828'}, {'name': 'XSLT', 'bytes': '124838'}]}"}}},{"rowIdx":849723,"cells":{"text":{"kind":"string","value":"package ie.kieranhogan.dayvinrosssoundboard;\n\nimport android.media.MediaPlayer;\nimport android.support.v7.app.AppCompatActivity;\nimport android.os.Bundle;\nimport android.view.View;\n\nimport java.io.IOException;\nimport java.util.ArrayList;\n\n\n\npublic class MainActivity extends AppCompatActivity {\n\n MediaPlayer a_theme, b_roundbrush, c_time, d_welcome, e_bother,\n f_brush, g_nomistakes, h_colours, i_noise1, j_whack;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n MediaPlayer intro = MediaPlayer.create(getApplicationContext(), R.raw.b_roundbrush);\n intro.start();\n\n a_theme = MediaPlayer.create(this, R.raw.a_theme);\n b_roundbrush = MediaPlayer.create(this, R.raw.b_roundbrush);\n c_time = MediaPlayer.create(this, R.raw.c_time);\n d_welcome = MediaPlayer.create(this, R.raw.d_welcome);\n e_bother = MediaPlayer.create(this, R.raw.e_bother);\n f_brush = MediaPlayer.create(this, R.raw.f_brush);\n g_nomistakes = MediaPlayer.create(this, R.raw.g_nomistakes);\n h_colours = MediaPlayer.create(this, R.raw.h_colours);\n i_noise1 = MediaPlayer.create(this, R.raw.i_noise1);\n j_whack = MediaPlayer.create(this, R.raw.j_whack);\n }\n\n\n public void a_theme(View view) {\n if (a_theme.isPlaying()){\n a_theme.seekTo(0); }\n else {\n a_theme.start();\n }\n }\n public void b_roundbrush(View view) {\n if (b_roundbrush.isPlaying()){\n b_roundbrush.seekTo(0); }\n else {\n b_roundbrush.start();\n }\n }\n public void c_time(View view) {\n if (c_time.isPlaying()){\n c_time.seekTo(0); }\n else {\n c_time.start();\n }\n }\n public void d_welcome(View view) {\n if (d_welcome.isPlaying()){\n d_welcome.seekTo(0); }\n else {\n d_welcome.start();\n }\n }\n public void e_bother(View view) {\n if (e_bother.isPlaying()){\n e_bother.seekTo(0); }\n else {\n e_bother.start();\n }\n }\n public void f_brush(View view) {\n if (f_brush.isPlaying()){\n f_brush.seekTo(0); }\n else {\n f_brush.start();\n }\n }\n public void g_nomistakes(View view) {\n if (g_nomistakes.isPlaying()){\n g_nomistakes.seekTo(0); }\n else {\n g_nomistakes.start();\n }\n }\n public void h_colours(View view) {\n if (h_colours.isPlaying()){\n h_colours.seekTo(0); }\n else {\n h_colours.start();\n }\n }\n public void i_noise1(View view) {\n if (i_noise1.isPlaying()){\n i_noise1.seekTo(0); }\n else {\n i_noise1.start();\n } }\n public void j_whack(View view) {\n if (j_whack.isPlaying()){\n j_whack.seekTo(0); }\n else {\n j_whack.start();\n }\n }\n\n}\n"},"meta":{"kind":"string","value":"{'content_hash': 'e1bc56a404d6acf6d9445575f5902bdf', 'timestamp': '', 'source': 'github', 'line_count': 109, 'max_line_length': 92, 'avg_line_length': 27.91743119266055, 'alnum_prop': 0.5514295103516267, 'repo_name': 'kieranhogan13/Java', 'id': '291dc3353382775d1a389d71c5907d17ed2edeb5', 'size': '3043', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Android Development/DayvinRossSoundboard/app/src/main/java/ie/kieranhogan/dayvinrosssoundboard/MainActivity.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '799'}, {'name': 'CSS', 'bytes': '23981'}, {'name': 'HTML', 'bytes': '265575'}, {'name': 'Java', 'bytes': '328051'}, {'name': 'JavaScript', 'bytes': '827'}]}"}}},{"rowIdx":849724,"cells":{"text":{"kind":"string","value":"classdef (Sealed) HebiJoystick < handle\n % HebiJoystick creates a joystick object\n %\n % HebiJoystick is an alternative to MATLAB's built-in 'vrjoystick'\n % for users who don't have access to the Simulink 3D Modelling\n % Toolbox. The API is identical to 'vrjoystick' and can serve mostly\n % as a drop-in replacement.\n %\n % Note that the ordering of axes and buttons may be different on\n % various operating systems, and that it may also be different from\n % vrjoystick.\n %\n % HebiJoystick Methods:\n %\n % loadLibs - loads the required Java library\n %\n % read - reads the status of axes, buttons, and POVs\n % axis - reads the status of selected axes\n % button - reads the status of selected buttons\n % pov - reads the status of selected POV (point of view)\n % caps - returns a structure of joystick capabilities\n % close - closes and invalidates the joystick object\n % force - applies force feedback to selected axes\n %\n % Example:\n % % Connect to the first joystick and read its state\n % joy = HebiJoystick(1);\n % [axes, buttons, povs] = read(joy);\n %\n % See also vrjoystick, loadLibs, read\n \n % Copyright (c) 2016-2017 HEBI Robotics\n \n properties (SetAccess = private)\n Name\n Axes\n Buttons\n POVs\n Forces\n end\n \n properties (Access = private)\n joy\n end\n \n methods (Static, Access = public)\n function loadLibs()\n % Loads the backing Java files and native binaries. This\n % method assumes that the jar file is located in the same\n % directory as this class-script, and that the file name\n % matches the string below.\n jarFileName = 'matlab-input-1.2.jar';\n \n % Load only once\n if ~exist('us.hebi.matlab.input.HebiJoystick', 'class')\n \n localDir = fileparts(mfilename('fullpath'));\n \n % Add binary libs\n java.lang.System.setProperty(...\n 'net.java.games.input.librarypath', ...\n fullfile(localDir, 'lib'));\n \n % Add Java library\n javaaddpath(fullfile(localDir, jarFileName));\n \n end\n end\n end\n \n methods (Access = public)\n \n function this = HebiJoystick(index, ~)\n % creates a joystick object\n if nargin < 2\n % be compatible with the original API\n end\n \n % Create backing Java object\n HebiJoystick.loadLibs();\n this.joy = us.hebi.matlab.input.HebiJoystick(index);\n if ~ismac()\n % Increase event queue to not have to poll as often.\n % Doesn't work on mac.\n this.joy.setEventQueueSize(200);\n end\n \n % Set properties\n caps = this.caps();\n this.Name = this.joy.getName();\n this.Axes = caps.Axes;\n this.Buttons = caps.Buttons;\n this.POVs = caps.POVs;\n this.Forces = caps.Forces;\n \n end\n \n function varargout = read(this)\n % reads the status of axes, buttons, and POVs\n %\n % Example\n % joy = HebiJoystick(1);\n % [axes, buttons, povs] = read(joy);\n varargout = read(this.joy);\n end\n \n function axes = axis(this, mask)\n % reads the status of selected axes\n [axes, ~, ~] = read(this);\n if nargin > 1\n axes = axes(mask);\n end\n end\n \n function buttons = button(this, mask)\n % reads the status of selected buttons\n [~, buttons, ~] = read(this);\n if nargin > 1\n buttons = buttons(mask);\n end\n end\n \n function povs = pov(this, mask)\n % reads the status of selected POV (point of view)\n [~, ~, povs] = read(this);\n if nargin > 1\n povs = povs(mask);\n end\n end\n \n function out = caps(this)\n % returns a structure of joystick capabilities\n out = struct(caps(this.joy));\n end\n \n function [] = close(this)\n % closes and invalidates the joystick object\n close(this.joy);\n end\n \n function [] = force(this, indices, value)\n % applies force feedback to selected axes\n force(this.joy, indices, value);\n end\n \n end\n \n % Hide inherited methods (handle) from auto-complete\n % and docs\n methods(Access = public, Hidden = true)\n \n function [] = delete(this)\n % destructor disposes this instance\n close(this);\n end\n \n function varargout = addlistener(varargin)\n varargout{:} = addlistener@handle(varargin{:});\n end\n function varargout = eq(varargin)\n varargout{:} = eq@handle(varargin{:});\n end\n function varargout = findobj(varargin)\n varargout{:} = findobj@handle(varargin{:});\n end\n function varargout = findprop(varargin)\n varargout{:} = findprop@handle(varargin{:});\n end\n function varargout = ge(varargin)\n varargout{:} = ge@handle(varargin{:});\n end\n function varargout = gt(varargin)\n varargout{:} = gt@handle(varargin{:});\n end\n function varargout = le(varargin)\n varargout{:} = le@handle(varargin{:});\n end\n function varargout = lt(varargin)\n varargout{:} = lt@handle(varargin{:});\n end\n function varargout = ne(varargin)\n varargout{:} = ne@handle(varargin{:});\n end\n function varargout = notify(varargin)\n varargout{:} = notify@handle(varargin{:});\n end\n \n end\n \nend"},"meta":{"kind":"string","value":"{'content_hash': 'c632228e1f2e0faed5429d1c03f35bc6', 'timestamp': '', 'source': 'github', 'line_count': 190, 'max_line_length': 74, 'avg_line_length': 32.526315789473685, 'alnum_prop': 0.5158576051779935, 'repo_name': 'HebiRobotics/hebi-matlab-examples', 'id': '71cdccd605875a66ab7d8e55b19e9b603cee5d1a', 'size': '6180', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'kits/igor/tools/input/HebiJoystick.m', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '126'}, {'name': 'MATLAB', 'bytes': '665332'}, {'name': 'Shell', 'bytes': '1677'}]}"}}},{"rowIdx":849725,"cells":{"text":{"kind":"string","value":"\n\n#import \"ThoMoNetworkStub.h\"\n#import \n#import \"ThoMoTCPConnection.h\"\n#import \n\nNSString *const kThoMoNetworkInfoKeyUserMessage\t\t\t\t\t= @\"kThoMoNetworkInfoKeyUserMessage\";\nNSString *const kThoMoNetworkInfoKeyData\t\t\t\t\t\t= @\"kThoMoNetworkInfoKeyData\";\nNSString *const kThoMoNetworkInfoKeyRemoteConnectionIdString\t= @\"kThoMoNetworkInfoKeyRemoteConnectionIdString\";\nNSString *const kThoMoNetworkInfoKeyLocalNetworkStub\t\t\t= @\"kThoMoNetworkInfoKeyLocalNetworkStub\";\n\nNSString *const kThoMoNetworkPrefScopeSpecifierKey\t\t\t\t= @\"kThoMoNetworkPrefScopeSpecifierKey\";\n\n// interface category for main thread relay methods\n@interface ThoMoNetworkStub (RelayMethods)\n-(void)networkStubDidShutDownRelayMethod;\n-(void)netServiceProblemRelayMethod:(NSDictionary *)infoDict;\n-(void)didReceiveDataRelayMethod:(NSDictionary *)infoDict;\n-(void)connectionEstablishedRelayMethod:(NSDictionary *)infoDict;\n-(void)connectionLostRelayMethod:(NSDictionary *)infoDict;\n-(void)connectionClosedRelayMethod:(NSDictionary *)infoDict;\n@end\n\n@interface ThoMoNetworkStub ()\n\n-(void)sendDataWithInfoDict:(NSDictionary *)theInfoDict;\n\n@end\n\n\n\n\n// =====================================================================================================================\n#pragma mark -\n#pragma mark Public Methods\n// ---------------------------------------------------------------------------------------------------------------------\n\n@implementation ThoMoNetworkStub\n\n#pragma mark Housekeeping\n\n-(id)initWithProtocolIdentifier:(NSString *)theProtocolIdentifier;\n{\n\tself = [super init];\n\tif (self != nil) \n\t{\n\t\t// check if there is a scope specifier present in the user defaults and add it to the protocolId\n\t\tNSString *scopeSpecifier = [[NSUserDefaults standardUserDefaults] stringForKey:kThoMoNetworkPrefScopeSpecifierKey];\n\t\tif (scopeSpecifier)\n\t\t{\n\t\t\tprotocolIdentifier = [scopeSpecifier stringByAppendingFormat:@\"-%@\", theProtocolIdentifier];\n\t\t\tNSLog(@\"Warning: ThoMo Networking Protocol Prefix in effect! If your app cannot connect to its counterpart that may be the reason.\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tprotocolIdentifier = [theProtocolIdentifier copy];\n\t\t}\n\n\t\tif ([protocolIdentifier length] > 14)\n\t\t{\n\t\t\t// clean up internally\n\t\t\t[NSException raise:@\"ThoMoInvalidArgumentException\" \n\t\t\t\t\t\tformat:@\"The protocol identifier plus the optional scoping prefix (\\\"%@\\\") exceed\"\n\t\t\t\t\t\t\t\t\" Bonjour's maximum allowed length of fourteen characters!\", protocolIdentifier];\n\t\t} \n\t\t\n\t\tconnections\t= [[NSMutableDictionary alloc] init];\n\t}\n\treturn self;\n}\n\n-(id)init;\n{\n\treturn [self initWithProtocolIdentifier:@\"thoMoNetworkStubDefaultIdentifier\"];\n}\n\n\n// these methods are called on the main thread\n#pragma mark Control\n\n-(void) start;\n{\n\tif ([networkThread isExecuting])\n\t{\n\t\t[NSException raise:@\"ThoMoStubAlreadyRunningException\" \n\t\t\t\t\tformat:@\"The client stub had already been started before and cannot be started twice.\"];\n\t}\n\t\n\t// TODO: check if we cannot run a start-stop-start cycle\n\tNSAssert(networkThread == nil, @\"Network thread not released properly\");\n\t\n\tnetworkThread = [[NSThread alloc] initWithTarget:self selector:@selector(networkThreadEntry) object:nil];\n\t[networkThread start];\n}\n\n-(void) stop;\n{\n\t[networkThread cancel];\n\t\n\t// TODO: check if we can release the networkthread here\n}\n\n-(NSArray *)activeConnections;\n{\n\tNSArray *result;\n\t@synchronized(self)\n\t{\n\t\tresult = [[connections allKeys] copy];\n\t}\n\treturn result;\n}\n\n-(void)send:(id)theData toConnection:(NSString *)theConnectionIdString;\n{\n\tNSData *sendData = [NSKeyedArchiver archivedDataWithRootObject:theData];\n\t[self sendByteData:sendData toConnection:theConnectionIdString];\n}\n\n-(void)sendByteData:(NSData *)sendData toConnection:(NSString *)theConnectionIdString;\n{\n\tNSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:\n\t\t\t\t\t\t\t sendData, @\"DATA\",\n\t\t\t\t\t\t\t theConnectionIdString, @\"ID\",\n\t\t\t\t\t\t\t nil];\n\t\n\t[self performSelector:@selector(sendDataWithInfoDict:) onThread:networkThread withObject:infoDict waitUntilDone:NO];\n}\n\n#pragma mark Send Data Relay\n\n// only call on network thread\n-(void)sendDataWithInfoDict:(NSDictionary *)theInfoDict;\n{\n\tNSData *sendData = [theInfoDict objectForKey:@\"DATA\"];\n\tNSString *theConnectionIdString = [theInfoDict objectForKey:@\"ID\"];\n\t\n\tThoMoTCPConnection *connection = nil;\n\t@synchronized(self)\n\t{\n\t\tconnection = [connections valueForKey:theConnectionIdString];\n\t}\n\t\n\tif (!connection) \n\t{\n\t\t[NSException raise:@\"ThoMoInvalidArgumentException\" \n\t\t\t\t\tformat:@\"No connection found for id %@\", theConnectionIdString];\n\t}\n\telse\n\t{\t\t\n\t\t[connection enqueueNextSendObject:sendData];\n\t}\n}\n\n\n#pragma mark Threading Methods\n\n-(void)networkThreadEntry\n{\n\t#ifndef NDEBUG\n\t\t#ifdef THOMO_PTHREAD_NAMING_AVAILABLE\n\t\t\tpthread_setname_np(\"ThoMoNetworking Dispatch Thread\");\n\t\t#endif\n\t#endif\n\t\n\t\n\t@autoreleasepool {\n\t\n\t\tif([self setup])\n\t\t{\t\t\n\t\t\twhile (![networkThread isCancelled])\n\t\t\t{\n\t\t\t\tNSDate *inOneSecond = [[NSDate alloc] initWithTimeIntervalSinceNow:1];\n\t\t\t\t\n\t\t\t\t// catch exceptions and propagate to main thread\n\t\t\t\t@try {\n\t\t\t\t\t[[NSRunLoop currentRunLoop]\trunMode:NSDefaultRunLoopMode beforeDate:inOneSecond];\n\t\t\t\t}\n\t\t\t\t@catch (NSException * e) {\n\t\t\t\t\t[e performSelectorOnMainThread:@selector(raise) withObject:nil waitUntilDone:YES];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t[self teardown];\n\t\t}\n\t\t\n\t\t[self performSelectorOnMainThread:@selector(networkStubDidShutDownRelayMethod) withObject:nil waitUntilDone:NO];\n\t\n\t}\n}\n\n#pragma mark -\n#pragma mark Connection Delegate Methods\n\n/// Delegate method that gets called from ThoMoTCPConnections whenever they did receive data.\n/**\n Takes the received data and relays it to a method on the main thread.\n This method is typically overridden in the subclasses of ThoMoNetworkStub and then directly called from there.\n \n \\param[in]\ttheData\t\t\treference to the received data\n \\param[in]\ttheConnection\treference to the connection that received the data\n */\n-(void)didReceiveData:(NSData *)theData onConnection:(ThoMoTCPConnection *)theConnection;\n{\n\t// look up the connection\n\tNSString *connectionKey = [self keyForConnection:theConnection];\n\t\n\t// unarchive the data\n\tid receivedData = [NSKeyedUnarchiver unarchiveObjectWithData:theData];\n\t\n\t// package the parameters into an info dict and relay them to the main thread\n\tNSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:\t\n\t\t\t\t\t\t\t connectionKey,\tkThoMoNetworkInfoKeyRemoteConnectionIdString,\n\t\t\t\t\t\t\t self,\t\t\t\tkThoMoNetworkInfoKeyLocalNetworkStub,\n\t\t\t\t\t\t\t receivedData,\t\tkThoMoNetworkInfoKeyData,\n\t\t\t\t\t\t\t nil];\n\t\n\t[self performSelectorOnMainThread:@selector(didReceiveDataRelayMethod:) withObject:infoDict waitUntilDone:NO];\n}\n\n-(void)streamsDidOpenOnConnection:(ThoMoTCPConnection *)theConnection;\n{\n\t// look up the connection\n\tNSString *connectionKey = [self keyForConnection:theConnection];\n\t\n\t// package the parameters into an info dict and relay them to the main thread\n\tNSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:\t\n\t\t\t\t\t\t\t self,\t\t\t\tkThoMoNetworkInfoKeyLocalNetworkStub,\n\t\t\t\t\t\t\t connectionKey,\tkThoMoNetworkInfoKeyRemoteConnectionIdString,\n\t\t\t\t\t\t\t nil];\n\t\n\t[self performSelectorOnMainThread:@selector(connectionEstablishedRelayMethod:) withObject:infoDict waitUntilDone:NO];\n}\n\n-(void)streamEndEncountered:(NSStream *)theStream onConnection:(ThoMoTCPConnection *)theConnection;\n{\n\tNSString *connectionKey = [self keyForConnection:theConnection];\n\t\n\tNSString *userMessage = [NSString stringWithFormat:@\"Stream end event encountered on stream to %@! Closing connection.\", connectionKey];\n\t\n\t[theConnection close];\n\t\n\t@synchronized(self)\n\t{\n\t\t[connections removeObjectForKey:connectionKey];\n\t}\n\t\n\tNSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:\t\n\t\t\t\t\t\t\t self,\t\t\t\tkThoMoNetworkInfoKeyLocalNetworkStub,\n\t\t\t\t\t\t\t connectionKey,\tkThoMoNetworkInfoKeyRemoteConnectionIdString,\t\n\t\t\t\t\t\t\t userMessage,\t\tkThoMoNetworkInfoKeyUserMessage,\n\t\t\t\t\t\t\t nil];\n\t\n\t[self performSelectorOnMainThread:@selector(connectionClosedRelayMethod:) withObject:infoDict waitUntilDone:NO];\n}\n\n-(void)streamErrorEncountered:(NSStream *)theStream onConnection:(ThoMoTCPConnection *)theConnection;\n{\n\tNSString *connectionKey = [self keyForConnection:theConnection];\n\t\n\tNSError *theError = [theStream streamError];\n\tNSString *userMessage = [NSString stringWithFormat:@\"Error %li: \\\"%@\\\" on stream to %@! Terminating connection.\", (long)[theError code], [theError localizedDescription], connectionKey];\n\t\n\t[theConnection close];\n\t\n\t@synchronized(self)\n\t{\n\t\t[connections removeObjectForKey:connectionKey];\n\t}\n\t\n\tNSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:\t\n\t\t\t\t\t\t\t self,\t\t\t\tkThoMoNetworkInfoKeyLocalNetworkStub,\n\t\t\t\t\t\t\t connectionKey,\tkThoMoNetworkInfoKeyRemoteConnectionIdString,\t\n\t\t\t\t\t\t\t userMessage,\t\tkThoMoNetworkInfoKeyUserMessage,\n\t\t\t\t\t\t\t nil];\n\t\n\t[self performSelectorOnMainThread:@selector(connectionLostRelayMethod:) withObject:infoDict waitUntilDone:NO];\n}\n\n\n\n// =====================================================================================================================\n#pragma mark -\n#pragma mark Protected Methods\n// ---------------------------------------------------------------------------------------------------------------------\n\n\n-(BOOL)setup\n{\n\treturn YES;\n}\n\n-(void)teardown\n{\n\t// close all open connections\n\t@synchronized(self)\n\t{\n\t\tfor (ThoMoTCPConnection *connection in [connections allValues]) {\n\t\t\t[connection close];\n\t\t}\n\t\t\n\t\t[connections removeAllObjects];\t\t\n\t}\n}\n\n-(NSString *)keyStringFromAddress:(NSData *)addr;\n{\n\t// get the peer socket address from the NSData object\n\t// NOTE:\tthere actually is a struct sockaddr in there, NOT a struct sockaddr_in! \n\t//\t\t\tI heard from beej () that they share the same 15 first bytes so casting should not be a problem. \n\t//\t\t\tYou've been warned, though...\n\tstruct sockaddr_in *peerSocketAddress = (struct sockaddr_in *)[addr bytes];\n\t\n\t// convert in_addr to ascii (note: returns a pointer to a statically allocated buffer inside inet_ntoa! calling again will overwrite)\n\tchar *humanReadableAddress\t= inet_ntoa(peerSocketAddress->sin_addr);\n\tNSString *peerAddress\t\t= [NSString stringWithCString:humanReadableAddress encoding:NSUTF8StringEncoding];\n\tNSString *peerPort\t\t\t= [NSString stringWithFormat:@\"%d\", ntohs(peerSocketAddress->sin_port)];\n\tNSString *peerKey\t\t\t= [NSString stringWithFormat:@\"%@:%@\", peerAddress, peerPort];\n\t\n\treturn peerKey;\n}\n\n-(NSString *)keyForConnection:(ThoMoTCPConnection *)theConnection;\n{\n\tNSString\t*connectionKey;\n\tNSArray\t\t*keys;\n\t@synchronized(self)\n\t{\n\t\tkeys = [connections allKeysForObject:theConnection];\n\t\tNSAssert([keys count] == 1, @\"More than one connection record in dict for a single connection.\");\n\t\tconnectionKey = [[keys objectAtIndex:0] copy];\n\t}\n\t\n\treturn connectionKey;\n}\n\n\n-(void) openNewConnection:(NSString *)theConnectionKey inputStream:(NSInputStream *)istr outputStream:(NSOutputStream *)ostr;\n{\n\t// create a new ThoMoTCPConnection object and set ourselves as the delegate to forward the incoming data to our own delegate\n\tThoMoTCPConnection *newConnection = [[ThoMoTCPConnection alloc] initWithDelegate:self inputStream:istr outputStream:ostr];\n\t\n\t// store in our dictionary, open, and release our copy\n\t@synchronized(self)\n\t{\n\t\t// it should never happen that we overwrite a connection\n\t\tNSAssert(![connections valueForKey:theConnectionKey], @\"ERROR: Tried to create a connection with an IP and port that we already have a connection for.\");\n\t\t\n\t\t[connections setValue:newConnection forKey:theConnectionKey];\n\t}\n\t[newConnection open];\n}\n\n@end\n\n\n\n#pragma mark -\n#pragma mark Main Thread Relay Methods\n\n@implementation ThoMoNetworkStub (RelayMethods)\n\n-(void)networkStubDidShutDownRelayMethod\n{\n\tNSLog(@\"%@ :: %@\", [self description], NSStringFromSelector(_cmd));\n}\n\n-(void)netServiceProblemRelayMethod:(NSDictionary *)infoDict\n{\n\tNSLog(@\"%@ :: %@\", [self description], NSStringFromSelector(_cmd));\n}\n\n-(void)didReceiveDataRelayMethod:(NSDictionary *)infoDict;\n{\n\tNSLog(@\"%@ :: %@\", [self description], NSStringFromSelector(_cmd));\n}\n\n-(void)connectionEstablishedRelayMethod:(NSDictionary *)infoDict;\n{\n\tNSLog(@\"%@ :: %@\", [self description], NSStringFromSelector(_cmd));\n}\n\n-(void)connectionLostRelayMethod:(NSDictionary *)infoDict;\n{\n\tNSLog(@\"%@ :: %@\", [self description], NSStringFromSelector(_cmd));\n}\n\n-(void)connectionClosedRelayMethod:(NSDictionary *)infoDict;\n{\n\tNSLog(@\"%@ :: %@\", [self description], NSStringFromSelector(_cmd));\n}\n\n\n#pragma mark -\n#pragma mark Debugging\n\n\n@end\n"},"meta":{"kind":"string","value":"{'content_hash': 'bc4e762d833ebf42e367c0a37f77f3b7', 'timestamp': '', 'source': 'github', 'line_count': 399, 'max_line_length': 186, 'avg_line_length': 31.340852130325814, 'alnum_prop': 0.7266693322670932, 'repo_name': 'i10/ThoMoNetworking', 'id': '9eb6fab97c3b8ab810a6d310cd39e34cbd652464', 'size': '13780', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Classes/ThoMoNetworkStub.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '86966'}]}"}}},{"rowIdx":849726,"cells":{"text":{"kind":"string","value":"\n\n/**\n * \\addtogroup pubsub\n * @{\n */\n\n#ifndef __M2ETIS_PUBSUB_FILTER_FILTEREXPRESSIONS_LESSTHANATTRIBUTEFILTER_H__\n#define __M2ETIS_PUBSUB_FILTER_FILTEREXPRESSIONS_LESSTHANATTRIBUTEFILTER_H__\n\n#include \"m2etis/pubsub/filter/filterexpressions/AttributeFilter.h\"\n\nnamespace m2etis {\nnamespace pubsub {\nnamespace filter {\n\n\ttemplate class EqualsAttributeFilter;\n\ttemplate class NotEqualsAttributeFilter;\n\ttemplate class GreaterThanAttributeFilter;\n\n\ttemplate\n\tclass LessThanAttributeFilter : public AttributeFilter {\n\tpublic:\n\t\ttypedef EventType schema; // needed for operator overloading\n\t\tLessThanAttributeFilter() : AttributeFilter(-1, {}) {} // needed for boost serialization\n\t\tLessThanAttributeFilter(const AttributeName attribute_id, const AttributeType & constants) : AttributeFilter(attribute_id, {constants}) {}\n\t\tvirtual ~LessThanAttributeFilter() {}\n\n\t\tvirtual void getAttributeType(FilterVisitor & visitor) const override {\n\t\t\tvisitor.getAttributeType(this);\n\t\t}\n\n\t\t// function called to match against an event\n\t\tvirtual bool matchAttribute(const AttributeType & attribute) const override {\n\t\t\treturn attribute < this->get_constants()[0]; // attribute type has to implement \"<\"-operator\n\t\t}\n\n\t\tusing AttributeFilter::overlaps;\n\n\t\tvirtual bool overlaps(const AttributeFilter * other_filter) const override {\n\t\t\tif (this->get_attribute_id() != other_filter->get_attribute_id()) {\n\t\t\t\treturn true; // AttributeFilters for different attributes overlap\n\t\t\t}\n\n\t\t\tif (typeid(EqualsAttributeFilter) == typeid(*other_filter)) {\n\t\t\t\treturn other_filter->overlaps(this);\n\t\t\t}\n\t\t\tif (typeid(NotEqualsAttributeFilter) == typeid(*other_filter)) {\n\t\t\t\treturn other_filter->overlaps(this);\n\t\t\t}\n\t\t\tif (typeid(GreaterThanAttributeFilter) == typeid(*other_filter)) {\n\t\t\t\treturn other_filter->overlaps(this); // TODO: (Roland) check for numeric_limits\n\t\t\t}\n\t\t\tif (typeid(LessThanAttributeFilter) == typeid(*other_filter)) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t private:\n\t\tfriend class boost::serialization::access;\n\t\ttemplate\n\t\tvoid serialize(Archive & ar, const unsigned int) {\n\t\t\tar & boost::serialization::base_object>(*this);\n\t\t}\n\t}; // LessThanAttributeFilter\n\n} /* namespace filter */\n} /* namespace pubsub */\n} /* namespace m2etis */\n\n#endif /* __M2ETIS_PUBSUB_FILTER_FILTEREXPRESSIONS_LESSTHANATTRIBUTEFILTER_H__ */\n\n/**\n * @}\n */\n"},"meta":{"kind":"string","value":"{'content_hash': 'b630a95e6d33de5a71db00ea6e97365a', 'timestamp': '', 'source': 'github', 'line_count': 77, 'max_line_length': 166, 'avg_line_length': 36.62337662337662, 'alnum_prop': 0.7531914893617021, 'repo_name': 'ClockworkOrigins/m2etis', 'id': '7b7a778d241f4813a65348e233a3d01cff2cbfba', 'size': '3425', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'library/include/m2etis/pubsub/filter/filterexpressions/LessThanAttributeFilter.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '13275'}, {'name': 'C++', 'bytes': '1044746'}, {'name': 'CMake', 'bytes': '187386'}, {'name': 'Python', 'bytes': '136028'}, {'name': 'Shell', 'bytes': '1079'}]}"}}},{"rowIdx":849727,"cells":{"text":{"kind":"string","value":"/**\n * @fileoverview Prevent missing parentheses around multilines JSX\n * @author Yannick Croissant\n */\n'use strict';\n\n// ------------------------------------------------------------------------------\n// Constants\n// ------------------------------------------------------------------------------\n\nvar DEFAULTS = {\n declaration: true,\n assignment: true,\n return: true\n};\n\n// ------------------------------------------------------------------------------\n// Rule Definition\n// ------------------------------------------------------------------------------\n\nmodule.exports = {\n meta: {\n docs: {},\n fixable: 'code',\n\n schema: [{\n type: 'object',\n properties: {\n declaration: {\n type: 'boolean'\n },\n assignment: {\n type: 'boolean'\n },\n return: {\n type: 'boolean'\n }\n },\n additionalProperties: false\n }]\n },\n\n create: function(context) {\n\n var sourceCode = context.getSourceCode();\n\n function isParenthesised(node) {\n var previousToken = sourceCode.getTokenBefore(node);\n var nextToken = sourceCode.getTokenAfter(node);\n\n return previousToken && nextToken &&\n previousToken.value === '(' && previousToken.range[1] <= node.range[0] &&\n nextToken.value === ')' && nextToken.range[0] >= node.range[1];\n }\n\n function isMultilines(node) {\n return node.loc.start.line !== node.loc.end.line;\n }\n\n function check(node) {\n if (!node || node.type !== 'JSXElement') {\n return;\n }\n\n if (!isParenthesised(node) && isMultilines(node)) {\n context.report({\n node: node,\n message: 'Missing parentheses around multilines JSX',\n fix: function(fixer) {\n return fixer.replaceText(node, '(' + sourceCode.getText(node) + ')');\n }\n });\n }\n }\n\n function isEnabled(type) {\n var userOptions = context.options[0] || {};\n if (({}).hasOwnProperty.call(userOptions, type)) {\n return userOptions[type];\n }\n return DEFAULTS[type];\n }\n\n // --------------------------------------------------------------------------\n // Public\n // --------------------------------------------------------------------------\n\n return {\n\n VariableDeclarator: function(node) {\n if (isEnabled('declaration')) {\n check(node.init);\n }\n },\n\n AssignmentExpression: function(node) {\n if (isEnabled('assignment')) {\n check(node.right);\n }\n },\n\n ReturnStatement: function(node) {\n if (isEnabled('return')) {\n check(node.argument);\n }\n }\n };\n\n }\n};\n"},"meta":{"kind":"string","value":"{'content_hash': 'e7042691a107b355128e6a110251b7b4', 'timestamp': '', 'source': 'github', 'line_count': 110, 'max_line_length': 81, 'avg_line_length': 24.327272727272728, 'alnum_prop': 0.44170403587443946, 'repo_name': 'lencioni/eslint-plugin-react', 'id': 'bca54662dda45c5038c738bdf2f0287a454959eb', 'size': '2676', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/rules/jsx-wrap-multilines.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '495876'}]}"}}},{"rowIdx":849728,"cells":{"text":{"kind":"string","value":"using System.Reflection;\n\n[assembly: AssemblyTitle(\"Effort.Extra\")]\n[assembly: AssemblyKeyFile(\"../Effort.Extra.snk\")]"},"meta":{"kind":"string","value":"{'content_hash': 'eb1908157dc9698a8adf44d59c564383', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 50, 'avg_line_length': 29.75, 'alnum_prop': 0.7563025210084033, 'repo_name': 'christophano/Effort.Extra', 'id': '67eee67b645b101c5ba46a6db9ff68313a9a47fc', 'size': '121', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Effort.Extra.StrongName/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '44318'}]}"}}},{"rowIdx":849729,"cells":{"text":{"kind":"string","value":"const express = require('express'),\n router = express.Router(),\n service = require('./services/book');\n\nrouter.get('/', service.find);\nrouter.get('/:id', service.show);\nrouter.post('/', service.create);\nrouter.put('/:id', service.update);\nrouter.patch('/:id', service.update);\nrouter.delete('/:id', service.destroy);\n\nmodule.exports = router;"},"meta":{"kind":"string","value":"{'content_hash': '92f32bf92bb677f062f58c45a0d1e76d', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 43, 'avg_line_length': 29.416666666666668, 'alnum_prop': 0.660056657223796, 'repo_name': 'leonanluppi/express-mongo', 'id': '5462a88d0cac0e63a996ad9d00074b4f653d8512', 'size': '353', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'api/books/index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '7932'}]}"}}},{"rowIdx":849730,"cells":{"text":{"kind":"string","value":"\n\n \n \n \n \n Foundation for Sites\n \n \n\n \n \n
\n \n
\n\n\n\n \n \n \n \n\n \n\n \n\n"},"meta":{"kind":"string","value":"{'content_hash': '9fa6b8531a901dfd21bd7b3c5ba720a3', 'timestamp': '', 'source': 'github', 'line_count': 34, 'max_line_length': 78, 'avg_line_length': 24.88235294117647, 'alnum_prop': 0.541371158392435, 'repo_name': 'surendias/Replace-on-page-emails-with-a-popup-form', 'id': 'ff530d63b01e46f754c56b82eadbfc5b0f537aac', 'size': '846', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'index.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '846'}, {'name': 'JavaScript', 'bytes': '5625'}]}"}}},{"rowIdx":849731,"cells":{"text":{"kind":"string","value":"package com.lin.web.service.impl;\n\nimport java.util.ArrayList;\nimport java.util.Calendar;\nimport java.util.Collections;\nimport java.util.Date;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.LinkedHashMap;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Map.Entry;\nimport java.util.logging.Logger;\n\nimport com.google.api.ads.dfp.jaxws.factory.DfpServices;\nimport com.google.api.ads.dfp.jaxws.utils.v201403.StatementBuilder;\nimport com.google.api.ads.dfp.jaxws.v201403.ComputedStatus;\nimport com.google.api.ads.dfp.jaxws.v201403.DateTime;\nimport com.google.api.ads.dfp.jaxws.v201403.Forecast;\nimport com.google.api.ads.dfp.jaxws.v201403.ForecastServiceInterface;\nimport com.google.api.ads.dfp.jaxws.v201403.LineItem;\nimport com.google.api.ads.dfp.jaxws.v201403.LineItemPage;\nimport com.google.api.ads.dfp.jaxws.v201403.LineItemServiceInterface;\nimport com.google.api.ads.dfp.jaxws.v201403.Money;\nimport com.google.api.ads.dfp.jaxws.v201403.Statement;\nimport com.google.api.ads.dfp.jaxws.v201403.TargetPlatform;\nimport com.google.api.ads.dfp.lib.client.DfpSession;\nimport com.google.api.client.util.Lists;\nimport com.google.visualization.datasource.base.TypeMismatchException;\nimport com.google.visualization.datasource.datatable.ColumnDescription;\nimport com.google.visualization.datasource.datatable.DataTable;\nimport com.google.visualization.datasource.datatable.value.DateValue;\nimport com.google.visualization.datasource.datatable.value.NumberValue;\nimport com.google.visualization.datasource.datatable.value.ValueType;\nimport com.google.visualization.datasource.render.JsonRenderer;\nimport com.lin.persistance.dao.ILinMobileDAO;\nimport com.lin.persistance.dao.IUserDetailsDAO;\nimport com.lin.persistance.dao.impl.LinMobileDAO;\nimport com.lin.persistance.dao.impl.UserDetailsDAO;\nimport com.lin.server.Exception.DataServiceException;\nimport com.lin.server.bean.ActualAdvertiserObj;\nimport com.lin.server.bean.AdvertiserByLocationObj;\nimport com.lin.server.bean.AdvertiserByMarketObj;\nimport com.lin.server.bean.AdvertiserReportObj;\nimport com.lin.server.bean.AgencyAdvertiserObj;\nimport com.lin.server.bean.CompanyObj;\nimport com.lin.server.bean.CustomLineItemObj;\nimport com.lin.server.bean.ForcastedAdvertiserObj;\nimport com.lin.server.bean.OrderLineItemObj;\nimport com.lin.server.bean.PerformanceMetricsObj;\nimport com.lin.server.bean.PublisherChannelObj;\nimport com.lin.server.bean.PublisherInventoryRevenueObj;\nimport com.lin.server.bean.PublisherPropertiesObj;\nimport com.lin.server.bean.PublisherSummaryObj;\nimport com.lin.server.bean.ReallocationDataObj;\nimport com.lin.server.bean.SellThroughDataObj;\nimport com.lin.web.dto.AdvertiserPerformerDTO;\nimport com.lin.web.dto.CommonDTO;\nimport com.lin.web.dto.ForcastLineItemDTO;\nimport com.lin.web.dto.LeftMenuDTO;\nimport com.lin.web.dto.LineChartDTO;\nimport com.lin.web.dto.LineItemDTO;\nimport com.lin.web.dto.PopUpDTO;\nimport com.lin.web.dto.PropertyDropDownDTO;\nimport com.lin.web.dto.PublisherReallocationHeaderDTO;\nimport com.lin.web.dto.PublisherReportChannelPerformanceDTO;\nimport com.lin.web.dto.PublisherReportComputedValuesDTO;\nimport com.lin.web.dto.PublisherReportHeaderDTO;\nimport com.lin.web.dto.PublisherReportPerformanceByPropertyDTO;\nimport com.lin.web.dto.PublisherTrendAnalysisHeaderDTO;\nimport com.lin.web.dto.PublisherViewDTO;\nimport com.lin.web.dto.QueryDTO;\nimport com.lin.web.dto.ReconciliationDataDTO;\nimport com.lin.web.service.ILinMobileBusinessService;\nimport com.lin.web.service.IQueryService;\nimport com.lin.web.service.IUserService;\nimport com.lin.web.util.AdvertiserViewMostActiveComparator;\nimport com.lin.web.util.AdvertiserViewNonPerformerComparator;\nimport com.lin.web.util.AdvertiserViewPerformerComparator;\nimport com.lin.web.util.DateUtil;\nimport com.lin.web.util.EncriptionUtil;\nimport com.lin.web.util.LinMobileConstants;\nimport com.lin.web.util.LinMobileVariables;\nimport com.lin.web.util.MemcacheUtil;\nimport com.lin.web.util.StringUtil;\n\npublic class LinMobileBusinessService implements ILinMobileBusinessService{\n\tprivate static final Logger log = Logger.getLogger(LinMobileBusinessService.class.getName());\t\n\t\n\t\n\tpublic List getLineItems(long orderId){\n\t\tList lineItemDTOList=null;\n\t\treturn lineItemDTOList;\n\t}\n\t\n\tprivate String ChannelsInQString(List allChannelName, StringBuilder memcacheKeySubstring) {\n\n\t\tString Channel = \"\";\n\t\tif (allChannelName.size() != 0) {\n\t\t\tint channelListSize = allChannelName.size();\n\t\t\tint i = 0;\n\t\t\tif (channelListSize == 1) {\n\t\t\t\tChannel = Channel + \"channel_name = '\"\n\t\t\t\t\t\t+ allChannelName.get(i) + \"' \";\n\t\t\t\tmemcacheKeySubstring.append(allChannelName.get(i));\n\t\t\t} else {\n\t\t\t\tChannel = Channel + \"(\";\n\t\t\t\tfor (i = 0; i < channelListSize; i++) {\n\t\t\t\t\tChannel = Channel + \"channel_name = '\" + allChannelName.get(i) + \"'\";\n\t\t\t\t\tmemcacheKeySubstring.append(allChannelName.get(i));\n\t\t\t\t\tif (i != channelListSize - 1) {\n\t\t\t\t\t\tChannel = Channel + \" OR \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tChannel = Channel + \" ) \";\n\n\t\t\t}\n\t\t}\n\t\tlog.info(\"Channels:\"+Channel);\n\t\treturn Channel;\n\n\t}\n\t\n\t@Override\n\tpublic String getPublisherBQId(String publisherName) {\n\t\tlog.info(\"publisherName : \"+publisherName);\n\t\t\n\t\tMap publisherMap = new HashMap<>();\n\t\tString publisherIdInBQ = \"\";\n\t\t\n\t\tpublisherMap.put(LinMobileConstants.LIN_MEDIA_PUBLISHER_NAME, LinMobileConstants.LIN_MEDIA_PUBLISHER_ID);\n\t\tpublisherMap.put(LinMobileConstants.TRIBUNE_DFP_PUBLISHER_NAME, LinMobileConstants.TRIBUNE_DFP_PUBLISHER_ID);\n\t\tpublisherMap.put(LinMobileConstants.LIN_DIGITAL_PUBLISHER_NAME, LinMobileConstants.LIN_DIGITAL_PUBLISHER_ID);\n\t\tpublisherMap.put(LinMobileConstants.LIN_MOBILE_PUBLISHER_NAME, LinMobileConstants.LIN_MOBILE_PUBLISHER_ID);\n\t\t\n\t\tpublisherIdInBQ = publisherMap.get(publisherName);\n\t\t\n\t\tlog.info(\"publisherIdInBQ : \"+publisherIdInBQ);\n\t\treturn publisherIdInBQ;\n\t}\n\t\n\tpublic String getChannelsBQId(String channels) {\n\t\tlog.info(\"channels : \"+channels);\n\t\t\n\t\tMap channelMap = new HashMap<>();\n\t\tStringBuilder channelIdString = new StringBuilder();\n\t\t\n\t\tchannelMap.put(\"Google Ad exchange\", \"7\");\n\t\tchannelMap.put(\"House\", \"8\");\n\t\tchannelMap.put(\"LSN\", \"10\");\n\t\tchannelMap.put(\"Local Sales Direct\", \"4\");\n\t\tchannelMap.put(\"Mojiva\", \"3\");\n\t\tchannelMap.put(\"National Sales Direct\", \"5\");\n\t\tchannelMap.put(\"Nexage\", \"2\");\n\t\tchannelMap.put(\"Undertone\", \"6\");\n\t\t\n\t\tif(channels != null && channels.trim().length() > 0) {\n\t\t\tString[] channelArray = channels.split(\",\");\n\t\t\tfor(String channel : channelArray){\n\t\t\t\tchannel = channel.replaceAll(\"'\", \"\");\n\t\t\t\tchannel = channelMap.get(channel.trim());\n\t\t\t\tif(channel.length() > 0) {\n\t\t\t\t\tif((channelIdString.toString()).length() > 0) {\n\t\t\t\t\t\tchannelIdString.append(\",\"+channel);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tchannelIdString.append(channel);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlog.info(\"channelIdString : \"+channelIdString);\n\t\treturn channelIdString.toString();\n\t}\n\t\n\tpublic QueryDTO getQueryDTO(String publisherIdInBQ, String startDate, String endDate, String schema) {\n\t\tlog.info(\"publisherId : \"+ publisherIdInBQ+\", startDate : \"+ startDate+\", endDate : \"+ endDate+\", schema : \"+ schema);\n\t\tQueryDTO queryDTO = null;\n\t\t\n\t\tif(publisherIdInBQ.length() > 0) {\n\t\t\tIQueryService queryService = (IQueryService) BusinessServiceLocator.locate(IQueryService.class);\n\t\t\tif(startDate.contains(\"00:00:00\")) {\n\t\t\t\tstartDate = startDate.replaceAll(\"00:00:00\", \"\");\n\t\t\t}\n\t\t\tif(endDate.contains(\"00:00:00\")) {\n\t\t\t\tendDate = endDate.replaceAll(\"00:00:00\", \"\");\n\t\t\t}\n\t\t\tstartDate = startDate.trim();\n\t\t\tendDate = endDate.trim();\n\t\t\tqueryDTO = queryService.createQueryFromClause(publisherIdInBQ, startDate, endDate, schema);\n\t\t}\n\t\tif(queryDTO != null && !queryDTO.getQueryData().isEmpty()) {\n\t\t\tlog.info(\"queryDTO.getQueryData() : \"+queryDTO.getQueryData());\n\t\t}\n\t\telse {\n\t\t\tlog.info(\"queryDTO : null or queryDTO.getQueryData() is empty\");\n\t\t\tlog.info(\"putting dummy data\");\n\t\t\tString projectId=null;\n\t\t\tString serviceAccountEmail=null;\n\t\t\tString servicePrivateKey=null;\n\t\t\tString dataSetId=LinMobileVariables.GOOGLE_BIGQUERY_DATASET_ID;\n\t\t\tStringBuffer queryData=new StringBuffer();\n\t\t\t\n\t\t\tif(schema.equals(LinMobileConstants.BQ_CORE_PERFORMANCE)) {\n\t\t\t\tqueryData.append(\"LIN_QA.CorePerformance_2014_01,LIN_QA.CorePerformance_2014_02,LIN_QA.CorePerformance_2014_03\");\n\t\t\t}\n\t\t\telse if(schema.equals(LinMobileConstants.BQ_DFP_TARGET)) {\n\t\t\t\tqueryData.append(\"LIN_QA.DFPTarget_2014_01,LIN_QA.DFPTarget_2014_02,LIN_QA.DFPTarget_2014_03\");\n\t\t\t}\n\t\t\telse if(schema.equals(LinMobileConstants.BQ_PERFORMANCE_BY_LOCATION)) {\n\t\t\t\tqueryData.append(\"LIN_QA.PerformanceByLocation_2014_01,LIN_QA.PerformanceByLocation_2014_02,LIN_QA.PerformanceByLocation_2014_03\");\n\t\t\t}\n\t\t\telse if(schema.equals(LinMobileConstants.BQ_SELL_THROUGH)) {\n\t\t\t\tqueryData.append(\"LIN.Sell_Through\");\n\t\t\t}\n\t\t\t\n\t\t\tswitch(publisherIdInBQ) {\t\t\n\t\t\t case \"1\":\n\t\t\t\t projectId=LinMobileConstants.LIN_MEDIA_GOOGLE_API_PROJECT_ID;\n\t\t\t\t serviceAccountEmail=LinMobileConstants.LIN_MEDIA_GOOGLE_API_SERVICE_ACCOUNT_EMAIL_ADDRESS;\n\t\t\t\t servicePrivateKey=LinMobileConstants.LIN_MEDIA_GOOGLE_BQ_SERVICE_ACCOUNT_PRIVATE_KEY;\n\t\t\t\t break;\n\t\t\t case \"2\":\n\t\t\t\t projectId=LinMobileConstants.LIN_DIGITAL_GOOGLE_API_PROJECT_ID;\n\t\t\t\t serviceAccountEmail=LinMobileConstants.LIN_DIGITAL_GOOGLE_API_SERVICE_ACCOUNT_EMAIL_ADDRESS;\n\t\t\t\t servicePrivateKey=LinMobileConstants.LIN_DIGITAL_GOOGLE_BQ_SERVICE_ACCOUNT_PRIVATE_KEY;\n\t\t\t\t break;\n\t\t\t case \"5\":\n\t\t\t\t projectId=LinMobileConstants.LIN_MOBILE_GOOGLE_API_PROJECT_ID;\n\t\t\t\t serviceAccountEmail=LinMobileConstants.LIN_MOBILE_GOOGLE_API_SERVICE_ACCOUNT_EMAIL_ADDRESS;\n\t\t\t\t servicePrivateKey=LinMobileConstants.LIN_MOBILE_GOOGLE_BQ_SERVICE_ACCOUNT_PRIVATE_KEY;\n\t\t\t\t break;\n\t\t\t default:\n\t\t\t\t log.warning(\"There is no project configured for this publisherId :\"+publisherIdInBQ);\n\t\t\t\t return queryDTO;\t\t\t \n\t\t\t}\t\n\t\t\t\n\t\t\tqueryDTO=new QueryDTO(serviceAccountEmail, servicePrivateKey, projectId,dataSetId, queryData.toString());\n\t\t\tlog.info(\"queryDTO.getQueryData() : \"+queryDTO.getQueryData());\n\t\t\t//\n\t\t}\n\t\treturn queryDTO;\n\t}\n\t\n\tpublic String getChannelAndDataSourceQuery(List selectedChannelName, StringBuilder memcacheKeySubstring, boolean allChannels) throws Exception {\n\t\tlog.info(\"Inside getChannelAndDataSourceQuery in LinMobileDAO\");\n\t\tString QUERY = \" and (( data_source = '' and channel_name = ''))\";\n\t\tint length = 0;\n\t\tIUserDetailsDAO userDetailsDAO = new UserDetailsDAO();\n\t\tList demandPartnersList = userDetailsDAO.getAllDemandPartners(MemcacheUtil.getAllCompanyList());\n\t\tif(allChannels && demandPartnersList != null) {\n\t\t\tlength = demandPartnersList.size();\n\t\t}\n\t\telse if(!allChannels && selectedChannelName != null && selectedChannelName.size() > 0) {\n\t\t\tlength = selectedChannelName.size();\n\t\t}\n\t\t\n\t\tQUERY = \"\";\n\t\tfor (int i=0; i 0) {\n\t\t\t\tdemandPartnerCompany = userDetailsDAO.getCompanyByName(selectedChannelName.get(i).trim(), demandPartnersList);\n\t\t\t}\n\t\t\tif(demandPartnerCompany!=null && demandPartnerCompany.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && demandPartnerCompany.getCompanyName() != null && !demandPartnerCompany.getCompanyName().trim().equalsIgnoreCase(\"\") && demandPartnerCompany.getDataSource() != null && !demandPartnerCompany.getDataSource().trim().equalsIgnoreCase(\"\")){\n\t\t\t\tmemcacheKeySubstring.append(demandPartnerCompany.getCompanyName().trim());\n\t\t\t\tif(i==0 && length == 1) {\n\t\t \t\t QUERY = QUERY+\" and (( data_source = '\"+demandPartnerCompany.getDataSource().trim()+\"' and channel_name = '\"+demandPartnerCompany.getCompanyName().trim()+\"'))\";\n\t\t \t }\n\t\t\t\telse if(i==0) {\n\t\t \t\t QUERY = QUERY+\" and (( data_source = '\"+demandPartnerCompany.getDataSource().trim()+\"' and channel_name = '\"+demandPartnerCompany.getCompanyName().trim()+\"')\";\n\t\t \t }\n\t \t\t else if(i == length-1) {\n\t\t \t\t QUERY = QUERY+\" or ( data_source = '\"+demandPartnerCompany.getDataSource().trim()+\"' and channel_name = '\"+demandPartnerCompany.getCompanyName().trim()+\"'))\";\n\t\t \t }\n\t \t\t else {\n\t\t \t\t QUERY = QUERY+\" or ( data_source = '\"+demandPartnerCompany.getDataSource().trim()+\"' and channel_name = '\"+demandPartnerCompany.getCompanyName().trim()+\"')\";\n\t\t \t } \n\t \t }\n\t\t}\n\t\treturn QUERY;\n\t}\n\t\n\t\n\t/*public String getAllChannelAndDataSourceQuery(StringBuilder memcacheKeySubstring) throws Exception {\n\t\tlog.info(\"Inside getAllChannelAndDataSourceQuery in LinMobileDAO\");\n\t\tString QUERY = \"\";\n\t\tIUserDetailsDAO userDetailsDAO = new UserDetailsDAO();\n\t\tList demandPartnersList = userDetailsDAO.getAllDemandPartners(MemcacheUtil.getAllCompanyList());\n\t\tif(demandPartnersList != null && demandPartnersList.size() > 0) {\n\t\t\tint length = demandPartnersList.size();\n\t\t\tfor (int i=0; i demandPartnersList = userDetailsDAO.getAllDemandPartners(MemcacheUtil.getAllCompanyList());\n\t\tif(demandPartnersList != null && demandPartnersList.size() > 0) {\n\t\t\tint length = demandPartnersList.size();\n\t\t\tfor (int i=0; i propertyObjList = userDetailsDAO.getSelectedPropertiesByUserIdAndPublisherId(userId, (Long.valueOf(publisherId)).toString().trim());\n\t\tif(propertyObjList != null && propertyObjList.size() > 0) {\n\t\t\tint length = propertyObjList.size();\n\t\t\tif(length > 0) {\n\t\t\t\tQUERY = new StringBuilder();\n\t\t\t\tfor (int i=0; i loadPerformingLineItems(String lowerDate,String upperDate){\n\t\tList advertiserReportList=null;\n\t\tList subList=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tadvertiserReportList=linDAO.loadPerformingLineItemsForAdvertiser(5,lowerDate,upperDate);\n\t\t\tif(advertiserReportList !=null){\n\t\t\t\tlog.info(\"Found objects from datastore :\"+advertiserReportList.size()+\" , going to sort by CTR using comperator.\");\n\t\t\t\tAdvertiserViewPerformerComparator performerComperator= new AdvertiserViewPerformerComparator();\n\t\t\t\tCollections.sort(advertiserReportList, performerComperator);\n\t\t\t\tif(advertiserReportList.size()>5){\n\t\t\t\t\tsubList=advertiserReportList.subList(0, 5);\n\t\t\t\t\tlog.info(\"fetched sorted subList with 5 objects from advertiserReportList.\");\n\t\t\t\t\treturn subList;\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\treturn advertiserReportList;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Found objects from datastore :null\");\n\t\t\t\treturn advertiserReportList;\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t\t\n\t}\n\t\n\tpublic List loadNonPerformingLineItems(String lowerDate,String upperDate){\n\t\tList advertiserReportList=null;\n\t\tList subList=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tadvertiserReportList=linDAO.loadNonPerformingLineItemsForAdvertiser(5,lowerDate,upperDate);\n\t\t\tif(advertiserReportList !=null){\n\t\t\t\tlog.info(\"Found objects from datastore :\"+advertiserReportList.size()+\" , going to sort by delivery indicator using comparator.\");\n\t\t\t\t\n\t\t\t\tdouble upperCap=100;\n\t\t\t\tIterator itr=advertiserReportList.iterator();\n\t\t\t\tAdvertiserReportObj obj=null;\n\t\t\t\t\n\t\t\t\twhile(itr.hasNext()){\n\t\t\t\t\tobj=(AdvertiserReportObj) itr.next();\n\t\t\t\t\t//log.info(\"obj.getDeliveryIndicator():\"+obj.getDeliveryIndicator());\n\t\t\t\t\tif(obj.getDeliveryIndicator() >= upperCap){\n\t\t\t\t\t\t//log.info(\"Removing lineitem with delivery indicator ::\"+obj.getDeliveryIndicator());\n\t\t\t\t\t\titr.remove();\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\tAdvertiserViewNonPerformerComparator nonPerformerComperator= new AdvertiserViewNonPerformerComparator();\n\t\t\t\tCollections.sort(advertiserReportList, nonPerformerComperator);\n\t\t\t\t\n\t\t\t\tif(advertiserReportList !=null && advertiserReportList.size()>5){\n\t\t\t\t\tsubList=advertiserReportList.subList(0, 5);\n\t\t\t\t\tlog.info(\"fetched sorted subList with 5 objects from advertiserReportList.\");\n\t\t\t\t\treturn subList;\n\t\t\t\t}else{\t\t\t\t\t\n\t\t\t\t\treturn advertiserReportList;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Found objects from datastore :null\");\n\t\t\t\treturn advertiserReportList;\n\t\t\t}\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t}\n\t\n\tpublic List loadAgencies(){\n\t\tlog.info(\"Service :loading agencies...\");\n\t\tList agencyAdvertiserList=null;\n\t\tList agencyList=new ArrayList();\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\t\t\t\n\t\t\tagencyAdvertiserList=linDAO.loadAllAgencies();\t\t\t\n\t\t\tfor(AgencyAdvertiserObj obj:agencyAdvertiserList){\n\t\t\t\tString agencyName=obj.getAgencyName();\n\t\t\t\tif(agencyName!=null && (!agencyName.equals(\"0\")) && !agencyList.contains(agencyName)){\n\t\t\t\t\tagencyList.add(agencyName);\n\t\t\t\t}else{\n\t\t\t\t\t//log.info(\"already added..\"+agencyList);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"Falied to load all agencies: DataServiceException:\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn agencyList;\n\t}\n\t\n\tpublic List loadAdvertisers(String agencyName){ \n List agencyAdvertiserList=null;\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tagencyAdvertiserList=linDAO.loadAllAdvertisers(agencyName);\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"Falied to load all advertisers: DataServiceException:\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn agencyAdvertiserList;\n\t}\n\t\n\t\n\tpublic List getMostActiveLineItems(String lowerDate,String upperDate){\n\t\tList resultList=null;\n\t\tList subList=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadMostActiveLineItem(5,lowerDate,upperDate);\n\t\t\tif(resultList !=null){\n\t\t\t\tlog.info(\"Found objects from datastore :\"+resultList.size()+\" , going to sort by delivery indicator using comperator.\");\n\t\t\t\tAdvertiserViewMostActiveComparator mostActiveComparator= new AdvertiserViewMostActiveComparator();\n\t\t\t\tCollections.sort(resultList, mostActiveComparator);\n\t\t\t\tif(resultList.size()>5){\n\t\t\t\t\tsubList=resultList.subList(0, 5);\n\t\t\t\t\tlog.info(\"fetched sorted subList with 5 objects from mostActiveList.\");\n\t\t\t\t\treturn subList;\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\treturn resultList;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Found objects from datastore :null\");\n\t\t\t\treturn resultList;\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t\t\n\t}\n\t\n\tpublic List getTopGainersLineItems(String lowerDate,String upperDate){\n\t\tList resultList=null;\n\t\tList subList=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadMostActiveLineItem(5,lowerDate,upperDate);\n\t\t\tif(resultList !=null){\n\t\t\t\tlog.info(\"Found objects from datastore :\"+resultList.size()+\" , going to sort by delivery indicator using comperator.\");\n\t\t\t\tAdvertiserViewMostActiveComparator mostActiveComparator= new AdvertiserViewMostActiveComparator();\n\t\t\t\tCollections.sort(resultList, mostActiveComparator);\n\t\t\t\tif(resultList.size()>5){\n\t\t\t\t\tsubList=resultList.subList(0, 5);\n\t\t\t\t\tlog.info(\"fetched sorted subList with 5 objects from mostActiveList.\");\n\t\t\t\t\treturn subList;\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\treturn resultList;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Found objects from datastore :null\");\n\t\t\t\treturn resultList;\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t\t\n\t\t\n\t}\n\t\n\tpublic List getTopLosersLineItems(String lowerDate,String upperDate){\t\t\n\t\tList resultList=null;\n\t\tList subList=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadMostActiveLineItem(5,lowerDate,upperDate);\n\t\t\tif(resultList !=null){\n\t\t\t\tlog.info(\"Found objects from datastore :\"+resultList.size()+\" , going to sort by delivery indicator using comperator.\");\n\t\t\t\tAdvertiserViewMostActiveComparator mostActiveComparator= new AdvertiserViewMostActiveComparator();\n\t\t\t\tCollections.sort(resultList, mostActiveComparator);\n\t\t\t\tif(resultList.size()>5){\n\t\t\t\t\tsubList=resultList.subList(0, 5);\n\t\t\t\t\tlog.info(\"fetched sorted subList with 5 objects from mostActiveList.\");\n\t\t\t\t\treturn subList;\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\treturn resultList;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Found objects from datastore :null\");\n\t\t\t\treturn resultList;\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t\t\n\t}\n\t\n\tpublic void insertPublisherViewDTO(List publisherViewList)\n\t{\n\t\tLinMobileDAO linDao = new LinMobileDAO();\n\t\tfor(PublisherViewDTO publisherView : publisherViewList)\n\t\t{\n\t\t\ttry {\n\t\t\t\tlinDao.saveObject(publisherView);\n\t\t\t} catch (DataServiceException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t}\n\t\n\tpublic List getPublisherViewDTO()\n\t{\n\t\tLinMobileDAO linDao = new LinMobileDAO();\n\t\ttry {\n\t\t\treturn linDao.getPublisherViewDTO();\n\t\t} catch (DataServiceException e) {\t\t\t\n\t\t\t\n\t\t\tlog.info(\":exception: \"+e.getMessage());\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\t\n\tpublic List getPublisherViewDTO(int pageNo)\n\t{\n\t\tLinMobileDAO linDao = new LinMobileDAO();\n\t\ttry {\n\t\t\treturn linDao.getPublisherView(pageNo);\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.info(\":exception: \"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic void insertLeftMenuDTO(List leftMenuItemList)\n\t{\n\t\tLinMobileDAO linDao = new LinMobileDAO();\n\t\tfor(LeftMenuDTO leftMenuDTO : leftMenuItemList)\n\t\t{\n\t\t\ttry {\n\t\t\t\tlinDao.saveObject(leftMenuDTO);\n\t\t\t} catch (DataServiceException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\t\n\tpublic List getLeftMenuList()\n\t{\n\t\tLinMobileDAO linDao = new LinMobileDAO();\n\t\ttry {\n\t\t\treturn linDao.getLeftMenuList();\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.info(\":exception: \"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic List getAdvertiserPerformanceMetrics(int counter,String lowerDate,String upperDate){\t\t\n\t\tList resultList=null;\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadAdvertiserPerformanceMetrics(counter,lowerDate,upperDate);\n\t\t\treturn resultList;\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic List getAdvertiserPerformanceMetrics(String lowerDate,String upperDate){\t\t\n\t\tList resultList=null;\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadAdvertiserPerformanceMetrics(lowerDate,upperDate);\n\t\t\treturn resultList;\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\t\n\tpublic void loadAdvertisersByLocationData(String lowerDate,String upperDate,StringBuilder sbStr ){\n\t try{\n\t\t\tList advertiserByLocationObjList =null;\n\t\t\tLinMobileDAO linDao = new LinMobileDAO();\n\t\t\t\n\t\t\tadvertiserByLocationObjList = linDao.loadAdvertisersByLocationData(lowerDate, upperDate);\n\t\t\t\n\t\t\tsbStr.append(\"[['State', 'Impression', 'CTR(%)']\");\n\t\t\tfor (AdvertiserByLocationObj object : advertiserByLocationObjList) {\n\t\t\t\tsbStr.append(\",[\");\n\t\t\t\tsbStr.append(\"'\"+object.getState()+\"',\"+object.getImpression()+\",\"+object.getCtrPercent());\n\t\t\t\tsbStr.append(\"]\");\n\t\t\t}\n\t\t\tsbStr.append(\"]\");\n\t }catch(Exception e){\n\t \t\n\t \tlog.severe(\"Exception :\"+e.getMessage());\n\t }\t\n\t}\n\t\t\n\tpublic void loadAdvertisersByMarketData(String lowerDate,String upperDate,StringBuilder sbStr){\n\t\ttry{\n\t\t\tList advertiserBymarketObjList =null;\n\t\t\tLinMobileDAO linDao = new LinMobileDAO();\n\t\t\t\n\t\t\tadvertiserBymarketObjList = linDao.loadAdvertisersBymarketData(lowerDate, upperDate);\n\t\t\t\n\t\t\tsbStr.append(\"[['State', 'lin-property', 'CTR(%)']\");\n\t\t\tfor (AdvertiserByMarketObj object : advertiserBymarketObjList) {\n\t\t\t\tsbStr.append(\",[\");\n\t\t\t\tsbStr.append(\"'\"+object.getState()+\"','\"+object.getLinProperty()+\"',\"+object.getCtrPercent());\n\t\t\t\tsbStr.append(\"]\");\n\t\t\t}\n\t\t\tsbStr.append(\"]\");\n\t }catch(Exception e){\n\t \t\n\t \tlog.severe(\"Exception :\"+e.getMessage());\n\t }\t\n\t}\n\t\n\t\n\t/*\n\t * Load advertiser details by advertiserId\n\t * @see com.lin.web.service.ILinMobileBusinessService#loadAdvertiserDetails(long)\n\t */\n\tpublic List loadAdvertiserDetails(long advertiserId){\n\t\t List agencyAdvertiserList=null;\t\t\n\t\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\t\ttry {\n\t\t\t\tagencyAdvertiserList=linDAO.loadAdvertiserById(advertiserId);\t\t\t\n\t\t\t} catch (DataServiceException e) {\n\t\t\t\tlog.severe(\"Falied to load all advertisers: DataServiceException:\"+e.getMessage());\n\t\t\t\t\n\t\t\t}\n\t\t\treturn agencyAdvertiserList;\n\t}\n\t\n\t\n\t\n\n\t\n/*\tpublic List getChannelPerformanceList(String lowerDate, String upperDate, String compareStartDate, String compareEndDate, String allChannelName, String publisher){\n\t\tList resultList=null;\n\t\tList publisherList=new ArrayList();\t\n\t\tList channelNameList=new ArrayList();\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\t\n\t\tList channelArrList = new ArrayList();\n\t\tString[] str = allChannelName.split(\",\");\n\t\tif(str!=null){\n\t\t\tfor (String channel : str) {\n\t\t\t\tchannelArrList.add(channel.trim());\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\ttry {\n\t\t\tresultList=linDAO.loadChannelPerformanceList(lowerDate,upperDate,compareStartDate,compareEndDate, channelArrList,publisher );\n\t\t\tif(resultList != null && resultList.size() > 0) {\n\t\t\t\tfor(PublisherChannelObj obj:resultList){\n\t\t\t\t\tif(!channelNameList.contains(obj.getChannelName())){\n\t\t\t\t\t\tchannelNameList.add(obj.getChannelName());\n\t\t\t\t\t\tpublisherList.add(obj);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn publisherList;\n\t\t} catch (Exception e) {\n\t\t\tlog.severe(\"Exception in getChannelPerformanceList in LinMobileBusinessService :\"+e.getMessage());\n\t\t\t\n\t\t\treturn publisherList;\n\t\t}\n\t}*/\n\t\n\tpublic List getPerformanceByPropertyList(int limit,String lowerDate,String upperDate)\n\t{\n\t\tList resultList=null;\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadPerformanceByPropertyList(limit,lowerDate,upperDate);\n\t\t\treturn resultList;\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic List getPerformanceByPropertyList(String lowerDate,String upperDate){\n\t\tList resultList=null;\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadPerformanceByPropertyList(lowerDate,upperDate);\n\t\t\treturn resultList;\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic List getPerformanceByPropertyList(String lowerDate,String upperDate, String compareStartDate, String compareEndDate, String channel, String publisher){\n\t\tList resultList=null;\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\tIUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class);\n\t\ttry {\n\t\t\tStringBuilder memcacheKeysubstring = new StringBuilder();\n\t\t\tString channelAndDataSourceQuery = getChannelAndDataSourceQuery(userService.CommaSeperatedStringToList(channel), memcacheKeysubstring, false);\n\t\t\tresultList=linDAO.loadPerformanceByPropertyList(lowerDate,upperDate,compareStartDate,compareEndDate, channel, publisher, channelAndDataSourceQuery);\n\t\t\treturn resultList;\n\t\t} catch (Exception e) {\n\t\t\tlog.severe(\"Exception :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic List getSellThroughDataList(String lowerDate,String upperDate, String publisherName, long publisherId, long userId)\n\t{\n\t\tList resultList=null;\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tString publisherBQId = getPublisherBQId(publisherName);\n\t\t\tStringBuilder DFP_Properties_MemcacheKeyPart = new StringBuilder();\n\t\t\tString selectedDFPPropertiesQuery = getSelectedDFPPropertiesQuery(publisherId, userId, DFP_Properties_MemcacheKeyPart);\n\t\t\tresultList = MemcacheUtil.getSellThroughData(lowerDate, upperDate, publisherBQId, DFP_Properties_MemcacheKeyPart.toString());\n\t\t\tif(resultList == null || resultList.size() <= 0) {\n\t\t\t\tQueryDTO queryDTO = getQueryDTO(publisherBQId, lowerDate, upperDate, LinMobileConstants.BQ_SELL_THROUGH);\n\t\t\t\tlog.info(\"Sell through data not found in memcache, get from bigquery..\");\n\t\t\t\tresultList=linDAO.loadSellThroughDataList(lowerDate,upperDate, selectedDFPPropertiesQuery, queryDTO);\n\t\t\t\tif(resultList != null && resultList.size()>0) {\n\t\t\t\t\tMemcacheUtil.setSellThroughData(resultList, lowerDate, upperDate, publisherBQId, DFP_Properties_MemcacheKeyPart.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn resultList;\n\t\t} catch (Exception e) {\n\t\t\tlog.severe(\"Exception : \"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\t/*\n\t * Get LineItem by id\n\t * @Param - String lowerDate,String upperDate,long lineItemId\n\t * @Return - PopUpDTO popUpObj\n\t */\n\tpublic PopUpDTO getLineItemForPopUP(String lowerDate,String upperDate,long lineItemId){\n\t\tList resultList=null;\n\t\t\n\t\tPopUpDTO popUpObj=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tpopUpObj=new PopUpDTO();\n\t\t\tresultList=linDAO.loadLineItem(lowerDate,upperDate,lineItemId);\n\t\t\tpopUpObj.setId(String.valueOf(lineItemId));\n\t\t\tif(resultList !=null && resultList.size()>0){\n\t\t\t\tlog.info(\"Got lineItems:\"+resultList.size());\n\t\t\t\tAdvertiserReportObj obj=resultList.get(0);\n\t\t\t\tpopUpObj.setBookedImpression(String.valueOf(obj.getGoalQuantity()));\n\t\t\t\tpopUpObj.setImpressionDeliveredLifeTime(String.valueOf(obj.getLineItemLifeItemImpressions()));\n\t\t\t\tpopUpObj.setImpressionDeliveredInSelectedTime(String.valueOf(obj.getAdServerImpressions()));\n\t\t\t\tpopUpObj.setClicksInSelectedTime(String.valueOf(obj.getAdServerClicks()));\n\t\t\t\tpopUpObj.setClicksLifeTime(String.valueOf(obj.getLineItemLifeTimeClicks()));\n\t\t\t\tpopUpObj.setCtrLifeTime(String.valueOf(obj.getAdServerCTR()));\n\t\t\t\tpopUpObj.setCtrInSelectedTime(String.valueOf(obj.getAdServerCTR()));\n\t\t\t\tpopUpObj.seteCPM(String.valueOf(obj.getAdServerECPM()));\n\t\t\t\tpopUpObj.setTitle(obj.getLineItemName());\n \n\t\t\t\tStringBuffer strBuffer=new StringBuffer();\n\t\t\t\t\n\t\t\t\tstrBuffer.append(\"[['Days', 'Impression']\");\n\t\t\t\tfor (AdvertiserReportObj object:resultList) {\n\t\t\t\t\tstrBuffer.append(\",[\");\n\t\t\t\t\tstrBuffer.append(\"'\"+DateUtil.getFormatedDate(object.getDate(), \"yyyy-MM-dd\", \"MM/dd\")+\"',\"+object.getAdServerImpressions());\n\t\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\t}\n\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\tlog.info(\"strBuffer.toString():\"+strBuffer.toString());\n\t\t\t\tpopUpObj.setChartData(strBuffer.toString());\n\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"No lineitem found for lineItemId:\"+lineItemId+\" and time: lowerDate:\"+lowerDate+\" and upperDate:\"+upperDate);\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"Exception in loading lineItem with id:\"+lineItemId+\" : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn popUpObj;\n\t}\n\t\n\tpublic List getPublishers(){\n\t\tList resultList=null;\n\t\tList publisherList=new ArrayList();\n\t\t\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadPublisherDataList();\n\t\t\tfor(PublisherChannelObj obj:resultList){\n\t\t\t\tif(!publisherList.contains(obj.getPublisherName())){\n\t\t\t\t\tpublisherList.add(obj.getPublisherName());\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn publisherList;\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic List getPublisherDataList(String publisherName){\n\t\tList resultList=null;\n\t\tList publisherList=new ArrayList();\n\t\tList publisherObjList=new ArrayList();\n\t\t\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadPublisherDataList();\n\t\t\tfor(PublisherChannelObj obj:resultList){\n\t\t\t\tif( (!publisherList.contains(obj.getPublisherName())) && (publisherName.equalsIgnoreCase(obj.getPublisherName())) ){\n\t\t\t\t\tpublisherList.add(obj.getPublisherName());\n\t\t\t\t\tpublisherObjList.add(obj);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn publisherObjList;\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\t\n\tpublic List loadChannelsByPublisher(String publisherName){\n\t\tList resultList=null;\n\t\tList channelObjList=new ArrayList();\n\t\tList channelList=new ArrayList();\n\t\t\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadChannels(publisherName);\n\t\t\tfor(PublisherChannelObj obj:resultList){\n\t\t\t\tif(!channelList.contains(obj.getChannelName())){\n\t\t\t\t\tchannelList.add(obj.getChannelName());\n\t\t\t\t\tchannelObjList.add(obj);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn channelObjList;\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\tpublic List loadChannelsByName(String channelName){\n\t\tList resultList=null;\n\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tresultList=linDAO.loadChannelsByName(channelName);\t\t\t\n\t\t\treturn resultList;\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\n\t}\n\t\n\t/*\n\t * Get LineItem by id\n\t * @Param - String lowerDate,String upperDate,String lineItemName\n\t * @Return - PopUpDTO popUpObj\n\t */\n\tpublic PopUpDTO getLineItemForPopUP(String lowerDate,String upperDate,String lineItemName){\n\t\tList resultList=null;\n\t\t\n\t\tPopUpDTO popUpObj=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tpopUpObj=new PopUpDTO();\n\t\t\tresultList=linDAO.loadLineItem(lowerDate,upperDate,lineItemName);\n\t\t\t\n\t\t\tif(resultList !=null && resultList.size()>0){\n\t\t\t\tlog.info(\"Got lineItems:\"+resultList.size());\n\t\t\t\tCustomLineItemObj obj=resultList.get(0);\n\t\t\t\tString bookedImpressions=(obj.getDeliveredImpressions()*2)+\"\";\n\t\t\t\tpopUpObj.setBookedImpression(bookedImpressions);\n\t\t\t\tpopUpObj.setImpressionDeliveredLifeTime(String.valueOf(obj.getDeliveredImpressions()*3/2));\n\t\t\t\tpopUpObj.setImpressionDeliveredInSelectedTime(String.valueOf(obj.getDeliveredImpressions()));\n\t\t\t\tString clicks=(Math.round(obj.getDeliveredImpressions()/5))+\"\";\n\t\t\t\tString clicksLifeTime=(Math.round((obj.getDeliveredImpressions()/5)))+\"\";\n\t\t\t\tpopUpObj.setClicksInSelectedTime(String.valueOf(clicks));\n\t\t\t\tpopUpObj.setClicksLifeTime(clicksLifeTime);\n\t\t\t\tpopUpObj.setCtrLifeTime(String.valueOf(obj.getCTR()*2));\n\t\t\t\tpopUpObj.setCtrInSelectedTime(String.valueOf(obj.getCTR()));\n\t\t\t\tString cpm=String.valueOf(obj.getCTR()*20);\n\t\t\t\tif(cpm.indexOf(\"-\")>=0){\n\t\t\t\t\tcpm=cpm.replace(\"-\", \"\");\t\n\t\t\t\t}\n\t\t\t\tpopUpObj.seteCPM(cpm);\n\t\t\t\tpopUpObj.setTitle(obj.getLineItemName());\t\n\t\t\t\tString revenueDelivered=(Math.round(obj.getDeliveryIndicator()*1500)/100)+\"\"; //dummy data\n\t\t\t\tString revenueRemaining=(Math.round(obj.getDeliveryIndicator()*1000)/100)+\"\"; //dummy data\n\t\t\t\tString revenueDeliveredLifeTime=(Math.round(obj.getDeliveryIndicator()*2000)/100)+\"\"; //dummy data\n\t\t\t\tString revenueRemainingLifeTime=(Math.round((obj.getDeliveryIndicator()*1500)/100))+\"\"; //dummy data\n\t\t\t\tpopUpObj.setRevenueDeliveredInSelectedTime(revenueDelivered);\n\t\t\t\tpopUpObj.setRevenueDeliveredLifeTime(revenueDeliveredLifeTime);\n\t\t\t\tpopUpObj.setRevenueRemainingInSelectedTime(revenueRemaining);\n\t\t\t\tpopUpObj.setRevenueRemainingLifeTime(revenueRemainingLifeTime);\t\t\t\t\n\t\t\t\t\n StringBuffer strBuffer=new StringBuffer();\n\t\t\t\t\n\t\t\t\tstrBuffer.append(\"[['Days', 'Impression']\");\n\t\t\t\tfor (CustomLineItemObj object:resultList) {\n\t\t\t\t\tstrBuffer.append(\",[\");\n\t\t\t\t\tstrBuffer.append(\"'\"+DateUtil.getFormatedDate(object.getDate(), \"yyyy-MM-dd\", \"MM/dd\")+\"',\"+object.getDeliveredImpressions());\n\t\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\t}\n\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\tpopUpObj.setChartData(strBuffer.toString());\n\t\t\t\tlog.info(\"strBuffer.toString():\"+strBuffer.toString());\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"No lineitem found for lineItemName:\"+lineItemName+\" and time: lowerDate:\"+lowerDate+\" and upperDate:\"+upperDate);\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"Exception in loading lineItem with lineItemName:\"+lineItemName+\" : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn popUpObj;\n\t}\n\n\t/*\n\t * getPerformanceMetricLineItemForPopUP\n\t * @Param - String lowerDate,String upperDate,String lineItemName\n\t * @Return - PopUpDTO popUpObj\n\t */\n\tpublic PopUpDTO getPerformanceMetricLineItemForPopUP(String lowerDate,String upperDate,String lineItemName){\n\t\tList resultList=null;\n\t\t\n\t\tPopUpDTO popUpObj=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tpopUpObj=new PopUpDTO();\n\t\t\tresultList=linDAO.loadLineItemForPerformanceMetrics(lowerDate,upperDate,lineItemName);\n\t\t\t\n\t\t\tif(resultList!=null && resultList.size()>0){\n\t\t\t\tlog.info(\"Got lineItems:\"+resultList.size());\n\t\t\t\tPerformanceMetricsObj obj=resultList.get(0);\n\t\t\t\tString bookedImpressions=(obj.getImpressionsBooked())+\"\";\n\t\t\t\tpopUpObj.setBookedImpression(bookedImpressions);\n\t\t\t\tpopUpObj.setImpressionDeliveredLifeTime(String.valueOf(obj.getImpressionsDelivered()*3/2));\n\t\t\t\tpopUpObj.setImpressionDeliveredInSelectedTime(String.valueOf(obj.getImpressionsDelivered()));\n\t\t\t\tString clicks=(Math.round(obj.getClicks()/5))+\"\";\n\t\t\t\tString clicksLifeTime=(obj.getClicks())+\"\";\n\t\t\t\tpopUpObj.setClicksInSelectedTime(String.valueOf(clicks));\n\t\t\t\tpopUpObj.setClicksLifeTime(clicksLifeTime);\n\t\t\t\tpopUpObj.setCtrLifeTime(String.valueOf(obj.getCTR()));\n\t\t\t\tpopUpObj.setCtrInSelectedTime(String.valueOf(obj.getCTR()));\n\t\t\t\tString cpm=String.valueOf(Math.round(obj.getCTR()*2000)/100);\n\t\t\t\tif(cpm.indexOf(\"-\")>=0){\n\t\t\t\t\tcpm=cpm.replace(\"-\", \"\");\t\n\t\t\t\t}\n\t\t\t\tpopUpObj.seteCPM(cpm);\n\t\t\t\tpopUpObj.setTitle(obj.getLineItemName());\t\n\t\t\t\tString revenueDelivered=(Math.round(obj.getRevenueRecoByDay()*100)/100)+\"\"; //dummy data\n\t\t\t\tString revenueRemaining=(Math.round(obj.getRevenueLeftByDay()*100)/100)+\"\"; //dummy data\n\t\t\t\tString revenueDeliveredLifeTime=(Math.round(obj.getRevenueRecoByDay()*200)/100)+\"\"; //dummy data\n\t\t\t\tString revenueRemainingLifeTime=(Math.round((obj.getRevenueLeftByDay()*150)/100))+\"\"; //dummy data\n\t\t\t\tpopUpObj.setRevenueDeliveredInSelectedTime(revenueDelivered);\n\t\t\t\tpopUpObj.setRevenueDeliveredLifeTime(revenueDeliveredLifeTime);\n\t\t\t\tpopUpObj.setRevenueRemainingInSelectedTime(revenueRemaining);\n\t\t\t\tpopUpObj.setRevenueRemainingLifeTime(revenueRemainingLifeTime);\t\t\t\t\n\t\t\t\t\n\t\t\t\tStringBuffer strBuffer=new StringBuffer();\n\t\t\t\t\n\t\t\t\tstrBuffer.append(\"[['Days', 'Impression']\");\n\t\t\t\tfor (PerformanceMetricsObj metricsObj:resultList) {\n\t\t\t\t\tstrBuffer.append(\",[\");\n\t\t\t\t\tstrBuffer.append(\"'\"+DateUtil.getFormatedDate(metricsObj.getDate(), \"yyyy-MM-dd\", \"MM/dd\")+\"',\"+metricsObj.getImpressionsDelivered());\n\t\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\t}\n\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\tpopUpObj.setChartData(strBuffer.toString());\n\t\t\t\tlog.info(\"strBuffer.toString():\"+strBuffer.toString());\n\t\t\t\t\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"No lineitem found for lineItemName:\"+lineItemName+\" and time: lowerDate:\"+lowerDate+\" and upperDate:\"+upperDate);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"Exception in loading lineItem with lineItemName:\"+lineItemName+\" : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn popUpObj;\n\t}\n\t\n\tpublic List loadOrders(){\n\t\tList orderNameList=null;\n\t\tList orderList=new ArrayList();\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\torderNameList=linDAO.loadAllOrders();\n\t\t\tfor(OrderLineItemObj obj:orderNameList){\n\t\t\t\tString orderName=obj.getOrderName();\n\t\t\t\tif(orderName!=null && (!orderName.equals(\"0\")) && !orderList.contains(orderName)){\n\t\t\t\t\torderList.add(orderName);\n\t\t\t\t\tlog.info(\"order list.....\"+orderList.size());\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"Falied to load all agencies: DataServiceException:\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn orderList;\n\t}\n\t\n\t\n\t\n\tpublic List loadLineItemName(String orderName){ \n List lineItemList=null;\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tlineItemList=linDAO.loadAllLineItems(orderName);\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"Falied to load all advertisers: DataServiceException:\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn lineItemList;\n\t}\n\t\n\tpublic List loadLineItemName(long orderId){\n\t\t List lineItemList=null;\t\t\n\t\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\t\ttry {\n\t\t\t\tlineItemList=linDAO.loadAllLineItems(orderId);\t\t\t\n\t\t\t} catch (DataServiceException e) {\n\t\t\t\tlog.severe(\"Falied to load all advertisers: DataServiceException:\"+e.getMessage());\n\t\t\t\t\n\t\t\t}\n\t\t\treturn lineItemList;\n\t}\n\t\n\tpublic List loadLineItem(long lineItemId){\n\t\t List lineItemList=null;\t\t\n\t\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\t\ttry {\n\t\t\t\tlineItemList=linDAO.loadLineItem(lineItemId);\t\t\t\n\t\t\t} catch (DataServiceException e) {\n\t\t\t\tlog.severe(\"Falied to load all advertisers: DataServiceException:\"+e.getMessage());\n\t\t\t\t\n\t\t\t}\n\t\t\treturn lineItemList;\n\t}\n\t\n\tpublic List loadReallocationItems(String lowerDate,String upperDate){\n\t\tList reallocationReportList=null;\n\t\tList subList=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\treallocationReportList=linDAO.loadReallocationItemsForAdvertiser(5,lowerDate,upperDate);\n\t\t\tif(reallocationReportList !=null){\n\t\t\t\tlog.info(\"Found objects from datastore :\"+reallocationReportList.size()+\" , going to sort by CTR using comperator.\");\n\t\t\t\t/*AdvertiserViewPerformerComparator performerComperator= new AdvertiserViewPerformerComparator();\n\t\t\t\tCollections.sort(reallocationReportList, performerComperator);*/\n\t\t\t\tif(reallocationReportList.size()>5){\n\t\t\t\t\tsubList=reallocationReportList.subList(0, 5);\n\t\t\t\t\tlog.info(\"fetched sorted subList with 5 objects from advertiserReportList.\");\n\t\t\t\t\treturn subList;\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\treturn reallocationReportList;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Found objects from datastore :null\");\n\t\t\t\treturn reallocationReportList;\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t\t\n\t}\n\t\n\tpublic List loadActualAdvertiserData(String lowerDate,String upperDate){\n\t\tList actualAdvertiserList=null;\n\t\tList subList=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tactualAdvertiserList=linDAO.loadActualDataForAdvertiser(5,lowerDate,upperDate);\n\t\t\tif(actualAdvertiserList !=null){\n\t\t\t\tlog.info(\"Found objects from datastore :\"+actualAdvertiserList.size()+\" , going to sort by CTR using comperator.\");\n\t\t\t\t/*AdvertiserViewPerformerComparator performerComperator= new AdvertiserViewPerformerComparator();\n\t\t\t\tCollections.sort(reallocationReportList, performerComperator);*/\n\t\t\t\tif(actualAdvertiserList.size()>15){\n\t\t\t\t\tsubList=actualAdvertiserList.subList(0, 15);\n\t\t\t\t\tlog.info(\"fetched sorted subList with 5 objects from actualAdvertiserList.\");\n\t\t\t\t\treturn subList;\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\treturn actualAdvertiserList;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Found objects from datastore :null\");\n\t\t\t\treturn actualAdvertiserList;\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t\t\n\t}\n\t\n\tpublic List loadForcastAdvertiserData(String lowerDate,String upperDate){\n\t\tList forcastAdvertiserList=null;\n\t\tList subList=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tforcastAdvertiserList=linDAO.loadForcastDataForAdvertiser(5,lowerDate,upperDate);\n\t\t\tif(forcastAdvertiserList !=null){\n\t\t\t\tlog.info(\"Found objects from datastore :\"+forcastAdvertiserList.size()+\" , going to sort by CTR using comperator.\");\n\t\t\t\t/*AdvertiserViewPerformerComparator performerComperator= new AdvertiserViewPerformerComparator();\n\t\t\t\tCollections.sort(reallocationReportList, performerComperator);*/\n\t\t\t\tif(forcastAdvertiserList.size()>15){\n\t\t\t\t\tsubList=forcastAdvertiserList.subList(0, 15);\n\t\t\t\t\tlog.info(\"fetched sorted subList with 5 objects from actualAdvertiserList.\");\n\t\t\t\t\treturn subList;\n\t\t\t\t}else{\n\t\t\t\t\t\n\t\t\t\t\treturn forcastAdvertiserList;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Found objects from datastore :null\");\n\t\t\t\treturn forcastAdvertiserList;\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t\t\n\t}\n\t\n\tpublic List loadActualPublisherData(String lowerDate,String upperDate,String publisherName,String channelName){\n\t\tList actualPublisherList=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\t//String channelAndDataSourceQuery = \"\";\n\t\t//IUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class);\n\t\t//List channelArrList = new ArrayList();\n\t\ttry {\n\t\t\t\n\t\t\tString replaceStr = \"\\\\\\\\'\";\n\t\t\t\n\t\t\tif(channelName!=null){\n\t\t\t\t//StringBuilder memcacheKeySubstring = new StringBuilder();\n\t\t\t\t//channelAndDataSourceQuery = getChannelAndDataSourceQuery(userService.CommaSeperatedStringToList(channelName), memcacheKeySubstring, false);\n\t\t\t\tchannelName = channelName.replaceAll(\"'\", replaceStr);\n\t\t\t\tchannelName = channelName.replaceAll(\",\", \"','\");\n\t\t\t}else{\n\t\t\t\tchannelName = \"\";\n\t\t\t}\n\t\t\tString channelId = getChannelsBQId(channelName);\n\t\t\tString publisherId = getPublisherBQId(publisherName);\n\t\t\tactualPublisherList = MemcacheUtil.getTrendsAnalysisActualDataPublisher(lowerDate, upperDate, publisherId, channelId);\n\t\t\tif(actualPublisherList==null || actualPublisherList.size()<=0) {\n\t\t\t\tQueryDTO queryDTO = getQueryDTO(publisherId, lowerDate, upperDate, LinMobileConstants.BQ_CORE_PERFORMANCE);\n\t\t\t\tif(queryDTO != null && queryDTO.getQueryData() != null && queryDTO.getQueryData().length() > 0) {\n\t\t\t\t\tactualPublisherList=linDAO.loadActualDataForPublisher(lowerDate,upperDate,channelId, queryDTO);\n\t\t\t\t\tMemcacheUtil.setTrendsAnalysisActualDataPublisher(lowerDate, upperDate, publisherId, channelId, actualPublisherList);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\treturn actualPublisherList;\n\n\t\t} catch (Exception e) {\n\t\t\tlog.severe(\"Exception :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t\t\n\t}\n\t\n\tpublic List loadReallocationPublisherData(String lowerDate,String upperDate,String publisherName){\n\t\tList reallocationPublisherList=null;\n\t\tList reallocationPublisherAlteredList= new ArrayList();\n\t\tList networkList=new ArrayList();\n\t\t\n\t\tList subList=null;\n\t\tPublisherChannelObj channelObj = new PublisherChannelObj();\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\treallocationPublisherList=linDAO.loadReallocationDataForPublisher(5,lowerDate,upperDate,publisherName);\n\t\t\t\n\t\t\tif(reallocationPublisherList !=null){\n\t\t\t\tIterator iterator = reallocationPublisherList.iterator();\n\t\t\t\twhile(iterator.hasNext()){\n\t\t\t\t\tchannelObj = iterator.next();\n\t\t\t\t\tdouble ecpm = channelObj.geteCPM();\n\t\t\t\t\tdouble ctr = channelObj.getCTR();\n\t\t\t\t\tdouble cpc = ecpm/(1000*ctr);\n\t\t\t\t\tdouble floorCPM = 1000 * ctr * cpc;\n\t\t\t\t\tchannelObj.setCPC(cpc);\n\t\t\t\t\tchannelObj.setFloorCPM(floorCPM);\n\t\t\t\t\tif(!networkList.contains(channelObj.getChannelName())){\n\t\t\t\t\t\treallocationPublisherAlteredList.add(channelObj);\n\t\t\t\t\t\tnetworkList.add(channelObj.getChannelName());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t }\n\t\t\t\tlog.info(\"Networks: \"+networkList);\n\t\t\t\tlog.info(\"Found objects from datastore :\"+reallocationPublisherAlteredList.size());\n\t\t\t\treturn reallocationPublisherAlteredList;\n\t\t\t}else{\n\t\t\t\tlog.info(\"Found objects from datastore :null\");\n\t\t\t\treturn reallocationPublisherAlteredList;\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t\t\n\t}\n\t\n\tpublic List loadReallocationGraphPublisherData(String lowerDate,String upperDate,String publisherName){\n\t\t\n\t\tList reallocationPublisherList= null;\n\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\treallocationPublisherList=linDAO.loadReallocationDataForPublisher(5,lowerDate,upperDate,publisherName);\n\t\t\treturn reallocationPublisherList;\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\n\t\t\treturn null;\n\t\t}\t\t\n\t\t\n\t}\n\t\n\t/*\n\t * Get ChannelPerformancePopUP\n\t * @Param - String lowerDate,String upperDate,String channelName\n\t * @Return - PopUpDTO popUpObj\n\t */\n\tpublic PopUpDTO getChannelPerformancePopUP(String lowerDate,String upperDate,String channelName, String publisher){\n\t\t\n\t\tString preUpperDate=DateUtil.getModifiedDateStringByDays(lowerDate, -1, \"yyyy-MM-dd\");\n\t\tint days=(int)DateUtil.getDifferneceBetweenTwoDates(lowerDate, upperDate, \"yyyy-MM-dd\")+1;\n\t\tString preLowerDate=DateUtil.getModifiedDateStringByDays(preUpperDate, -days, \"yyyy-MM-dd\");\n\t\t\n\t\t\n\t\tString monthToDateEnd=DateUtil.getCurrentTimeStamp(\"yyyy-MM-dd\");\n\t\tString[] dayArray=monthToDateEnd.split(\"-\");\n\t\tint year=Integer.parseInt(dayArray[0]);\n\t\tint month=Integer.parseInt(dayArray[1])-1; // subtract 1 from day String as day starts from 0 to 11 in Calender class\n\t\tString monthToDateStart=DateUtil.getDateByYearMonthDays(year,month,1,\"yyyy-MM-dd\");;\n\t\t\n\t\tlog.info(\"Service: (startDate:\"+lowerDate+\" and endDate:\"+upperDate+\") and (preLowerDate=\"+preLowerDate+\", preUpperDate=\"+preUpperDate+\") and (monthToDateStart=\"+monthToDateStart+\", monthToDateEnd=\"+monthToDateEnd+\")\");\n\t\t\n\t\tPopUpDTO popUpObj = null;\n\t\tString chartData = null;\n\t\ttry{\n\t\t\tpopUpObj=new PopUpDTO();\n\t\t\tchartData=loadPerformanceChannelPopUpGraphDataFromBigQuery(lowerDate, upperDate, channelName, publisher);\n\t\t\tpopUpObj.setChartData(chartData);\n\t\t\t\n\t\t}catch (Exception e) {\n\t\t\tlog.severe(\"Exception in loading channel:\"+channelName+\" : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn popUpObj;\n\t}\n\t\n\tpublic String loadPerformanceChannelPopUpGraphDataFromBigQuery(String lowerDate,String upperDate,String channelName, String publisher){\n\t\tList resultList=null;\n\t\tIUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class);\n\t\tStringBuilder memcacheKeysubstring = new StringBuilder();\n\t\tString chartData = \"\";\n\t\ttry {\n\t\t\tString channelId = getChannelsBQId(channelName);\n\t\t\tString publisherId = getPublisherBQId(publisher);\n\t\t\tchartData=MemcacheUtil.getPublisherChannelPopUpGraphData(lowerDate, upperDate, channelId, publisherId);\n\t\t\tif(chartData == null ){\n\t\t\t\tlog.info(\"Chart data not found in memcache, going to fetch from bigquery..\");\n\t\t\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\t\t\ttry {\n\t\t\t\t\tQueryDTO queryDTO = getQueryDTO(publisherId, lowerDate, upperDate, LinMobileConstants.BQ_CORE_PERFORMANCE);\n\t\t\t\t\tif(queryDTO != null && queryDTO.getQueryData() != null && queryDTO.getQueryData().length() > 0) {\n\t\t\t\t\t\tresultList=linDAO.loadChannelsPerformancePopUpGraphData(lowerDate, upperDate, channelId, publisherId, queryDTO);\n\t\t\t\t\t\tStringBuffer strBuffer=new StringBuffer();\t\t\t\t\n\t\t\t\t\t\tstrBuffer.append(\"[['Days', 'Impression']\");\n\t\t\t\t\t\tfor (PopUpDTO object:resultList) {\n\t\t\t\t\t\t\tstrBuffer.append(\",[\");\n\t\t\t\t\t\t\tstrBuffer.append(\"'\"+DateUtil.getFormatedDate(object.getDate(), \"yyyy-MM-dd\", \"MM/dd\")+\"',\"+object.getImpressionDeliveredLifeTime());\n\t\t\t\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\t\t\tchartData=strBuffer.toString();\n\t\t\t\t\t\tlog.info(\"Going to set this in memcache, chartData:\"+chartData);\n\t\t\t\t\t\tMemcacheUtil.setPublisherChannelPopUpGraphData(chartData,lowerDate, upperDate, channelId, publisherId);\n\t\t\t\t\t}\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlog.severe(\"Exception :\"+e.getMessage());\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Chart data found from memcache:\"+chartData);\n\t\t\t}\n\t\t}catch (Exception e) {\n\t\t\tlog.severe(\"Exception in loadPerformanceChannelPopUpGraphDataFromBigQuery : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn chartData;\n\t}\n\t\n\t/*\n\t * loadActualPublisherData by channel name, selected time interval\n\t * @see com.lin.web.service.ILinMobileBusinessService#loadActualPublisherData(java.lang.String, java.lang.String, java.lang.String)\n\t */\n\tpublic List loadActualPublisherData(String lowerDate,String upperDate,String channelName){\n List resultList=null;\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\t\t\t\n\t\t\tresultList=linDAO.loadChannels(lowerDate, upperDate, channelName);\n\t\t}catch (DataServiceException e) {\n\t\t\tlog.severe(\"Exception in loadActualPublisherData :\"+channelName+\" : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn resultList;\n\t}\n\t\n\t/*\n\t * Get getSellThroughPopUP\n\t * @Param - String lowerDate,String upperDate,String channelName\n\t * @Return - PopUpDTO popUpObj\n\t */\n\tpublic PopUpDTO getSellThroughPopUP(String lowerDate,String upperDate,String propertyName){\n\t\tList resultList=null;\n\t\t\n\t\tPopUpDTO popUpObj=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tpopUpObj=new PopUpDTO();\n\t\t\tresultList=linDAO.loadSellThroughDataByProperty(lowerDate, upperDate, propertyName);\n\t\t\t\n\t\t\tif(resultList !=null && resultList.size()>0){\n\t\t\t\tlog.info(\"Got property :\"+resultList.size());\n\t\t\t\tSellThroughDataObj obj=resultList.get(0);\t\t\t\t\n\t\t\t\tpopUpObj.setImpressionReserved(String.valueOf((obj.getReservedImpressions())));\n\t\t\t\tpopUpObj.setImpressionAvailable(String.valueOf((obj.getAvailableImpressions())) );\n\t\t\t\tpopUpObj.setImpressionForcasted(String.valueOf((obj.getForecastedImpressions())));\n\t\t\t\tpopUpObj.setSellThroughRate(String.valueOf((obj.getSellThroughRate())));\n \n\t\t\t\tStringBuffer strBuffer=new StringBuffer();\n\t\t\t\t\n\t\t\t\tstrBuffer.append(\"[['Days', 'Impression']\");\n\t\t\t\tfor (SellThroughDataObj object:resultList) {\n\t\t\t\t\tstrBuffer.append(\",[\");\n\t\t\t\t\tstrBuffer.append(\"'\"+DateUtil.getFormatedDate(object.getDate(), \"yyyy-MM-dd\", \"MM/dd\")+\"',\"+object.getAvailableImpressions());\n\t\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\t}\n\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\tlog.info(\"strBuffer.toString():\"+strBuffer.toString());\n\t\t\t\tpopUpObj.setChartData(strBuffer.toString());\n\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"No property found:\"+propertyName+\" and time: lowerDate:\"+lowerDate+\" and upperDate:\"+upperDate);\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"Exception in loading property:\"+propertyName+\" : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn popUpObj;\n\t}\n\t\n\tpublic PopUpDTO getPropertyPopup(String lowerDate,String upperDate,String propertyName){\n\t\tList resultList=null;\n\t\tPopUpDTO popUpObj=null;\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\ttry {\n\t\t\tpopUpObj=new PopUpDTO();\n\t\t\tresultList=linDAO.loadPerformanceByPropertyList(lowerDate, upperDate, propertyName);\n\t\t\t\n\t\t\tif(resultList !=null && resultList.size()>0){\n\t\t\t\tlog.info(\"Got property :\"+resultList.size());\n\t\t\t\tPublisherPropertiesObj obj=resultList.get(0);\t\t\t\t\n\t\t\t\tpopUpObj.seteCPM(String.valueOf(obj.geteCPM()));\n\t\t\t\tpopUpObj.setClicksInSelectedTime(String.valueOf(obj.getClicks()));\n\t\t\t\tpopUpObj.setImpressionDeliveredInSelectedTime(String.valueOf(obj.getImpressionsDelivered()));\n\t\t\t\tpopUpObj.setPayout(String.valueOf(obj.getPayout()));\n\t\t\t\tpopUpObj.setChangeCTRInSelectedTime(String.valueOf(obj.getCHG()));\n\t\t\t\t\n\t\t\t\tStringBuffer strBuffer=new StringBuffer();\n\t\t\t\t\n\t\t\t\tstrBuffer.append(\"[['Days', 'Impression']\");\n\t\t\t\tfor (PublisherPropertiesObj object:resultList) {\n\t\t\t\t\tstrBuffer.append(\",[\");\n\t\t\t\t\tstrBuffer.append(\"'\"+DateUtil.getFormatedDate(object.getDate(), \"yyyy-MM-dd\", \"MM/dd\")+\"',\"+object.getImpressionsDelivered());\n\t\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\t}\n\t\t\t\tstrBuffer.append(\"]\");\n\t\t\t\tlog.info(\"strBuffer.toString():\"+strBuffer.toString());\n\t\t\t\tpopUpObj.setChartData(strBuffer.toString());\n\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"No property found:\"+propertyName+\" and time: lowerDate:\"+lowerDate+\" and upperDate:\"+upperDate);\n\t\t\t}\n\t\t\t\n\t\t} catch (DataServiceException e) {\n\t\t\tlog.severe(\"Exception in loading property:\"+propertyName+\" : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn popUpObj;\n\t \n\t}\n\t\n\tpublic List loadTrendAnalysisHeaderData(String lowerDate,String upperDate,String publisherName,String channelName){\n\t\tList list = new ArrayList();\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\tIUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class);\n String replaceStr = \"\\\\\\\\'\";\n String channelAndDataSourceQuery = \"\";\n\t\ttry {\n\t\t\tif(channelName!=null){\n\t\t\t\tStringBuilder memcacheKeysubstring = new StringBuilder();\n\t\t\t\tchannelAndDataSourceQuery = getChannelAndDataSourceQuery(userService.CommaSeperatedStringToList(channelName), memcacheKeysubstring, false);\n\t\t\t\tchannelName = channelName.replaceAll(\"'\", replaceStr);\n\t\t\t\tchannelName = channelName.replaceAll(\",\", \"','\");\n\t\t\t}else{\n\t\t\t\tchannelName = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tlist = linDAO.loadTrendAnalysisHeaderData(lowerDate, upperDate, publisherName, channelName, channelAndDataSourceQuery);\n\t\t} catch (Exception e) {\n\t\t\tlog.severe(\"Exception in loadTrendAnalysisHeaderData of LinMobileBusinessService : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn list;\n\t\t\n\t}\n\t\n\tpublic List loadInventoryRevenueHeaderData(String lowerDate,String upperDate,String publisherName,String channelName){\n\t\tList list = new ArrayList();\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\tIUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class);\n\t\tList channelArrList = null;\n\t\ttry {\n\t\t\tchannelArrList = userService.CommaSeperatedStringToList(channelName);\n\t\t\tStringBuilder memcacheKeysubstring = new StringBuilder();\n\t\t\tString channelAndDataSourceQuery = getChannelAndDataSourceQuery(channelArrList, memcacheKeysubstring, false);\n\t\t\tString ChannelsStr = ChannelsInQString(channelArrList, memcacheKeysubstring);\n\t\t\tlist = linDAO.loadInventoryRevenueHeaderData(lowerDate, upperDate, publisherName, ChannelsStr, channelAndDataSourceQuery);\n\t\t} catch (Exception e) {\n\t\t\tlog.severe(\"Exception in loadInventoryRevenueHeaderData of LinMobileBusinessService : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn list;\n\t\t\n\t}\n\n\tpublic List loadPublisherSummaryData(String lowerDate,String upperDate,String publisherName, long dataStorePublisherId, long userId, String channelNames)\n\t{\n\t\tList list = new ArrayList();\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\t//IUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class);\n\t\ttry {\n\t\t\tif(lowerDate == null && upperDate== null)\n\t\t\t{\t// get MTD data\n\t\t\t\tString monthToDateEnd=DateUtil.getCurrentTimeStamp(\"yyyy-MM-dd\");\n\t\t\t\tString[] dayArray=monthToDateEnd.split(\"-\");\n\t\t\t\tint year=Integer.parseInt(dayArray[0]);\n\t\t\t\tint month=Integer.parseInt(dayArray[1])-1; // subtract 1 from day String as day starts from 0 to 11 in Calender class\n\t\t\t\tString monthToDateStart=DateUtil.getDateByYearMonthDays(year,month,1,\"yyyy-MM-dd\");\n\t\t\t\t\n\t\t\t\tlowerDate = monthToDateStart;\n\t\t\t\tupperDate = monthToDateEnd;\n\t\t\t}\n\t\t\tString channelIds = getChannelsBQId(channelNames);\n\t\t\tString publisherId = getPublisherBQId(publisherName);\n\t\t\tQueryDTO queryDTO = getQueryDTO(publisherId, lowerDate, upperDate, LinMobileConstants.BQ_CORE_PERFORMANCE);\n\t\t\tif(queryDTO != null && queryDTO.getQueryData() != null && queryDTO.getQueryData().length() > 0) {\n\t\t\t\t//StringBuilder allChannelAndDataSourceDFP_MemcacheKeyPart = new StringBuilder();\n\t\t\t\tStringBuilder DFP_Properties_MemcacheKeyPart = new StringBuilder(); \n\t\t\t\tString selectedDFPPropertiesQuery = getSelectedDFPPropertiesQuery(dataStorePublisherId, userId, DFP_Properties_MemcacheKeyPart);\n\t\t\t\t//String selectedDFPPropertiesQuery = \"\";\n\t\t\t\t//String allChannelAndDataSourceQuery = getChannelAndDataSourceQuery(userService.CommaSeperatedStringToList(channelNames), allChannelAndDataSourceDFP_MemcacheKeyPart, true);\n\t\t\t\tlist = linDAO.loadPublisherSummaryData(lowerDate, upperDate, selectedDFPPropertiesQuery, channelIds, queryDTO);\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog.severe(\"Exception in loadPublisherSummaryData of LinMobileBusinessService : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn list;\n\t\t\n\t\n\t}\n\t\n\tpublic Map> loadAllPerformanceByProperty(String lowerDate,String upperDate,String publisherName, long dataStorePublisherId, long userId,String channels,String applyFlag) throws Exception\n\t{\n\n\t\tList list = new ArrayList();\n\t\tList allPerformanceByPropertyTempList = new ArrayList();\n\t\tList allPerformanceByPropertyList = new ArrayList();\n\t\tList allPerformanceByPropertyBySiteNameList = new ArrayList();\n\t\tList performanceByPropertyDFPObjectList = new ArrayList();\n\t\tList performanceByPropertyNonDFPObjectList = new ArrayList();\n\t\t\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\tMap totalImpByChannelMap = new HashMap();\n\t\tMap dataBySiteMap = new HashMap();\n\t\tMap> performanceByPropertyMap = new HashMap>();\n\t\tMap DFPObjectMap = new HashMap();\n\t\tMap nonDFPObjectMap = new HashMap();\n\t\tdouble totalImpDelByChannel = 0;\n\t\t\n\t\t//StringBuilder allChannelAndDataSource_MemcacheKeyPart = new StringBuilder();\n\t\tStringBuilder DFP_Properties_MemcacheKeyPart = new StringBuilder(); \n\t\t//StringBuilder channelWithDataSourceDFP_MemcacheKeyPart = new StringBuilder(); \n\t\t//String allChannelAndDataSourceQuery = getChannelAndDataSourceQuery(null, allChannelAndDataSource_MemcacheKeyPart, true);\n\t\tString selectedDFPPropertiesQuery = getSelectedDFPPropertiesQuery(dataStorePublisherId, userId, DFP_Properties_MemcacheKeyPart);\n\t\t//String selectedDFPSource = getChannelWithDataSourceDFPQuery(channelWithDataSourceDFP_MemcacheKeyPart);\n\t\t\n\t\tString channelIds = getChannelsBQId(channels);\n\t\tString publisherId = getPublisherBQId(publisherName);\n\t\tlist = MemcacheUtil.getAllPerformanceByPropertyList(lowerDate, upperDate,publisherId, channelIds, DFP_Properties_MemcacheKeyPart.toString());\n\t\tif(list==null || list.size()<=0){\n\t\t\tQueryDTO queryDTO = getQueryDTO(publisherId, lowerDate, upperDate, LinMobileConstants.BQ_CORE_PERFORMANCE);\n\t\t\tif(queryDTO != null && queryDTO.getQueryData() != null && queryDTO.getQueryData().length() > 0) {\n\t\t\t\tlist = linDAO.loadAllPerformanceByProperty(lowerDate, upperDate, channelIds, selectedDFPPropertiesQuery, queryDTO);\n\t\t\t\tMemcacheUtil.setAllPerformanceByPropertyList(list, lowerDate, upperDate,publisherId, channelIds, DFP_Properties_MemcacheKeyPart.toString());\n\t\t\t}\n\t\t}\n\t\tif(list!=null && list.size()>0){\n\t\t\tIUserDetailsDAO userDetailsDAO = new UserDetailsDAO();\n\t\t\tList demandPartnersList = userDetailsDAO.getAllDemandPartners(MemcacheUtil.getAllCompanyList());\n\t\t\tfor (PublisherPropertiesObj publisherPropertiesObj : list) {\n\t\t\t\tif(publisherPropertiesObj!=null){\n\t\t\t\t\tCompanyObj demandPartnerCompany = userDetailsDAO.getCompanyByName(publisherPropertiesObj.getChannelName().trim(), demandPartnersList);\n\t\t\t\t\tif(demandPartnerCompany!=null && demandPartnerCompany.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && demandPartnerCompany.getCompanyName() != null && !demandPartnerCompany.getCompanyName().trim().equalsIgnoreCase(\"\") && demandPartnerCompany.getDataSource() != null && !demandPartnerCompany.getDataSource().trim().equalsIgnoreCase(\"\")){\n\t\t\t\t\t\tpublisherPropertiesObj.setDataSource(demandPartnerCompany.getDataSource().trim());\n\t\t\t\t\t}\n\t\t\t\t\tif( !totalImpByChannelMap.containsKey(publisherPropertiesObj.getChannelName()) && !publisherPropertiesObj.getDataSource().equals(LinMobileConstants.DEFAULT_DATASOURE_NAME)){\n\t\t\t\t\t\ttotalImpByChannelMap.put(publisherPropertiesObj.getChannelName(), Math.round(publisherPropertiesObj.getImpressionsDelivered())+0.0);\n\t\t\t\t\t}else if(totalImpByChannelMap.size()!=0 && totalImpByChannelMap.containsKey(publisherPropertiesObj.getChannelName())){\n\t\t\t\t\t\ttotalImpDelByChannel = totalImpByChannelMap.get(publisherPropertiesObj.getChannelName())+ Math.round(publisherPropertiesObj.getImpressionsDelivered());\n\t\t\t\t\t\ttotalImpByChannelMap.put(publisherPropertiesObj.getChannelName(), totalImpDelByChannel);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tallPerformanceByPropertyTempList.add(publisherPropertiesObj);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(allPerformanceByPropertyTempList!=null && allPerformanceByPropertyTempList.size()>0){\n\t\t\t\tfor (PublisherPropertiesObj publisherPropertiesObj : allPerformanceByPropertyTempList) {\n\t\t\t\t\tif(publisherPropertiesObj!=null){\n\t\t\t\t\t\tif(totalImpByChannelMap!=null && totalImpByChannelMap.containsKey(publisherPropertiesObj.getChannelName())){\n\t\t\t\t\t\t\tpublisherPropertiesObj.setTotalImpressionsDeliveredByChannelName(totalImpByChannelMap.get(publisherPropertiesObj.getChannelName()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tallPerformanceByPropertyList.add(publisherPropertiesObj);\n\t\t\t\t}\n\t\t\t\tperformanceByPropertyMap.put(\"allData\", allPerformanceByPropertyList);\n\t\t}\n\t\tMemcacheUtil.setAllPerformanceByPropertyCalculatedList(allPerformanceByPropertyList,lowerDate,upperDate,publisherId, channelIds, DFP_Properties_MemcacheKeyPart.toString());\n\t\t\n\t\tif(allPerformanceByPropertyList!=null && allPerformanceByPropertyList.size()>0){\n\t\t\tList channelArrList = new ArrayList();\n\t\t\tString[] str = channels.split(\",\");\n\t\t\tif(str!=null){\n\t\t\t\tfor (String channel : str) {\n\t\t\t\t\tchannelArrList.add(channel);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (PublisherPropertiesObj publisherPropertiesObjBySiteName : allPerformanceByPropertyList) {\n\t\t\t\tif( channelArrList!=null && channelArrList.contains(publisherPropertiesObjBySiteName.getChannelName())){\n\t\t\t\tif(publisherPropertiesObjBySiteName!=null && publisherPropertiesObjBySiteName.getDataSource().equals(LinMobileConstants.DEFAULT_DATASOURE_NAME)){\n\t\t\t\t\tperformanceByPropertyDFPObjectList.add(publisherPropertiesObjBySiteName);\n\t\t\t\t}else{\n\t\t\t\t\tperformanceByPropertyNonDFPObjectList.add(publisherPropertiesObjBySiteName);\n\t\t\t\t}\n\t\t\t }\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(performanceByPropertyDFPObjectList!=null && performanceByPropertyDFPObjectList.size()>0){\n\t\t\tfor (PublisherPropertiesObj publisherPropertiesObj : performanceByPropertyDFPObjectList) {\n\t\t\t\tif(!DFPObjectMap.containsKey(publisherPropertiesObj.getSite())){\n\t\t\t\t\tDFPObjectMap.put(publisherPropertiesObj.getSite(), publisherPropertiesObj);\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tPublisherPropertiesObj propertiesObj = copyObject(DFPObjectMap.get(publisherPropertiesObj.getSite()));\n\t\t\t\t\tdouble impressions = publisherPropertiesObj.getImpressionsDelivered();\n\t\t\t\t\tdouble payout = publisherPropertiesObj.getDFPPayout();\n\t\t\t\t long clicks = publisherPropertiesObj.getClicks();\n\t\t\t\t\tpropertiesObj.setImpressionsDelivered(impressions + propertiesObj.getImpressionsDelivered());\n\t\t\t\t\tpropertiesObj.setClicks(clicks + propertiesObj.getClicks());\n\t\t\t\t\tpropertiesObj.setDFPPayout(payout + propertiesObj.getDFPPayout());\n\t\t\t\t\tif(propertiesObj.getImpressionsDelivered()!=0){\n\t\t\t\t\t\tdouble ecpm = (propertiesObj.getDFPPayout()/propertiesObj.getImpressionsDelivered())*1000;\t\n\t\t\t\t\t\tpropertiesObj.seteCPM(ecpm);\n\t\t\t\t\t}\n\t\t\t\t\tDFPObjectMap.put(propertiesObj.getSite(), propertiesObj);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t Iterator iterator = DFPObjectMap.entrySet().iterator();\n\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\tMap.Entry mapEntry = (Map.Entry) iterator.next();\n\t\t\t\t\tallPerformanceByPropertyBySiteNameList.add((PublisherPropertiesObj) mapEntry.getValue());\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(performanceByPropertyNonDFPObjectList!=null && performanceByPropertyNonDFPObjectList.size()>0)\n\t\t{\n\t\t\tfor (PublisherPropertiesObj publisherPropertiesObj : performanceByPropertyNonDFPObjectList) {\n\t\t\t\t//PublisherPropertiesObj propertiesObj = copyObject(dataBySiteMap.get(publisherPropertiesObj.getSite()));\n\t\t\t\tif(!nonDFPObjectMap.containsKey(publisherPropertiesObj.getSite())){\n\t\t\t\t\tnonDFPObjectMap.put(publisherPropertiesObj.getSite(), publisherPropertiesObj);\n\t\t\t\t\tdouble requestWeightage = 0.0;\n\t\t\t\t\tdouble impressions = 0.0;\n\t\t\t\t\tdouble payout = 0.0;\n\t\t\t\t\t\n\t\t\t\t\tPublisherPropertiesObj propertiesObj = copyObject(nonDFPObjectMap.get(publisherPropertiesObj.getSite()));\n\t\t\t\t\tif(propertiesObj.getTotalImpressionsDeliveredByChannelName()!=0){\n\t\t\t\t\t\trequestWeightage = propertiesObj.getImpressionsDelivered()/propertiesObj.getTotalImpressionsDeliveredByChannelName();\n\t\t\t\t\t}\n\t\t\t\t\tlong clicks = publisherPropertiesObj.getClicks();\n\t\t\t\t\t impressions = (requestWeightage * propertiesObj.getTotalImpressionsDeliveredBySiteName());\n\t\t\t\t\t payout = requestWeightage * propertiesObj.getPayout();\n\t\t\t\t\tpropertiesObj.setImpressionsDelivered((impressions));\n\t\t\t\t\tpropertiesObj.setPayout(payout);\n\t\t\t\t\tpropertiesObj.setClicks(clicks + propertiesObj.getClicks());\n\t\t\t\t\tif(propertiesObj.getImpressionsDelivered()!=0){\n\t\t\t\t\t\tdouble ecpm = (propertiesObj.getPayout()/propertiesObj.getImpressionsDelivered())*1000;\t\n\t\t\t\t\t\tpropertiesObj.seteCPM(ecpm);\n\t\t\t\t\t}\n\t\t\t\t\tnonDFPObjectMap.put(propertiesObj.getSite(), propertiesObj);\n\t\t\t\t}else{\n\t\t\t\t\tdouble requestWeightage = 0.0;\n\t\t\t\t\tdouble impressions = 0.0;\n\t\t\t\t\tdouble payout = 0.0;\n\t\t\t\t\tPublisherPropertiesObj propertiesObj = copyObject(nonDFPObjectMap.get(publisherPropertiesObj.getSite()));\n\t\t\t\t\tif(publisherPropertiesObj.getTotalImpressionsDeliveredByChannelName()!=0){\n\t\t\t\t\t\t requestWeightage = publisherPropertiesObj.getImpressionsDelivered()/publisherPropertiesObj.getTotalImpressionsDeliveredByChannelName();\n\t\t\t\t\t}\n\t\t\t\t\tlong clicks = publisherPropertiesObj.getClicks();\n\t\t\t\t\t impressions = (requestWeightage * publisherPropertiesObj.getTotalImpressionsDeliveredBySiteName());\n\t\t\t\t\t payout = requestWeightage * publisherPropertiesObj.getPayout();\n\t\t\t\t\tpropertiesObj.setImpressionsDelivered(impressions+propertiesObj.getImpressionsDelivered());\n\t\t\t\t\tpropertiesObj.setPayout(payout+propertiesObj.getPayout());\n\t\t\t\t\tpropertiesObj.setClicks(clicks + propertiesObj.getClicks());\n\t\t\t\t\tif(propertiesObj.getImpressionsDelivered()!=0){\n\t\t\t\t\t\tdouble ecpm = (propertiesObj.getPayout()/propertiesObj.getImpressionsDelivered())*1000;\t\n\t\t\t\t\t\tpropertiesObj.seteCPM(ecpm);\n\t\t\t\t\t}\n\t\t\t\t\tnonDFPObjectMap.put(propertiesObj.getSite(), propertiesObj);\n\t\t\t\t}\n\t\t\t}\n\t\t\t Iterator iterator = nonDFPObjectMap.entrySet().iterator();\n\t\t\twhile (iterator.hasNext()) {\n\t\t\t\tMap.Entry mapEntry = (Map.Entry) iterator.next();\n\t\t\t\tallPerformanceByPropertyBySiteNameList.add((PublisherPropertiesObj) mapEntry.getValue());\n\t\t }\n\t\t}\n\t\t\n\t\tif(allPerformanceByPropertyBySiteNameList!=null && allPerformanceByPropertyBySiteNameList.size()>0){\n\t\t\tfor (PublisherPropertiesObj publisherPropertiesObj : allPerformanceByPropertyBySiteNameList) {\n\t\t\t\tif(!dataBySiteMap.containsKey(publisherPropertiesObj.getSite())){\n\t\t\t\t\tdataBySiteMap.put(publisherPropertiesObj.getSite(), publisherPropertiesObj);\n\t\t\t\t\tPublisherPropertiesObj propertiesObj = copyObject(dataBySiteMap.get(publisherPropertiesObj.getSite()));\n\t\t\t\t\tif(propertiesObj.getDataSource().equals(LinMobileConstants.DEFAULT_DATASOURE_NAME)){\n\t\t\t\t\t\tdouble payout = propertiesObj.getDFPPayout();\n\t\t\t\t\t\tpropertiesObj.setPayout(payout);\n\t\t\t\t\t\tdataBySiteMap.put(publisherPropertiesObj.getSite(), propertiesObj);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tdouble payout = 0.0;\n\t\t\t\t\tdouble previousPayout = 0.0;\n\t\t\t\t\tPublisherPropertiesObj propertiesObj = copyObject(dataBySiteMap.get(publisherPropertiesObj.getSite()));\n\t\t\t\t\tlong clicks = publisherPropertiesObj.getClicks();\n\t\t\t\t\tdouble impressions = Math.round(publisherPropertiesObj.getImpressionsDelivered()) + 0.0;\n\t\t\t\t\tif(!publisherPropertiesObj.getDataSource().equals(LinMobileConstants.DEFAULT_DATASOURE_NAME)){\n\t\t\t\t\t\t payout = publisherPropertiesObj.getPayout();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t payout = publisherPropertiesObj.getDFPPayout();\n\t\t\t\t\t}\n\t\t\t\t\tif(!propertiesObj.getDataSource().equals(LinMobileConstants.DEFAULT_DATASOURE_NAME)){\n\t\t\t\t\t\tpreviousPayout = propertiesObj.getPayout();\n\t\t\t\t\t}else{\n\t\t\t\t\t\tpreviousPayout = propertiesObj.getDFPPayout();\n\t\t\t\t\t}\n\t\t\t\t\tpropertiesObj.setImpressionsDelivered(impressions + Math.round(propertiesObj.getImpressionsDelivered())+0.0);\n\t\t\t\t\tpropertiesObj.setPayout(payout + previousPayout);\n\t\t\t\t\tpropertiesObj.setClicks(clicks + propertiesObj.getClicks());\n\t\t\t\t\tif(propertiesObj.getImpressionsDelivered()!=0){\n\t\t\t\t\t\tdouble ecpm = (propertiesObj.getPayout()/propertiesObj.getImpressionsDelivered())*1000;\t\n\t\t\t\t\t\tpropertiesObj.seteCPM(ecpm);\n\t\t\t\t\t}\n\t\t\t\t\tdataBySiteMap.put(propertiesObj.getSite(), propertiesObj);\n\t\t\t\t}\n\t\t\t}\n\t\t\t Iterator iterator = dataBySiteMap.entrySet().iterator();\n\t\t\t allPerformanceByPropertyBySiteNameList = new ArrayList();\n\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\tMap.Entry mapEntry = (Map.Entry) iterator.next();\n\t\t\t\t\tallPerformanceByPropertyBySiteNameList.add((PublisherPropertiesObj) mapEntry.getValue());\n\t\t\t}\n\t\t\t\tperformanceByPropertyMap.put(\"allDataBySiteName\", allPerformanceByPropertyBySiteNameList);\n\t\t}\n\t\n\t\treturn performanceByPropertyMap;\n\t}\n\t\n\t\n\tpublic List loadReallocationHeaderData(String lowerDate,String upperDate,String publisherName,String channelName)\n\t{\n\n\t\tList list = new ArrayList();\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\tList channelArrList = new ArrayList();\n\t\tString[] str = channelName.split(\",\");\n\t\tif(str!=null){\n\t\t\tfor (String channel : str) {\n\t\t\t\tchannelArrList.add(channel);\n\t\t\t}\n\t\t}\n\t\t\n\t\tlist = linDAO.loadReallocationHeaderData(lowerDate, upperDate, publisherName, channelArrList);\n\t\t\n\t\treturn list;\n\t\t\n\t\n\t}\n\t\n\t\n\t\n\tpublic List loadPublisherPropertyDropDownList(String publisherName,long userId,String str)\n\t{\n\t\tList propertyList = new ArrayList();\n\t\tString replaceStr = \"\\\\\\\\'\";\n\t\tif(str!=null){\n\t\t\tstr = str.replaceAll(\"'\", replaceStr);\n\t\t}\n\t\tif(publisherName!=null){\n\t\t\tpublisherName = publisherName.replaceAll(\"'\", replaceStr);\n\t\t}\n\t\t\n\t\t/*ILinMobileDAO linDAO=new LinMobileDAO(); 24.08.2013\n\t\tpropertyList = linDAO.loadPublisherPropertyDropDownList(publisherName,userId,str);*/\n\t\tIUserDetailsDAO dao = new UserDetailsDAO();\n\t\tpropertyList = dao.loadPropertyDropDownList(publisherName,userId,str);\n\t\tif(propertyList!=null && propertyList.size()>0){\n\t\t\treturn propertyList;\n\t\t}\n\t\treturn new ArrayList();\n\t}\t\n\n\t@Override\n\tpublic List getAllPublishersByPublisherIdAndUserId(String selectedPublisherId, List channelsNameList, long userId) {\n\t\tlog.info(\"Inside getAllPublishersByPublisherIdAndUserId in LinMobileBusinessService\");\n\t\tIUserDetailsDAO dao = new UserDetailsDAO();\n\t\tList publisherIdList = new ArrayList();\n\t\tList allPublishersList = new ArrayList(0);\n\t\ttry {\n\t\t\tList companyObjList = MemcacheUtil.getAllCompanyList();\n\t\t\tList publisherList = dao.getAllPublishers(companyObjList);\n\t\t\tList selectedPublishersList = dao.getSelectedPublishersByUserId(userId, publisherIdList, publisherList);\n\t\t\tif(!selectedPublisherId.trim().equalsIgnoreCase(\"\")) {\n\t\t\t\tCompanyObj publisherCompany = dao.getCompanyById(Long.valueOf(selectedPublisherId), publisherList);\n\t\t\t\tif(publisherCompany != null && publisherIdList.contains(String.valueOf(publisherCompany.getId())) && publisherCompany.getStatus().trim().equals(LinMobileConstants.STATUS_ARRAY[0]) && publisherCompany.getCompanyName() != null) {\n\t\t\t\t\tallPublishersList.add(new CommonDTO(selectedPublisherId.trim(), publisherCompany.getCompanyName().trim()));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(selectedPublishersList != null && selectedPublishersList.size() > 0) {\n\t\t\t\tfor (CompanyObj publisherCompany : selectedPublishersList) {\n\t\t\t\t\tif(publisherCompany != null && publisherCompany.getStatus().trim().equalsIgnoreCase(LinMobileConstants.STATUS_ARRAY[0]) && publisherCompany.getCompanyName() != null && !publisherCompany.getCompanyName().trim().equalsIgnoreCase(\"\")) {\n\t\t\t\t\t\tif(!selectedPublisherId.trim().equalsIgnoreCase(\"\") && selectedPublisherId.trim().equals(String.valueOf(publisherCompany.getId()))) {\n\t\t\t\t\t\t\t//do nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tallPublishersList.add(new CommonDTO(String.valueOf(publisherCompany.getId()),publisherCompany.getCompanyName().trim()));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(allPublishersList != null && allPublishersList.size() > 0) {\n\t\t\t\tselectedPublisherId = allPublishersList.get(0).getId();\n\t\t\t\tString commaSeperatedChannelsName = getCommaSeperatedChannelsNameByPublisherIdAndUserId(selectedPublisherId, userId, companyObjList);\n\t\t\t\tif(commaSeperatedChannelsName != null && !commaSeperatedChannelsName.trim().equalsIgnoreCase(\"\")) {\n\t\t\t\t\tchannelsNameList.add(commaSeperatedChannelsName);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog.severe(\"Exception in getAllPublishersByPublisherIdAndUserId of LinMobileBusinessService\"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn allPublishersList;\n\t}\n\n\t@Override\n\tpublic String getCommaSeperatedChannelsNameByPublisherIdAndUserId(String publisherId, long userId, List companyObjList) throws Exception {\n\t\tlog.info(\"Inside getCommaSeperatedChannelsNameByPublisherIdAndUserId in LinMobileBusinessService\");\n\t\tIUserDetailsDAO dao = new UserDetailsDAO();\n\t\tList commaSeperatedChannelsNameList = new ArrayList(0);\n\t\tString commaSeperatedChannelsName = \"\";\n\t\tList demandPartnersList = dao.getActiveDemandPartnersByPublisherCompanyId(publisherId);\n\t\tif(demandPartnersList != null && demandPartnersList.size() > 0) {\n\t\t\tlog.info(\"demandPartnersIdList.size : \"+demandPartnersList.size());\n\t\t\tfor (CompanyObj demandPartner : demandPartnersList) {\n\t\t\t\tif(demandPartner != null && !commaSeperatedChannelsNameList.contains(demandPartner.getCompanyName().trim())) {\n\t\t\t\t\tcommaSeperatedChannelsNameList.add(demandPartner.getCompanyName().trim());\n\t\t\t\t\tcommaSeperatedChannelsName = commaSeperatedChannelsName + demandPartner.getCompanyName().trim() + \",\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(commaSeperatedChannelsName.lastIndexOf(\",\") != -1) {\n\t\t\t\tcommaSeperatedChannelsName = commaSeperatedChannelsName.substring(0, commaSeperatedChannelsName.lastIndexOf(\",\"));\n\t\t\t}\n\t\t}\n\t\treturn commaSeperatedChannelsName;\n\t}\n\t\n\tpublic List loadAdvertiserPropertyDropDownList(String publisherId,long userId,String str)\n\t{\n\t\tList propertyList = new ArrayList();\n\t\tString replaceStr = \"\\\\\\\\'\";\n\t\tif(str!=null){\n\t\t\tstr = str.replaceAll(\"'\", replaceStr);\n\t\t}\n\t\tIUserDetailsDAO dao = new UserDetailsDAO();\n\t\tpropertyList = dao.loadPropertyDropDownList(publisherId,userId,str);\n\t\tif(propertyList!=null && propertyList.size()>0){\n\t\t\treturn propertyList;\n\t\t}\n\t\treturn new ArrayList();\n\t}\n\n\t@Override\n\tpublic String getCommaSeperatedChannelsNameByChannelIdList(List channelIdList) throws Exception {\n\t\tlog.info(\"Inside getCommaSeperatedChannelsNameByChannelIdList of LinMobileBussinessService\");\n\t\tString commaSeperatedChannelNames = \"\";\n\t\tIUserDetailsDAO userDetailsDAO = new UserDetailsDAO();\n\t\tList demandPartnersList = userDetailsDAO.getAllDemandPartners(MemcacheUtil.getAllCompanyList());\n\t\tif(channelIdList != null && channelIdList.size() > 0) {\n\t\t\tfor (String channelId : channelIdList) {\n\t\t\t\tCompanyObj demandPartnerCompany = userDetailsDAO.getCompanyById(Long.valueOf(channelId), demandPartnersList);\n\t\t\t\tif(demandPartnerCompany != null && demandPartnerCompany.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && demandPartnerCompany.getCompanyName() != null) {\n\t\t\t\t\tcommaSeperatedChannelNames = commaSeperatedChannelNames + demandPartnerCompany.getCompanyName().trim() + \",\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(commaSeperatedChannelNames.lastIndexOf(\",\") != -1) {\n\t\t\tcommaSeperatedChannelNames = commaSeperatedChannelNames.substring(0, commaSeperatedChannelNames.lastIndexOf(\",\"));\n\t\t}\n\t\treturn commaSeperatedChannelNames;\n\t}\n\n\t@Override\n\tpublic String getCommaSeperatedChannelsName(String publisherName) throws Exception {\n\t\tlog.info(\"Inside getCommaSeperatedChannelsName of LinMobileBussinessService\");\n\t\tString commaSeperatedChannelNames = \"\";\n\t\tIUserDetailsDAO userDetailsDAO = new UserDetailsDAO();\n\t\tList companyObjList = MemcacheUtil.getAllCompanyList();\n\t\tList demandPartnersList = userDetailsDAO.getAllDemandPartners(companyObjList);\n\t\tCompanyObj publisherCompany = userDetailsDAO.getCompanyObjByNameAndCompanyType(publisherName, LinMobileConstants.COMPANY_TYPE[0], companyObjList);\n\t\tif(publisherCompany != null && publisherCompany.getStatus().trim().equalsIgnoreCase(LinMobileConstants.STATUS_ARRAY[0]) && publisherCompany.getDemandPartnerId() != null) {\n\t\t\tList channelIdList = publisherCompany.getDemandPartnerId();\n\t\t\tif(channelIdList != null && channelIdList.size() > 0) {\n\t\t\t\tfor (String channelId : channelIdList) {\n\t\t\t\t\tCompanyObj demandPartnerCompany = userDetailsDAO.getCompanyById(Long.valueOf(channelId), demandPartnersList);\n\t\t\t\t\tif(demandPartnerCompany != null && demandPartnerCompany.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && demandPartnerCompany.getCompanyName() != null) {\n\t\t\t\t\t\tcommaSeperatedChannelNames = commaSeperatedChannelNames + demandPartnerCompany.getCompanyName().trim() + \",\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(commaSeperatedChannelNames.lastIndexOf(\",\") != -1) {\n\t\t\tcommaSeperatedChannelNames = commaSeperatedChannelNames.substring(0, commaSeperatedChannelNames.lastIndexOf(\",\"));\n\t\t}\n\t\treturn commaSeperatedChannelNames;\n\t}\n\t\n\tpublic List createSummaryData(List reconciliationDataDTOList, String channelName, List passBackList) {\n\t\tlog.info(\"Inside createSummaryData of LinMobileBussinessService\");\n\t\tList tempReconciliationSummaryDataList = new ArrayList();\n\t\tlong DFP_requests = 0;\n\t\tlong DFP_delivered = 0;\n\t\tlong DFP_passback = 0;\n\t\tlong demandPartnerRequests = 0;\n\t\tlong demandPartnerDelivered = 0;\n\t\tlong demandPartnerPassbacks = 0;\n\t\tdouble varianceRequests = 0;\n\t\tdouble varianceDelivered = 0;\n\t\tdouble variancePassbacks = 0;\n\t\t\n\t\tif(reconciliationDataDTOList != null && reconciliationDataDTOList.size() > 0) {\n\t\t\tfor (ReconciliationDataDTO reconciliationDataDTO : reconciliationDataDTOList) {\n\t\t\t\tif(reconciliationDataDTO != null) {\n\t\t\t\t\tDFP_requests = DFP_requests +reconciliationDataDTO.getDFP_requests();\n\t\t\t\t\tDFP_delivered = DFP_delivered +reconciliationDataDTO.getDFP_delivered();\n\t\t\t\t\tDFP_passback = DFP_passback +reconciliationDataDTO.getDFP_passback();\n\t\t\t\t\tdemandPartnerRequests = demandPartnerRequests +reconciliationDataDTO.getDemandPartnerRequests();\n\t\t\t\t\tdemandPartnerDelivered = demandPartnerDelivered +reconciliationDataDTO.getDemandPartnerDelivered();\n\t\t\t\t\tdemandPartnerPassbacks = demandPartnerPassbacks +reconciliationDataDTO.getDemandPartnerPassbacks();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(DFP_requests != 0) {\n\t\t\t\tvarianceRequests = Double.valueOf((demandPartnerRequests - DFP_requests)*100)/DFP_requests;\n\t\t\t}\n\t\t\tif(DFP_delivered != 0) {\n\t\t\t\tvarianceDelivered = Double.valueOf((demandPartnerDelivered - DFP_delivered)*100)/DFP_delivered;\n\t\t\t}\n\t\t\tif(DFP_passback != 0) {\n\t\t\t\tvariancePassbacks = Double.valueOf((demandPartnerPassbacks - DFP_passback)*100)/DFP_passback;\n\t\t\t}\n\t\t\t\n\t\t\tif(DFP_requests == 0) {\n\t\t\t\tDFP_delivered = 0;\n\t\t\t\tvarianceRequests = 0;\n\t\t\t\tvarianceDelivered = 0;\n\t\t\t}\n\t\t\tif(demandPartnerRequests == 0) {\n\t\t\t\tdemandPartnerPassbacks = 0;\n\t\t\t\tvarianceRequests = 0;\n\t\t\t\tvariancePassbacks = 0;\n\t\t\t}\n\t\t\t\n\t\t\tReconciliationDataDTO dto = new ReconciliationDataDTO();\n\t\t\tif(passBackList == null || passBackList.size() == 0) {\n\t\t\t\tdto.setSiteType(\"NA\");\n\t\t\t}\n\t\t\tdto.setChannelName(channelName);\n\t\t\tdto.setDFP_requests(DFP_requests);\n\t\t\tdto.setDFP_delivered(DFP_delivered);\n\t\t\tdto.setDFP_passback(DFP_passback);\n\t\t\tdto.setDemandPartnerRequests(demandPartnerRequests);\n\t\t\tdto.setDemandPartnerDelivered(demandPartnerDelivered);\n\t\t\tdto.setDemandPartnerPassbacks(demandPartnerPassbacks);\n\t\t\tdto.setVarianceRequests(varianceRequests);\n\t\t\tdto.setVarianceDelivered(varianceDelivered);\n\t\t\tdto.setVariancePassbacks(variancePassbacks);\n\t\t\ttempReconciliationSummaryDataList.add(dto);\n\t\t\t\n\t\t}\n\t\t\n\t\treturn tempReconciliationSummaryDataList;\n\t}\n\n\t@Override\n\tpublic void loadAllReconciliationData(String startDate, String endDate, String publisherId, long userId, List reconciliationSummaryDataList, List reconciliationDetailsDataList) throws Exception {\n\t\tlog.info(\"Inside loadAllReconciliationData of LinMobileBussinessService\");\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\tIUserDetailsDAO userDetailsDAO = new UserDetailsDAO();\n\t\tList tempSubList = null;\n\t\tList dateList = new ArrayList();\n\t\tList reconciliationDataDTOList = null;\n\t\tList resultList = null;\n\t\tList channelsInfo = new ArrayList();\n\t\tHashMap> channelPassbackSiteTypeMap = new HashMap>();\n\t\tString publisherName = \"\";\n\t\tint tempCount = 0;\n\t\t\n\t\tList companyObjList = MemcacheUtil.getAllCompanyList();\n\t\tCompanyObj publisherCompany = userDetailsDAO.getCompanyObjByIdAndCompanyType(publisherId, LinMobileConstants.COMPANY_TYPE[0], companyObjList);\n\t\tif(publisherCompany != null && publisherCompany.getStatus().trim().equalsIgnoreCase(LinMobileConstants.STATUS_ARRAY[0]) && publisherCompany.getCompanyName() != null && !publisherCompany.getCompanyName().equalsIgnoreCase(\"\")) {\n\t\t\tList demandPartnersList = userDetailsDAO.getActiveDemandPartnersByPublisherCompanyId(publisherId);\n\t\t\tif(demandPartnersList != null && demandPartnersList.size() > 0) {\n\t\t\t\tList passbackValues = userDetailsDAO.getPassbackValues(demandPartnersList);\n\t\t\t\tString hashedPassbackValueString = \"\";\n\t\t\t\tString lineItemQuery = \"line_item =''\";\n\t\t\t\tif(passbackValues != null && passbackValues.size() > 0) {\n\t\t\t\t\tlineItemQuery = \"\";\n\t\t\t\t\tfor(String passbackValue : passbackValues) {\n\t\t\t\t\t\thashedPassbackValueString = hashedPassbackValueString + passbackValue.trim();\n\t\t\t\t\t\tlineItemQuery = lineItemQuery + \"line_item ='\"+passbackValue.trim()+\"' or \";\n\t\t\t\t\t}\n\t\t\t\t\tif(lineItemQuery.lastIndexOf(\"or\") != -1) {\n\t\t\t\t\t\tlineItemQuery = lineItemQuery.substring(0, lineItemQuery.lastIndexOf(\"or\"));\n\t\t\t\t\t}\n\t\t\t\t\thashedPassbackValueString = EncriptionUtil.getEncriptedStrMD5(hashedPassbackValueString);\n\t\t\t\t}\n\t\t\t\tpublisherName = publisherCompany.getCompanyName();\n\t\t\t\t\n\t\t\t\tString publisherBQId = getPublisherBQId(publisherName);\n\t\t\t\tQueryDTO queryDTO = getQueryDTO(publisherBQId, startDate, endDate, LinMobileConstants.BQ_CORE_PERFORMANCE);\n\t\t\t\t\n\t\t\t\tresultList = MemcacheUtil.getReconciliationDataList(startDate, endDate, publisherBQId, hashedPassbackValueString);\n\t\t\t\tif(resultList != null && resultList.size()> 0) {\n\t\t\t\t\treconciliationDataDTOList =resultList;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tresultList = linDAO.loadAllRecociliationData(startDate, endDate, lineItemQuery, queryDTO);\n\t\t\t\t\tif(resultList != null && resultList.size()> 0) {\n\t\t\t\t\t\tMemcacheUtil.setReconciliationDataList(resultList, startDate, endDate, publisherBQId, hashedPassbackValueString);\n\t\t\t\t\t\treconciliationDataDTOList =resultList;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(reconciliationDataDTOList != null && reconciliationDataDTOList.size() > 0) {\n\t\t\t\t\tfor (CompanyObj demandPartner : demandPartnersList) {\n\t\t\t\t\t\tif(demandPartner != null && !demandPartner.getDataSource().trim().equals(LinMobileConstants.DFP_DATA_SOURCE)) {\n\t\t\t\t\t\t\tif(demandPartner.getPassback_Site_type() != null && demandPartner.getPassback_Site_type().size() > 0) {\n\t\t\t\t\t\t\t\tchannelPassbackSiteTypeMap.put(demandPartner.getCompanyName().trim(), demandPartner.getPassback_Site_type());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tchannelPassbackSiteTypeMap.put(demandPartner.getCompanyName().trim(), new ArrayList());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCommonDTO commonDTO = new CommonDTO();\n\t\t\t\t\t\t\tcommonDTO.setChannelName(demandPartner.getCompanyName().trim());\n\t\t\t\t\t\t\tcommonDTO.setChannelDataSource(demandPartner.getDataSource().trim());\n\t\t\t\t\t\t\tchannelsInfo.add(commonDTO);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(channelsInfo != null && channelsInfo.size() > 0) {\n\t\t\t\t\t\tList tempDateList = new ArrayList();\n\t\t\t\t\t\tfor (ReconciliationDataDTO reconciliationDataDTO : reconciliationDataDTOList) {\n\t\t\t\t\t\t\tif(reconciliationDataDTO != null && reconciliationDataDTO.getDate() != null && !tempDateList.contains(reconciliationDataDTO.getFormattedDate().trim())) {\n\t\t\t\t\t\t\t\ttempDateList.add(reconciliationDataDTO.getFormattedDate().trim());\n\t\t\t\t\t\t\t\tdateList.add(reconciliationDataDTO.getDate());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(dateList != null && dateList.size() > 0) {\n\t\t\t\t\t\t\tfor(CommonDTO channelInfo : channelsInfo) {\n\t\t\t\t\t\t\t\tList tempReconciliationDetailsDataList = new ArrayList(); \n\t\t\t\t\t\t\t\tString channel = channelInfo.getChannelName().trim();\n\t\t\t\t\t\t\t\tString channelDataSource = channelInfo.getChannelDataSource().trim();\n\t\t\t\t\t\t\t\tList passBackList = channelPassbackSiteTypeMap.get(channel);\n\t\t\t\t\t\t\t\ttempSubList = reconciliationDataDTOList.subList(0, reconciliationDataDTOList.size()-1);\n\t\t\t\t\t\t\t\ttempCount = 0;\n\t\t\t\t\t\t\t\tfor(Date date : dateList) {\n\t\t\t\t\t\t\t\t\tlong DFP_requests = 0;\n\t\t\t\t\t\t\t\t\tlong DFP_delivered = 0;\n\t\t\t\t\t\t\t\t\tlong DFP_passback = 0;\n\t\t\t\t\t\t\t\t\tlong demandPartnerRequests = 0;\n\t\t\t\t\t\t\t\t\tlong demandPartnerDelivered = 0;\n\t\t\t\t\t\t\t\t\tlong demandPartnerPassbacks = 0;\n\t\t\t\t\t\t\t\t\tdouble varianceRequests = 0;\n\t\t\t\t\t\t\t\t\tdouble varianceDelivered = 0;\n\t\t\t\t\t\t\t\t\tdouble variancePassbacks = 0;\n\t\t\t\t\t\t\t\t\tfor (ReconciliationDataDTO reconciliationDataDTO : tempSubList) {\n\t\t\t\t\t\t\t\t\t\tif(reconciliationDataDTO != null && reconciliationDataDTO.getDate() != null) {\n\t\t\t\t\t\t\t\t\t\t\tif(reconciliationDataDTO.getDate().compareTo(date) > 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t// create detail data\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif(passBackList == null || passBackList.size() == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tDFP_requests = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tDFP_delivered = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tDFP_passback = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerRequests = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerDelivered = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerPassbacks = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceRequests = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceDelivered = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariancePassbacks = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tDFP_delivered = DFP_requests - DFP_passback;\n\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerPassbacks = demandPartnerRequests - demandPartnerDelivered;\n\t\t\t\t\t\t\t\t\t\t\t\tif(DFP_requests != 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceRequests = Double.valueOf((demandPartnerRequests - DFP_requests)*100)/DFP_requests;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif(DFP_delivered != 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceDelivered = Double.valueOf((demandPartnerDelivered - DFP_delivered)*100)/DFP_delivered;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif(DFP_passback != 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariancePassbacks = Double.valueOf((demandPartnerPassbacks - DFP_passback)*100)/DFP_passback;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif(DFP_requests == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tDFP_delivered = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceRequests = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceDelivered = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif(demandPartnerRequests == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerPassbacks = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceRequests = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariancePassbacks = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tReconciliationDataDTO dto = new ReconciliationDataDTO();\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setChannelName(channel);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setFormattedDate(DateUtil.getFormatedStringDateYYYYMMDD(date));\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDFP_requests(DFP_requests);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDFP_delivered(DFP_delivered);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDFP_passback(DFP_passback);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDemandPartnerRequests(demandPartnerRequests);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDemandPartnerDelivered(demandPartnerDelivered);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDemandPartnerPassbacks(demandPartnerPassbacks);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setVarianceRequests(varianceRequests);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setVarianceDelivered(varianceDelivered);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setVariancePassbacks(variancePassbacks);\n\t\t\t\t\t\t\t\t\t\t\t\ttempReconciliationDetailsDataList.add(dto);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\ttempSubList = reconciliationDataDTOList.subList(tempCount, reconciliationDataDTOList.size()-1);\n\t\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\ttempCount++;\n\t\t\t\t\t\t\t\t\t\t\t// calculate Data\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tif(reconciliationDataDTO.getDataSource().trim().equalsIgnoreCase(LinMobileConstants.DFP_DATA_SOURCE) && reconciliationDataDTO.getChannelName().trim().equals(channel)) {\n\t\t\t\t\t\t\t\t\t\t\t\tDFP_requests = DFP_requests + reconciliationDataDTO.getRequests();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif(reconciliationDataDTO.getDataSource().trim().equalsIgnoreCase(LinMobileConstants.DFP_DATA_SOURCE) && passBackList.contains(reconciliationDataDTO.getSiteType().trim())) {\n\t\t\t\t\t\t\t\t\t\t\t\tDFP_passback = DFP_passback + reconciliationDataDTO.getDelivered();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif(reconciliationDataDTO.getDataSource().trim().equals(channelDataSource) && reconciliationDataDTO.getChannelName().trim().equals(channel)) {\n\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerRequests = demandPartnerRequests + reconciliationDataDTO.getRequests();\n\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerDelivered = demandPartnerDelivered + reconciliationDataDTO.getDelivered();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tif(tempCount == reconciliationDataDTOList.size()-1) {\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif(passBackList == null || passBackList.size() == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tDFP_requests = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tDFP_delivered = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tDFP_passback = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerRequests = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerDelivered = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerPassbacks = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceRequests = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceDelivered = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariancePassbacks = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tDFP_delivered = DFP_requests - DFP_passback;\n\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerPassbacks = demandPartnerRequests - demandPartnerDelivered;\n\t\t\t\t\t\t\t\t\t\t\t\tif(DFP_requests != 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceRequests = Double.valueOf((demandPartnerRequests - DFP_requests)*100)/DFP_requests;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif(DFP_delivered != 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceDelivered = Double.valueOf((demandPartnerDelivered - DFP_delivered)*100)/DFP_delivered;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif(DFP_passback != 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariancePassbacks = Double.valueOf((demandPartnerPassbacks - DFP_passback)*100)/DFP_passback;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tif(DFP_requests == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tDFP_delivered = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceRequests = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceDelivered = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tif(demandPartnerRequests == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tdemandPartnerPassbacks = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvarianceRequests = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariancePassbacks = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tReconciliationDataDTO dto = new ReconciliationDataDTO();\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setChannelName(channel);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setFormattedDate(DateUtil.getFormatedStringDateYYYYMMDD(date));\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDFP_requests(DFP_requests);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDFP_delivered(DFP_delivered);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDFP_passback(DFP_passback);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDemandPartnerRequests(demandPartnerRequests);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDemandPartnerDelivered(demandPartnerDelivered);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setDemandPartnerPassbacks(demandPartnerPassbacks);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setVarianceRequests(varianceRequests);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setVarianceDelivered(varianceDelivered);\n\t\t\t\t\t\t\t\t\t\t\t\tdto.setVariancePassbacks(variancePassbacks);\n\t\t\t\t\t\t\t\t\t\t\t\ttempReconciliationDetailsDataList.add(dto);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\ttempSubList = reconciliationDataDTOList.subList(tempCount, reconciliationDataDTOList.size()-1);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treconciliationDetailsDataList.addAll(tempReconciliationDetailsDataList);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// create summary data\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tList tempReconciliationSummaryDataList = createSummaryData(tempReconciliationDetailsDataList, channel, passBackList);\n\t\t\t\t\t\t\t\tif(tempReconciliationSummaryDataList !=null && tempReconciliationSummaryDataList.size() > 0) {\n\t\t\t\t\t\t\t\t\treconciliationSummaryDataList.addAll(tempReconciliationSummaryDataList);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\t public List loadCampaignTraffickingData(DfpServices dfpServices,DfpSession session,String lowerDate, String upperDate,long userId)throws Exception\n\t {\n\t\t log.info(\"inside loadCampaignTraffickingData() of LinMobileBusinessService class\");\n\t\t LineItemServiceInterface lineItemService = dfpServices.get(session, LineItemServiceInterface.class);\n\t\t List totalLineItemDTOList=new ArrayList();\n\t\t List lineItemList=new ArrayList();\n\t\t Statement lineItemStatement=new Statement();\n\t\t LineItemPage page = null;\n\t\t String query = \"\";\n\t\t /*Getting DELIVERING lineitems*/\n\t\t try\n\t\t {\n\t\t\t List deliveringCampaignList = MemcacheUtil.getDeliveringCampaignList(lowerDate,upperDate);\n\t\t\t if(deliveringCampaignList == null || deliveringCampaignList.size() <= 0)\n\t\t\t {\n\t\t\t query=\"WHERE status = '\"+ComputedStatus.DELIVERING+\"' AND targetPlatform = '\"+TargetPlatform.MOBILE+\"' AND startDateTime = '\"+lowerDate+\"' AND endDateTime = '\"+upperDate+\"'\"; \n\t\t\t log.info(\"loadCampaignTraffickingData Query 1 (DELIVERING): \"+query); \n\t\t\t \n\t\t\t lineItemStatement.setQuery(query);\n\t\t\t \n\t\t\t int j=0;\n\t\t\t do{\n\t\t\t page=lineItemService.getLineItemsByStatement(lineItemStatement);\n\t\t\t List result = page.getResults();\n\t\t\t if(result !=null && result.size()>0)\n\t\t\t {\n\t\t\t \t deliveringCampaignList = getLineItemDTOList(result);\n\t\t\t \t log.info(\"Delivering Campaigns = \"+deliveringCampaignList.size());\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t \t log.warning(\"No line items found for query (DELIVERING):\"+query);\n\t\t\t }\n\t\t\t \t}while(page.getResults()== null && j<=3);\n\t\t\t \n\t\t\t MemcacheUtil.setDeliveringCampaignList(deliveringCampaignList,lowerDate,upperDate);\n\t\t \n\t\t }\n\t\t\t \n\t\t if(deliveringCampaignList != null && deliveringCampaignList.size() > 0)\n\t\t {\n\t \ttotalLineItemDTOList.addAll(deliveringCampaignList);\n\t\t }\n\t }catch(Exception e)\n\t {\n\t\t\t\t log.severe(\"exception in loadCampaignTraffickingData LinMobileBusinessService (DELIVERING): \"+e.getMessage());\n\t\t\t\t \n\t } \n \n\t\t \n\t\t /*Getting READY lineitems*/\n\t\t try\n\t\t {\n\t\t\t List readyCampaignList = MemcacheUtil.getReadyCampaignList();\n\t\t\t if(readyCampaignList == null || readyCampaignList.size() <= 0)\n\t\t\t {\n\t\t query=\"WHERE status = '\"+ComputedStatus.READY+\"' AND targetPlatform = '\"+TargetPlatform.MOBILE+\"'\"; \n\t\t\t\tlog.info(\"loadCampaignTraffickingData Query 2 (READY): \"+query); \n\t\t\t\tlineItemStatement.setQuery(query);\n\t\t\t\t\n\t\t\t\tint j=0;\n\t\t\tdo{\n\t\t\t\tpage=lineItemService.getLineItemsByStatement(lineItemStatement);\n\t\t\t\tList result = page.getResults();\n\t\t if(result !=null && result.size()>0)\n\t\t {\n\t\t \treadyCampaignList = getLineItemDTOList(result);\n\t\t \tlog.info(\"Ready Campaigns = \"+readyCampaignList.size());\n\t\t }\n\t\t else\n\t\t {\n\t\t \t \tlog.warning(\"No line items found for quer (READY): \"+query);\n\t\t }\n\t\t\t}while(page.getResults()== null && j<=3);\n\t\t\t\n\t\t\tMemcacheUtil.setReadyCampaignList(readyCampaignList);\n\t\t\t}\n\t\t \n\t\t if(readyCampaignList != null && readyCampaignList.size() > 0)\n\t\t {\n\t \t\ttotalLineItemDTOList.addAll(readyCampaignList);\n\t\t }\n\t\t\t \n\t\t}catch(Exception e)\n\t\t{\n\t\t\t log.severe(\"exception in loadCampaignTraffickingData LinMobileBusinessService (READY): \"+e.getMessage());\n\t\t\t \n\t\t} \n \n\t\t\n\t\t/*Getting DRAFTS & NEEDS_CREATIVES lineitems*/\n \t try\n\t {\n \t\tList draftAndNeedCreativesCampaignList = MemcacheUtil.getDraftAndNeedCreativesCampaignList();\n\t\t if(draftAndNeedCreativesCampaignList == null || draftAndNeedCreativesCampaignList.size() <= 0)\n\t\t {\n query=\"WHERE ( status = '\"+ComputedStatus.DRAFT+\"' \" +\n\t\t\t\"or status = '\"+ComputedStatus.NEEDS_CREATIVES+\"'\" +\n\t\t\t\")\" +\n\t\t\t\" AND targetPlatform = '\"+TargetPlatform.MOBILE+\"'\"; \n\t\t log.info(\"loadCampaignTraffickingData Query 3 (DRAFT & NEEDS_CREATIVES):\"+query);\n\t\t lineItemStatement.setQuery(query);\n\t\t \n\t\tint j=0;\n\t\tdo{\n\t page=lineItemService.getLineItemsByStatement(lineItemStatement);\n\t List result = page.getResults();\n\t if(result !=null && result.size()>0)\n\t {\n\t \tdraftAndNeedCreativesCampaignList = getLineItemDTOList(result);\n\t \tlog.info(\"Draft and Need Creatives Campaigns = \"+draftAndNeedCreativesCampaignList.size());\n\t }\n\t else\n\t {\n\t \t log.warning(\"No line items found for query (DRAFT & NEEDS_CREATIVES): \"+query);\n\t }\n\t\n\t\t}while(page.getResults()== null && j<=3); \n\t\t\n\t\tMemcacheUtil.setDraftAndNeedCreativesCampaignList(draftAndNeedCreativesCampaignList);\n\t\t}\n\t\t \n\t if(draftAndNeedCreativesCampaignList != null && draftAndNeedCreativesCampaignList.size() > 0)\n\t {\n \t\ttotalLineItemDTOList.addAll(draftAndNeedCreativesCampaignList);\n\t }\n\t }catch(Exception e)\n\t {\n\t\t\t\t log.severe(\"exception in loadCampaignTraffickingData RichMediaAdvertiserService (DRAFT & NEEDS_CREATIVES): \"+e.getMessage());\n\t\t\t\t \n\t } \n \n\t \n\t \n\t /*Getting PAUSED & PAUSED_INVENTORY_RELEASED lineitems*/\n \t try\n\t { \n \t\tList pausedAndInventoryReleasedCampaignList = MemcacheUtil.getPausedAndInventoryReleasedCampaignList();\n\t\tif(pausedAndInventoryReleasedCampaignList == null || pausedAndInventoryReleasedCampaignList.size() <= 0)\n\t\t{\n\t\t query=\"WHERE (\" +\n\t\t\t\"status = '\"+ComputedStatus.PAUSED+\"' \" +\n\t\t\t\"or status = '\"+ComputedStatus.PAUSED_INVENTORY_RELEASED+\"' \" +\n\t\t\t\") \" +\n\t\t\t\"AND targetPlatform = '\"+TargetPlatform.MOBILE+\"'\"; \n\t\t log.info(\"loadCampaignTraffickingData Query 4 (PAUSED & PAUSED_INVENTORY_RELEASED): \"+query); \n\t\t lineItemStatement.setQuery(query);\n\t\t int j=0;\n\t\t do{\n\t page=lineItemService.getLineItemsByStatement(lineItemStatement);\n\t List result = page.getResults();\n\t if(result != null && result.size() > 0)\n\t {\n\t \t pausedAndInventoryReleasedCampaignList = getLineItemDTOList(result);\n\t \t log.info(\"Paused And Inventory Released Campaigns = \"+pausedAndInventoryReleasedCampaignList.size());\n\t }\n\t else\n\t {\n\t \t log.warning(\"No line items found for query 5 (PAUSED & PAUSED_INVENTORY_RELEASED):\"+query);\n\t }\n\t\t }while(page.getResults()== null && j<=3);\n\t\t \n\t\tMemcacheUtil.setPausedAndInventoryReleasedCampaignList(pausedAndInventoryReleasedCampaignList);\n\t\t}\n\t\t\n\t\tif(pausedAndInventoryReleasedCampaignList != null && pausedAndInventoryReleasedCampaignList.size() > 0)\n \t{\n \t\ttotalLineItemDTOList.addAll(pausedAndInventoryReleasedCampaignList);\n \t}\n\t }catch(Exception e)\n\t {\n\t\t\t\t log.severe(\"exception in loadCampaignTraffickingData LinMobileBusinessService (PAUSED & PAUSED_INVENTORY_RELEASED): \"+e.getMessage());\n\t\t\t\t \n\t }\n\n\t \n\t \n\t /*Getting PENDING_APPROVAL lineitems*/\n \t try\n\t\t { \n \t\t List pendingApprovalCampaignList = MemcacheUtil.getPendingApprovalCampaignList();\n \t\t if(pendingApprovalCampaignList == null || pendingApprovalCampaignList.size() <= 0)\n \t\t {\n query=\"WHERE status = '\"+ComputedStatus.PENDING_APPROVAL+\"' AND targetPlatform = '\"+TargetPlatform.MOBILE+\"'\"; \n\n\t\t log.info(\"loadCampaignTraffickingData Query 6 (PENDING_APPROVAL): \"+query); \n\t\t lineItemStatement.setQuery(query);\n\t\tint j=0;\n\t\tdo{ \n\t page=lineItemService.getLineItemsByStatement(lineItemStatement);\n\t List result = page.getResults();\n\t if(result !=null && result.size()>0)\n\t {\n\t \tpendingApprovalCampaignList = getLineItemDTOList(result);\n\t \tlog.info(\"Pending Approval Campaigns = \"+pendingApprovalCampaignList.size());\n\t }\n\t else\n\t {\n\t \t log.warning(\"No line items found for query (PENDING_APPROVAL) :\"+query);\n\t }\n }while(page.getResults()== null && j<=3);\n\t\tMemcacheUtil.setPendingApprovalCampaignList(pendingApprovalCampaignList);\n \t}\n \t\t \n \tif(pendingApprovalCampaignList != null && pendingApprovalCampaignList.size() > 0)\n \t{\n \t\ttotalLineItemDTOList.addAll(pendingApprovalCampaignList);\n \t}\n\t\t}catch(Exception e)\n\t\t{\n\t\t\t log.severe(\"exception in loadCampaignTraffickingData LinMobileBusinessService (PENDING_APPROVAL): \"+e.getMessage());\n\t\t\t \n\t\t} \n\n\t\treturn totalLineItemDTOList;\n\t }\n\t \n\t private List getLineItemDTOList(List lineItemList)\n\t {\n\t\t List list = new ArrayList();\n\t\t try{\n\t \n\t if(lineItemList!=null && lineItemList.size()>0){\n\n\t\t Iterator iterator = lineItemList.iterator();\n\t\t while(iterator.hasNext())\n\t\t {\n\t\t\t LineItem lineItemObj = iterator.next();\n\t\t\t if(!lineItemObj.isIsArchived()){\n\t\t\t LineItemDTO lineItem= new LineItemDTO();\n\t\t\t lineItem.setLineItemId(lineItemObj.getId());\n\t\t\t lineItem.setStatus(lineItemObj.getStatus().toString());\n\t\t\t lineItem.setName(lineItemObj.getName());\n\t\t\t lineItem.setGoalQuantity(lineItemObj.getUnitsBought());\n\t\t\t \n\t\t\t Money money = lineItemObj.getCostPerUnit();\n\t\t\t lineItem.setCpm(money.getMicroAmount() / 1000000);\n\t\t\t \n\t\t\t if (lineItemObj.getStartDateTime()!= null){\n\t\t\t\t com.google.api.ads.dfp.jaxws.v201403.Date startDateTime = lineItemObj.getStartDateTime().getDate();\n\t\t\t\t lineItem.setStartDateTime(startDateTime.getMonth()+\"/\"+startDateTime.getDay()+\"/\"+startDateTime.getYear());\n\t\t\t }\n\t\t\t else{\n\t\t\t \t \n\t\t\t \t lineItem.setStartDateTime(null);\n\t\t\t }\n\t\t\t \n\t\t\t \n\t\t\t \n\t\t\t if (lineItemObj.getEndDateTime()!= null){\n\t\t\t\t com.google.api.ads.dfp.jaxws.v201403.Date endDateTime = lineItemObj.getEndDateTime().getDate();\n\t\t\t\t lineItem.setEndDateTime(endDateTime.getMonth()+\"/\"+endDateTime.getDay()+\"/\"+endDateTime.getYear());\n\t\t\t }\n\t\t\t else{\n\t\t\t \t \n\t\t\t \t lineItem.setEndDateTime(null);\n\t\t\t }\n\t\t\t \n\t\t\t list.add(lineItem);\n\t\t\t }//end of if\n\t\t }//end of while\n\t\t \n\t }\n\t \n\t\t\t}catch(Exception e)\n\t\t\t{\n\t\t\t\t\t log.severe(\"exception in loadCampaignTraffickingData LinMobileBusinessService : \"+e.getMessage());\n\t\t\t\t\t \n\t\t\t}\n\t\t\t \n\t\t\treturn list;\n\t }\n\t \n\t \n\t public List getLineItemForcasts(DfpServices dfpServices,DfpSession session,String[] lineItemIds){\n\t \tlog.info(\"inside getLineItemForcasts of LinMobile Business Service\");\n\t \tList forcastLineItemDTOList = new ArrayList();\n\t \tlong deliveredImpressions = 0;\n\t \tlong bookedImpressions = 0;\n\t \tlong impressionsToBeDelivered = 0;\n\t \tLineItemServiceInterface lineItemService = null;\n\t \tForecastServiceInterface forecastService = null;\n\t \t\n\t \ttry\n\t \t{\n\t \t\tint j=0;\n\t \t\tdo{\n\t \t\t\tlineItemService = dfpServices.get(session, LineItemServiceInterface.class);\n\t \t\t}while(lineItemService == null && j < 3);\n\t \t}catch(Exception e)\n\t \t{\n\t \t\t\n\t \t}\n\t \ttry{\n\t \t\tint k=0;\n\t \t\tdo{\n\t \t\t\tforecastService = dfpServices.get(session, ForecastServiceInterface.class);\n\t \t\t}while(forecastService == null && k < 3);\n\t \t}catch(Exception e){\n\t \t\t\n\t \t}\n\t \t\n\t \t\n\t \t\tfor(String id : lineItemIds){\n\t\t \t\tlog.info(\"IDs = \"+id);\n\t\t \t\tForcastLineItemDTO forcastLineItemDTO = new ForcastLineItemDTO();\n\t\t \t\t\n\t\t \t\tLineItem lineItem =null;\n\t\t \t\ttry{\n\t\t \t\t\t\n\t\t \t\t StatementBuilder statementBuilder = new StatementBuilder()\n\t\t \t\t\t .where(\" id = :id\")\t\t \t\t\t \n\t\t \t\t\t .withBindVariableValue(\"id\",Long.valueOf(id)); \n\t\t \t\t \n\t\t\t \t\tLineItemPage lineItemPage = lineItemService.getLineItemsByStatement(statementBuilder.toStatement());\n\t\t\t \t\t\n\t\t\t \t\tif(lineItemPage != null && lineItemPage.getResults().size()>0){\n\t\t\t \t\t\tList lineItemList=lineItemPage.getResults();\n\t\t\t \t\t\tlineItem=lineItemList.get(0);\n\t\t\t \t\t\t\n\t\t\t\t \t\tif(lineItem.getStats()!=null){\n\t\t\t\t \t\t\tif(lineItem.getStats().getImpressionsDelivered().toString()!=null){\n\t\t\t\t \t\t\t\tdeliveredImpressions = lineItem.getStats().getImpressionsDelivered();\n\t\t\t\t \t\t\t}\n\t\t\t\t \t }\n\t\t\t\t \t\tif(lineItem.getUnitsBought()!=0){\n\t\t\t\t \t\t\tbookedImpressions = lineItem.getUnitsBought();\n\t\t\t\t \t\t\tforcastLineItemDTO.setBookedImpressions(String.valueOf(lineItem.getUnitsBought()));\n\t\t\t\t \t }\n\t\t\t\t \t\t\n\t\t\t\t \t\tif(deliveredImpressions>=0 && bookedImpressions>=0 ){\n\t\t\t\t \t\t\timpressionsToBeDelivered = bookedImpressions - deliveredImpressions;\n\t\t\t\t \t\t}\n\t\t\t\t \t\t if(lineItem.getCostPerUnit().toString()!=null){\n\t\t\t\t \t\t double costPerUnit = ((double) lineItem.getCostPerUnit()\n\t\t\t\t \t\t\t\t\t\t.getMicroAmount() / 1000000);\n\t\t\t\t \t\tforcastLineItemDTO.setECPM(String.valueOf(costPerUnit));\n\t\t\t\t \t }\n\t\t\t\t \t\t \n\t\t\t\t \t\t if(lineItem.getName()!=null && !lineItem.getName().equals(\"\")){\n\t\t\t\t \t\t\t forcastLineItemDTO.setLineItem(lineItem.getName());\n\t\t\t\t \t\t }\n\t\t\t\t \t\t \n\t\t\t\t \t\t if(lineItem!=null && lineItem.getStartDateTime().toString()!=null){\n\t\t\t\t \t\t\t forcastLineItemDTO.setStartDate(getCustomDate(lineItem.getStartDateTime()));\n\t\t\t\t\t }\n\t\t\t\t \t\t \n\t\t\t\t \t\t if(lineItem!=null && lineItem.getEndDateTime().toString()!=null){\n\t\t\t\t \t\t\t forcastLineItemDTO.setEndDate(getCustomDate(lineItem.getEndDateTime()));\n\t\t\t\t\t }\n\t\t\t }\n\t\t\t \t\telse\n\t\t\t \t\t{\n\t\t\t \t\t\tlog.info(\"FOUND NULL from lineItemService.getLineItem(Long.valueOf(id))\");\n\t\t\t \t\t}\n\t\t \t\t}catch(Exception e)\n\t\t \t\t{\n\t\t \t\t\tlog.info(\"1. UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED Exception found\");\n\t\t \t\t}\n\t\t \t\t\n\t\t log.info(\"Before getting lineitem forcast data\");\n\t\t \n\t\t Forecast forecast = null;\n\t\t \n\t\t try{\n\t\t \t\t\tforecast = forecastService.getForecastById(Long.valueOf(id));\n\t\t\t \t \n\t\t\t if(forecast!=null)\n\t\t\t {\n\t\t\t \t if(forecast.getId()!=null)\n\t\t\t \t {\n\t\t\t \t\t forcastLineItemDTO.setLineItemId(forecast.getId());\n\t\t\t \t\t log.info(forecast.getId().toString());\n\t\t\t \t }\n\t\t\t \t if(forecast.getAvailableUnits()!=null)\n\t\t\t \t {\n\t\t\t \t\t forcastLineItemDTO.setAvailableUnit(forecast.getAvailableUnits());\n\t\t\t \t\t log.info(\"AvailableUnits : \"+forecast.getAvailableUnits().toString());\n\t\t\t \t }\n\t\t\t \t if(forecast.getDeliveredUnits()!=null)\n\t\t\t \t {\n\t\t\t \t\t forcastLineItemDTO.setDeliveredUnit((forecast.getDeliveredUnits()));\n\t\t\t \t\t log.info(\"DeliveredUnits : \"+forecast.getDeliveredUnits().toString());\n\t\t\t \t }\n\t\t\t \t if(forecast.getMatchedUnits()!=null)\n\t\t\t \t {\n\t\t\t \t\t forcastLineItemDTO.setMatchedUnit(forecast.getMatchedUnits());\n\t\t\t \t\t log.info(\"MatchedUnits : \"+forecast.getMatchedUnits().toString());\n\t\t\t \t }\n\t\t\t \t if(forecast.getPossibleUnits()!=null)\n\t\t\t \t {\n\t\t\t \t\t forcastLineItemDTO.setPossibleUnit(forecast.getPossibleUnits());\n\t\t\t \t\t log.info(\"PossibleUnits : \"+forecast.getPossibleUnits().toString());\n\t\t\t \t }\n\t\t\t \t if(forcastLineItemDTO.getAvailableUnit()!=null && impressionsToBeDelivered>=0 )\n\t\t\t \t {\n\t\t\t \t\t if(forcastLineItemDTO.getAvailableUnit()>=impressionsToBeDelivered)\n\t\t\t \t\t {\n\t\t\t \t\t\t forcastLineItemDTO.setStatus(true);\n\t\t\t \t\t }\n\t\t\t \t }\n\t\t\t \t else\n\t\t\t \t {\n\t\t\t \t\t forcastLineItemDTO.setStatus(false);\n\t\t\t \t }\n\t\t\t \t forcastLineItemDTO.setArchived(\"no\"); \n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t \t\t\tlog.info(\"FOUND NULL from forecastService.getForecastById(Long.valueOf(id))\");\n\t\t\t }\n\t\t }catch(Exception e)\n\t\t {\n\t\t \tforcastLineItemDTO.setDeliveredUnit(impressionsToBeDelivered);\n\t\t \tforcastLineItemDTO.setArchived(\"yes\");\n\t\t \tlog.info(\"2. UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED Exception found\");\n\t\t }\n\t\t\t \n\t\t\t forcastLineItemDTOList.add(forcastLineItemDTO);\n\t \t\t}\n\t \t\t\n\t \t\tlineItemService = null;\n\t \t\tforecastService = null;\n\t \t\n\t \tlog.info(\"forcastLineItemDTOList.size() = \"+forcastLineItemDTOList.size());\n\t \t\n\t\t\treturn forcastLineItemDTOList;\n\t }\n\t \n\t \n\t\tpublic static String getCustomDate(DateTime dfpDateTime) {\n\t\t\tString customDateStr = \"\";\n\t\t\tif (dfpDateTime != null) {\n\t\t\t\tCalendar calendar = Calendar.getInstance();\n\t\t\t\tcalendar.clear();\n\t\t\t\tcalendar.set(Calendar.YEAR, dfpDateTime.getDate().getYear());\n\t\t\t\tcalendar.set(Calendar.MONTH, dfpDateTime.getDate().getMonth() - 1);\n\t\t\t\tcalendar.set(Calendar.DAY_OF_MONTH, dfpDateTime.getDate().getDay());\n\t\t\t\t//calendar.set(Calendar.HOUR, dfpDateTime.getHour());\n\t\t\t\t//calendar.set(Calendar.MINUTE, dfpDateTime.getMinute());\n\t\t\t\t//calendar.set(Calendar.SECOND, dfpDateTime.getSecond());\n\t\t\t\t//calendar.setTimeZone(TimeZone.getTimeZone(dfpDateTime\n\t\t\t\t//\t\t.getTimeZoneID()));\n\t\t\t\tjava.util.Date customDate = calendar.getTime();\n\t\t\t\tcustomDateStr = DateUtil.getFormatedDate(customDate,\n\t\t\t\t\t\t\"yyyy-MM-dd\");\n\t\t\t}else{\n\t\t\t\tcustomDateStr=\"NULL\";\n\t\t\t}\n\t\t\treturn customDateStr;\n\t\t}\n\t\t\n\t\tpublic PublisherPropertiesObj copyObject(PublisherPropertiesObj sourceObj){\n\t\t\tPublisherPropertiesObj destinationObj=new PublisherPropertiesObj(sourceObj.getChannelName(),\n\t\t\t\t\tsourceObj.getName(), sourceObj.geteCPM(), sourceObj.getImpressionsDelivered(),\n\t\t\t\t\tsourceObj.getClicks(),sourceObj.getTotalImpressionsDeliveredBySiteName(),\n\t\t\t\t\tsourceObj.getPayout(), sourceObj.getStateName(), sourceObj.getSite(),\n\t\t\t\t\tsourceObj.getDFPPayout());\n\t\t\tdestinationObj.setDataSource(sourceObj.getDataSource());\n\t\t\tdestinationObj.setTotalImpressionsDeliveredByChannelName(sourceObj.getTotalImpressionsDeliveredByChannelName());\n\t\t\tdestinationObj.setLatitude(sourceObj.getLatitude());\n\t\t\tdestinationObj.setLongitude(sourceObj.getLongitude());\n\t\t\tdestinationObj.setClicks(sourceObj.getClicks());\n\t\t\treturn destinationObj;\n\t\t}\n\t\t\n\t\tpublic Map> loadCampainTotalDataPublisherViewList(String lowerDate,String upperDate,String publisherName,String advertiser, String agency, String properties)\n\t\t{\n\t\t\tMap> campainTotalDataPublisherMap = new HashMap>();\n\t\t\tMap calculatedLineItemMap = new HashMap();\n\t\t\t//Map nonDFPObjectMap = new HashMap();\n\t\t\tList list = new ArrayList();\n\t\t\tList lineItemCalculatedList = new ArrayList();\n\t\t\t//AdvertiserDAO advDAO=new AdvertiserDAO();\n\t\t\t\n\t\t\tString replaceStr = \"\\\\\\\\'\";\n\t\t\tif(advertiser != null && !advertiser.trim().equalsIgnoreCase(\"\")) {\n\t\t\t\tadvertiser = advertiser.replaceAll(\"'\", replaceStr);\n\t\t\t}else {\n\t\t\t\tadvertiser = \"\";\n\t\t\t}\n\t\t\tif(agency != null && !agency.trim().equalsIgnoreCase(\"\")) {\n\t\t\t\tagency = agency.replaceAll(\"'\", replaceStr);\t\t\n\t\t\t}else {\n\t\t\t\tagency = \"\";\n\t\t\t}\n\t\t\t\n\t\t\tif(lowerDate == null && upperDate== null)\n\t\t\t{\n\t\t\tString monthToDateEnd=DateUtil.getCurrentTimeStamp(\"yyyy-MM-dd\");\n\t\t\tString[] dayArray=monthToDateEnd.split(\"-\");\n\t\t\tint year=Integer.parseInt(dayArray[0]);\n\t\t\tint month=Integer.parseInt(dayArray[1])-1; // subtract 1 from day String as day starts from 0 to 11 in Calender class\n\t\t\tString monthToDateStart=DateUtil.getDateByYearMonthDays(year,month,1,\"yyyy-MM-dd\");\n\t\t\t\n\t\t\tlowerDate = monthToDateStart;\n\t\t\tupperDate = monthToDateEnd;\n\t\t\t}\n\t\t\t\n\t\t\t//list = advDAO.loadAdvertiserTotalDataList(lowerDate, upperDate, publisherName,advertiser,agency,properties);\n\t\t\t\n\t\t\t\n\t\t\tlist = MemcacheUtil.getPublisherCampaignTotalDataList(lowerDate, upperDate, publisherName,advertiser,agency,properties);\n\t\t\tif(list == null || list.size() <= 0)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t LinMobileDAO pubDAO=new LinMobileDAO();\n\t\t\t\t list = pubDAO.loadCampainTotalDataPublisherViewList(lowerDate, upperDate, publisherName,advertiser,agency,properties);\n\t\t\t\t MemcacheUtil.setPublisherCampaignTotalDataList(lineItemCalculatedList,lowerDate, upperDate, publisherName,advertiser,agency,properties);\n\t\t\t\t}catch (Exception e) {\n\t\t\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Advertiser Total Data found from memcache:\");\n\t\t }\n\t\t\ttry{\n\t\t\t\tif(list!=null && list.size()>0){\n\t\t\t\t\tcampainTotalDataPublisherMap.put(\"campainTotal\",list);\n\t\t\t\t\tfor (AdvertiserPerformerDTO advertiserPerformerDTO : list) {\n\t\t\t\t\t\tif(!calculatedLineItemMap.containsKey(advertiserPerformerDTO.getCampaignLineItem())){\n\t\t\t\t\t\t\tadvertiserPerformerDTO.setLineItemCountFlag(1);\n\t\t\t\t\t\t\tcalculatedLineItemMap.put(advertiserPerformerDTO.getCampaignLineItem(), advertiserPerformerDTO);\n\t\t\t\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tlong impressions = 0;\n\t\t\t\t\t\tlong clicks = 0;\n\t\t\t\t\t\tlong bookedImpressions = 0;\n\t\t\t\t\t\tdouble ctr = 0.0;\n\t\t\t\t\t\tint lineItemCountFlag = 0;\n\t\t\t\t\t\tdouble deliveryIndicator = 0.0;\n\t\t\t\t\t\tdouble revenue = 0.0;\n\t\t\t\t\t\tAdvertiserPerformerDTO advertiserObj = copyObject(calculatedLineItemMap.get(advertiserPerformerDTO.getCampaignLineItem()));\n\t\t\t\t\t\tlineItemCountFlag = advertiserObj.getLineItemCountFlag() + 1;\n\t\t\t\t\t\tif(lineItemCountFlag!=0){\n\t\t\t\t\t\t\tdeliveryIndicator = (advertiserPerformerDTO.getDeliveryIndicator()+advertiserObj.getDeliveryIndicator())/lineItemCountFlag;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tadvertiserObj.setLineItemCountFlag(lineItemCountFlag);\n\t\t\t\t\t\timpressions = advertiserPerformerDTO.getImpressionDelivered() + advertiserObj.getImpressionDelivered();\n\t\t\t\t\t\tclicks = advertiserPerformerDTO.getClicks() + advertiserObj.getClicks();\n\t\t\t\t\t\tbookedImpressions = advertiserPerformerDTO.getBookedImpressions() + advertiserObj.getBookedImpressions();\n\t\t\t\t\t\tif(impressions!=0){\n\t\t\t\t\t\t\tctr = Double.valueOf(clicks*100)/impressions;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\trevenue = advertiserPerformerDTO.getRevenueDeliverd()+ advertiserObj.getRevenueDeliverd();\n\t\t\t\t\t\tadvertiserObj.setImpressionDelivered(impressions);\n\t\t\t\t\t\tadvertiserObj.setClicks(clicks);\n\t\t\t\t\t\tadvertiserObj.setCTR(ctr);\n\t\t\t\t\t\tadvertiserObj.setBookedImpressions(bookedImpressions);\n\t\t\t\t\t\tadvertiserObj.setDeliveryIndicator(deliveryIndicator);\n\t\t\t\t\t\tadvertiserObj.setRevenueDeliverd(revenue);\n\t\t\t\t\t\tcalculatedLineItemMap.put(advertiserObj.getCampaignLineItem(), advertiserObj);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tIterator iterator = calculatedLineItemMap.entrySet().iterator();\n\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\tMap.Entry mapEntry = (Map.Entry) iterator.next();\n\t\t\t\t\tlineItemCalculatedList.add((AdvertiserPerformerDTO) mapEntry.getValue());\n\t\t\t}\n\t\t\t\tcampainTotalDataPublisherMap.put(\"lineItemCalculated\",lineItemCalculatedList);\t\n\t\t\t\t\n\t\t\t}catch(Exception e){\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn campainTotalDataPublisherMap;\n\t\t}\n\t\t\n\t\tpublic List loadCampainPerformanceDeliveryIndicatorData(String lowerDate,String upperDate,String publisherName,String advertiser, String agency, String properties)\n\t\t{\n\t\t\tList list = new ArrayList();\n\t\t\tString replaceStr = \"\\\\\\\\'\";\n\t\t\tif(advertiser != null && !advertiser.trim().equalsIgnoreCase(\"\")) {\n\t\t\t\tadvertiser = advertiser.replaceAll(\"'\", replaceStr);\n\t\t\t}else {\n\t\t\t\tadvertiser = \"\";\n\t\t\t}\n\t\t\tif(agency != null && !agency.trim().equalsIgnoreCase(\"\")) {\n\t\t\t\tagency = agency.replaceAll(\"'\", replaceStr);\t\t\n\t\t\t}else {\n\t\t\t\tagency = \"\";\n\t\t\t}\n\t\t\t\n\t\t\t//list = advDAO.loadDeliveryIndicatorData(lowerDate, upperDate, publisherName, advertiser, agency, properties);\n\t\t\t\n\t\t\t//list = MemcacheUtil.getDeliveryIndicatorData(lowerDate, upperDate, publisherName, advertiser, agency, properties);\n\t\t\tif(list == null || list.size() <= 0)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tLinMobileDAO pubDAO=new LinMobileDAO();\n\t\t\t\tlist = pubDAO.loadCampainPerformanceDeliveryIndicatorData(lowerDate, upperDate, publisherName, advertiser, agency, properties);\n\t\t\t\t//MemcacheUtil.setDeliveryIndicatorData(list,lowerDate, upperDate, publisherName,advertiser,agency,properties);\n\t\t\t\t\n\t\t\t\t}catch (Exception e) {\n\t\t\t\t\tlog.severe(\"DataServiceException :\"+e.getMessage());\n\t\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}else{\n\t\t\t\tlog.info(\"Delivery Indicator Data found from memcache:\");\n\t\t }\n\t\t\t\n\t\t\t\n\t\t\treturn list;\n\t\t}\n\t\t\n\t\tpublic AdvertiserPerformerDTO copyObject(AdvertiserPerformerDTO sourceObj){\n\t\t\tAdvertiserPerformerDTO destinationObj=new AdvertiserPerformerDTO(sourceObj.getCampaignIO(),\n\t\t\t\t\tsourceObj.getLineItemId(), sourceObj.getCampaignLineItem(), sourceObj.getImpressionDelivered(),\n\t\t\t\t\tsourceObj.getClicks(),sourceObj.getCTR(),sourceObj.getRevenueDeliverd(),sourceObj.getAgency(),\n\t\t\t\t\tsourceObj.getAdvertiser(), sourceObj.getCreativeType(), sourceObj.getMarket(),\n\t\t\t\t\tsourceObj.getDeliveryIndicator(),sourceObj.getSite(),sourceObj.getBookedImpressions(),sourceObj.getBudget(),sourceObj.getPublisherName(),sourceObj.getSiteName(),\"\");\n\t\t\t\n\t\t\tdestinationObj.setCampaignLineItem(sourceObj.getCampaignLineItem());\n\t\t\tdestinationObj.setImpressionDelivered(sourceObj.getImpressionDelivered());\n\t\t\tdestinationObj.setClicks(sourceObj.getClicks());\n\t\t\tdestinationObj.setCTR(sourceObj.getCTR());\n\t\t\tdestinationObj.setBookedImpressions(sourceObj.getBookedImpressions());\n\t\t\tdestinationObj.setLineItemCountFlag(sourceObj.getLineItemCountFlag());\n\t\t\tdestinationObj.setRevenueDeliverd((sourceObj.getRevenueDeliverd()));\n\t\t\treturn destinationObj;\n\t\t}\n\t\t\n\t@Override\n\tpublic PublisherReportHeaderDTO getHeaderData(String allChannelName, List currentDateSummaryList, List compareDateSummaryList) {\n\t\tint maxSite = 0;\n\t\tdouble totalECPM = 0.0;\n\t\tlong totalEmpDelivered = 0;\n\t\tlong totalClicks = 0;\n\t\tdouble totalCTR = 0.0;\n\t\tdouble totalRPM = 0.0;\n\t\tdouble totalPayouts = 0.0;\n\t\tlong totalRequests = 0;\n\t\tlong houseImpression = 0;\n\t\tint newFlag = 0;\n\t\tdouble fillPercentage = 0.0;\n\t\tlong allChannelsTotalEmpDelivered = 0;\n\t\tPublisherReportHeaderDTO publisherReportHeaderDTO = new PublisherReportHeaderDTO();\n\t\t\n\t\ttry {\n\t\t\tIUserService service = (IUserService) BusinessServiceLocator.locate(IUserService.class);\n\t\t\tList channelList = service.CommaSeperatedStringToList(allChannelName);\n\t\t\t\n\t\t\tif(channelList != null && channelList.size() > 0 && currentDateSummaryList != null && compareDateSummaryList != null) {\n\t\t\t\tList totalEmpDeliveredCheckList = new ArrayList();\n\t\t\t\t \n\t\t\t for (PublisherSummaryObj dtoObject : currentDateSummaryList) {\n\t\t\t\t newFlag++;\n\t\t\t\t if(channelList.contains(dtoObject.getChannelName().trim())) {\n\t\t\t\t\t if(dtoObject.getChannelName().equals(\"House\")) {\n\t\t\t\t\t\t houseImpression = dtoObject.getImpressionsDelivered();\n\t\t\t\t\t }\n\t\t\t\t\t if(dtoObject.getSite() > maxSite) {\n\t\t\t\t\t\t maxSite = dtoObject.getSite();\n\t\t\t\t\t }\n\t\t\t\t\t totalEmpDelivered = totalEmpDelivered + dtoObject.getImpressionsDelivered();\n\t\t\t\t\t totalClicks = totalClicks + dtoObject.getClicks();\n\t\t\t\t\t totalPayouts = totalPayouts + dtoObject.getPayOuts();\n\t\t\t\t\t totalRequests = totalRequests + dtoObject.getRequests();\n\t\t\t\t }\n\t\t\t\t if(!totalEmpDeliveredCheckList.contains(dtoObject.getChannelName().trim())){\n\t\t\t\t\t totalEmpDeliveredCheckList.add(dtoObject.getChannelName().trim());\n\t\t\t\t\t allChannelsTotalEmpDelivered = allChannelsTotalEmpDelivered + dtoObject.getImpressionsDelivered(); \n\t\t\t\t }\n\t\t\t }\n\t\t\t\t\n\t\t\t totalCTR = ((double)totalClicks / totalEmpDelivered) * 100;\n\t\t\t totalECPM = (totalPayouts / totalEmpDelivered) * 1000;\n\t\t\t \n\t\t\t if(totalRequests != 0) {\n\t\t\t\t totalRPM = (totalPayouts / totalRequests) * 1000;\n\t\t\t }\n\t\t\t \n\t\t\t fillPercentage = ((double)((totalEmpDelivered - houseImpression)* 100) / allChannelsTotalEmpDelivered);\n\t\t\t \n\t\t\t if(newFlag > 0) {\n\t\t\t\t maxSite = 23;\n\t\t\t }\t\n\t\t\t \n\t\t\t publisherReportHeaderDTO.setSite(maxSite);\n\t\t\t publisherReportHeaderDTO.setImpressionsDelivered(totalEmpDelivered);\n\t\t\t publisherReportHeaderDTO.setClicks(totalClicks);\n\t\t\t publisherReportHeaderDTO.setCtrPercentage(totalCTR/100);\n\t\t\t publisherReportHeaderDTO.setEcpm(totalECPM);\n\t\t\t publisherReportHeaderDTO.setRpm(totalRPM);\n\t\t\t publisherReportHeaderDTO.setPayouts(totalPayouts);\n\t\t\t publisherReportHeaderDTO.setFillPercentage(fillPercentage/100);\n\t\t\t\t\t \n\t\t\t}\n\t\t}catch (Exception e) {\n\t\t\tlog.severe(\"Exception in getHeaderData of LinMobileService : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\treturn publisherReportHeaderDTO;\n\t}\n\t\n\t@Override\n\tpublic Map getChannelPerformanceData(String allChannelName, List currentDateSummaryList, List compareDateSummaryList) {\n\t\tdouble totalECPMLast = 0.0;\n\t\tdouble totalPayoutsLast = 0.0;\n\t\tlong totalEmpDeliveredLast = 0;\n\t\tdouble totalECPM = 0.0;\n\t\tlong totalEmpDelivered = 0;\n\t\tlong totalClicks = 0;\n\t\tdouble totalCTR = 0.0;\n\t\tdouble totalPayouts = 0.0;\n\t\tdouble totalChange = 0.0;\n\t\tdouble totalChangePercentage = 0.0;\n\t\t//int flg = 0;\n\t\tMap channelperformanceMap = new HashMap();\n\t\tList pubReportChannelPerformanceDTOList = new ArrayList();\n\t\tList publisherReportComputedValuesDTOList = new ArrayList();\n\t\ttry {\n\t\t\tIUserService service = (IUserService) BusinessServiceLocator.locate(IUserService.class);\n\t\t\tList channelList = service.CommaSeperatedStringToList(allChannelName);\n\t\t\t\n\t\t\tif(channelList != null && channelList.size() > 0 && currentDateSummaryList != null && currentDateSummaryList.size() > 0) {\n\t\t\t\t\n\t\t\t\tfor(PublisherSummaryObj dtoObjectCurrent : currentDateSummaryList) {\n\t\t\t\t\tif(channelList.contains(dtoObjectCurrent.getChannelName().trim())) {\n\t\t\t\t\t\tint matchflag = 0;\n\t\t\t\t\t\tif(compareDateSummaryList.size() > 0) {\n\t\t\t\t\t\t\tint compareDateSummaryLength = compareDateSummaryList.size();\n\t\t\t\t\t\t\tint compareCount = 0;\n\t\t\t\t\t\t\tfor (PublisherSummaryObj dtoObjectCompare : compareDateSummaryList) {\n\t\t\t\t\t\t\t\tif(channelList.contains(dtoObjectCompare.getChannelName().trim())) {\n\t\t\t\t\t\t\t\t\tPublisherReportChannelPerformanceDTO publisherReportChannelPerformanceDTO = new PublisherReportChannelPerformanceDTO();\n\t\t\t\t\t\t\t\t\tif(dtoObjectCurrent.getChannelName().equals(dtoObjectCompare.getChannelName())) { \n\t\t\t\t\t\t\t\t\t\t//flg ++;\n\t\t\t\t\t\t\t\t\t\tdouble CHG = 0;\n\t\t\t\t\t\t\t\t\t\tdouble percentageCHG = 0.0;\n\t\t\t\t\t\t\t\t\t\tmatchflag = 1;\n\t\t\t\t\t\t\t\t\t\tCHG = dtoObjectCurrent.geteCPM() - dtoObjectCompare.geteCPM();\n\t\t\t\t\t\t\t\t\t\tif(dtoObjectCompare.geteCPM() == 0) {\n\t\t\t\t\t\t\t\t\t\t\tpercentageCHG = 0.0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\tpercentageCHG = (CHG / dtoObjectCompare.geteCPM()) * 100;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setSalesChannel(dtoObjectCurrent.getChannelName());\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setEcpm(dtoObjectCurrent.geteCPM());\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setChange(CHG);\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setChangePercentage(percentageCHG/100);\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setImpressionsDelivered(dtoObjectCurrent.getImpressionsDelivered());\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setClicks(dtoObjectCurrent.getClicks());\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setCtrPercentage(dtoObjectCurrent.getCTR()/100);\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setPayouts(dtoObjectCurrent.getPayOuts());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\ttotalPayoutsLast = totalPayoutsLast + dtoObjectCompare.getPayOuts();\n\t\t\t\t\t\t\t\t\t\ttotalEmpDeliveredLast = totalEmpDeliveredLast + dtoObjectCompare.getImpressionsDelivered();\n\t\t\t\t\t\t\t\t\t\ttotalEmpDelivered = totalEmpDelivered + dtoObjectCurrent.getImpressionsDelivered();\n\t\t\t\t\t\t\t\t\t\ttotalClicks = totalClicks + dtoObjectCurrent.getClicks();\n\t\t\t\t\t\t\t\t\t\ttotalPayouts = totalPayouts + dtoObjectCurrent.getPayOuts();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tpubReportChannelPerformanceDTOList.add(publisherReportChannelPerformanceDTO);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}else if(compareDateSummaryLength-1 == compareCount && matchflag == 0) {\n\t\t\t\t\t\t\t\t\t\t//flg ++;\n\t\t\t\t\t\t\t\t\t\tdouble CHG = 0;\n\t\t\t\t\t\t\t\t\t\tdouble percentageCHG = 0.0;\n\t\t\t\t\t\t\t\t\t\tmatchflag = 1;\n\t\t\t\t\t\t\t\t\t\tCHG = dtoObjectCurrent.geteCPM();\n\t\t\t\t\t\t\t\t\t\tpercentageCHG = 0.0;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setSalesChannel(dtoObjectCurrent.getChannelName());\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setEcpm(dtoObjectCurrent.geteCPM());\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setChange(CHG);\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setChangePercentage(percentageCHG/100);\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setImpressionsDelivered(dtoObjectCurrent.getImpressionsDelivered());\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setClicks(dtoObjectCurrent.getClicks());\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setCtrPercentage(dtoObjectCurrent.getCTR()/100);\n\t\t\t\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setPayouts(dtoObjectCurrent.getPayOuts());\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\ttotalEmpDelivered = totalEmpDelivered + dtoObjectCurrent.getImpressionsDelivered();\n\t\t\t\t\t\t\t\t\t\ttotalClicks = totalClicks + dtoObjectCurrent.getClicks();\n\t\t\t\t\t\t\t\t\t\ttotalPayouts = totalPayouts + dtoObjectCurrent.getPayOuts();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tpubReportChannelPerformanceDTOList.add(publisherReportChannelPerformanceDTO);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tcompareCount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tPublisherReportChannelPerformanceDTO publisherReportChannelPerformanceDTO = new PublisherReportChannelPerformanceDTO();\n\t\t\t\t\t\t\t//flg ++;\n\t\t\t\t\t\t\tdouble CHG = 0;\n\t\t\t\t\t\t\tdouble percentageCHG = 0.0;\n\t\t\t\t\t\t\tmatchflag = 1;\n\t\t\t\t\t\t\tCHG = dtoObjectCurrent.geteCPM();\n\t\t\t\t\t\t\tpercentageCHG = 0.0;\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setSalesChannel(dtoObjectCurrent.getChannelName());\n\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setEcpm(dtoObjectCurrent.geteCPM());\n\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setChange(CHG);\n\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setChangePercentage(percentageCHG/100);\n\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setImpressionsDelivered(dtoObjectCurrent.getImpressionsDelivered());\n\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setClicks(dtoObjectCurrent.getClicks());\n\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setCtrPercentage(dtoObjectCurrent.getCTR()/100);\n\t\t\t\t\t\t\tpublisherReportChannelPerformanceDTO.setPayouts(dtoObjectCurrent.getPayOuts());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpubReportChannelPerformanceDTOList.add(publisherReportChannelPerformanceDTO);\n\t\t\t \t \t\t \t\t\n\t\t\t\t\t\t\ttotalEmpDelivered = totalEmpDelivered + dtoObjectCurrent.getImpressionsDelivered();\n\t\t\t\t\t\t\ttotalClicks = totalClicks + dtoObjectCurrent.getClicks();\n\t\t\t\t\t\t\ttotalPayouts = totalPayouts + dtoObjectCurrent.getPayOuts();\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\n\t\t\t\ttotalCTR = (totalClicks / totalEmpDelivered) * 100;\n\t\t\t\ttotalECPM = (totalPayouts / totalEmpDelivered) * 1000;\n\t\t\t\ttotalECPMLast = (totalPayoutsLast / totalEmpDeliveredLast) * 1000;\n\t\t\t\ttotalChange = totalECPM - totalECPMLast;\n\t\t\t\ttotalChangePercentage = (totalChange / totalECPMLast) * 100;\n\t\t\t\tPublisherReportComputedValuesDTO publisherReportComputedValuesDTO = new PublisherReportComputedValuesDTO();\n\t\t\t\tpublisherReportComputedValuesDTO.setChange(totalChange);\n\t\t\t\tpublisherReportComputedValuesDTO.setChangePercentage(totalChangePercentage/100);\n\t\t\t\tpublisherReportComputedValuesDTOList.add(publisherReportComputedValuesDTO);\n\t\t\t\t\n\t\t\t\tfor(PublisherReportChannelPerformanceDTO publisherReportChannelPerformanceDTO : pubReportChannelPerformanceDTOList) {\n\t\t\t\t\tpublisherReportChannelPerformanceDTO.setFillRate((double)publisherReportChannelPerformanceDTO.getImpressionsDelivered()/totalEmpDelivered);\n\t\t\t\t}\n\t\t\t}\n\t\t}catch (Exception e) {\n\t\t\tlog.severe(\"Exception in getChannelPerformanceDate of LinMobileService : \"+e.getMessage());\n\t\t\t\n\t\t}\n\t\tchannelperformanceMap.put(\"PublisherReportChannelPerformanceDTO\", pubReportChannelPerformanceDTOList);\n\t\tchannelperformanceMap.put(\"PublisherReportComputedValuesDTO\", publisherReportComputedValuesDTOList);\n\t\treturn channelperformanceMap;\n\t}\n\t\n\tpublic Map getPerformanceByPropertyData(String channelName, List performanceByPropertyCurrentDataBySiteName, List performanceByPropertyCompareDataBySiteName) {\n\t\t\tdouble payoutsTotalCompare = 0.0;\n\t\t\tdouble impDeliveredTotalCompare = 0.0;\n\t\t\tdouble clicksTotalCurrent = 0;\n\t\t\tdouble payoutsTotalCurrent = 0.0;\n\t\t\tdouble impDeliveredTotalCurrent = 0.0;\n\t\t\tdouble eCPMTotalCompare = 0.0;\n\t\t\tdouble eCPMTotalCurrent = 0.0;\n\t\t\tdouble changeTotal = 0.0;\n\t\t\tdouble percentageCHGTotal = 0.0;\n\t\t\tdouble imprs =0.0;\n\t\t\tlong payout = 0;\n\t\t\tint flg = 0;\n\t\t\t\n\t\t\tMap performanceByPropertyMap = new HashMap();\n\t\t\tList publisherReportPerformanceByPropertyDTOList = new ArrayList();\n\t\t\tList publisherReportComputedValuesDTOList = new ArrayList();\n\t\n\t\ttry {\n\t\t\tif(performanceByPropertyCurrentDataBySiteName != null && performanceByPropertyCurrentDataBySiteName.size() > 0) {\n\t\t\t\tfor(PublisherPropertiesObj objectCurrent : performanceByPropertyCurrentDataBySiteName) {\n\t\t\t\t\tint matchflag = 0;\n\t\t\t\t\tif(performanceByPropertyCompareDataBySiteName != null && performanceByPropertyCompareDataBySiteName.size() > 0) {\n\t\t\t\t\t\tint compareCount = 0;\n\t\t\t\t\t\tfor(PublisherPropertiesObj objectCompare : performanceByPropertyCompareDataBySiteName) {\n\t\t\t\t\t\t\tPublisherReportPerformanceByPropertyDTO publisherReportPerformanceByPropertyDTO = new PublisherReportPerformanceByPropertyDTO();\n\t\t\t\t\t\t\tif(objectCurrent.getSite() != null && objectCompare.getSite() != null && objectCurrent.getSite().equals(objectCompare.getSite()) && objectCurrent.getChannelName().equals(objectCompare.getChannelName())) {\t\n\t\t\t\t\t\t\t\timprs = 0;\n\t\t\t\t\t\t\t\tlong clks = objectCurrent.getClicks();\n\t\t\t\t\t\t\t\timprs = objectCurrent.getImpressionsDelivered();\n\t\t\t\t\t\t\t\tdouble ctr = (clks / imprs) * 100;\n\t\t\t\n\t\t\t\t\t\t\t\tflg++;\n\t\t\t\t\t\t\t\tmatchflag = 1;\t\n\t\t\t\t\t\t\t\tdouble eCPM = objectCurrent.geteCPM();\n\t\t\t\t\t\t\t\tdouble CHG = 0.0;\n\t\t\t\t\t\t\t\tdouble percentageCHG = 0.0;\n\t\t\t\t\t\t\t\tif(objectCompare.geteCPM() == 0.0) {\n\t\t\t\t\t\t\t\t\tCHG = objectCurrent.geteCPM();\n\t\t\t\t\t\t\t\t\tpercentageCHG = 0.0;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tCHG = objectCurrent.geteCPM() - objectCompare.geteCPM();\n\t\t\t\t\t\t\t\t\tpercentageCHG = (CHG / objectCompare.geteCPM()) * 100;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setProperty(objectCurrent.getName());\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setEcpm(objectCurrent.geteCPM());\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setChange(CHG);\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setChangePercentage(percentageCHG/100);\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setImpressionsDelivered(Math.round(objectCurrent.getImpressionsDelivered()));\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setClicks(objectCurrent.getClicks());\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setPayouts(objectCurrent.getPayout());\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTOList.add(publisherReportPerformanceByPropertyDTO);\n\t\t\t\n\t\t\t\t\t\t\t\tpayoutsTotalCompare = payoutsTotalCompare + objectCompare.getPayout();\n\t\t\t\t\t\t\t\timpDeliveredTotalCompare = impDeliveredTotalCompare + objectCompare.getImpressionsDelivered();\n\t\t\t\t\t\t\t\tclicksTotalCurrent = clicksTotalCurrent + objectCurrent.getClicks();\n\t\t\t\t\t\t\t\tpayoutsTotalCurrent = payoutsTotalCurrent + objectCurrent.getPayout();\n\t\t\t\t\t\t\t\timpDeliveredTotalCurrent = impDeliveredTotalCurrent + Math.round(objectCurrent.getImpressionsDelivered());\n\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if(performanceByPropertyCompareDataBySiteName.size()-1 == compareCount && matchflag == 0 ) {\n\t\t\t\t\t\t\t\timprs = 0;\n\t\t\t\t\t\t\t\tlong clks = objectCurrent.getClicks();\n\t\t\t\t\t\t\t\timprs = objectCurrent.getImpressionsDelivered();\n\t\t\t\t\t\t\t\tdouble ctr = (clks / imprs) * 100;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tflg++;\n\t\t\t\t\t\t\t\tmatchflag = 1;\t\n\t\t\t\t\t\t\t\tdouble eCPM = objectCurrent.geteCPM();\n\t\t\t\t\t\t\t\tdouble CHG = 0.0;\n\t\t\t\t\t\t\t\tdouble percentageCHG = 0.0;\n\t\t\t\t\t\t\t\tCHG = objectCurrent.geteCPM();\n\t\t\t\t\t\t\t\tpercentageCHG = 0.0;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setProperty(objectCurrent.getName());\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setEcpm(objectCurrent.geteCPM());\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setChange(CHG);\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setChangePercentage(percentageCHG/100);\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setImpressionsDelivered(Math.round(objectCurrent.getImpressionsDelivered()));\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setClicks(objectCurrent.getClicks());\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setPayouts(objectCurrent.getPayout());\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTOList.add(publisherReportPerformanceByPropertyDTO);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\tclicksTotalCurrent = clicksTotalCurrent + objectCurrent.getClicks();\n\t\t\t\t\t\t\t payoutsTotalCurrent = payoutsTotalCurrent + objectCurrent.getPayout();\n\t\t\t\t\t\t\t impDeliveredTotalCurrent = impDeliveredTotalCurrent + Math.round(objectCurrent.getImpressionsDelivered());\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcompareCount++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tPublisherReportPerformanceByPropertyDTO publisherReportPerformanceByPropertyDTO = new PublisherReportPerformanceByPropertyDTO();\n\t\t\t\t\t\timprs = 0;\n\t\t\t\t\t\tlong clks = objectCurrent.getClicks();\n\t\t\t\t\t\timprs = objectCurrent.getImpressionsDelivered();\n\t\t\t\t\t\tdouble ctr = (clks / imprs) * 100;\n\t\t\t\t\t\t\n\t\t\t\t\t\tflg++;\n\t\t\t\t\t\tmatchflag = 1;\t\n\t\t\t\t\t\tdouble eCPM = objectCurrent.geteCPM();\n\t\t\t\t\t\tdouble CHG = 0.0;\n\t\t\t\t\t\tdouble percentageCHG = 0.0;\n\t\t\t\t\t\tCHG = objectCurrent.geteCPM();\n\t\t\t\t\t\tpercentageCHG = 0.0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setProperty(objectCurrent.getName());\n\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setEcpm(objectCurrent.geteCPM());\n\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setChange(CHG);\n\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setChangePercentage(percentageCHG/100);\n\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setImpressionsDelivered(Math.round(objectCurrent.getImpressionsDelivered()));\n\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setClicks(objectCurrent.getClicks());\n\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTO.setPayouts(objectCurrent.getPayout());\n\t\t\t\t\t\t\n\t\t\t\t\t\tpublisherReportPerformanceByPropertyDTOList.add(publisherReportPerformanceByPropertyDTO);\n\t\t\n\t\t\t \t \tclicksTotalCurrent = clicksTotalCurrent + objectCurrent.getClicks();\n\t\t\t \t \tpayoutsTotalCurrent = payoutsTotalCurrent + objectCurrent.getPayout();\n\t\t\t \t \timpDeliveredTotalCurrent = impDeliveredTotalCurrent + Math.round(objectCurrent.getImpressionsDelivered());\t\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\t\t\t\t\t\n\t\t\t\tif(flg > 0) {\n\t\t\t\t\teCPMTotalCurrent = (payoutsTotalCurrent / impDeliveredTotalCurrent) * 1000;\n\t\t\t\t\teCPMTotalCompare = (payoutsTotalCompare / impDeliveredTotalCompare) * 1000;\n\t\t\t\t\tchangeTotal = (eCPMTotalCurrent - eCPMTotalCompare);\n\t\t\t\t\tpercentageCHGTotal = (changeTotal / eCPMTotalCompare) * 100;\n\t\t\t\t}\n\t\t\t\tPublisherReportComputedValuesDTO publisherReportComputedValuesDTO = new PublisherReportComputedValuesDTO();\n\t\t\t\tpublisherReportComputedValuesDTO.setChange(changeTotal);\n\t\t\t\tpublisherReportComputedValuesDTO.setChangePercentage(percentageCHGTotal/100);\n\t\t\t\tpublisherReportComputedValuesDTOList.add(publisherReportComputedValuesDTO);\n\t\t\t}\n\t\t}catch (Exception e) {\n\t\t\tlog.severe(\"Exception in getPerformanceByPropertyData of LinMobileService : \"+e.getMessage());\n\t\t\t\n\t\t}\t\n\t\tperformanceByPropertyMap.put(\"PublisherReportPerformanceByPropertyDTO\", publisherReportPerformanceByPropertyDTOList);\n\t\tperformanceByPropertyMap.put(\"PublisherReportPerformanceComputedValuesDTO\", publisherReportComputedValuesDTOList);\n\t\treturn performanceByPropertyMap;\n\t}\n\t\n\t/*\n\t * This method will create json string for line chart\n\t */\n\t@SuppressWarnings(\"unused\")\n\tprivate String createJsonResponseForLineChart(Map dateMap,\n\t\t\tMap channelMap,Map perfDataMap,String chartType) throws TypeMismatchException{\n\t\t\n\t\tDataTable linechartTable = new DataTable();\t \t\n\t \tList rows;\n\n\t ColumnDescription col0 = new ColumnDescription(\"date\", ValueType.DATE, \"Date\");\n\t //ColumnDescription col0 = new ColumnDescription(\"date\", ValueType.TEXT, \"Date\");\n\t linechartTable.addColumn(col0);\n\n\t for (Entry channel : channelMap.entrySet()) {\n\t\t\t String channelName = channel.getKey();\n\t\t\t ColumnDescription channelcol = new ColumnDescription(channelName, ValueType.NUMBER, channelName);\n\t\t\t linechartTable.addColumn(channelcol);\n\t\t}\n\t \n\t rows = Lists.newArrayList();\t\n\t int year, month, day = 0;\t\n\t for (Entry dates : dateMap.entrySet()) {\n\t\t\t String date = dates.getKey();\n\t\t\t String [] dtArray=date.split(\"-\");\n\t\t\t com.google.visualization.datasource.datatable.TableRow row = new com.google.visualization.datasource.datatable.TableRow();\n\t\t\t \n\t\t\t year = Integer.parseInt(dtArray[0]);\n\t\t\t month = Integer.parseInt(dtArray[1])-1;\n\t\t\t day = Integer.parseInt(dtArray[2]);\n\t\t\t DateValue dateValue= new DateValue(year,month,day);\n\t\t\t \n\t\t\t row.addCell(new com.google.visualization.datasource.datatable.TableCell(dateValue));\n\t\t\t //row.addCell(new com.google.visualization.datasource.datatable.TableCell(date));\n\t\t\t \n\t\t\t for (Entry channel : channelMap.entrySet()) {\n\t\t\t\t String channelName = channel.getKey();\n\t\t\t\t String key=date+\"_\"+channelName;\t\t\t\t\t \n\t\t\t\t LineChartDTO perData = (LineChartDTO) perfDataMap.get(key);\t\t\t\t\t \n\t\t\t\t if ( perData != null){\n\t\t\t\t\t //row.addCell(new com.google.visualization.datasource.datatable.TableCell(perData.getCtr()).);\t\t\t\t\t\t \n\t\t\t\t\t if(chartType.equalsIgnoreCase(\"CTR\")){\n\t\t\t\t\t\t Double ctr=StringUtil.getDoubleValue(perData.getCtr(), 4);\n\t\t\t\t\t\t row.addCell(new NumberValue(new Double(ctr))); \n\t\t\t\t\t }else if(chartType.equalsIgnoreCase(\"Clicks\")){\n\t\t\t\t\t\t row.addCell(new NumberValue(new Long(perData.getClicks()))); \n\t\t\t\t\t }else if(chartType.equalsIgnoreCase(\"Impressions\")){\n\t\t\t\t\t\t row.addCell(new NumberValue(new Long(perData.getImpressions()))); \n\t\t\t\t\t }else if(chartType.equalsIgnoreCase(\"Revenue\")){\n\t\t\t\t\t\t Double revenue = StringUtil.getDoubleValue(perData.getRevenue(), 4);\n\t\t\t\t\t\t row.addCell(new NumberValue(new Double(revenue))); \n\t\t\t\t\t }else if(chartType.equalsIgnoreCase(\"Ecpm\")){\n\t\t\t\t\t\t Double ecpm=StringUtil.getDoubleValue(perData.geteCPM(), 4);\n\t\t\t\t\t\t row.addCell(new NumberValue(new Double(ecpm))); \n\t\t\t\t\t }else if(chartType.equalsIgnoreCase(\"FillRate\")){\n\t\t\t\t\t\t Double fillRate=StringUtil.getDoubleValue(perData.getFillRate(), 4);\n\t\t\t\t\t\t row.addCell(new NumberValue(new Double(fillRate))); \n\t\t\t\t\t }\n\t\t\t\t }else{\n\t\t\t\t\t row.addCell(new com.google.visualization.datasource.datatable.TableCell(0));\n\t\t\t\t }\n\t\t\t\t \n\t\t\t }\n\t\t\t rows.add(row);\t\t\t\t \n\t }\n\t linechartTable.addRows(rows);\n\t \n\t java.lang.CharSequence jsonStr =\t JsonRenderer.renderDataTable(linechartTable, true, false);\n\t //System.out.println(\"LineChart Table JSON Data::\" + jsonStr.toString());\n\t return jsonStr.toString();\n\t}\n\t\n\tpublic Map processPublisherLineChartData(String lowerDate,String upperDate,String publisherName,String channelName){\n\t\tList actualPublisherList=null;\n\t\tMap dateMap = new LinkedHashMap();\n\t\tMap perfDataMap = new LinkedHashMap();\n\t\tMap channelMap = new LinkedHashMap();\n\t\tILinMobileDAO linDAO=new LinMobileDAO();\n\t\tMap jsonChartMap = null;\n\t\ttry {\n\t\t\tString channelId = getChannelsBQId(channelName);\n\t\t\tString publisherId = getPublisherBQId(publisherName);\n\t\t\tjsonChartMap = MemcacheUtil.getLineChartMapFromCachePublisher(lowerDate, upperDate, publisherId, channelId);\n\t\t\tif(jsonChartMap ==null || jsonChartMap.size()==0){\n\t\t\t\tjsonChartMap = new LinkedHashMap();\n\t\t\t\t actualPublisherList = MemcacheUtil.getTrendsAnalysisActualDataPublisher(lowerDate, upperDate, publisherName, channelName);\n\t\t\t\t if(actualPublisherList==null || actualPublisherList.size()<=0){\n\t\t\t\t\t String replaceStr = \"\\\\\\\\'\";\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(channelName!=null){\n\t\t\t\t\t\t\tchannelName = channelName.replaceAll(\"'\", replaceStr);\n\t\t\t\t\t\t\tchannelName = channelName.replaceAll(\",\", \"','\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tchannelName = \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tQueryDTO queryDTO = getQueryDTO(publisherId, lowerDate, upperDate, LinMobileConstants.BQ_CORE_PERFORMANCE);\n\t\t\t\t\t\tif(queryDTO != null && queryDTO.getQueryData() != null && queryDTO.getQueryData().length() > 0) {\n\t\t\t\t\t\t\tactualPublisherList=linDAO.loadActualDataForPublisher(lowerDate,upperDate,channelId, queryDTO);\n\t\t\t\t\t\t\tMemcacheUtil.setTrendsAnalysisActualDataPublisher(lowerDate, upperDate, publisherId, channelId, actualPublisherList);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t for (PublisherChannelObj publisherChannelObj : actualPublisherList) {\n\t\t\t\t\t\tString date = publisherChannelObj.getDate();\n\t\t\t\t\t\tString channelNamekey = publisherChannelObj.getChannelName();\n\t\t\t\t\t\tString revenue = publisherChannelObj.getRevenue()+\"\";\n\t\t\t\t\t\tString impressions = publisherChannelObj.getImpressionsDelivered()+\"\";\n\t\t\t\t\t\tString clicks = publisherChannelObj.getClicks()+\"\";\n\t\t\t\t\t\tString ctr = publisherChannelObj.getCTR()+\"\";\n\t\t\t\t\t\tString fillRate = publisherChannelObj.getFillRate()+\"\";\n\t\t\t\t\t\tString ecpm = publisherChannelObj.geteCPM()+\"\";\n\t\t\t\t\t\tLineChartDTO lineChartDTO = new LineChartDTO(impressions, clicks, ctr, date, fillRate, ecpm, revenue);\n\t\t\t\t\t\tdateMap.put(date, null);\n\t\t\t\t\t\tchannelMap.put(channelNamekey, null);\n\t\t\t\t\t\tString key=date+\"_\"+channelNamekey;\n\t\t\t\t\t\tperfDataMap.put(key, lineChartDTO);\n\t\t\t\t\t}\n\t\t\t\t\t String ctrLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, \"CTR\");\n\t\t\t\t\t\tjsonChartMap.put(\"CTR\", ctrLineChartJson);\n\t\t\t\t\t\tString clicksLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, \"Clicks\");\n\t\t\t\t\t\tjsonChartMap.put(\"Clicks\", clicksLineChartJson);\n\t\t\t\t\t\tString impressionsLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, \"Impressions\");\n\t\t\t\t\t\tjsonChartMap.put(\"Impressions\", impressionsLineChartJson);\n\t\t\t\t\t\tString revenueLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, \"Revenue\");\n\t\t\t\t\t\tjsonChartMap.put(\"Revenue\", revenueLineChartJson);\n\t\t\t\t\t\tString ecpmLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, \"Ecpm\");\n\t\t\t\t\t\tjsonChartMap.put(\"Ecpm\", ecpmLineChartJson);\n\t\t\t\t\t\tString fillRateLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, \"FillRate\");\n\t\t\t\t\t\tjsonChartMap.put(\"FillRate\", fillRateLineChartJson);\n\t\t\t\t\t MemcacheUtil.setLineChartMapInCachePublisher(jsonChartMap, lowerDate, upperDate, publisherId, channelId);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tlog.info(\"Found line chart data in memcache..size:\"+jsonChartMap.size());\n\t }\n\n\t}catch (Exception e) {\n\t\tlog.severe(\"Exception :\"+e.getMessage());\n\t\t\n\t\treturn null;\n\t}\n\t return jsonChartMap;\n\t}\n }\n\n\n\n"},"meta":{"kind":"string","value":"{'content_hash': 'fb76939f45babb395ff3d29532f356c3', 'timestamp': '', 'source': 'github', 'line_count': 3428, 'max_line_length': 351, 'avg_line_length': 44.25904317386231, 'alnum_prop': 0.7198391774321118, 'repo_name': 'nareshPokhriyal86/testing', 'id': '4785070b45e19bddec85c0fa1b9cf813329059bd', 'size': '151720', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/lin/web/service/impl/LinMobileBusinessService.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '1241396'}, {'name': 'HTML', 'bytes': '56004'}, {'name': 'Java', 'bytes': '6601853'}, {'name': 'JavaScript', 'bytes': '3910511'}]}"}}},{"rowIdx":849732,"cells":{"text":{"kind":"string","value":"'use strict';\n\nangular.module('mean.users')\n .controller('AuthCtrl', ['$scope', '$rootScope', '$http', '$location', 'Global',\n function ($scope, $rootScope, $http, $location, Global) {\n // This object will contain list of available social buttons to authorize\n $scope.socialButtonsCounter = 0;\n $scope.global = Global;\n\n $http.get('/get-config')\n .success(function (config) {\n $scope.socialButtons = config;\n });\n }\n ])\n .controller('LoginCtrl', ['$scope', '$rootScope', '$http', '$location', 'Global',\n function ($scope, $rootScope, $http, $location, Global) {\n // This object will be filled by the form\n $scope.user = {};\n $scope.global = Global;\n $scope.global.registerForm = false;\n $scope.input = {\n type: 'password',\n placeholder: 'Password',\n confirmPlaceholder: 'Repeat Password',\n iconClass: '',\n tooltipText: 'Show password'\n };\n\n $scope.togglePasswordVisible = function () {\n $scope.input.type = $scope.input.type === 'text' ? 'password' : 'text';\n $scope.input.placeholder = $scope.input.placeholder === 'Password' ? 'Visible Password' : 'Password';\n $scope.input.iconClass = $scope.input.iconClass === 'icon_hide_password' ? '' : 'icon_hide_password';\n $scope.input.tooltipText = $scope.input.tooltipText === 'Show password' ? 'Hide password' : 'Show password';\n };\n\n // Register the login() function\n $scope.login = function () {\n $http.post('/login', {\n email: $scope.user.email,\n password: $scope.user.password\n })\n .success(function (response) {\n // authentication OK\n $scope.loginError = 0;\n $rootScope.user = response.user;\n $rootScope.$emit('loggedin');\n if (response.redirect) {\n if (window.location.href === response.redirect) {\n //This is so an admin user will get full admin page\n window.location.reload();\n } else {\n window.location = response.redirect;\n }\n } else {\n $location.url('/');\n }\n })\n .error(function () {\n $scope.loginerror = 'Authentication failed.';\n });\n };\n }\n ])\n .controller('RegisterCtrl', ['$scope', '$rootScope', '$http', '$location', 'Global',\n function ($scope, $rootScope, $http, $location, Global) {\n $scope.user = {};\n $scope.global = Global;\n $scope.global.registerForm = true;\n $scope.input = {\n type: 'password',\n placeholder: 'Password',\n placeholderConfirmPass: 'Repeat Password',\n iconClassConfirmPass: '',\n tooltipText: 'Show password',\n tooltipTextConfirmPass: 'Show password'\n };\n\n $scope.togglePasswordVisible = function () {\n $scope.input.type = $scope.input.type === 'text' ? 'password' : 'text';\n $scope.input.placeholder = $scope.input.placeholder === 'Password' ? 'Visible Password' : 'Password';\n $scope.input.iconClass = $scope.input.iconClass === 'icon_hide_password' ? '' : 'icon_hide_password';\n $scope.input.tooltipText = $scope.input.tooltipText === 'Show password' ? 'Hide password' : 'Show password';\n };\n $scope.togglePasswordConfirmVisible = function () {\n $scope.input.type = $scope.input.type === 'text' ? 'password' : 'text';\n $scope.input.placeholderConfirmPass = $scope.input.placeholderConfirmPass === 'Repeat Password' ? 'Visible Password' : 'Repeat Password';\n $scope.input.iconClassConfirmPass = $scope.input.iconClassConfirmPass === 'icon_hide_password' ? '' : 'icon_hide_password';\n $scope.input.tooltipTextConfirmPass = $scope.input.tooltipTextConfirmPass === 'Show password' ? 'Hide password' : 'Show password';\n };\n\n $scope.register = function () {\n $scope.usernameError = null;\n $scope.registerError = null;\n $http.post('/register', {\n email: $scope.user.email,\n password: $scope.user.password,\n confirmPassword: $scope.user.confirmPassword,\n username: $scope.user.username,\n name: $scope.user.name\n })\n .success(function () {\n // authentication OK\n $scope.registerError = 0;\n $rootScope.user = $scope.user;\n Global.user = $rootScope.user;\n Global.authenticated = !!$rootScope.user;\n $rootScope.$emit('loggedin');\n $location.url('/');\n })\n .error(function (error) {\n // Error: authentication failed\n if (error === 'Username already taken') {\n $scope.usernameError = error;\n } else if (error === 'Email already taken') {\n $scope.emailError = error;\n } else\n $scope.registerError = error;\n });\n };\n }\n ])\n .controller('ForgotPasswordCtrl', ['$scope', '$rootScope', '$http', '$location', 'Global',\n function ($scope, $rootScope, $http, $location, Global) {\n $scope.user = {};\n $scope.global = Global;\n $scope.global.registerForm = false;\n $scope.forgotpassword = function () {\n $http.post('/forgot-password', {\n text: $scope.user.email\n })\n .success(function (response) {\n $scope.response = response;\n })\n .error(function (error) {\n $scope.response = error;\n });\n };\n }\n ])\n .controller('ResetPasswordCtrl', ['$scope', '$rootScope', '$http', '$location', '$stateParams', 'Global',\n function ($scope, $rootScope, $http, $location, $stateParams, Global) {\n $scope.user = {};\n $scope.global = Global;\n $scope.global.registerForm = false;\n $scope.resetpassword = function () {\n $http.post('/reset/' + $stateParams.tokenId, {\n password: $scope.user.password,\n confirmPassword: $scope.user.confirmPassword\n })\n .success(function (response) {\n $rootScope.user = response.user;\n $rootScope.$emit('loggedin');\n if (response.redirect) {\n if (window.location.href === response.redirect) {\n //This is so an admin user will get full admin page\n window.location.reload();\n } else {\n window.location = response.redirect;\n }\n } else {\n $location.url('/');\n }\n })\n .error(function (error) {\n if (error.msg === 'Token invalid or expired')\n $scope.resetpassworderror = 'Could not update password as token is invalid or may have expired';\n else\n $scope.validationError = error;\n });\n };\n }\n ]);\n"},"meta":{"kind":"string","value":"{'content_hash': '72a14eaae858f78d1b127ccc6cd16843', 'timestamp': '', 'source': 'github', 'line_count': 173, 'max_line_length': 157, 'avg_line_length': 52.31791907514451, 'alnum_prop': 0.41708098552646117, 'repo_name': 'iakomus/infographics', 'id': 'bec46778f35935c6d7795e3d6d9a7771ddb67607', 'size': '9051', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'packages/users/public/controllers/meanUser.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '81771'}, {'name': 'HTML', 'bytes': '79432'}, {'name': 'JavaScript', 'bytes': '266790'}]}"}}},{"rowIdx":849733,"cells":{"text":{"kind":"string","value":"\n\n\n\n\nBootstrapActions.Daemon (AWS SDK for Java - 1.10.27)\n\n\n\n\n\n\n\n
\n\n\n\n\n\n
\n \n \n \n \n \n \n \n
\n \n
\n \n \n \n\n
\n
\n
\n
\n \n
\n
\n
\n
\n \n
\n \n \n \n \n
\n
\n \n\n \n
\n

Did this page help you?

\n \n\n
\n \n \n\n
\n\n
\n
\n
\n\n\n\n
\n\n
\n
\n\n\n
\n\n\n
\n\n\n
\n
com.amazonaws.services.elasticmapreduce.util
\n

Enum BootstrapActions.Daemon

\n
\n
\n
    \n
  • java.lang.Object
  • \n
  • \n
      \n
    • java.lang.Enum&lt;BootstrapActions.Daemon&gt;
    • \n
    • \n
        \n
      • com.amazonaws.services.elasticmapreduce.util.BootstrapActions.Daemon
      • \n
      \n
    • \n
    \n
  • \n
\n
\n\n
\n
\n
    \n
  • \n\n\n\n
      \n
    • \n\n\n

      Method Summary

      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
      Methods&nbsp;
      Modifier and TypeMethod and Description
      static BootstrapActions.DaemonvalueOf(java.lang.String&nbsp;name)\n
      Returns the enum constant of this type with the specified name.
      \n
      static BootstrapActions.Daemon[]values()\n
      Returns an array containing the constants of this enum type, in\nthe order they are declared.
      \n
      \n
        \n
      • \n\n\n

        Methods inherited from class&nbsp;java.lang.Enum

        \ncompareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • \n
      \n
        \n
      • \n\n\n

        Methods inherited from class&nbsp;java.lang.Object

        \ngetClass, notify, notifyAll, wait, wait, wait
      • \n
      \n
    • \n
    \n
  • \n
\n
\n
\n
    \n
  • \n\n\n\n
      \n
    • \n\n\n

      Method Detail

      \n\n\n\n
        \n
      • \n

        values

        \n
        public static&nbsp;BootstrapActions.Daemon[]&nbsp;values()
        \n
        Returns an array containing the constants of this enum type, in\nthe order they are declared. This method may be used to iterate\nover the constants as follows:\n
        \nfor (BootstrapActions.Daemon c : BootstrapActions.Daemon.values())\n&nbsp;   System.out.println(c);\n
        \n
        Returns:
        an array containing the constants of this enum type, in the order they are declared
        \n
      • \n
      \n\n\n\n
        \n
      • \n

        valueOf

        \n
        public static&nbsp;BootstrapActions.Daemon&nbsp;valueOf(java.lang.String&nbsp;name)
        \n
        Returns the enum constant of this type with the specified name.\nThe string must match exactly an identifier used to declare an\nenum constant in this type. (Extraneous whitespace characters are \nnot permitted.)
        \n
        Parameters:
        name - the name of the enum constant to be returned.
        \n
        Returns:
        the enum constant with the specified name
        \n
        Throws:
        \n
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        \n
        java.lang.NullPointerException - if the argument is null
        \n
      • \n
      \n
    • \n
    \n
  • \n
\n
\n
\n\n\n
\n\n\n\n\n\n
\n \n
\n \n \n \n
\n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n
\n
\n
\n\n\n\n
\n\n
\n
\n\n\n
\n\n\n
\n\n

\n Copyright &#169; 2013 Amazon Web Services, Inc. All Rights Reserved.\n

\n\n\n"},"meta":{"kind":"string","value":"{'content_hash': '7771a05981295d4a5f57f8343f877a45', 'timestamp': '', 'source': 'github', 'line_count': 478, 'max_line_length': 258, 'avg_line_length': 45.49163179916318, 'alnum_prop': 0.6346286502644286, 'repo_name': 'TomNong/Project2-Intel-Edison', 'id': '0656aebc3178bf9b4c70ffb4909ba8625e364e83', 'size': '21745', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'documentation/javadoc/com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '5522'}]}"}}},{"rowIdx":849734,"cells":{"text":{"kind":"string","value":".. Auto-generated by help-rst from \"mirtk open-scalars -h\" output\n\n.. |open-scalars-brief-description| replace::\n\n Opens scalar data of an input point set by perfoming an erosion\n followed by the same number of dilations. When the input data array\n has more than one component, each component is processed separately.\n"},"meta":{"kind":"string","value":"{'content_hash': '9ff0b21dd2ef010183259e1d462f97e3', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 71, 'avg_line_length': 46.285714285714285, 'alnum_prop': 0.7623456790123457, 'repo_name': 'schuhschuh/MIRTK', 'id': '3d4ecdd5cf5c24114e4c0abb51bf746ef14626d1', 'size': '324', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Documentation/commands/_summaries/open-scalars.rst', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '1226'}, {'name': 'C', 'bytes': '22955'}, {'name': 'C++', 'bytes': '14908108'}, {'name': 'CMake', 'bytes': '1262915'}, {'name': 'Dockerfile', 'bytes': '7098'}, {'name': 'Python', 'bytes': '232475'}, {'name': 'Shell', 'bytes': '24544'}]}"}}},{"rowIdx":849735,"cells":{"text":{"kind":"string","value":""},"meta":{"kind":"string","value":"{'content_hash': 'c95dc94753f75e301c4a9e37517d25a2', 'timestamp': '', 'source': 'github', 'line_count': 1, 'max_line_length': 43, 'avg_line_length': 43.0, 'alnum_prop': 0.6511627906976745, 'repo_name': 'HtmlUnit/htmlunit-neko', 'id': 'ac368d5aba6e965e409e1c52454245d44f285f88', 'size': '43', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/test/resources/error-handling/test-broken-attribute1.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '51224'}, {'name': 'Java', 'bytes': '2509522'}]}"}}},{"rowIdx":849736,"cells":{"text":{"kind":"string","value":"package com.goodworkalan.spawn;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.PipedInputStream;\nimport java.io.PipedOutputStream;\n\n/**\n * Used when an output stream needs to be translated into an input stream to be\n * read by code expecting an input stream of a pipline output. This is\n * implemented using PipedInputStream and\n * PipedOutputStream so the reader needs to be in a separate thread\n * from the writer.\n * \n * @author Alan Gutierrez\n * \n */\nclass MissingProcess extends AbstractProgram {\n /** The piped input stream. */\n private final PipedInputStream in;\n\n /** The piped output stream. */\n private final PipedOutputStream out;\n \n /** Create a missing process. */\n public MissingProcess() {\n try {\n this.in = new PipedInputStream();\n this.out = new PipedOutputStream(this.in);\n } catch (IOException e) {\n throw new RuntimeException(e);\n }\n }\n \n /**\n * Get the piped input stream.\n * \n * @return The piped input stream.\n */\n public InputStream getInputStream() {\n return in;\n }\n \n /**\n * Get the piped output stream.\n * \n * @return The piped output stream.\n */\n public OutputStream getOutputStream() {\n return out;\n }\n}\n"},"meta":{"kind":"string","value":"{'content_hash': 'ca0e717a62e33d0318e6efd97dafa9bb', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 80, 'avg_line_length': 25.67924528301887, 'alnum_prop': 0.639235855988244, 'repo_name': 'defunct/spawn', 'id': 'b02f1c6859f667ad65ce5a10f8a579725821156b', 'size': '1361', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/goodworkalan/spawn/MissingProcess.java', 'mode': '33188', 'license': 'mit', 'language': []}"}}},{"rowIdx":849737,"cells":{"text":{"kind":"string","value":"ACCEPTED\n\n#### According to\nIndex Fungorum\n\n#### Published in\nOpredelitel' trutovykh gribov Belorussii 89 (1964)\n\n#### Original name\nTyromyces albellus f. aurantiacus Komarova\n\n### Remarks\nnull"},"meta":{"kind":"string","value":"{'content_hash': '530afb0b88698eb71c5665de97b5a9e3', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 50, 'avg_line_length': 14.846153846153847, 'alnum_prop': 0.7512953367875648, 'repo_name': 'mdoering/backbone', 'id': '8f298b6de8a621d2a4b1c1a2bcbbecf008a8de37', 'size': '258', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Tyromyces/Tyromyces aurantiacus/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}"}}},{"rowIdx":849738,"cells":{"text":{"kind":"string","value":"@interface AppDelegate : UIResponder \n\n@property (strong, nonatomic) UIWindow *window;\n\n\n@end\n\n"},"meta":{"kind":"string","value":"{'content_hash': '7eedcf6e8f0e819a6b2bb672179025b8', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 60, 'avg_line_length': 16.857142857142858, 'alnum_prop': 0.7796610169491526, 'repo_name': 'gzios/SystemLearn', 'id': '42f55ead6bf34b296569f5d0a6304745051f6205', 'size': '264', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Block/Block/AppDelegate.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '2017844'}, {'name': 'Go', 'bytes': '1235'}, {'name': 'HTML', 'bytes': '1929'}, {'name': 'M4', 'bytes': '33730'}, {'name': 'Makefile', 'bytes': '13860'}, {'name': 'Objective-C', 'bytes': '851901'}, {'name': 'Python', 'bytes': '7805'}, {'name': 'Roff', 'bytes': '28115'}, {'name': 'Ruby', 'bytes': '2090'}, {'name': 'Shell', 'bytes': '11957'}, {'name': 'Swift', 'bytes': '72870'}]}"}}},{"rowIdx":849739,"cells":{"text":{"kind":"string","value":"\n\n OK\n \n locality\n political\n 8756 Sankt Georgen ob Judenburg, Austria\n \n Sankt Georgen ob Judenburg\n Sankt Georgen ob Judenburg\n locality\n political\n \n \n Gemeinde Sankt Georgen ob Judenburg\n Gemeinde St. Georgen ob Judenburg\n administrative_area_level_3\n political\n \n \n Judenburg\n Judenburg\n administrative_area_level_2\n political\n \n \n Styria\n Styria\n administrative_area_level_1\n political\n \n \n Austria\n AT\n country\n political\n \n \n 8756\n 8756\n postal_code\n \n \n \n 47.2060000\n 14.4984000\n \n APPROXIMATE\n \n \n 47.1984191\n 14.4823926\n \n \n 47.2135798\n 14.5144074\n \n \n \n ChIJd4BzHt8HNhQREVGoPRATeNI\n \n\n"},"meta":{"kind":"string","value":"{'content_hash': 'fc7e36391f215323f33f41cef45d43f3', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 81, 'avg_line_length': 28.532258064516128, 'alnum_prop': 0.6823063877897118, 'repo_name': 'linkeddatalab/statspace', 'id': '65c587cdda1be64e019e1206a64b6fcddcaf130a', 'size': '1769', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'data/datasources/ogd.ifs.tuwien.ac.at_sparql/areas/62000_62026.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '24977'}, {'name': 'HTML', 'bytes': '245851'}, {'name': 'Java', 'bytes': '1177495'}]}"}}},{"rowIdx":849740,"cells":{"text":{"kind":"string","value":"define([\"three\"], function(THREE) {\n var renderer = new THREE.WebGLRenderer({\n clearColor: 0x000000,\n antialiasing: true\n });\n renderer.setSize(1920, 1080);\n document.body.appendChild(renderer.domElement);\n\n return renderer;\n});\n"},"meta":{"kind":"string","value":"{'content_hash': '1e62d3fee23ee871857b2c6fc6d04f76', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 51, 'avg_line_length': 25.8, 'alnum_prop': 0.6511627906976745, 'repo_name': 'IndigoDemo/IndiWorks', 'id': '6a3f381294bfa0b4c0a03e8dc70cbbc8bde4c364', 'size': '258', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'js/app/renderer.js', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '145'}, {'name': 'GLSL', 'bytes': '452'}, {'name': 'HTML', 'bytes': '326'}, {'name': 'JavaScript', 'bytes': '62756'}, {'name': 'Python', 'bytes': '606'}]}"}}},{"rowIdx":849741,"cells":{"text":{"kind":"string","value":"using System.Reflection;\r\nusing System.Runtime.CompilerServices;\r\nusing System.Runtime.InteropServices;\r\n\r\n// General Information about an assembly is controlled through the following \r\n// set of attributes. Change these attribute values to modify the information\r\n// associated with an assembly.\r\n[assembly: AssemblyTitle(\"Sentience.Tests\")]\r\n[assembly: AssemblyDescription(\"\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\n[assembly: AssemblyCompany(\"\")]\r\n[assembly: AssemblyProduct(\"Sentience.Tests\")]\r\n[assembly: AssemblyCopyright(\"Copyright © Andreas Håkansson 2014\")]\r\n[assembly: AssemblyTrademark(\"\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the types in this assembly not visible \r\n// to COM components. If you need to access a type in this assembly from \r\n// COM, set the ComVisible attribute to true on that type.\r\n[assembly: ComVisible(false)]\r\n\r\n// The following GUID is for the ID of the typelib if this project is exposed to COM\r\n[assembly: Guid(\"901858e5-0f30-49a4-9e70-4bb78c3460f0\")]\r\n\r\n// Version information for an assembly consists of the following four values:\r\n//\r\n// Major Version\r\n// Minor Version \r\n// Build Number\r\n// Revision\r\n//\r\n// You can specify all the values or you can default the Build and Revision Numbers \r\n// by using the '*' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\r\n"},"meta":{"kind":"string","value":"{'content_hash': '060e58611e6bd8c36fdb2f51383a9f70', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 84, 'avg_line_length': 40.44444444444444, 'alnum_prop': 0.7287087912087912, 'repo_name': 'thecodejunkie/sentience', 'id': 'c1439255bd1db35b473347b737e466b0529efccd', 'size': '1460', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Sentience.Tests/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '21278'}]}"}}},{"rowIdx":849742,"cells":{"text":{"kind":"string","value":"\n\ntitle: Section Cover\npages: false\nfiles: true\nfields:\n title:\n label: Title\n type: text\n coversubtitle:\n label: Cover Subtitle\n type: textarea\n coverbtn:\n label: Cover Button Text\n type: text\n coverbtnlink:\n label: Cover Button Link\n type: text\n coverpic:\n label: Cover Picture\n type: select\n options: images"},"meta":{"kind":"string","value":"{'content_hash': '535cc4913681210cefea12b96307de20', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 35, 'avg_line_length': 17.454545454545453, 'alnum_prop': 0.6588541666666666, 'repo_name': 'dioptre/diym', 'id': 'c32d53cf246b979290f0befc77e15f6c37d8fdc7', 'size': '384', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'site/blueprints/sectioncover.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '1254'}, {'name': 'CSS', 'bytes': '1651345'}, {'name': 'HTML', 'bytes': '432116'}, {'name': 'JavaScript', 'bytes': '5635658'}, {'name': 'PHP', 'bytes': '1039710'}, {'name': 'Ruby', 'bytes': '6736'}]}"}}},{"rowIdx":849743,"cells":{"text":{"kind":"string","value":"/**\n * This file/module contains all configuration for the build process.\n */\nmodule.exports = {\n /**\n * The `build_dir` folder is where our projects are compiled during\n * development and the `compile_dir` folder is where our app resides once it's\n * completely built.\n */\n build_dir: 'build',\n compile_dir: 'dist',\n mopidy_package_dir: 'mopidy_mopify',\n\n /**\n * This is a collection of file patterns that refer to our app code (the\n * stuff in `src/`). These file paths are used in the configuration of\n * build tasks. `js` is all project javascript, less tests. `ctpl` contains\n * our reusable components' (`src/common`) template HTML files, while\n * `atpl` contains the same, but for our app's code. `html` is just our\n * main HTML file, `less` is our main stylesheet, and `unit` contains our\n * app's unit tests.\n */\n app_files: {\n js: [ 'src/app/**/*.js' ],\n\n css: [ 'src/css/**/*.css' ],\n \n atpl: [ 'src/app/**/*.tmpl.html' ],\n\n html: [ 'src/index.html' ]\n },\n\n /**\n * This is the same as `app_files`, except it contains patterns that\n * reference vendor code (`vendor/`) that we need to place into the build\n * process somewhere. While the `app_files` property ensures all\n * standardized files are collected for compilation, it is the user's job\n * to ensure non-standardized (i.e. vendor-related) files are handled\n * appropriately in `vendor_files.js`.\n *\n * The `vendor_files.js` property holds files to be automatically\n * concatenated and minified with our project source files.\n *\n * The `vendor_files.css` property holds any CSS files to be automatically\n * included in our app.\n *\n * The `vendor_files.assets` property holds any assets to be copied along\n * with our app's assets. This structure is flattened, so it is not\n * recommended that you use wildcards.\n */\n vendor_files: {\n js: [\n 'src/vendor/mopidy/mopidy.js',\n 'src/vendor/angular/angular.js',\n 'src/vendor/angular-route/angular-route.js',\n 'src/vendor/angular-local-storage/dist/angular-local-storage.js',\n 'src/vendor/angular-echonest/src/angular-echonest.js',\n 'src/vendor/angular-loading-bar/src/loading-bar.js',\n 'src/vendor/angular-sanitize/angular-sanitize.js',\n 'src/vendor/ng-context-menu/dist/ng-context-menu.js',\n 'src/vendor/angular-animate/angular-animate.min.js',\n 'src/vendor/angular-notifier/dist/angular-notifier.min.js',\n 'src/vendor/angular-spotify/src/angular-spotify.js',\n 'src/vendor/underscore/underscore-min.js',\n 'src/vendor/ngInfiniteScroll/build/ng-infinite-scroll.min.js',\n 'src/vendor/angular-bootstrap/ui-bootstrap-tpls.min.js',\n 'src/vendor/angular-prompt/dist/angular-prompt.js',\n 'src/vendor/angular-toggle-switch/angular-toggle-switch.min.js',\n 'src/vendor/hammerjs/hammer.js',\n 'src/vendor/ryanmullins-angular-hammer/angular.hammer.js',\n 'src/vendor/angular-hotkeys/build/hotkeys.js'\n ],\n css: [\n 'src/vendor/html5-boilerplate/css/normalize.css',\n 'src/vendor/html5-boilerplate/css/main.css',\n 'src/vendor/angular-loading-bar/src/loading-bar.css',\n 'src/vendor/angular-notifier/dist/angular-notifier.css',\n 'src/vendor/angular-toggle-switch/angular-toggle-switch.css',\n 'src/vendor/angular-hotkeys/build/hotkeys.css'\n ],\n assets: [\n ],\n fonts: [\n 'src/assets/webfonts/ss-standard.*'\n ]\n },\n};\n"},"meta":{"kind":"string","value":"{'content_hash': 'b0afda5bf0da721c28cad4cd49dd6463', 'timestamp': '', 'source': 'github', 'line_count': 87, 'max_line_length': 82, 'avg_line_length': 43.08045977011494, 'alnum_prop': 0.6189967982924226, 'repo_name': 'dbrgn/mopidy-mopify', 'id': '9838bb744df4795cefa87b6159685ab33b3fca67', 'size': '3748', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'build.config.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '199559'}, {'name': 'HTML', 'bytes': '310154'}, {'name': 'JavaScript', 'bytes': '537300'}, {'name': 'Python', 'bytes': '14635'}]}"}}},{"rowIdx":849744,"cells":{"text":{"kind":"string","value":"using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following\n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"03. JSON Parse\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"03. JSON Parse\")]\n[assembly: AssemblyCopyright(\"Copyright © 2017\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible\n// to COM components. If you need to access a type in this assembly from\n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"41bc9e5c-4ff9-4d12-b4fb-51aa67a7aa7e\")]\n\n// Version information for an assembly consists of the following four values:\n//\n// Major Version\n// Minor Version\n// Build Number\n// Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"},"meta":{"kind":"string","value":"{'content_hash': '0663c74d1871d9a1b874915d95c4a833', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 84, 'avg_line_length': 38.77777777777778, 'alnum_prop': 0.744269340974212, 'repo_name': 'spiderbait90/Step-By-Step-In-Coding', 'id': '80f29b828a69457f383332ef08d73d15c7991817', 'size': '1399', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Programming Fundamentals/Strings and Text/03. JSON Parse/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '106'}, {'name': 'C#', 'bytes': '1601570'}, {'name': 'CSS', 'bytes': '513'}, {'name': 'HTML', 'bytes': '5127'}, {'name': 'JavaScript', 'bytes': '10918'}, {'name': 'Smalltalk', 'bytes': '1516'}]}"}}},{"rowIdx":849745,"cells":{"text":{"kind":"string","value":"SPHINXOPTS =\nSPHINXBUILD = sphinx-build\nPAPER =\nBUILDDIR = _build\n\n# Internal variables.\nPAPEROPT_a4 = -D latex_paper_size=a4\nPAPEROPT_letter = -D latex_paper_size=letter\nALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .\n\n.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest\n\nhelp:\n\t@echo \"Please use \\`make ' where is one of\"\n\t@echo \" html to make standalone HTML files\"\n\t@echo \" dirhtml to make HTML files named index.html in directories\"\n\t@echo \" pickle to make pickle files\"\n\t@echo \" json to make JSON files\"\n\t@echo \" htmlhelp to make HTML files and a HTML help project\"\n\t@echo \" qthelp to make HTML files and a qthelp project\"\n\t@echo \" latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter\"\n\t@echo \" changes to make an overview of all changed/added/deprecated items\"\n\t@echo \" linkcheck to check all external links for integrity\"\n\t@echo \" doctest to run all doctests embedded in the documentation (if enabled)\"\n\nclean:\n\t-rm -rf $(BUILDDIR)/*\n\nhtml:\n\t$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html\n\t@echo\n\t@echo \"Build finished. The HTML pages are in $(BUILDDIR)/html.\"\n\ndirhtml:\n\t$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml\n\t@echo\n\t@echo \"Build finished. The HTML pages are in $(BUILDDIR)/dirhtml.\"\n\npickle:\n\t$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle\n\t@echo\n\t@echo \"Build finished; now you can process the pickle files.\"\n\njson:\n\t$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json\n\t@echo\n\t@echo \"Build finished; now you can process the JSON files.\"\n\nhtmlhelp:\n\t$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp\n\t@echo\n\t@echo \"Build finished; now you can run HTML Help Workshop with the\" \\\n\t \".hhp project file in $(BUILDDIR)/htmlhelp.\"\n\nqthelp:\n\t$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp\n\t@echo\n\t@echo \"Build finished; now you can run \"qcollectiongenerator\" with the\" \\\n\t \".qhcp project file in $(BUILDDIR)/qthelp, like this:\"\n\t@echo \"# qcollectiongenerator $(BUILDDIR)/qthelp/matplotlib2tikz.qhcp\"\n\t@echo \"To view the help file:\"\n\t@echo \"# assistant -collectionFile $(BUILDDIR)/qthelp/matplotlib2tikz.qhc\"\n\nlatex:\n\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex\n\t@echo\n\t@echo \"Build finished; the LaTeX files are in $(BUILDDIR)/latex.\"\n\t@echo \"Run \\`make all-pdf' or \\`make all-ps' in that directory to\" \\\n\t \"run these through (pdf)latex.\"\n\nchanges:\n\t$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes\n\t@echo\n\t@echo \"The overview file is in $(BUILDDIR)/changes.\"\n\nlinkcheck:\n\t$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck\n\t@echo\n\t@echo \"Link check complete; look for any errors in the above output \" \\\n\t \"or in $(BUILDDIR)/linkcheck/output.txt.\"\n\ndoctest:\n\t$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest\n\t@echo \"Testing of doctests in the sources finished, look at the \" \\\n\t \"results in $(BUILDDIR)/doctest/output.txt.\"\n"},"meta":{"kind":"string","value":"{'content_hash': 'b25b423f73d44f3bbaf83eac91c62fc3', 'timestamp': '', 'source': 'github', 'line_count': 85, 'max_line_length': 91, 'avg_line_length': 35.90588235294118, 'alnum_prop': 0.7031454783748362, 'repo_name': 'danielhkl/matplotlib2tikz', 'id': 'cb99cd76fec39cc09c6d6684161dd5c73e172331', 'size': '3144', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'doc/Makefile', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Makefile', 'bytes': '654'}, {'name': 'Python', 'bytes': '150161'}]}"}}},{"rowIdx":849746,"cells":{"text":{"kind":"string","value":"\n\n\n\n \n curator\n gravia\n mvn:io.fabric8.poc/fabric8-api/${project.version}\n mvn:io.fabric8.poc/fabric8-container-karaf-attributes/${project.version}\n mvn:io.fabric8.poc/fabric8-container-karaf-managed/${project.version}\n mvn:io.fabric8.poc/fabric8-container-tomcat-managed/${project.version}\n mvn:io.fabric8.poc/fabric8-container-wildfly-connector/${project.version}\n mvn:io.fabric8.poc/fabric8-container-wildfly-managed/${project.version}\n mvn:io.fabric8.poc/fabric8-core/${project.version}\n mvn:io.fabric8.poc/fabric8-domain-agent/${project.version}\n mvn:io.fabric8.poc/fabric8-git/${project.version}\n mvn:io.fabric8.poc/fabric8-spi/${project.version}\n mvn:io.fabric8.poc/fabric8-jolokia/${project.version}\n \n\n \n mvn:com.google.guava/guava/${version.guava}\n mvn:io.fabric8.poc/fabric8-zookeeper/${project.version}\n mvn:org.apache.curator/curator-client/${version.apache.curator}\n mvn:org.apache.curator/curator-framework/${version.apache.curator}\n mvn:org.apache.curator/curator-recipes/${version.apache.curator}\n \n\n \n mvn:org.apache.commons/commons-compress/${version.apache.commons.compress}\n mvn:org.apache.felix/org.apache.felix.eventadmin/${version.apache.felix.eventadmin}\n mvn:org.apache.felix/org.apache.felix.scr/${version.apache.felix.scr}\n mvn:org.apache.felix/org.apache.felix.metatype/${version.apache.felix.metatype}\n mvn:org.apache.felix/org.apache.felix.http.bundle/${version.apache.felix.http}\n mvn:org.jboss.gravia/gravia-provision/${version.jboss.gravia}\n mvn:org.jboss.gravia/gravia-resolver/${version.jboss.gravia}\n mvn:org.jboss.gravia/gravia-resource/${version.jboss.gravia}\n mvn:org.jboss.gravia/gravia-repository/${version.jboss.gravia}\n mvn:org.jboss.gravia/gravia-runtime-api/${version.jboss.gravia}\n mvn:org.jboss.gravia/gravia-runtime-osgi/${version.jboss.gravia}\n \n\n\n"},"meta":{"kind":"string","value":"{'content_hash': '0d52142c6e626ee29fac797b1f0157da', 'timestamp': '', 'source': 'github', 'line_count': 57, 'max_line_length': 126, 'avg_line_length': 62.89473684210526, 'alnum_prop': 0.7087866108786611, 'repo_name': 'tdiesler/fabric8poc', 'id': '59042bf61973022bdac1d54bf5c1f2c41a608952', 'size': '3585', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'container/karaf/features/src/main/resources/features.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '1142765'}, {'name': 'Shell', 'bytes': '2680'}]}"}}},{"rowIdx":849747,"cells":{"text":{"kind":"string","value":"ACCEPTED\n\n#### According to\nInternational Plant Names Index\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull"},"meta":{"kind":"string","value":"{'content_hash': 'c468265b44720a7d4f166720f87da78f', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': 'f02ba78b1a3e0f7f3657152fe359c0cd0e58d05e', 'size': '179', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Saxifragales/Saxifragaceae/Micranthes/Micranthes sachalinensis/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}"}}},{"rowIdx":849748,"cells":{"text":{"kind":"string","value":"\n com.behindthewires.intellij.fitnesse\n Fitnesse Plugin\n 1.0\n\n \n most HTML tags may be used\n ]]>\n\n \n most HTML tags may be used\n ]]>\n \n\n \n \n\n \n \n\n \n \n \n \n\n \n \n \n\n \n \n \n\n \n \n \n\n"},"meta":{"kind":"string","value":"{'content_hash': '25be5e00abd00ea7d2bc2dc30eaf6f49', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 118, 'avg_line_length': 30.348837209302324, 'alnum_prop': 0.6865900383141762, 'repo_name': 'chrisjgell/intj-fitnesse', 'id': '7109c4efa7c555629f8f3b26c8f304295c1c1ea9', 'size': '1305', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'META-INF/plugin.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '2784'}]}"}}},{"rowIdx":849749,"cells":{"text":{"kind":"string","value":"__version__=''' $Id$ '''\n__doc__=\"\"\"Experimental class to generate Tables of Contents easily\n\nThis module defines a single TableOfContents() class that can be used to\ncreate automatically a table of tontents for Platypus documents like\nthis:\n\n story = []\n toc = TableOfContents()\n story.append(toc)\n # some heading paragraphs here...\n doc = MyTemplate(path)\n doc.multiBuild(story)\n\nThe data needed to create the table is a list of (level, text, pageNum)\ntriplets, plus some paragraph styles for each level of the table itself.\nThe triplets will usually be created in a document template's method\nlike afterFlowable(), making notification calls using the notify()\nmethod with appropriate data like this:\n\n (level, text, pageNum) = ...\n self.notify('TOCEntry', (level, text, pageNum))\n\nOptionally the list can contain four items in which case the last item\nis a destination key which the entry should point to. A bookmark\nwith this key needs to be created first like this:\n\n key = 'ch%s' % self.seq.nextf('chapter')\n self.canv.bookmarkPage(key)\n self.notify('TOCEntry', (level, text, pageNum, key))\n\nAs the table of contents need at least two passes over the Platypus\nstory which is why the moultiBuild0() method must be called.\n\nThe levelParaStyle variables are the paragraph styles used\nto format the entries in the table of contents. Their indentation\nis calculated like this: each entry starts at a multiple of some\nconstant named delta. If one entry spans more than one line, all\nlines after the first are indented by the same constant named\nepsilon.\n\"\"\"\n\nfrom reportlab.lib import enums\nfrom reportlab.lib.units import cm\nfrom reportlab.lib.utils import commasplit, escapeOnce, encode_label, decode_label, strTypes\nfrom reportlab.lib.styles import ParagraphStyle, _baseFontName\nfrom reportlab.platypus.paragraph import Paragraph\nfrom reportlab.platypus.doctemplate import IndexingFlowable\nfrom reportlab.platypus.tables import TableStyle, Table\nfrom reportlab.platypus.flowables import Spacer, Flowable\nfrom reportlab.pdfbase.pdfmetrics import stringWidth\nfrom reportlab.pdfgen import canvas\n\ndef unquote(txt):\n from xml.sax.saxutils import unescape\n return unescape(txt, {\"&apos;\": \"'\", \"&quot;\": '\"'})\n\ntry:\n set\nexcept:\n class set(list):\n def add(self,x):\n if x not in self:\n list.append(self,x)\n\ndef drawPageNumbers(canvas, style, pages, availWidth, availHeight, dot=' . '):\n '''\n Draws pagestr on the canvas using the given style.\n If dot is None, pagestr is drawn at the current position in the canvas.\n If dot is a string, pagestr is drawn right-aligned. If the string is not empty,\n the gap is filled with it.\n '''\n pages.sort()\n pagestr = ', '.join([str(p) for p, _ in pages])\n x, y = canvas._curr_tx_info['cur_x'], canvas._curr_tx_info['cur_y']\n \n fontSize = style.fontSize\n pagestrw = stringWidth(pagestr, style.fontName, fontSize)\n \n #if it's too long to fit, we need to shrink to fit in 10% increments.\n #it would be very hard to output multiline entries.\n #however, we impose a minimum size of 1 point as we don't want an\n #infinite loop. Ultimately we should allow a TOC entry to spill\n #over onto a second line if needed.\n freeWidth = availWidth-x\n while pagestrw > freeWidth and fontSize >= 1.0:\n fontSize = 0.9 * fontSize\n pagestrw = stringWidth(pagestr, style.fontName, fontSize)\n \n \n if isinstance(dot, strTypes):\n if dot:\n dotw = stringWidth(dot, style.fontName, fontSize)\n dotsn = int((availWidth-x-pagestrw)/dotw)\n else:\n dotsn = dotw = 0\n text = '%s%s' % (dotsn * dot, pagestr)\n newx = availWidth - dotsn*dotw - pagestrw\n pagex = availWidth - pagestrw\n elif dot is None:\n text = ', ' + pagestr\n newx = x\n pagex = newx\n else:\n raise TypeError('Argument dot should either be None or an instance of basestring.')\n\n tx = canvas.beginText(newx, y)\n tx.setFont(style.fontName, fontSize)\n tx.setFillColor(style.textColor)\n tx.textLine(text)\n canvas.drawText(tx)\n\n commaw = stringWidth(', ', style.fontName, fontSize)\n for p, key in pages:\n if not key:\n continue\n w = stringWidth(str(p), style.fontName, fontSize)\n canvas.linkRect('', key, (pagex, y, pagex+w, y+style.leading), relative=1)\n pagex += w + commaw\n\n# Default paragraph styles for tables of contents.\n# (This could also be generated automatically or even\n# on-demand if it is not known how many levels the\n# TOC will finally need to display...)\n\ndelta = 1*cm\nepsilon = 0.5*cm\n\ndefaultLevelStyles = [\n ParagraphStyle(\n name='Level 0',\n fontName=_baseFontName,\n fontSize=10,\n leading=11,\n firstLineIndent = 0,\n leftIndent = epsilon)]\n\ndefaultTableStyle = \\\n TableStyle([\n ('VALIGN', (0,0), (-1,-1), 'TOP'),\n ('RIGHTPADDING', (0,0), (-1,-1), 0),\n ('LEFTPADDING', (0,0), (-1,-1), 0),\n ])\n\nclass TableOfContents(IndexingFlowable):\n \"\"\"This creates a formatted table of contents.\n\n It presumes a correct block of data is passed in.\n The data block contains a list of (level, text, pageNumber)\n triplets. You can supply a paragraph style for each level\n (starting at zero).\n Set dotsMinLevel to determine from which level on a line of\n dots should be drawn between the text and the page number.\n If dotsMinLevel is set to a negative value, no dotted lines are drawn.\n \"\"\"\n\n def __init__(self):\n self.rightColumnWidth = 72\n self.levelStyles = defaultLevelStyles\n self.tableStyle = defaultTableStyle\n self.dotsMinLevel = 1\n self._table = None\n self._entries = []\n self._lastEntries = []\n\n def beforeBuild(self):\n # keep track of the last run\n self._lastEntries = self._entries[:]\n self.clearEntries()\n\n def isIndexing(self):\n return 1\n\n def isSatisfied(self):\n return (self._entries == self._lastEntries)\n\n def notify(self, kind, stuff):\n \"\"\"The notification hook called to register all kinds of events.\n\n Here we are interested in 'TOCEntry' events only.\n \"\"\"\n if kind == 'TOCEntry':\n self.addEntry(*stuff)\n\n def clearEntries(self):\n self._entries = []\n\n def getLevelStyle(self, n):\n '''Returns the style for level n, generating and caching styles on demand if not present.'''\n try:\n return self.levelStyles[n]\n except IndexError:\n prevstyle = self.getLevelStyle(n-1)\n self.levelStyles.append(ParagraphStyle(\n name='%s-%d-indented' % (prevstyle.name, n),\n parent=prevstyle,\n firstLineIndent = prevstyle.firstLineIndent+delta,\n leftIndent = prevstyle.leftIndent+delta))\n return self.levelStyles[n]\n\n def addEntry(self, level, text, pageNum, key=None):\n \"\"\"Adds one entry to the table of contents.\n\n This allows incremental buildup by a doctemplate.\n Requires that enough styles are defined.\"\"\"\n\n assert type(level) == type(1), \"Level must be an integer\"\n self._entries.append((level, text, pageNum, key))\n\n\n def addEntries(self, listOfEntries):\n \"\"\"Bulk creation of entries in the table of contents.\n\n If you knew the titles but not the page numbers, you could\n supply them to get sensible output on the first run.\"\"\"\n\n for entryargs in listOfEntries:\n self.addEntry(*entryargs)\n\n\n def wrap(self, availWidth, availHeight):\n \"All table properties should be known by now.\"\n\n # makes an internal table which does all the work.\n # we draw the LAST RUN's entries! If there are\n # none, we make some dummy data to keep the table\n # from complaining\n if len(self._lastEntries) == 0:\n _tempEntries = [(0,'Placeholder for table of contents',0,None)]\n else:\n _tempEntries = self._lastEntries\n\n def drawTOCEntryEnd(canvas, kind, label):\n '''Callback to draw dots and page numbers after each entry.'''\n label = label.split(',')\n page, level, key = int(label[0]), int(label[1]), eval(label[2],{})\n style = self.getLevelStyle(level)\n if self.dotsMinLevel >= 0 and level >= self.dotsMinLevel:\n dot = ' . '\n else:\n dot = ''\n drawPageNumbers(canvas, style, [(page, key)], availWidth, availHeight, dot)\n self.canv.drawTOCEntryEnd = drawTOCEntryEnd\n\n tableData = []\n for (level, text, pageNum, key) in _tempEntries:\n style = self.getLevelStyle(level)\n if key:\n text = '%s' % (key, text)\n keyVal = repr(key).replace(',','\\\\x2c').replace('\"','\\\\x2c')\n else:\n keyVal = None\n para = Paragraph('%s' % (text, pageNum, level, keyVal), style)\n if style.spaceBefore:\n tableData.append([Spacer(1, style.spaceBefore),])\n tableData.append([para,])\n\n self._table = Table(tableData, colWidths=(availWidth,), style=self.tableStyle)\n\n self.width, self.height = self._table.wrapOn(self.canv,availWidth, availHeight)\n return (self.width, self.height)\n\n\n def split(self, availWidth, availHeight):\n \"\"\"At this stage we do not care about splitting the entries,\n we will just return a list of platypus tables. Presumably the\n calling app has a pointer to the original TableOfContents object;\n Platypus just sees tables.\n \"\"\"\n return self._table.splitOn(self.canv,availWidth, availHeight)\n\n\n def drawOn(self, canvas, x, y, _sW=0):\n \"\"\"Don't do this at home! The standard calls for implementing\n draw(); we are hooking this in order to delegate ALL the drawing\n work to the embedded table object.\n \"\"\"\n self._table.drawOn(canvas, x, y, _sW)\n\ndef makeTuple(x):\n if hasattr(x, '__iter__'):\n return tuple(x)\n return (x,)\n\nclass SimpleIndex(IndexingFlowable):\n \"\"\"Creates multi level indexes.\n The styling can be cutomized and alphabetic headers turned on and off.\n \"\"\"\n\n def __init__(self, **kwargs):\n \"\"\"\n Constructor of SimpleIndex.\n Accepts the same arguments as the setup method.\n \"\"\"\n #keep stuff in a dictionary while building\n self._entries = {}\n self._lastEntries = {}\n self._flowable = None\n self.setup(**kwargs)\n\n def getFormatFunc(self,format):\n try:\n D = {}\n exec('from reportlab.lib.sequencer import _format_%s as formatFunc' % format, D)\n return D['formatFunc']\n except ImportError:\n raise ValueError('Unknown format %r' % format)\n\n def setup(self, style=None, dot=None, tableStyle=None, headers=True, name=None, format='123', offset=0):\n \"\"\"\n This method makes it possible to change styling and other parameters on an existing object.\n \n style is the paragraph style to use for index entries.\n dot can either be None or a string. If it's None, entries are immediatly followed by their\n corresponding page numbers. If it's a string, page numbers are aligned on the right side\n of the document and the gap filled with a repeating sequence of the string.\n tableStyle is the style used by the table which the index uses to draw itself. Use this to\n change properties like spacing between elements.\n headers is a boolean. If it is True, alphabetic headers are displayed in the Index when the first\n letter changes. If False, we just output some extra space before the next item \n name makes it possible to use several indexes in one document. If you want this use this\n parameter to give each index a unique name. You can then index a term by refering to the\n name of the index which it should appear in:\n \n \n\n format can be 'I', 'i', '123', 'ABC', 'abc'\n \"\"\"\n \n if style is None:\n style = ParagraphStyle(name='index',\n fontName=_baseFontName,\n fontSize=11)\n self.textStyle = style\n self.tableStyle = tableStyle or defaultTableStyle\n self.dot = dot\n self.headers = headers\n if name is None:\n from reportlab.platypus.paraparser import DEFAULT_INDEX_NAME as name\n self.name = name\n self.formatFunc = self.getFormatFunc(format)\n self.offset = offset\n\n def __call__(self,canv,kind,label):\n try:\n terms, format, offset = decode_label(label)\n except:\n terms = label\n format = offset = None\n if format is None:\n formatFunc = self.formatFunc\n else:\n formatFunc = self.getFormatFunc(format)\n if offset is None:\n offset = self.offset\n\n terms = commasplit(terms)\n pns = formatFunc(canv.getPageNumber()-offset)\n key = 'ix_%s_%s_p_%s' % (self.name, label, pns)\n\n info = canv._curr_tx_info\n canv.bookmarkHorizontal(key, info['cur_x'], info['cur_y'] + info['leading'])\n self.addEntry(terms, pns, key)\n\n def getCanvasMaker(self, canvasmaker=canvas.Canvas):\n\n def newcanvasmaker(*args, **kwargs):\n from reportlab.pdfgen import canvas\n c = canvasmaker(*args, **kwargs)\n setattr(c,self.name,self)\n return c\n\n return newcanvasmaker\n\n def isIndexing(self):\n return 1\n\n def isSatisfied(self):\n return (self._entries == self._lastEntries)\n\n def beforeBuild(self):\n # keep track of the last run\n self._lastEntries = self._entries.copy()\n self.clearEntries()\n\n def clearEntries(self):\n self._entries = {}\n\n def notify(self, kind, stuff):\n \"\"\"The notification hook called to register all kinds of events.\n\n Here we are interested in 'IndexEntry' events only.\n \"\"\"\n if kind == 'IndexEntry':\n (text, pageNum) = stuff\n self.addEntry(text, pageNum)\n\n def addEntry(self, text, pageNum, key=None):\n \"\"\"Allows incremental buildup\"\"\"\n self._entries.setdefault(makeTuple(text),set([])).add((pageNum, key))\n\n def split(self, availWidth, availHeight):\n \"\"\"At this stage we do not care about splitting the entries,\n we will just return a list of platypus tables. Presumably the\n calling app has a pointer to the original TableOfContents object;\n Platypus just sees tables.\n \"\"\"\n return self._flowable.splitOn(self.canv,availWidth, availHeight)\n\n def _getlastEntries(self, dummy=[(['Placeholder for index'],enumerate((None,)*3))]):\n '''Return the last run's entries! If there are none, returns dummy.'''\n if not self._lastEntries:\n if self._entries:\n return list(self._entries.items())\n return dummy\n return list(self._lastEntries.items())\n\n def _build(self,availWidth,availHeight):\n _tempEntries = self._getlastEntries()\n def getkey(seq):\n return [x.upper() for x in seq[0]]\n _tempEntries.sort(key=getkey)\n leveloffset = self.headers and 1 or 0\n\n def drawIndexEntryEnd(canvas, kind, label):\n '''Callback to draw dots and page numbers after each entry.'''\n style = self.getLevelStyle(leveloffset)\n pages = decode_label(label)\n drawPageNumbers(canvas, style, pages, availWidth, availHeight, self.dot)\n self.canv.drawIndexEntryEnd = drawIndexEntryEnd\n\n alpha = ''\n tableData = []\n lastTexts = []\n alphaStyle = self.getLevelStyle(0)\n for texts, pageNumbers in _tempEntries:\n texts = list(texts)\n #track when the first character changes; either output some extra\n #space, or the first letter on a row of its own. We cannot do\n #widow/orphan control, sadly.\n nalpha = texts[0][0].upper()\n if alpha != nalpha:\n alpha = nalpha\n if self.headers:\n header = alpha\n else:\n header = ' '\n tableData.append([Spacer(1, alphaStyle.spaceBefore),])\n tableData.append([Paragraph(header, alphaStyle),])\n tableData.append([Spacer(1, alphaStyle.spaceAfter),])\n\n \n i, diff = listdiff(lastTexts, texts)\n if diff:\n lastTexts = texts\n texts = texts[i:]\n label = encode_label(list(pageNumbers))\n texts[-1] = '%s' % (texts[-1], label)\n for text in texts:\n #Platypus and RML differ on how parsed XML attributes are escaped. \n #e.g. . The only place this seems to bite us is in\n #the index entries so work around it here.\n text = escapeOnce(text) \n \n style = self.getLevelStyle(i+leveloffset)\n para = Paragraph(text, style)\n if style.spaceBefore:\n tableData.append([Spacer(1, style.spaceBefore),])\n tableData.append([para,])\n i += 1\n\n self._flowable = Table(tableData, colWidths=[availWidth], style=self.tableStyle)\n\n def wrap(self, availWidth, availHeight):\n \"All table properties should be known by now.\"\n self._build(availWidth,availHeight)\n self.width, self.height = self._flowable.wrapOn(self.canv,availWidth, availHeight)\n return self.width, self.height\n\n def drawOn(self, canvas, x, y, _sW=0):\n \"\"\"Don't do this at home! The standard calls for implementing\n draw(); we are hooking this in order to delegate ALL the drawing\n work to the embedded table object.\n \"\"\"\n self._flowable.drawOn(canvas, x, y, _sW)\n\n def draw(self):\n t = self._flowable\n ocanv = getattr(t,'canv',None)\n if not ocanv:\n t.canv = self.canv\n try:\n t.draw()\n finally:\n if not ocanv:\n del t.canv\n\n def getLevelStyle(self, n):\n '''Returns the style for level n, generating and caching styles on demand if not present.'''\n if not hasattr(self.textStyle, '__iter__'):\n self.textStyle = [self.textStyle]\n try:\n return self.textStyle[n]\n except IndexError:\n self.textStyle = list(self.textStyle)\n prevstyle = self.getLevelStyle(n-1)\n self.textStyle.append(ParagraphStyle(\n name='%s-%d-indented' % (prevstyle.name, n),\n parent=prevstyle,\n firstLineIndent = prevstyle.firstLineIndent+.2*cm,\n leftIndent = prevstyle.leftIndent+.2*cm))\n return self.textStyle[n]\n\nAlphabeticIndex = SimpleIndex\n\ndef listdiff(l1, l2):\n m = min(len(l1), len(l2))\n for i in range(m):\n if l1[i] != l2[i]:\n return i, l2[i:]\n return m, l2[m:]\n\nclass ReferenceText(IndexingFlowable):\n \"\"\"Fakery to illustrate how a reference would work if we could\n put it in a paragraph.\"\"\"\n def __init__(self, textPattern, targetKey):\n self.textPattern = textPattern\n self.target = targetKey\n self.paraStyle = ParagraphStyle('tmp')\n self._lastPageNum = None\n self._pageNum = -999\n self._para = None\n\n def beforeBuild(self):\n self._lastPageNum = self._pageNum\n\n def notify(self, kind, stuff):\n if kind == 'Target':\n (key, pageNum) = stuff\n if key == self.target:\n self._pageNum = pageNum\n\n def wrap(self, availWidth, availHeight):\n text = self.textPattern % self._lastPageNum\n self._para = Paragraph(text, self.paraStyle)\n return self._para.wrap(availWidth, availHeight)\n\n def drawOn(self, canvas, x, y, _sW=0):\n self._para.drawOn(canvas, x, y, _sW)\n\n\n"},"meta":{"kind":"string","value":"{'content_hash': '1b5c2577f7858da7217ad117dad184a3', 'timestamp': '', 'source': 'github', 'line_count': 551, 'max_line_length': 123, 'avg_line_length': 37.201451905626136, 'alnum_prop': 0.6104985852278271, 'repo_name': 'kitanata/resume', 'id': 'd3f685368eb460f5302713072e6071a83a97cfb9', 'size': '20696', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'env/lib/python2.7/site-packages/reportlab/platypus/tableofcontents.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '4224'}, {'name': 'CoffeeScript', 'bytes': '385'}, {'name': 'JavaScript', 'bytes': '37733'}]}"}}},{"rowIdx":849750,"cells":{"text":{"kind":"string","value":"/*global TimelineUrl*/\n'use strict';\n\nclass TimelineUrlPane {\n\tconstructor() {\n\t\tthis.paneTitle = 'Generate Timeline URL';\n\t\tthis.createSidebar();\n\t}\n\n\tcreateSidebar() {\n\t\tchrome.devtools.panels.sources.createSidebarPane(this.paneTitle, function (sidebar) {\n\t\t\tsidebar.setPage('sidebar.html');\n\t\t\tsidebar.onShown.addListener(this.bindEvents.bind(this));\n\t\t}.bind(this));\n\t}\n\n\tbindEvents(win) {\n\t\twin.generateBtn.addEventListener('click', function () {\n\t\t\tnew TimelineUrl(win);\n\t\t});\n\t}\n}\n\n// kick it off.\nvar tlpane = new TimelineUrlPane();\n"},"meta":{"kind":"string","value":"{'content_hash': '742917a9f15df828f84d35166ad1da43', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 87, 'avg_line_length': 21.64, 'alnum_prop': 0.7024029574861368, 'repo_name': 'ChromeDevTools/timeline-url', 'id': '6187d7a7006350e1d6f4c09cba98279a1c60047d', 'size': '541', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'app/scripts/panel.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '2082'}, {'name': 'JavaScript', 'bytes': '7945'}, {'name': 'Shell', 'bytes': '649'}]}"}}},{"rowIdx":849751,"cells":{"text":{"kind":"string","value":"\n * @created 04.11.13 12:48\n */\nclass PartnerClient extends AbstractServiceClient\n{\n\n /**\n * Order is being processed\n */\n const ORDER_STATUS_PROCESSING = 'PROCESSING';\n\n /**\n * Order submitted to the delivery\n */\n const ORDER_STATUS_DELIVERY = 'DELIVERY';\n\n /**\n * Order delivered to the point of self-delivery\n */\n const ORDER_STATUS_PICKUP = 'PICKUP';\n\n /**\n * The order is received by the buyer\n */\n const ORDER_STATUS_DELIVERED = 'DELIVERED';\n\n /**\n * Order canceled.\n */\n const ORDER_STATUS_CANCELLED = 'CANCELLED';\n\n //Sub-statuses for status CANCELLED\n // - the buyer is not finalized the reserved order on time\n const ORDER_SUBSTATUS_RESERVATION_EXPIRED = 'RESERVATION_EXPIRED';\n // - the buyer did not pay for the order ( for the type of payment PREPAID)\n const ORDER_SUBSTATUS_USER_NOT_PAID = 'USER_NOT_PAID';\n // - failed to communicate with the buyer\n const ORDER_SUBSTATUS_USER_UNREACHABLE = 'USER_UNREACHABLE';\n // - buyer canceled the order for cause\n const ORDER_SUBSTATUS_USER_CHANGED_MIND = 'USER_CHANGED_MIND';\n // - the buyer is not satisfied with the terms of delivery\n const ORDER_SUBSTATUS_USER_REFUSED_DELIVERY = 'USER_REFUSED_DELIVERY';\n // - the buyer did not fit the goods\n const ORDER_SUBSTATUS_USER_REFUSED_PRODUCT = 'USER_REFUSED_PRODUCT';\n // - shop can not fulfill the order\n const ORDER_SUBSTATUS_SHOP_FAILED = 'SHOP_FAILED';\n // - the buyer is not satisfied with the quality of the goods\n const ORDER_SUBSTATUS_USER_REFUSED_QUALITY = 'USER_REFUSED_QUALITY';\n // - buyer changes the composition of the order\n const ORDER_SUBSTATUS_REPLACING_ORDER = 'REPLACING_ORDER';\n //- store does not process orders on time\n const ORDER_SUBSTATUS_PROCESSING_EXPIRED = 'PROCESSING_EXPIRED';\n\n //Способ оплаты заказа\n //предоплата через Яндекс;\n const PAYMENT_METHOD_YANDEX = 'YANDEX';\n //предоплата напрямую магазину,\n //не принимающему предоплату через Яндекс.\n const PAYMENT_METHOD_SHOP_PREPAID = 'SHOP_PREPAID';\n // наличный расчет при получении заказа;\n const PAYMENT_METHOD_CASH_ON_DELIVERY = 'CASH_ON_DELIVERY';\n // оплата банковской картой при получении заказа.\n const PAYMENT_METHOD_CARD_ON_DELIVERY = 'CARD_ON_DELIVERY';\n\n //Типы доставки\n //курьерская доставка\n const DELIVERY_TYPE_DELIVERY = 'DELIVERY';\n //самовывоз\n const DELIVERY_TYPE_PICKUP = 'PICKUP';\n //почта\n const DELIVERY_TYPE_POST = 'POST';\n\n const ORDER_DECLINE_REASON_OUT_OF_DATE= 'OUT_OF_DATE';\n\n /**\n * Requested version of API\n * @var string\n */\n private $version = 'v2';\n\n /**\n * Application id\n *\n * @var string\n */\n protected $clientId;\n\n /**\n * User login\n *\n * @var string\n */\n protected $login;\n\n /**\n * Campaign Id\n *\n * @var string\n */\n protected $campaignId;\n\n /**\n * API domain\n *\n * @var string\n */\n protected $serviceDomain = 'api.partner.market.yandex.ru';\n\n /**\n * Get url to service resource with parameters\n *\n * @param string $resource\n * @see http://api.yandex.ru/market/partner/doc/dg/concepts/method-call.xml\n * @return string\n */\n public function getServiceUrl($resource = '')\n {\n return $this->serviceScheme . '://' . $this->serviceDomain . '/'\n . $this->version . '/' . $resource;\n }\n\n /**\n * @param string $token access token\n */\n public function __construct($token = '')\n {\n $this->setAccessToken($token);\n }\n\n /**\n * @param string $clientId\n */\n public function setClientId($clientId)\n {\n $this->clientId = $clientId;\n }\n\n /**\n * @param string $login\n */\n public function setLogin($login)\n {\n $this->login = $login;\n }\n\n /**\n * @param string $campaignId\n */\n public function setCampaignId($campaignId)\n {\n $this->campaignId = $campaignId;\n }\n\n /**\n * @return string\n */\n public function getClientId()\n {\n return $this->clientId;\n }\n\n /**\n * @return string\n */\n public function getLogin()\n {\n return $this->login;\n }\n\n /**\n * Sends a request\n *\n * @param string $method HTTP method\n * @param string|UriInterface $uri URI object or string.\n * @param array $options Request options to apply.\n *\n * @return Response\n *\n * @throws ForbiddenException\n * @throws UnauthorizedException\n * @throws PartnerRequestException\n */\n protected function sendRequest($method, $uri, array $options = [])\n {\n try {\n $response = $this->getClient()->request($method, $uri, $options);\n } catch (ClientException $ex) {\n $result = $ex->getResponse();\n $code = $result->getStatusCode();\n $message = $result->getReasonPhrase();\n\n $body = $result->getBody();\n if ($body) {\n $jsonBody = json_decode($body);\n if ($jsonBody && isset($jsonBody->error) && isset($jsonBody->error->message)) {\n $message = $jsonBody->error->message;\n }\n }\n\n if ($code === 403) {\n throw new ForbiddenException($message);\n }\n\n if ($code === 401) {\n throw new UnauthorizedException($message);\n }\n\n throw new PartnerRequestException(\n 'Service responded with error code: \"' . $code . '\" and message: \"' . $message . '\"',\n $code\n );\n }\n\n return $response;\n }\n\n /**\n * Get OAuth data for header request\n *\n * @see http://api.yandex.ru/market/partner/doc/dg/concepts/authorization.xml\n *\n * @return string\n */\n public function getAccessToken()\n {\n return 'oauth_token=' . parent::getAccessToken() . ', oauth_client_id=' . $this->getClientId()\n . ', oauth_login=' . $this->getLogin();\n }\n\n /**\n * Get User Campaigns\n *\n * Returns the user to the list of campaigns Yandex.market.\n * The list coincides with the list of campaigns\n * that are displayed in the partner interface Yandex.Market on page \"My shops.\"\n *\n * @see http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns.xml\n *\n * @return Models\\Campaigns\n */\n public function getCampaigns()\n {\n $resource = 'campaigns.json';\n\n $response = $this->sendRequest('GET', $this->getServiceUrl($resource));\n\n $decodedResponseBody = $this->getDecodedBody($response->getBody());\n\n $getCampaignsResponse = new Models\\GetCampaignsResponse($decodedResponseBody);\n return $getCampaignsResponse->getCampaigns();\n }\n\n\n /**\n * Get information about orders by campaign id\n *\n * @param array $params\n *\n * Returns information on the requested orders.\n * Available filtering by date ordering and order status.\n * The maximum range of dates in a single request for a resource - 30 days.\n *\n * @see http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-orders.xml\n *\n * @return Models\\GetOrdersResponse\n */\n public function getOrdersResponse($params = [])\n {\n $resource = 'campaigns/' . $this->campaignId . '/orders.json';\n $resource .= '?' . http_build_query($params);\n\n $response = $this->sendRequest('GET', $this->getServiceUrl($resource));\n\n $decodedResponseBody = $this->getDecodedBody($response->getBody());\n\n return new Models\\GetOrdersResponse($decodedResponseBody);\n }\n\n\n /**\n * Get only orders data without pagination\n *\n * @param array $params\n * @return null|Models\\Orders\n */\n public function getOrders($params = [])\n {\n return $this->getOrdersResponse($params)->getOrders();\n }\n\n\n /**\n * Get order info\n *\n * @param int $orderId\n * @return Models\\Order\n *\n * @link http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-orders-id.xml\n */\n public function getOrder($orderId)\n {\n $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '.json';\n\n $response = $this->sendRequest('GET', $this->getServiceUrl($resource));\n\n $decodedResponseBody = $this->getDecodedBody($response->getBody());\n\n $getOrderResponse = new Models\\GetOrderResponse($decodedResponseBody);\n return $getOrderResponse->getOrder();\n }\n\n\n /**\n * Send changed status to Yandex.Market\n *\n * @param int $orderId\n * @param string $status\n * @param null|string $subStatus\n * @return Models\\Order\n *\n * @link http://api.yandex.ru/market/partner/doc/dg/reference/put-campaigns-id-orders-id-status.xml\n */\n public function setOrderStatus($orderId, $status, $subStatus = null)\n {\n $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '/status.json';\n\n $data = [\n \"order\" => [\n \"status\" => $status\n ]\n ];\n if ($subStatus) {\n $data['order']['substatus'] = $subStatus;\n }\n\n $response = $this->sendRequest(\n 'PUT',\n $this->getServiceUrl($resource),\n [\n 'json' => $data\n ]\n );\n\n $decodedResponseBody = $this->getDecodedBody($response->getBody());\n\n $updateOrderStatusResponse = new Models\\UpdateOrderStatusResponse($decodedResponseBody);\n return $updateOrderStatusResponse->getOrder();\n }\n\n\n /**\n * Update changed delivery parameters\n *\n * @param int $orderId\n * @param Models\\Delivery $delivery\n * @return Models\\Order\n *\n * Example:\n * PUT /v2/campaigns/10003/order/12345/delivery.json HTTP/1.1\n *\n * @link http://api.yandex.ru/market/partner/doc/dg/reference/put-campaigns-id-orders-id-delivery.xml\n */\n public function updateDelivery($orderId, Models\\Delivery $delivery)\n {\n $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '/delivery.json';\n\n $response = $this->sendRequest(\n 'PUT',\n $this->getServiceUrl($resource),\n [\n 'json' => $delivery->toArray()\n\n ]\n );\n\n $decodedResponseBody = $this->getDecodedBody($response->getBody());\n\n $updateOrderDeliveryResponse = new Models\\UpdateOrderDeliveryResponse($decodedResponseBody);\n return $updateOrderDeliveryResponse->getOrder();\n }\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '4ceff4bb2d824d316d860707f4961306', 'timestamp': '', 'source': 'github', 'line_count': 404, 'max_line_length': 105, 'avg_line_length': 27.70049504950495, 'alnum_prop': 0.5951210794388347, 'repo_name': 'zbarinov/yandex-php-library', 'id': '4d23b3d0fa84b9ced63215d540995f4a205b7969', 'size': '11532', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Yandex/Market/Partner/PartnerClient.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Nginx', 'bytes': '715'}, {'name': 'PHP', 'bytes': '1149782'}, {'name': 'Shell', 'bytes': '4433'}]}"}}},{"rowIdx":849752,"cells":{"text":{"kind":"string","value":"require 'spec_helper'\nrequire 'devise-links/links/registration'\nrequire 'devise-links/links/labels'\n\ndescribe Devise::Links::Registration do\n \n extend_view_with Devise::Links::Registration\n extend_view_with Devise::Links::Labels\n \n describe '#new_registration_link' do\n it \"should create a registration link\" do\n view_engine do |e, view|\n label = 'new registration'\n path = 'new/reg/path' \n\n # view.stubs(:user_reg_path).with(:new, :admin).returns path\n view.stubs(:new_registration_path).returns path\n \n output_label = view.new_registration_label\n \n view.stubs(:link_to).returns output_label\n \n res = e.run_template do \n %{<%= new_registration_link(:role => :admin) %> }\n end\n res.should match /#{output_label}/\n end\n end\n end\nend\n\n"},"meta":{"kind":"string","value":"{'content_hash': 'de7c41818d2c5919b9bb8ae9e29f71d2', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 68, 'avg_line_length': 27.677419354838708, 'alnum_prop': 0.6177156177156177, 'repo_name': 'kristianmandrup/devise-links', 'id': 'a49f5e2681fe23a30f98992f262ee298d4f093eb', 'size': '858', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/devise-links/registration-links_spec.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '10567'}]}"}}},{"rowIdx":849753,"cells":{"text":{"kind":"string","value":"package android.support.log4j2.slf4j;\n\nimport org.apache.logging.log4j.LogManager;\nimport org.apache.logging.log4j.spi.AbstractLoggerAdapter;\nimport org.apache.logging.log4j.spi.LoggerContext;\nimport org.apache.logging.slf4j.Log4jLogger;\nimport org.slf4j.ILoggerFactory;\nimport org.slf4j.Logger;\n\n/**\n * Log4jLoggerFactory\n */\n\npublic class Log4jLoggerFactory extends AbstractLoggerAdapter implements ILoggerFactory {\n\n @Override\n protected Logger newLogger(final String name, final LoggerContext context) {\n final String key = Logger.ROOT_LOGGER_NAME.equals(name) ? LogManager.ROOT_LOGGER_NAME : name;\n return new Log4jLogger(context.getLogger(key), name);\n }\n\n @Override\n protected LoggerContext getContext() {\n return LogManager.getContext(false);\n }\n\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '30ecddd07332e8e153d734ede4bb6409', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 101, 'avg_line_length': 29.77777777777778, 'alnum_prop': 0.7611940298507462, 'repo_name': 'fine1021/Log4JAndroid', 'id': '783ab0dc661cf1d7b6b15a97dc7d54f04e361dad', 'size': '804', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'log4j2-android/src/main/java/android/support/log4j2/slf4j/Log4jLoggerFactory.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '142518'}]}"}}},{"rowIdx":849754,"cells":{"text":{"kind":"string","value":"title = $breadcrum;\n$this->params['breadcrumbs'][] = $this->title;\n?>\n
\n $dataProvider,\n'itemView' => '/content/listItem',\n'layout' => \"{items}\\n{pager}\",\n]);?>\n\n
\n"},"meta":{"kind":"string","value":"{'content_hash': 'e3a665720ae77a0d5393b311aae3978f', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 52, 'avg_line_length': 21.63157894736842, 'alnum_prop': 0.6423357664233577, 'repo_name': 'froyot/dandan', 'id': '4af02620b7a0482e6beaef0c7179e5a7dedb9098', 'size': '411', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'fronted/views/post/index.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '515'}, {'name': 'CSS', 'bytes': '491122'}, {'name': 'HTML', 'bytes': '87733'}, {'name': 'JavaScript', 'bytes': '1879144'}, {'name': 'PHP', 'bytes': '335320'}]}"}}},{"rowIdx":849755,"cells":{"text":{"kind":"string","value":"local_path=$(dirname $0)\nsource $local_path/Common\n\nfunc_check_xwalkservice\nif [[ $? -eq 1 ]]; then\n func_xwalkservice\n if [[ $? -eq 1 ]]; then\n echo \"set xwalk service failure\"\n exit 1\n fi\nfi\n\npkgcmd -i -t wgt -p $local_path/../source/manifest_app_mainsource_tests.wgt -q\na=`sqlite3 /home/app/.applications/dbspace/.app_info.db \"select package from app_info;\" | grep mainsource`\nif [[ $a =~ 'mainsource' ]]; then\n echo \"Use run as service install successfully\"\nelse\n echo \"Use run as service mode install failure\"\n exit 1\nfi\n\nif [[ $a =~ 'mainsource' ]]; then\n echo \"Use run as service install app and the DB correctly\"\n pkgcmd -u -n mainsource -q\n exit 0\nelse\n echo \"Use run as service install app and the DB incorrectly\"\n pkgcmd -u -n mainsource -q\n exit 1\nfi\n"},"meta":{"kind":"string","value":"{'content_hash': 'de93ce27f338800de3710a18462304f2', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 106, 'avg_line_length': 34.1, 'alnum_prop': 0.5219941348973607, 'repo_name': 'yugang/crosswalk-test-suite', 'id': '54c0b08cb3d270907554aa10b7327052f000be70', 'size': '2539', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'wrt/wrt-rtbin-tizen-tests/rtbinauto/Crosswalk_Run_As_Service_CheckDB.sh', 'mode': '33261', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '3495'}, {'name': 'CSS', 'bytes': '1694855'}, {'name': 'Erlang', 'bytes': '2850'}, {'name': 'Java', 'bytes': '155590'}, {'name': 'JavaScript', 'bytes': '32256550'}, {'name': 'PHP', 'bytes': '43783'}, {'name': 'Perl', 'bytes': '1696'}, {'name': 'Python', 'bytes': '4215706'}, {'name': 'Shell', 'bytes': '638387'}, {'name': 'XSLT', 'bytes': '2143471'}]}"}}},{"rowIdx":849756,"cells":{"text":{"kind":"string","value":"export * from \"./trafficChart.component\";\nexport * from \"./trafficChart.service\";\n"},"meta":{"kind":"string","value":"{'content_hash': '06019fa48b660eb111ab948d000baf9f', 'timestamp': '', 'source': 'github', 'line_count': 2, 'max_line_length': 41, 'avg_line_length': 41.0, 'alnum_prop': 0.7317073170731707, 'repo_name': 'huazai128/angular2-admin', 'id': '05964f32312de63dbc63db611f5331f4f1420667', 'size': '82', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/app/pages/dashboard/trafficChart/index.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '76849'}, {'name': 'HTML', 'bytes': '20295'}, {'name': 'JavaScript', 'bytes': '38780'}, {'name': 'Shell', 'bytes': '153'}, {'name': 'TypeScript', 'bytes': '125804'}]}"}}},{"rowIdx":849757,"cells":{"text":{"kind":"string","value":"\npackage nz.co.doltech.gwtjui.demo.client.application.interactions.selectable;\n\nimport com.google.gwt.core.client.Scheduler;\nimport com.google.gwt.uibinder.client.UiBinder;\nimport com.google.gwt.uibinder.client.UiField;\nimport com.google.gwt.user.client.Command;\nimport com.google.gwt.user.client.ui.FocusPanel;\nimport com.google.gwt.user.client.ui.SimplePanel;\nimport com.google.gwt.user.client.ui.Widget;\nimport com.gwtplatform.mvp.client.ViewWithUiHandlers;\nimport nz.co.doltech.gwtjui.interactions.client.ui.Selectable;\nimport org.gwtbootstrap3.client.ui.html.OrderedList;\n\nimport javax.inject.Inject;\n\npublic class SelectableView extends ViewWithUiHandlers implements SelectablePresenter.MyView {\n interface Binder extends UiBinder {\n }\n\n @UiField OrderedList list;\n @UiField FocusPanel focus;\n\n private Selectable selectable;\n\n @Inject\n SelectableView(Binder uiBinder) {\n initWidget(uiBinder.createAndBindUi(this));\n\n selectable = new Selectable(list);\n }\n\n @Override\n protected void onAttach() {\n super.onAttach();\n\n Scheduler.get().scheduleDeferred(new Command() {\n @Override\n public void execute() {\n focus.setFocus(true);\n focus.setFocus(false);\n }\n });\n }\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '0bc1b6f9eb0da8c0a3e8fd7d83c096c5', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 116, 'avg_line_length': 29.91111111111111, 'alnum_prop': 0.7184249628528975, 'repo_name': 'BenDol/gwt-jui-demo', 'id': '03841050047850066da53d8d784441569f8e416d', 'size': '1945', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/nz/co/doltech/gwtjui/demo/client/application/interactions/selectable/SelectableView.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '2462'}, {'name': 'HTML', 'bytes': '1602'}, {'name': 'Java', 'bytes': '68504'}, {'name': 'Shell', 'bytes': '1342'}]}"}}},{"rowIdx":849758,"cells":{"text":{"kind":"string","value":"
\n I parametri consentono di richiedere agli utenti uno o più input che saranno\n forniti a una compilazione. Ad esempio, si potrebbe avere un progetto che\n esegue test su richiesta consentendo agli utenti di caricare un file ZIP\n contenente i binari da testare. Si potrebbe ottenere tale risultato\n aggiungendo qui un\n Parametro file\n .\n
\n Oppure si potrebbe avere un progetto che rilascia del software e si desidera\n che gli utenti immettano delle note di rilascio che saranno caricate insieme\n al software. Si potrebbe ottenere tale risultato aggiungendo qui un\n Parametro stringa multiriga\n .\n

\n Ogni parametro ha un\n Nome\n e qualche tipo di\n Valore\n che dipende dal tipo del parametro. Queste coppie nome-valore saranno\n esportate come variabili d'ambiente all'avvio della compilazione,\n consentendo ai passaggi successivi della configurazione della compilazione\n (come le istruzioni di compilazione) di accedere a tali valori, ad esempio\n utilizzando la sintassi\n ${NOME_PARAMETRO}\n (o\n %NOME_PARAMETRO%\n su Windows).\n
\n Ciò implica anche che ogni parametro definito qui debba avere un\n Nome\n univoco.\n

\n\n

\n Quando un progetto è parametrizzato, il collegamento\n Compila ora\n usuale sarà sostituito da un collegamento\n Compila con parametri\n dove agli utenti verrà chiesto di specificare i valori per ognuno dei\n parametri definiti. Se questi scelgono di non immettere nulla, la\n compilazione verrà avviata con il valore predefinito per ogni parametro.\n

\n\n

\n Se una compilazione è avviata automaticamente, ad esempio se è avviata da un\n trigger del sistema di gestione del codice sorgente, saranno utilizzati i\n valori predefiniti per ogni parametro.\n

\n\n

\n Quando una compilazione parametrizzata è in coda, i tentativi di avvio di\n un'altra compilazione dello stesso progetto avranno successo solo se i\n valori dei parametri sono diversi, o se l'opzione\n Esegui compilazioni concorrenti se necessario\n è abilitata.\n

\n\n

\n Si veda la\n \n documentazione sulle compilazioni parametrizzate\n \n per ulteriori informazioni su questa funzionalità.\n

\n
\n"},"meta":{"kind":"string","value":"{'content_hash': '749fbff80f64cb8457b3a335c0efba01', 'timestamp': '', 'source': 'github', 'line_count': 70, 'max_line_length': 80, 'avg_line_length': 35.02857142857143, 'alnum_prop': 0.7222675367047309, 'repo_name': 'damianszczepanik/jenkins', 'id': 'f738e6f2852b08ccac8beaa3e7c30d54ecf978f0', 'size': '2463', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_it.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ANTLR', 'bytes': '4633'}, {'name': 'Batchfile', 'bytes': '1023'}, {'name': 'C', 'bytes': '2091'}, {'name': 'CSS', 'bytes': '215757'}, {'name': 'Dockerfile', 'bytes': '163'}, {'name': 'Groovy', 'bytes': '75812'}, {'name': 'HTML', 'bytes': '938754'}, {'name': 'Handlebars', 'bytes': '15221'}, {'name': 'Java', 'bytes': '11624679'}, {'name': 'JavaScript', 'bytes': '392682'}, {'name': 'Less', 'bytes': '193265'}, {'name': 'Perl', 'bytes': '16145'}, {'name': 'Python', 'bytes': '4709'}, {'name': 'Ruby', 'bytes': '17290'}, {'name': 'Shell', 'bytes': '2354'}]}"}}},{"rowIdx":849759,"cells":{"text":{"kind":"string","value":"{-# LANGUAGE GADTs #-}\n{-# LANGUAGE ImplicitParams #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE RecordWildCards #-}\n{-# LANGUAGE ScopedTypeVariables #-}\n\n{-| Low-level file storage engine -}\nmodule Hevents.Eff.Store.FileOps where\n\nimport Control.Concurrent.Async\nimport Control.Concurrent.STM\nimport Control.Exception (Exception, IOException, bracket, catch)\nimport Control.Monad (forever)\nimport Control.Monad.Trans (liftIO)\nimport qualified Data.Binary.Get as Bin\nimport Data.ByteString (hGet, hPut)\nimport Data.ByteString.Lazy (fromStrict)\nimport Data.Either\nimport Data.Functor (void)\nimport Data.Monoid ((<>))\nimport Data.Serialize\nimport Data.Typeable\nimport Hevents.Eff.Store\nimport Prelude hiding (length, read)\nimport System.IO\n\n\n-- |Internal definition of the storage to use for operations\ndata FileStorage = FileStorage { storeName :: String\n , storeVersion :: Version\n , storeHandle :: Maybe Handle\n -- ^Handle to the underlying OS stream for storing events\n , storeTid :: TMVar (Async ())\n -- ^The store's thread id, if store is open and running\n , storeTQueue :: TBQueue QueuedOperation\n }\n\n-- | Options for opening storage\ndata StorageOptions = StorageOptions { storageFilePath :: FilePath\n -- ^The file path to store data\n , storageVersion :: Version\n -- ^Events version. Note this version represents the point of view of the consumer\n -- of this storage which may contain events with different versions. The implementation\n -- of `Versionable` should be able to handle any version, up to `storageVersion`\n , storageQueueSize :: Int\n -- ^Upper bound on the number of store operations that can be queued. The exact value\n -- is dependent on the number of clients this storage is consumed by and the operations\n -- throughput. Requests for operations will block when queue is full.\n }\n\ndefaultOptions :: StorageOptions\ndefaultOptions = StorageOptions \"store.data\" (Version 1) 100\n\ndata QueuedOperation where\n QueuedOperation :: forall s . \n { operation :: StoreOperation IO s,\n opResult :: TMVar (StorageResult s) } -> QueuedOperation\n\ndata StorageException = CannotDeserialize String\n deriving (Show, Typeable)\n\ninstance Exception StorageException\n\nopenFileStorage :: StorageOptions -> IO FileStorage\nopenFileStorage StorageOptions{..} = do\n tidvar <- atomically newEmptyTMVar\n tq <- newTBQueueIO storageQueueSize\n h <- openFile storageFilePath ReadWriteMode\n hSetBuffering h NoBuffering\n let s@FileStorage{..} = FileStorage storageFilePath storageVersion (Just h) tidvar tq\n tid <- async (runStorage s)\n atomically $ putTMVar storeTid tid\n return s\n\nopenHandleStorage :: Handle -> IO FileStorage\nopenHandleStorage hdl = do\n tidvar <- atomically newEmptyTMVar\n tq <- newTBQueueIO 100\n hSetBuffering hdl NoBuffering\n let s@FileStorage{..} = FileStorage \"\" (Version 1) (Just hdl) tidvar tq\n tid <- async (runStorage s)\n atomically $ putTMVar storeTid tid\n return s\n\ncloseFileStorage :: FileStorage -> IO FileStorage\ncloseFileStorage s@(FileStorage _ _ h ltid _) = do\n t <- liftIO $ atomically $ tryTakeTMVar ltid\n case t of\n Just tid -> liftIO $ cancel tid\n Nothing -> return ()\n void $ hClose `traverse` h\n return s\n\n-- | Run some computation requiring a `FileStorage`, automatically opening and closing required\n-- file.\nwithStorage :: StorageOptions -> (FileStorage -> IO a) -> IO a\nwithStorage opts = bracket (openFileStorage opts) closeFileStorage\n\nrunStorage :: FileStorage -> IO ()\nrunStorage FileStorage{..} = do\n forever $ do\n QueuedOperation op res <- atomically $ readTBQueue storeTQueue\n let ?currentVersion = storeVersion\n atomically . putTMVar res =<< runOp op storeHandle\n\n\nrunOp :: (?currentVersion::Version) =>\n StoreOperation IO s -> Maybe Handle -> IO (StorageResult s)\nrunOp _ Nothing = return NoOp\nrunOp (OpStore pre post) (Just h) =\n do\n p <- pre\n case p of\n Right ev -> do\n let s = doStore ev\n opres <- (hSeek h SeekFromEnd 0 >> hPut h s >> hFlush h >> return (WriteSucceed ev))\n `catch` \\ (ex :: IOException) -> return (OpFailed $ \"exception \" <> show ex <> \" while storing event\")\n WriteSucceed <$> (post $ Right opres)\n Left l -> WriteFailed <$> post (Left l)\n\nrunOp OpLoad (Just h) = do\n pos <- hTell h\n hSeek h SeekFromEnd 0\n sz <- hTell h\n hSeek h AbsoluteSeek 0\n opres <- (LoadSucceed <$> readAll h sz)\n `catch` \\ (ex :: IOException) -> return (OpFailed $ \"exception \" <> show ex <> \" while loading events\")\n hSeek h AbsoluteSeek pos\n return opres\n where\n readAll :: (?currentVersion :: Version, Versionable s) => Handle -> Integer -> IO [s]\n readAll hdl sz = if sz > 0 then\n do\n (loaded,ln) <- doLoad hdl\n case loaded of\n Right e -> do\n es <- readAll hdl (sz - ln)\n return $ e : es\n Left err -> fail err\n else\n return []\nrunOp OpReset (Just handle) =\n do\n w <- hIsWritable handle\n opres <- case w of\n False -> return $ OpFailed \"File handle not writeable while resetting event store\"\n True -> do\n emptyEvents `catch` \\ (ex :: IOException) -> return (OpFailed $ \"exception\" <> (show ex) <> \" while resetting event store\")\n where emptyEvents = do\n (hSetFileSize handle 0)\n return ResetSucceed\n return opres\n\n\n-- |Read a single event from file store, returning also the number of bytes read\n--\n-- This is not symetric to doStore as we need first to read the length of the message, then\n-- to read only the necessary amount of bytes from storage\ndoLoad :: Versionable s => Handle -> IO (Either String s, Integer)\ndoLoad h = do\n lw <- hGet h 4\n let l = fromIntegral $ Bin.runGet Bin.getWord32be $ fromStrict lw\n bs <- hGet h l\n let msg = do\n v <- getWord8\n _ <- getWord32be\n pay <- getByteString (l - 5)\n either fail return $ read (fromIntegral v) pay\n content = runGet msg bs\n return $ (content, fromIntegral $ l + 4)\n\npush :: StoreOperation IO s -> FileStorage -> IO (StorageResult s)\npush op FileStorage{..} = do\n v <- atomically $ do\n tmv <- newEmptyTMVar\n writeTBQueue storeTQueue (QueuedOperation op tmv)\n return tmv\n atomically $ takeTMVar v\n\nwriteStore :: (Versionable e) => FileStorage -> IO (Either a e) -> (Either a (StorageResult e) -> IO r) -> IO (StorageResult r)\nwriteStore s pre post = push (OpStore pre post) s\n\nreadStore :: (Versionable s) => FileStorage -> IO (StorageResult s)\nreadStore = push OpLoad \n\nresetStore :: FileStorage -> IO (StorageResult ())\nresetStore = push OpReset\n\n\ninstance Store IO FileStorage where\n close = closeFileStorage\n store = writeStore\n load = readStore\n reset = resetStore\n"},"meta":{"kind":"string","value":"{'content_hash': '3cf2667ec75bc3e2633189cfd8358724', 'timestamp': '', 'source': 'github', 'line_count': 194, 'max_line_length': 131, 'avg_line_length': 40.53092783505155, 'alnum_prop': 0.5906142693628386, 'repo_name': 'abailly/hevents', 'id': 'c5d2c04e26ee988a97ce21361e8a6d9308627593', 'size': '7863', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Hevents/Eff/Store/FileOps.hs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Haskell', 'bytes': '63862'}]}"}}},{"rowIdx":849760,"cells":{"text":{"kind":"string","value":"ACCEPTED\n\n#### According to\nInternational Plant Names Index\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull"},"meta":{"kind":"string","value":"{'content_hash': '454c8928366a8c3cb959cff93d58d0d7', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': 'c269b288701ac087aff2a42d2da6202c0d06493a', 'size': '178', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Caryophyllaceae/Silene/Silene kungessana/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}"}}},{"rowIdx":849761,"cells":{"text":{"kind":"string","value":"import os\nimport sys\nimport subprocess\n\ndef ReadKddsToBeCalculated(fname):\n \"\"\"\n self explanatory\n \"\"\"\n\n listKdds=[]\n\n with open(fname,'r') as f:\n for line in f:\n listKdds.append(line.rstrip('\\n'))\n\n return listKdds\n \ngcr = \"us.gcr.io\"\nproject = \"direct-disk-101619\"\ndocker = \"egs-rc-4039\"\n\nKdds = ReadKddsToBeCalculated(sys.argv[1])\n\ndocker2run = os.path.join(gcr, project, docker) # full path to docker\n \nfor kdd in Kdds:\n cmd = \"docker run {0} python main.py {1}\".format(docker2run, kdd)\n #print(cmd)\n rc = subprocess.call(cmd, shell=True)\n #print(rc)\n"},"meta":{"kind":"string","value":"{'content_hash': 'b2652ab7dc9508985a77a6633fe20a50', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 69, 'avg_line_length': 20.3, 'alnum_prop': 0.6338259441707718, 'repo_name': 'Iwan-Zotow/runEGS', 'id': '7f3bc8523aa7d240a3651756be534e9575f4fa09', 'size': '628', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'run_local.py', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'Jupyter Notebook', 'bytes': '12348489'}, {'name': 'Python', 'bytes': '205708'}]}"}}},{"rowIdx":849762,"cells":{"text":{"kind":"string","value":"module Features\n module AuthenticationHelpers\n unless ActionController::Base.new.respond_to?(:authenticate_participant!)\n ActionController::Base.class_eval do\n define_method(:authenticate_participant!) { true }\n end\n end\n end\nend\n"},"meta":{"kind":"string","value":"{'content_hash': 'ac5c7f2af57b176a12fc5a5e8cbe16f5', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 77, 'avg_line_length': 28.333333333333332, 'alnum_prop': 0.7215686274509804, 'repo_name': 'cbitstech/social_networking', 'id': 'dcce54b98f116267846b95ad566013a4f47d9d3c', 'size': '285', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/support/feature_helpers.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2598'}, {'name': 'HTML', 'bytes': '41438'}, {'name': 'JavaScript', 'bytes': '261548'}, {'name': 'Ruby', 'bytes': '179142'}]}"}}},{"rowIdx":849763,"cells":{"text":{"kind":"string","value":"module Status\n class Plugin\n # Plugin for Rubygems\n class Rubygems < self\n # Return url\n #\n # @return [String]\n #\n # @api private\n #\n def url\n \"https://rubygems.org/gems/#{project_short_name}\"\n end\n memoize :url\n\n # Return image source\n #\n # @return [String]\n #\n # @api private\n #\n def image_src\n \"https://badge.fury.io/rb/#{project_short_name}.png\"\n end\n memoize :image_src\n end\n end\nend\n"},"meta":{"kind":"string","value":"{'content_hash': '6be245db1b55add428a105e925b23ddd', 'timestamp': '', 'source': 'github', 'line_count': 28, 'max_line_length': 60, 'avg_line_length': 18.0, 'alnum_prop': 0.5099206349206349, 'repo_name': 'zaidan/rom-status', 'id': '955de0f07464467ab906a36877869f511f389571', 'size': '504', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/status/plugin/rubygems.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CoffeeScript', 'bytes': '454'}, {'name': 'Ruby', 'bytes': '35123'}]}"}}},{"rowIdx":849764,"cells":{"text":{"kind":"string","value":"package java8;\n\nimport com.sandwich.koan.Koan;\n\nimport java.util.Base64;\nimport java.io.UnsupportedEncodingException;\n\nimport static com.sandwich.koan.constant.KoanConstants.__;\nimport static com.sandwich.util.Assert.assertEquals;\n\npublic class AboutBase64 {\n\n private final String plainText = \"lorem ipsum\";\n private final String encodedText = \"bG9yZW0gaXBzdW0=\";\n\n @Koan\n public void base64Encoding() {\n try {\n // Encode the plainText\n // This uses the basic Base64 encoding scheme but there are corresponding\n // getMimeEncoder and getUrlEncoder methods available if you require a\n // different format/Base64 Alphabet \n assertEquals(encodedText, Base64.getEncoder().encodeToString(__.getBytes(\"utf-8\")));\n } catch (UnsupportedEncodingException ex) {}\n }\n\n @Koan\n public void base64Decoding() {\n // Decode the Base64 encodedText\n // This uses the basic Base64 decoding scheme but there are corresponding\n // getMimeDecoder and getUrlDecoder methods available if you require a\n // different format/Base64 Alphabet\n byte[] decodedBytes = Base64.getDecoder().decode(__);\n try {\n String decodedText = new String(decodedBytes, \"utf-8\");\n assertEquals(plainText, decodedText);\n } catch (UnsupportedEncodingException ex) {}\n }\n\n}\n"},"meta":{"kind":"string","value":"{'content_hash': 'd3d275755f4ea8e1a70e2cd58f75497e', 'timestamp': '', 'source': 'github', 'line_count': 40, 'max_line_length': 96, 'avg_line_length': 34.725, 'alnum_prop': 0.6781857451403888, 'repo_name': 'DavidWhitlock/java-koans', 'id': 'ed1235e89d727bf38b8e9dd949b89be65f349468', 'size': '1389', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'koans/src/java8/AboutBase64.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '1055'}, {'name': 'Java', 'bytes': '288280'}, {'name': 'Ruby', 'bytes': '751'}]}"}}},{"rowIdx":849765,"cells":{"text":{"kind":"string","value":"namespace System.Drawing.API\n{\n public interface IApiTiming\n {\n float DeltaTime { get; }\n }\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '91d4dff71faa5ec2c87c920185edf7ae', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 32, 'avg_line_length': 15.857142857142858, 'alnum_prop': 0.6036036036036037, 'repo_name': 'Meragon/Unity-WinForms', 'id': 'da15ce9d0a24a9f8df4638cd14c424768a40381c', 'size': '113', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Core/API/IApiTiming.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '1082017'}, {'name': 'ShaderLab', 'bytes': '2030'}]}"}}},{"rowIdx":849766,"cells":{"text":{"kind":"string","value":"class CefCallbackCToCpp\n : public CefCToCppRefCounted {\n public:\n CefCallbackCToCpp();\n\n // CefCallback methods.\n void Continue() OVERRIDE;\n void Cancel() OVERRIDE;\n};\n\n#endif // CEF_LIBCEF_DLL_CTOCPP_CALLBACK_CTOCPP_H_\n"},"meta":{"kind":"string","value":"{'content_hash': '42fa596748e6040fa083ef8bb9b12bc8', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 64, 'avg_line_length': 23.666666666666668, 'alnum_prop': 0.7183098591549296, 'repo_name': 'arkenthera/cef3d', 'id': '892d6e7ab624a835410c22c2b17948cef555c2c5', 'size': '1247', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Cef/libcef_dll/ctocpp/callback_ctocpp.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '1028782'}, {'name': 'C++', 'bytes': '2887899'}, {'name': 'CMake', 'bytes': '118535'}, {'name': 'HLSL', 'bytes': '821'}, {'name': 'Python', 'bytes': '82527'}]}"}}},{"rowIdx":849767,"cells":{"text":{"kind":"string","value":"\n\npackage org.gradle.api.internal.tasks.testing.results;\n\nimport org.gradle.api.internal.tasks.testing.TestCompleteEvent;\nimport org.gradle.api.internal.tasks.testing.TestDescriptorInternal;\nimport org.gradle.api.internal.tasks.testing.TestResultProcessor;\nimport org.gradle.api.internal.tasks.testing.TestStartEvent;\nimport org.gradle.api.tasks.testing.TestFailure;\nimport org.gradle.api.tasks.testing.TestOutputEvent;\n\npublic class AttachParentTestResultProcessor implements TestResultProcessor {\n private Object rootId;\n private final TestResultProcessor processor;\n\n public AttachParentTestResultProcessor(TestResultProcessor processor) {\n this.processor = processor;\n }\n\n @Override\n public void started(TestDescriptorInternal test, TestStartEvent event) {\n if (rootId == null) {\n assert test.isComposite();\n rootId = test.getId();\n } else if (event.getParentId() == null) {\n event = event.withParentId(rootId);\n }\n processor.started(test, event);\n }\n\n @Override\n public void failure(Object testId, TestFailure result) {\n processor.failure(testId, result);\n }\n\n @Override\n public void output(Object testId, TestOutputEvent event) {\n processor.output(testId, event);\n }\n\n @Override\n public void completed(Object testId, TestCompleteEvent event) {\n if (testId.equals(rootId)) {\n rootId = null;\n }\n processor.completed(testId, event);\n }\n}\n"},"meta":{"kind":"string","value":"{'content_hash': 'b0efecf7bbafa41abe21164804d9d76a', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 77, 'avg_line_length': 31.3125, 'alnum_prop': 0.7012641383898869, 'repo_name': 'gradle/gradle', 'id': 'd58225d4ece0ee44db8d19478afc7298230c2ac9', 'size': '2118', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'subprojects/testing-base/src/main/java/org/gradle/api/internal/tasks/testing/results/AttachParentTestResultProcessor.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '277'}, {'name': 'Brainfuck', 'bytes': '54'}, {'name': 'C', 'bytes': '123600'}, {'name': 'C++', 'bytes': '1781062'}, {'name': 'CSS', 'bytes': '151435'}, {'name': 'GAP', 'bytes': '424'}, {'name': 'Gherkin', 'bytes': '191'}, {'name': 'Groovy', 'bytes': '30897043'}, {'name': 'HTML', 'bytes': '54458'}, {'name': 'Java', 'bytes': '28750090'}, {'name': 'JavaScript', 'bytes': '78583'}, {'name': 'Kotlin', 'bytes': '4154213'}, {'name': 'Objective-C', 'bytes': '652'}, {'name': 'Objective-C++', 'bytes': '441'}, {'name': 'Python', 'bytes': '57'}, {'name': 'Ruby', 'bytes': '16'}, {'name': 'Scala', 'bytes': '10840'}, {'name': 'Shell', 'bytes': '12148'}, {'name': 'Swift', 'bytes': '2040'}, {'name': 'XSLT', 'bytes': '42693'}]}"}}},{"rowIdx":849768,"cells":{"text":{"kind":"string","value":"\n\n\n\n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n\n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n %simplethings.entityaudit.audited_entities%\n \n \n %simplethings.entityaudit.global_ignore_columns%\n \n \n %simplethings.entityaudit.table_prefix%\n \n \n %simplethings.entityaudit.table_suffix%\n \n \n %simplethings.entityaudit.revision_field_name%\n \n \n %simplethings.entityaudit.revision_type_field_name%\n \n \n %simplethings.entityaudit.revision_table_name%\n \n \n %simplethings.entityaudit.revision_id_field_type%\n \n \n \n\n\n"},"meta":{"kind":"string","value":"{'content_hash': '0ffc8483ff062ac6c31e4218921a088b', 'timestamp': '', 'source': 'github', 'line_count': 65, 'max_line_length': 185, 'avg_line_length': 53.69230769230769, 'alnum_prop': 0.6644699140401146, 'repo_name': 'kinkinweb/lhvb', 'id': '598d325a3987f0d5a5a35d62f7242fdaf65c22b6', 'size': '3490', 'binary': False, 'copies': '8', 'ref': 'refs/heads/master', 'path': 'vendor/simplethings/entity-audit-bundle/src/SimpleThings/EntityAudit/Resources/config/auditable.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '163'}, {'name': 'Batchfile', 'bytes': '376'}, {'name': 'CSS', 'bytes': '370932'}, {'name': 'Cucumber', 'bytes': '184496'}, {'name': 'HTML', 'bytes': '100628'}, {'name': 'JavaScript', 'bytes': '93972'}, {'name': 'Makefile', 'bytes': '1847'}, {'name': 'PHP', 'bytes': '544345'}, {'name': 'Ruby', 'bytes': '1112'}, {'name': 'Shell', 'bytes': '9898'}, {'name': 'Smarty', 'bytes': '721'}]}"}}},{"rowIdx":849769,"cells":{"text":{"kind":"string","value":"\n\n\n\n\n\nV8 API Reference Guide for node.js v6.10.2: Member List\n\n\n\n\n\n\n\n\n\n\n
\n
\n\n \n \n \n \n \n
\n
V8 API Reference Guide for node.js v6.10.2\n
\n
\n
\n\n\n\n
\n \n
\n \n\n
\n
\n\n\n
\n\n
\n\n
\n \n
\n
\n
\n
\n
v8::Exception Member List
\n
\n
\n\n

This is the complete list of members for v8::Exception, including all inherited members.

\n\n \n \n \n \n \n \n \n \n
CreateMessage(Isolate *isolate, Local&lt; Value &gt; exception)v8::Exceptionstatic
Error(Local&lt; String &gt; message) (defined in v8::Exception)v8::Exceptionstatic
GetStackTrace(Local&lt; Value &gt; exception)v8::Exceptionstatic
RangeError(Local&lt; String &gt; message) (defined in v8::Exception)v8::Exceptionstatic
ReferenceError(Local&lt; String &gt; message) (defined in v8::Exception)v8::Exceptionstatic
SyntaxError(Local&lt; String &gt; message) (defined in v8::Exception)v8::Exceptionstatic
TypeError(Local&lt; String &gt; message) (defined in v8::Exception)v8::Exceptionstatic
V8_DEPRECATED(&quot;Use version with an Isolate*&quot;, static Local&lt; Message &gt; CreateMessage(Local&lt; Value &gt; exception)) (defined in v8::Exception)v8::Exception
\n\n
\nGenerated by &#160;\n\"doxygen\"/\n 1.8.11\n
\n\n\n"},"meta":{"kind":"string","value":"{'content_hash': '72c2aa55f8e7f71c0f1c7d00dae8be0f', 'timestamp': '', 'source': 'github', 'line_count': 114, 'max_line_length': 379, 'avg_line_length': 61.98245614035088, 'alnum_prop': 0.661052929521653, 'repo_name': 'v8-dox/v8-dox.github.io', 'id': '7ce4edb063f4e8a0eb6fbace8b3f9ddd673225ab', 'size': '7066', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '1ff512c/html/classv8_1_1Exception-members.html', 'mode': '33188', 'license': 'mit', 'language': []}"}}},{"rowIdx":849770,"cells":{"text":{"kind":"string","value":"\r\nReview for Vertigo (1958)\r\n\r\n\r\n\r\n

Vertigo (1958)

reviewed by
Ian Low


\r\n
VERTIGO\r\nFragments Of An Obsession
\r\n

In the pantheon of film making, there are undoubtable classics that stand\r\nout as monumental artifacts of this art form. Some of these remain the\r\nstandards where new films are measured against and even imitated upon.\r\nCitizen Kane, Casablanca and Lawrence of Arabia are such examples of a great\r\ntradition of movie making that have been widely praised, liked and even\r\nanalyzed upon in countless books and articles. Yet, legendary as these films\r\nare, there is one motion picture that has reached the heights of such\r\nsimilar classic status, but still remains as one of the least conspicuous\r\namong its more illustrious peers. I am referring to Alfred Hitchcock's\r\nVertigo.

\r\n

Released to muted reviews and disappointing box office receipts, Vertigo has\r\nsince gained much respect and admiration from all aspects of the film\r\ncommunity. Ranging from film historians to the casual fan, Vertigo has now\r\ndeservedly taken its place among Hitchcock's other classic films as one of\r\nthe most intriguing of all thriller movies. And certainly, one of the most\r\npersonal films ever to have emerged from arguably, the best director in this\r\nbusiness. Beginning with this movie, Hitchcock managed to create a trilogy\r\nof films in successive years that is perhaps, the most remarkable ever\r\nattempted by any director. North By Northwest, Psycho and Vertigo feature\r\nfrequently among critics' best of lists and represents the culmination of\r\nHitchcock's prowess, as well as showcasing his brilliant skills as a\r\nfilm-maker and his extensive knowledge of the language of the cinema.

\r\n

Part of the mystique of the movie stems from the fact that it is misleading\r\nthe viewer right from the beginning, the plot seemingly about how James\r\nStewart's character, Scottie Ferguson tries to prevent \"Madeline\", played by\r\nKim Novak, from succumbing to a supernatural force that threatens to possess\r\nand ultimately, overwhelms her. This deception is carried on brilliantly by\r\nboth the performances and the usually taut direction that Hitchcock imposes\r\non the entire picture. It is not until the middle third of the movie, that\r\nHitchcock surprisingly reveals the mystery in a fashion that completely\r\ncatches the viewer off guard. From there on, the film shifts to a more\r\npersonal tone of undesirable and questionable obsession on Scottie's part to\r\ntransform Judy back into his dream woman that was \"Madeline\". Yet, the\r\n\"Madeline\" that he seeks never existed at all. It is this irony that\r\nprovides this film with its unique, almost surrealistic tone and among\r\nHitchcock's works, this is the film that is at once darkly depressing as it\r\nis revealingly autobiographical.

\r\n

Jimmy Stewart has always been known to play the charming and effervescent\r\nAmerican ordinary everyday guy, a role that is similarly typified by Tom\r\nHanks today. His winsome smile garnered him with his only Academy award in\r\nThe Philadelphia Story and his even more famous turn as George Bailey in\r\nCapra's It's A Wonderful Life cemented Stewart as the quintessential\r\nAmerican hero. A face and a style that any American and even non-American\r\ncan identify with. But since he began to work with Hitchcock, Jimmy Stewart\r\nbegan a series of roles that played him against type and character.

\r\n

In Rear Window, Stewart's L.B. Jefferies's character begins the film as a\r\nrestless voyeuristic photographer. But by the end of the movie, one tends to\r\nforget this questionable aspect of his character as he manages to solve a\r\nmurder mystery in the process. In Vertigo, however, Stewart plays a\r\ncharacter that displays even more flaws then the Jefferies character could\r\never have. At the beginning, he faces seemingly increasing difficulty in\r\novercoming his fear of heights that was triggered off by his guilt towards\r\ncausing the death of a fellow police officer. Hitchcock then pulls off an\r\nincredible delusion to the audience by deliberately misleading us into\r\nthinking that Scottie Ferguson will conquer his fear by falling in love and\r\nby resolving the mystery that surrounds \"Madeline\".

\r\n

For all his reputation for suspense and thriller films, Hitchcock's ultimate\r\nmasterpiece does not focus on those two aspects as he does on the personal\r\naspects of his two main characters in the picture. We are allowed a glimpse\r\ninto the director's mindset and dare I say it, his emotions as he molded\r\nScottie and \"Madeline\" into human beings that seem at once, frightfully true\r\nto life and yet, almost dreamlike in pure visual terms. As the audience, we\r\ncan certainly identify with Scottie's pursuit of his perfect woman as at one\r\ntime or another, each one of us had probably wanted to find that same person\r\nwho can fulfill our ultimate fantasies. The difference is, Scottie manages\r\nto come close.

\r\n

Only close, because his fantasy woman is after all, a masquerade fabricated\r\nby his longtime friend Gavin Elster to deliberately lead Scottie into his\r\nmurderous scheme as an unknowing accomplice and also, as a convenient\r\nscapegoat and alibi. Judy, the woman who plays the role of \"Madeline\" is\r\nnothing like the \"Madeline\" that Scottie envisions. The real Judy is a more\r\nearthly woman that seems at once materialistic and bubbly, which contrasts\r\nstrikingly with the icy cold blonde that is \"Madeline\", who simply emanates\r\nwith stylish sophistication. But Scottie is never let into this revelation\r\nas early as the audience, so from the moment the truth is made known to the\r\nviewer, we are made to observe and follow his emotional trauma in losing\r\n\"Madeline\" and then the joy of rediscovering her in the form of Judy.

\r\n

The beauty of the picture lies not in watching it for the first time, but\r\nfrom subsequent viewings, when the audience has the intimate knowledge of\r\nwhat has happened. The first half of the movie then takes on multiple layers\r\nof meanings and and it becomes a responsibility for the viewer to understand\r\nhow difficult it is for Kim Novak to play Judy who herself is playing\r\n\"Madeline\". Her movements and gestures are even more impressive with the\r\nrealization that she herself is putting up an act of deception and deceit.\r\nYet, from the moment Scottie fishes her out of the waters of the Golden Gate\r\nbridge, the audience can almost identify with the extreme restraint that is\r\nevident in Judy's eyes and that keeps her from revealing herself to Scottie.

\r\n

Later in Scottie's apartment, we are already well aware of the ruse that\r\nJudy is putting up for him. It is convincing to the point that the first\r\ntime viewer is totally taken in by the deception. You could believe that she\r\nwas suffering from amnesia, seemingly possessed by a \"supernatural spirit\"\r\nthat guides her through the various locations of San Francisco. But seeing\r\nit the second time, notice how Novak manages to \"act\" surprised and shocked\r\nin waking up naked in Scottie's room. But for all intents and purposes, she\r\n\"lets\" him bring her there and even \"lets\" him undresses her in a deliberate\r\nattempt to delude him. Throughout the whole charade, Scottie is completely\r\noblivious to the fact that she \"knows\". It is this idea of irony and\r\ndeceptive role-play that gives this film an unusual aural of mystery and\r\nsurrealistic romantiscm.

\r\n

This is a romance that is unlikely, yet when it does finally occur, at the\r\ncliffs where Judy almost overacts her part, we are already under the\r\nimpression that Scottie is in love with her. Simultaneously, we are equally\r\nconvinced that Judy, masquerading as \"Madeline\" is also falling for him. The\r\nHitchcockian touch at resolving this romance is sheer genius as it breaks\r\nnew ground in the way it treat film lovers on screen. Electing not to\r\nprovide an avenue for the doomed lovers to escape from, he decides to end\r\nthe picture almost abruptly at the infamous bell tower scene. It is the same\r\nexact spot where earlier on, Scottie first witnesses the \"suicidal\" fall of\r\nElster's real wife. The same exact scene where Scottie relives his guilt at\r\nbeing unable to prevent a certain death due to his vertigo.

\r\n

A guilt which is unfairly burdened upon him the second time round as he is\r\nonly playing a pawn in the midst of a greater murderous scheme. A scheme\r\nthat involves Judy as \"Madeline\", a common girl hired by Elster because her\r\nlooks probably resemble that of Elster's wife. A guilt which would be\r\nfurther complicated by the realization that Judy would herself find herself\r\nfalling hopelessly for him. At the end of the picture, Hitchcock has to\r\nsubmit Scottie to one last trauma at the bell tower. Right at the moment\r\nwhen Scottie is faced with the most difficult decision of his life, of\r\nwhether or not to bring Judy to justice or simply carry on the deception and\r\nlet the past slip by. The appearance of the nun at the top of the bell tower\r\nis an inspired decision, a decision apparently made by Samuel Taylor, the\r\nmain scriptwriter for the film.

\r\n

A nun represents God, and if the ending is abrupt, the resolvement of Judy's\r\ninvolvement in the murder of the actual \"Madeline\" is to symbolize the\r\ncliched notion that criminals may escape the hands of the law, but not from\r\nthe hand of God. Her apparent accidental fall may be even more symbolic in\r\nthe sense that she is re-enacting what she was asked to do by Elster, to\r\npretend to fall to her death to mask the death and murder of his actual\r\nwife. The terrific irony here again is she is not acting, but really \"doing\"\r\nit this time. Falling to her own death, which is as real as Elster's wife\r\ndeath was. With that, the film concludes with the everlasting image of\r\nStewart's Scottie standing at the bell tower, looking down on the lifeless\r\nbody of his de-mystified obsession, a woman who never existed for him. A\r\nwoman who was manufactured for the purpose of a diabolical crime, and a\r\nwoman was in turn, re-manufactured by the very same man she was supposed to\r\ndeceive.

\r\n

The re-fashioning of Judy into \"Madeline\" is itself, worthy of much\r\ndiscussion. The main focal point becomes that of Judy being willing to\r\nsubject herself to a second of time of role-playing. But whereas the first\r\nwas due to financial and material benefits, possibly from Elster himself,\r\nthe second was unquestionably due to the purpose of pleasing Scottie. For by\r\nthe time she was \"rediscovered\", the audience can sense her love for him.\r\nThis is most clearly demonstrated in her reluctance to leave him a goodbye\r\nnote explaining the whole crime, and willing to play a second round of\r\ncharade with Scottie. And even after voicing her objections to being\r\nremodeled, she eventually subjects herself to Scottie's almost unhealthy\r\ndesire to see and possess \"Madeline\" back in the form of another woman who\r\n\"happens\" to look like her. This possession obsession at one time becomes\r\nalmost surreal. Look at the scene when she finally emerges from the bathroom\r\nas the completed \"product\".

\r\n

Roger Ebert calls this the single best shot or sequence that Hitchcock has\r\never done, and I am very inclined to agree. The ghostlike green glow serves\r\nas a haunting, almost hallucinating background to Novak's \"Madeline\" as she\r\nproceeds with almost torturous pace towards Scottie. Their eyes locked in\r\nalmost twin emotions of elation and pain. Elation because both have\r\nultimately satisfied each other's desires. She, because she believes he will\r\nfinally accept her, and he, because the woman he thought he had \"lost\" so\r\ndramatically and tragically has finally returned. In a scene where there is\r\nno background or ambient noise, just images and Bernard Herrmann's stirring\r\nand hauntingly romantic score, it is the ultimate piece of pure cinema\r\nanyone has since or will ever conjure up. The moment the two tragic lovers\r\nlock and embrace, the camera circles around the both of them, and as it does\r\nso, images of San Juan Batista emerge from behind them, as if to indicate\r\nthat the past has caught up with the present, and later will engulf them to\r\na powerfully emotional and tragic end. Yet, Scottie clings on to her as if\r\nhe never has lost her, and he is at once willing to believe that she is the\r\nsame \"Madeline\" that he has fallen for during the first part of the film. He\r\nhesitates only for a brief moment, but once he is convinced that she is\r\n\"genuine\", he embraces her with the utmost of passion that has yet been\r\ncaptured on celluloid.

\r\n

Perhaps, the optimist would have hoped the film should have ended there. But\r\nthen, there is always the moral issue of not letting characters getting away\r\nwith blatant crime, especially when it involves murder. For us, for\r\nHitchcock, the resolution of this film represents one of the best climatic\r\nendings to a motion picture. Dark, emotional, tense and frightful, these are\r\nthe emotions that one goes through together with the two leads as they\r\nascend the steps of the bell tower. Of course, the innovative \"Vertigo\" shot\r\nheightens the tension and gives us a visual simulation of what Scottie is\r\nfeeling as he looks down towards the depths of the stairs. As Scottie\r\nunravels the truth, a truth where Novak's character and the audience are\r\nalready well aware of, we see his expression of anger and of passion at the\r\nsame time. Emotions which would have been overplayed by any other actor,\r\nJimmy Stewart manages to convince us equally of his confusion, his guilt,\r\nhis hurt and his ultimate love for a fabled \"woman\" from which there is no\r\nturning back from. As he reaches the top, he is ultimately faced with his\r\nown strong belief of upholding the law, and his equally passionate feelings\r\nfor a woman who has deceived him and yet, now offer the only real hope of\r\nredemption and his only compromised opportunity for a perfect love. And as\r\nhe contemplates his decision for either justice or love, he is cruelly\r\nrobbed of that decision as Judy accidentally plunges towards her own demise,\r\na justice meted out by perhaps, in equally \"supernatural\" manner.

\r\n

As a motion picture, Vertigo possesses all the necessary technical\r\ncredentials for a 1958 film. George Tomasini's taut editing, Robert Burks's\r\nelegant cinematography, Saul Bass's innovative and hypnotic title designs\r\nand of course, Herrmann's score. The importance of how music affects a film\r\nhas never been understated. Yet somehow, Herrmann's musical soundtrack\r\nmanages to bring images that Burk's camera could not even capture. The\r\nhaunting title theme elicits both terror and romance simultaneously, and it\r\nis this musical picture that gives the audience a glance into the movie's\r\ncontents right at the beginning of the credits. Coupled this with the eerie\r\nlogos supplied creatively by Bass and extreme close-ups of the woman's lips\r\nand eye, Vertigo manages to evoke the entire atmosphere of the film in the\r\nfirst few minutes. Herrmann's score is never catchy or tuneful, just long\r\nstretches of mesmerizing moods and ambience that complements both story and\r\nperformances to perfection. At times overbearing, at times tender, this is\r\nmusic that lives up to the high expectations of the director and his actors.\r\nPure cinema such as this could not have been created without the musical\r\nstrains of Bernard Herrmann and the striking photography of Burk and\r\nHitchcock.

\r\n

Artistically, films like Citizen Kane and A Birth Of A Nation may have\r\ndisplayed much more cinematic invention in terms of camera techniques and\r\nother technical innovations. Vertigo however, propels the film medium\r\nfurther by taking the established cinematic approaches and transcends them\r\nby exploring the human emotion on celluloid. To accomplish this requires a\r\ndirector of immense knowledge and skill, and a touch of brilliance. Further,\r\na set of actors who are able to translate the written script into film and\r\nthen expand on it by giving their own unique touch of humanity and\r\nexpression. Alfred Hitchcock, James Stewart and Kim Novak together with\r\nSamuel Taylor and the crew of Vertigo created a cinematic milestone in 1958\r\nand like the aforementioned film classics, it ranks as a motion picture\r\nmasterpiece worthy of the highest accolades. In generations to come, Vertigo\r\nwill only serve as a reminder to the art of the motion picture . or in\r\nHitchcock's preference, the art of pure cinema.

\r\n
Ian Low\r\n9th September 1999
\r\n

The review above was posted to the\r\nrec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
\r\nThe Internet Movie Database accepts no responsibility for the contents of the\r\nreview and has no editorial control. Unless stated otherwise, the copyright\r\nbelongs to the author.
\r\nPlease direct comments/criticisms of the review to relevant newsgroups.
\r\nBroken URLs inthe reviews are the responsibility of the author.
\r\nThe formatting of the review is likely to differ from the original due\r\nto ASCII to HTML conversion.\r\n

\r\n

Related links: index of all rec.arts.movies.reviews reviews

\r\n\r\n\r\n\r\n

\r\n"},"meta":{"kind":"string","value":"{'content_hash': 'ddd14c15060e04afeb89437786a89612', 'timestamp': '', 'source': 'github', 'line_count': 248, 'max_line_length': 183, 'avg_line_length': 70.70564516129032, 'alnum_prop': 0.7886512688907898, 'repo_name': 'xianjunzhengbackup/code', 'id': '772be949543761d3b78600de0a05c0aa240ab764', 'size': '17535', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'data science/machine_learning_for_the_web/chapter_4/movie/20449.html', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'BitBake', 'bytes': '113'}, {'name': 'BlitzBasic', 'bytes': '256'}, {'name': 'CSS', 'bytes': '49827'}, {'name': 'HTML', 'bytes': '157006325'}, {'name': 'JavaScript', 'bytes': '14029'}, {'name': 'Jupyter Notebook', 'bytes': '4875399'}, {'name': 'Mako', 'bytes': '2060'}, {'name': 'Perl', 'bytes': '716'}, {'name': 'Python', 'bytes': '874414'}, {'name': 'R', 'bytes': '454'}, {'name': 'Shell', 'bytes': '3984'}]}"}}},{"rowIdx":849771,"cells":{"text":{"kind":"string","value":"import sys\nimport os\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = []\n#extensions = ['sphinxcontrib.youtube']\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n# source_suffix = ['.rst', '.md']\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = 'BIOF509'\ncopyright = '2016, Jonathan Street'\nauthor = 'Jonathan Street'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = '1.0'\n# The full version, including alpha/beta/rc tags.\nrelease = '1.0'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = ['_build']\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n#keep_warnings = False\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = False\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\nhtml_theme = 'sphinx_rtd_theme'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents. If None, it defaults to\n# \" v documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar. Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n#html_extra_path = []\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a tag referring to it. The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Language to be used for generating the HTML full-text search index.\n# Sphinx supports the following languages:\n# 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'\n# 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'\n#html_search_language = 'en'\n\n# A dictionary with options for the search language support, empty by default.\n# Now only 'ja' uses this config value\n#html_search_options = {'type': 'default'}\n\n# The name of a javascript file (relative to the configuration directory) that\n# implements a search results scorer. If empty, the default will be used.\n#html_search_scorer = 'scorer.js'\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'BIOF509doc'\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n# The paper size ('letterpaper' or 'a4paper').\n#'papersize': 'letterpaper',\n\n# The font size ('10pt', '11pt' or '12pt').\n#'pointsize': '10pt',\n\n# Additional stuff for the LaTeX preamble.\n#'preamble': '',\n\n# Latex figure (float) alignment\n#'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n# author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n (master_doc, 'BIOF509.tex', 'BIOF509 Documentation',\n 'Jonathan Street', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n (master_doc, 'biof509', 'BIOF509 Documentation',\n [author], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n# dir menu entry, description, category)\ntexinfo_documents = [\n (master_doc, 'BIOF509', 'BIOF509 Documentation',\n author, 'BIOF509', 'One line description of project.',\n 'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#texinfo_no_detailmenu = False\n"},"meta":{"kind":"string","value":"{'content_hash': '99b4608177ebb59a505cceefb3261d0f', 'timestamp': '', 'source': 'github', 'line_count': 270, 'max_line_length': 79, 'avg_line_length': 32.53703703703704, 'alnum_prop': 0.7044963005122368, 'repo_name': 'streety/biof509', 'id': '035fd3c4a20ba52f00ba085655bce7183bffbf1f', 'size': '9228', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'docs/conf.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Jupyter Notebook', 'bytes': '44062'}]}"}}},{"rowIdx":849772,"cells":{"text":{"kind":"string","value":"\n\n\n\n \n StaticWeb - Admin\n \n \n \n \n \n \n \n \n \n \n\n\n\n

\n Login\n

\n \n\n\n\n"},"meta":{"kind":"string","value":"{'content_hash': 'ac83f918cd75abfd284a6566b40cc06f', 'timestamp': '', 'source': 'github', 'line_count': 26, 'max_line_length': 149, 'avg_line_length': 42.34615384615385, 'alnum_prop': 0.6802906448683016, 'repo_name': 'StefanWallin/core', 'id': '9a82a71660a135465ca88eb02f96f4a2bebf16c6', 'size': '1101', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'admin/index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '7575'}, {'name': 'HTML', 'bytes': '5078'}, {'name': 'JavaScript', 'bytes': '63433'}]}"}}},{"rowIdx":849773,"cells":{"text":{"kind":"string","value":"\n 4.0.0\n \n io.quarkus\n quarkus-bootstrap-parent\n 999-SNAPSHOT\n \n quarkus-bootstrap-bom-test\n Quarkus - Bootstrap - Test BOM\n This BOM contains only test scoped dependencies for the bootstrap project's testsuite\n pom\n \n \n \n io.quarkus\n quarkus-bootstrap-core\n ${project.version}\n test-jar\n test\n \n \n org.assertj\n assertj-core\n ${assertj.version}\n test\n \n \n org.junit.jupiter\n junit-jupiter\n ${junit.jupiter.version}\n test\n \n \n org.jboss.shrinkwrap\n shrinkwrap-depchain\n pom\n test\n ${shrinkwrap-depchain.version}\n \n \n org.apache.maven.plugin-testing\n maven-plugin-testing-harness\n 3.3.0\n test\n \n \n \n org.codehaus.plexus\n plexus-utils\n \n \n commons-io\n commons-io\n \n \n \n \n \n org.apache.maven\n maven-compat\n ${maven.version}\n test\n \n \n \n\n"},"meta":{"kind":"string","value":"{'content_hash': 'c9418a76b313d06708619abcc46f9877', 'timestamp': '', 'source': 'github', 'line_count': 68, 'max_line_length': 116, 'avg_line_length': 44.220588235294116, 'alnum_prop': 0.5407382773528434, 'repo_name': 'quarkusio/quarkus', 'id': '75ceb03f4c8062c316cc971e138670e8599826b4', 'size': '3007', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'independent-projects/bootstrap/bom-test/pom.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '23342'}, {'name': 'Batchfile', 'bytes': '13096'}, {'name': 'CSS', 'bytes': '6685'}, {'name': 'Dockerfile', 'bytes': '459'}, {'name': 'FreeMarker', 'bytes': '8106'}, {'name': 'Groovy', 'bytes': '16133'}, {'name': 'HTML', 'bytes': '1418749'}, {'name': 'Java', 'bytes': '38584810'}, {'name': 'JavaScript', 'bytes': '90960'}, {'name': 'Kotlin', 'bytes': '704351'}, {'name': 'Mustache', 'bytes': '13191'}, {'name': 'Scala', 'bytes': '9756'}, {'name': 'Shell', 'bytes': '71729'}]}"}}},{"rowIdx":849774,"cells":{"text":{"kind":"string","value":"\n\n \n \n \n metacoq-checker: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n « Up\n

\n metacoq-checker\n \n 1.0~alpha1+8.8\n Not compatible 👼\n \n

\n

📅 (2022-04-18 10:02:02 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-threads        base\nbase-unix           base\ncamlp5              7.14        Preprocessor-pretty-printer of OCaml\nconf-findutils      1           Virtual package relying on findutils\nconf-perl           2           Virtual package relying on perl\ncoq                 8.9.1       Formal proof management system\nnum                 1.4         The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.09.1      The OCaml compiler (virtual package)\nocaml-base-compiler 4.09.1      Official release 4.09.1\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.9.3       A library manager for OCaml\n# opam file:\nopam-version: &quot;2.0&quot;\nmaintainer: &quot;matthieu.sozeau@inria.fr&quot;\nhomepage: &quot;https://metacoq.github.io/metacoq&quot;\ndev-repo: &quot;git+https://github.com/MetaCoq/metacoq.git#coq-8.8&quot;\nbug-reports: &quot;https://github.com/MetaCoq/metacoq/issues&quot;\nauthors: [&quot;Abhishek Anand &lt;aa755@cs.cornell.edu&gt;&quot;\n          &quot;Simon Boulier &lt;simon.boulier@inria.fr&gt;&quot;\n          &quot;Cyril Cohen &lt;cyril.cohen@inria.fr&gt;&quot;\n          &quot;Yannick Forster &lt;forster@ps.uni-saarland.de&gt;&quot;\n          &quot;Fabian Kunze &lt;fkunze@fakusb.de&gt;&quot;\n          &quot;Gregory Malecha &lt;gmalecha@gmail.com&gt;&quot;\n          &quot;Matthieu Sozeau &lt;matthieu.sozeau@inria.fr&gt;&quot;\n          &quot;Nicolas Tabareau &lt;nicolas.tabareau@inria.fr&gt;&quot;\n          &quot;Théo Winterhalter &lt;theo.winterhalter@inria.fr&gt;&quot;\n]\nlicense: &quot;MIT&quot;\nbuild: [\n  [&quot;sh&quot; &quot;./configure.sh&quot;]\n  [make &quot;-j%{jobs}%&quot; &quot;checker&quot;]\n]\ninstall: [\n  [make &quot;-C&quot; &quot;checker&quot; &quot;install&quot;]\n]\ndepends: [\n  &quot;ocaml&quot; {&gt; &quot;4.02.3&quot;}\n  &quot;coq&quot; {&gt;= &quot;8.8&quot; &amp; &lt; &quot;8.9~&quot;}\n  &quot;coq-metacoq-template&quot; {= version}\n]\nsynopsis: &quot;Specification of Coq&#39;s type theory and reference checker implementation&quot;\ndescription: &quot;&quot;&quot;\nMetaCoq is a meta-programming framework for Coq.\nThe Checker module provides a complete specification of Coq&#39;s typing and conversion\nrelation along with a reference type-checker that is extracted to a pluging.\nThis provides a command: `MetaCoq Check [global_reference]` that can be used\nto typecheck a Coq definition using the verified type-checker.\n&quot;&quot;&quot;\nurl {\n  src: &quot;https://github.com/MetaCoq/metacoq/archive/1.0-alpha+8.8.tar.gz&quot;\n  checksum: &quot;sha256=c2fe122ad30849e99c1e5c100af5490cef0e94246f8eb83f6df3f2ccf9edfc04&quot;\n}
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install 🏜️

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-metacoq-checker.1.0~alpha1+8.8 coq.8.9.1
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.9.1).\nThe following dependencies couldn&#39;t be met:\n  - coq-metacoq-checker -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.06.0\n      base of this switch (use `--unlock-base&#39; to force)\nYour request can&#39;t be satisfied:\n  - No available version of coq satisfies the constraints\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-metacoq-checker.1.0~alpha1+8.8
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install 🚀

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall 🧹

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub © Guillaume Claret 🐣\n

\n
\n
\n \n \n \n\n"},"meta":{"kind":"string","value":"{'content_hash': '6b1349436f877e0115a633dbdca30445', 'timestamp': '', 'source': 'github', 'line_count': 181, 'max_line_length': 159, 'avg_line_length': 43.08839779005525, 'alnum_prop': 0.559174253109373, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': 'a9febdc2e0e2ddb10fc355a7692ffff8131a4e4a', 'size': '7825', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.09.1-2.0.6/released/8.9.1/metacoq-checker/1.0~alpha1+8.8.html', 'mode': '33188', 'license': 'mit', 'language': []}"}}},{"rowIdx":849775,"cells":{"text":{"kind":"string","value":"function B = normalizecols(A);\n%\n% B = normalizecols(A);\n%\n% Normalizes the columns of a matrix, so each is a unit vector.\n\nB = A./repmat(sqrt(sum(A.^2)), size(A,1), 1);"},"meta":{"kind":"string","value":"{'content_hash': 'd6b8bdd6ca4a20ec270b7a63d70b1af7', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 64, 'avg_line_length': 24.428571428571427, 'alnum_prop': 0.6432748538011696, 'repo_name': 'wilsonCernWq/GLMspiketools', 'id': 'a7c2416b430b63cf6fb5d7483289133ca85eabc4', 'size': '171', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'glmtools_misc/normalizecols.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Matlab', 'bytes': '92330'}]}"}}},{"rowIdx":849776,"cells":{"text":{"kind":"string","value":"package levar\n\npackage object util {\n\n import java.net.{ URL, MalformedURLException }\n\n /** Regex match for valid organization names */\n def validOrgName(name: String): Boolean = name.matches(\"\"\"[-\\w\\.]+\"\"\")\n\n /** Check for valid URL */\n def validURL(url: String): Boolean = {\n try {\n new URL(url)\n true\n } catch {\n case _: MalformedURLException => false\n }\n }\n\n def eitherAsAny(eith: Either[_, _]): Any = eith.fold(identity, identity)\n}\n"},"meta":{"kind":"string","value":"{'content_hash': 'ae986af11dc3f1b5bd9152d2bddad889', 'timestamp': '', 'source': 'github', 'line_count': 21, 'max_line_length': 74, 'avg_line_length': 22.333333333333332, 'alnum_prop': 0.6183368869936035, 'repo_name': 'peoplepattern/LeVar', 'id': '725e86f6b6b915da6e28845565628fcc1a308ee5', 'size': '469', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'levar-core/src/main/scala/levar/util.scala', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '23179'}, {'name': 'HTML', 'bytes': '3753'}, {'name': 'PLSQL', 'bytes': '9220'}, {'name': 'Scala', 'bytes': '189690'}]}"}}},{"rowIdx":849777,"cells":{"text":{"kind":"string","value":"using System;\r\n\r\nnamespace NLibuv\r\n{\r\n\tpublic interface IUvHandle\r\n\t{\r\n\t\t/// \r\n\t\t/// Gets the type of the current handle.\r\n\t\t/// \r\n\t\tUvHandleType HandleType { get; }\r\n\r\n\t\t/// \r\n\t\t/// Gets the loop object, on which the handle was initialized.\r\n\t\t/// \r\n\t\tUvLoop Loop { get; }\r\n\r\n\t\t/// \r\n\t\t/// Properly closes the handle and ensures that current object will be disposed correctly.\r\n\t\t/// \r\n\t\tvoid Close();\r\n\t}\r\n}"},"meta":{"kind":"string","value":"{'content_hash': '8972f53f255369db21775d8483c08709', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 92, 'avg_line_length': 21.227272727272727, 'alnum_prop': 0.6167023554603854, 'repo_name': 'neris/NLibuv', 'id': '3583d62ec5ca1105abd95da03c3e9e8c69014a61', 'size': '469', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/NLibuv/IUvHandle.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '79809'}]}"}}},{"rowIdx":849778,"cells":{"text":{"kind":"string","value":"\n* This code was generated by a Codezu. \n*\n* Changes to this file may cause incorrect behavior and will be lost if\n* the code is regenerated.\n* \n*/\n\n\nnamespace Mozu\\Api\\Contracts\\CommerceRuntime\\Carts;\n\n\n\n/**\n*\tCollection of messages logged or created each time the cart was modifed.\n*/\nclass CartChangeMessageCollection\n{\n\t/**\n\t*Total number of objects in am item collection. Total counts are calculated for numerous objects in Mozu, including location inventory, products, options, product types, product reservations, categories, addresses, carriers, tax rates, time zones, and much more.\n\t*/\n\tpublic $totalCount;\n\n\t/**\n\t*Collection list of items. All returned data is provided in an items array. For a failed request, the returned response may be success with an empty item collection. Items are used throughout APIs for carts, wish lists, documents, payments, returns, properties, and more.\n\t*/\n\tpublic $items;\n\n}\n\n?>\n"},"meta":{"kind":"string","value":"{'content_hash': 'bf5792f514496012e229c9505031e79b', 'timestamp': '', 'source': 'github', 'line_count': 34, 'max_line_length': 272, 'avg_line_length': 28.941176470588236, 'alnum_prop': 0.7408536585365854, 'repo_name': 'sanjaymandadi/mozu-php-sdk', 'id': '5c69c53aef07762b72c5830d2fc28467628b3084', 'size': '984', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Contracts/CommerceRuntime/Carts/CartChangeMessageCollection.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'PHP', 'bytes': '2811166'}]}"}}},{"rowIdx":849779,"cells":{"text":{"kind":"string","value":"// ----------------------------------------------------------------------------------\n//\n// Copyright Microsoft Corporation\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n// http://www.apache.org/licenses/LICENSE-2.0\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n// ----------------------------------------------------------------------------------\n\nusing System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\nusing Xunit;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Commands.Management.Storage.Test\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"Commands.Management.Storage.Test\")]\n[assembly: AssemblyCopyright(\"Copyright © 2015\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components. If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"779954d6-2751-45ba-ad0f-0e30d384c099\")]\n\n// Version information for an assembly consists of the following four values:\n//\n// Major Version\n// Minor Version \n// Build Number\n// Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n\n[assembly: AssemblyVersion(\"1.1.3\")]\n[assembly: AssemblyFileVersion(\"1.1.3\")]\n[assembly: CollectionBehavior(DisableTestParallelization = true)]\n"},"meta":{"kind":"string","value":"{'content_hash': '228176e83ab9e9b9319cf295d220df90', 'timestamp': '', 'source': 'github', 'line_count': 52, 'max_line_length': 86, 'avg_line_length': 42.86538461538461, 'alnum_prop': 0.699416778824585, 'repo_name': 'shuagarw/azure-powershell', 'id': 'f97be4ccddb16319ec5c949c3f88f6291931f2a7', 'size': '2232', 'binary': False, 'copies': '3', 'ref': 'refs/heads/dev', 'path': 'src/ResourceManager/Storage/Commands.Management.Storage.Test/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '16509'}, {'name': 'C#', 'bytes': '30266509'}, {'name': 'HTML', 'bytes': '209'}, {'name': 'JavaScript', 'bytes': '4979'}, {'name': 'PHP', 'bytes': '41'}, {'name': 'PowerShell', 'bytes': '3266272'}, {'name': 'Shell', 'bytes': '50'}, {'name': 'XSLT', 'bytes': '6114'}]}"}}},{"rowIdx":849780,"cells":{"text":{"kind":"string","value":"\npackage org.apache.activemq.artemis.core.config.impl;\n\nimport java.io.File;\n\nimport org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;\nimport org.apache.activemq.artemis.api.core.SimpleString;\nimport org.apache.activemq.artemis.core.config.Configuration;\nimport org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration;\nimport org.apache.activemq.artemis.core.journal.impl.JournalConstants;\nimport org.apache.activemq.artemis.core.server.JournalType;\nimport org.apache.activemq.artemis.tests.util.ActiveMQTestBase;\nimport org.apache.activemq.artemis.tests.util.RandomUtil;\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.Test;\n\npublic class ConfigurationImplTest extends ActiveMQTestBase {\n\n protected Configuration conf;\n\n @Test\n public void testDefaults() {\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultScheduledThreadPoolMaxSize(), conf.getScheduledThreadPoolMaxSize());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultSecurityInvalidationInterval(), conf.getSecurityInvalidationInterval());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultSecurityEnabled(), conf.isSecurityEnabled());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultBindingsDirectory(), conf.getBindingsDirectory());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultCreateBindingsDir(), conf.isCreateBindingsDir());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalDir(), conf.getJournalDirectory());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultCreateJournalDir(), conf.isCreateJournalDir());\n Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_TYPE, conf.getJournalType());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultJournalSyncTransactional(), conf.isJournalSyncTransactional());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultJournalSyncNonTransactional(), conf.isJournalSyncNonTransactional());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalFileSize(), conf.getJournalFileSize());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalMinFiles(), conf.getJournalMinFiles());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalMaxIoAio(), conf.getJournalMaxIO_AIO());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalMaxIoNio(), conf.getJournalMaxIO_NIO());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultWildcardRoutingEnabled(), conf.isWildcardRoutingEnabled());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultTransactionTimeout(), conf.getTransactionTimeout());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageExpiryScanPeriod(), conf.getMessageExpiryScanPeriod()); // OK\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageExpiryThreadPriority(), conf.getMessageExpiryThreadPriority()); // OK\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultTransactionTimeoutScanPeriod(), conf.getTransactionTimeoutScanPeriod()); // OK\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultManagementAddress(), conf.getManagementAddress()); // OK\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultManagementNotificationAddress(), conf.getManagementNotificationAddress()); // OK\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultClusterUser(), conf.getClusterUser()); // OK\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultClusterPassword(), conf.getClusterPassword()); // OK\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultPersistenceEnabled(), conf.isPersistenceEnabled());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultPersistDeliveryCountBeforeDelivery(), conf.isPersistDeliveryCountBeforeDelivery());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultFileDeployerScanPeriod(), conf.getFileDeployerScanPeriod());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultThreadPoolMaxSize(), conf.getThreadPoolMaxSize());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultJmxManagementEnabled(), conf.isJMXManagementEnabled());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultConnectionTtlOverride(), conf.getConnectionTTLOverride());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultAsyncConnectionExecutionEnabled(), conf.isAsyncConnectionExecutionEnabled());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultPagingDir(), conf.getPagingDirectory());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultLargeMessagesDir(), conf.getLargeMessagesDirectory());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalCompactPercentage(), conf.getJournalCompactPercentage());\n Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO());\n Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO());\n Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO());\n Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, conf.getJournalBufferSize_NIO());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultJournalLogWriteRate(), conf.isLogJournalWriteRate());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalPerfBlastPages(), conf.getJournalPerfBlastPages());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultMessageCounterEnabled(), conf.isMessageCounterEnabled());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageCounterMaxDayHistory(), conf.getMessageCounterMaxDayHistory());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageCounterSamplePeriod(), conf.getMessageCounterSamplePeriod());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultIdCacheSize(), conf.getIDCacheSize());\n Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultPersistIdCache(), conf.isPersistIDCache());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultServerDumpInterval(), conf.getServerDumpInterval());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMemoryWarningThreshold(), conf.getMemoryWarningThreshold());\n Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMemoryMeasureInterval(), conf.getMemoryMeasureInterval());\n }\n\n @Test\n public void testSetGetAttributes() throws Exception {\n for (int j = 0; j < 100; j++) {\n int i = RandomUtil.randomInt();\n conf.setScheduledThreadPoolMaxSize(i);\n Assert.assertEquals(i, conf.getScheduledThreadPoolMaxSize());\n\n long l = RandomUtil.randomLong();\n conf.setSecurityInvalidationInterval(l);\n Assert.assertEquals(l, conf.getSecurityInvalidationInterval());\n\n boolean b = RandomUtil.randomBoolean();\n conf.setSecurityEnabled(b);\n Assert.assertEquals(b, conf.isSecurityEnabled());\n\n String s = RandomUtil.randomString();\n conf.setBindingsDirectory(s);\n Assert.assertEquals(s, conf.getBindingsDirectory());\n\n b = RandomUtil.randomBoolean();\n conf.setCreateBindingsDir(b);\n Assert.assertEquals(b, conf.isCreateBindingsDir());\n\n s = RandomUtil.randomString();\n conf.setJournalDirectory(s);\n Assert.assertEquals(s, conf.getJournalDirectory());\n\n b = RandomUtil.randomBoolean();\n conf.setCreateJournalDir(b);\n Assert.assertEquals(b, conf.isCreateJournalDir());\n\n i = RandomUtil.randomInt() % 2;\n JournalType journal = i == 0 ? JournalType.ASYNCIO : JournalType.NIO;\n conf.setJournalType(journal);\n Assert.assertEquals(journal, conf.getJournalType());\n\n b = RandomUtil.randomBoolean();\n conf.setJournalSyncTransactional(b);\n Assert.assertEquals(b, conf.isJournalSyncTransactional());\n\n b = RandomUtil.randomBoolean();\n conf.setJournalSyncNonTransactional(b);\n Assert.assertEquals(b, conf.isJournalSyncNonTransactional());\n\n i = RandomUtil.randomInt();\n conf.setJournalFileSize(i);\n Assert.assertEquals(i, conf.getJournalFileSize());\n\n i = RandomUtil.randomInt();\n conf.setJournalMinFiles(i);\n Assert.assertEquals(i, conf.getJournalMinFiles());\n\n i = RandomUtil.randomInt();\n conf.setJournalMaxIO_AIO(i);\n Assert.assertEquals(i, conf.getJournalMaxIO_AIO());\n\n i = RandomUtil.randomInt();\n conf.setJournalMaxIO_NIO(i);\n Assert.assertEquals(i, conf.getJournalMaxIO_NIO());\n\n s = RandomUtil.randomString();\n conf.setManagementAddress(new SimpleString(s));\n Assert.assertEquals(s, conf.getManagementAddress().toString());\n\n i = RandomUtil.randomInt();\n conf.setMessageExpiryThreadPriority(i);\n Assert.assertEquals(i, conf.getMessageExpiryThreadPriority());\n\n l = RandomUtil.randomLong();\n conf.setMessageExpiryScanPeriod(l);\n Assert.assertEquals(l, conf.getMessageExpiryScanPeriod());\n\n b = RandomUtil.randomBoolean();\n conf.setPersistDeliveryCountBeforeDelivery(b);\n Assert.assertEquals(b, conf.isPersistDeliveryCountBeforeDelivery());\n\n b = RandomUtil.randomBoolean();\n conf.setEnabledAsyncConnectionExecution(b);\n Assert.assertEquals(b, conf.isAsyncConnectionExecutionEnabled());\n\n b = RandomUtil.randomBoolean();\n conf.setPersistenceEnabled(b);\n Assert.assertEquals(b, conf.isPersistenceEnabled());\n\n b = RandomUtil.randomBoolean();\n conf.setJMXManagementEnabled(b);\n Assert.assertEquals(b, conf.isJMXManagementEnabled());\n\n l = RandomUtil.randomLong();\n conf.setFileDeployerScanPeriod(l);\n Assert.assertEquals(l, conf.getFileDeployerScanPeriod());\n\n l = RandomUtil.randomLong();\n conf.setConnectionTTLOverride(l);\n Assert.assertEquals(l, conf.getConnectionTTLOverride());\n\n i = RandomUtil.randomInt();\n conf.setThreadPoolMaxSize(i);\n Assert.assertEquals(i, conf.getThreadPoolMaxSize());\n\n SimpleString ss = RandomUtil.randomSimpleString();\n conf.setManagementNotificationAddress(ss);\n Assert.assertEquals(ss, conf.getManagementNotificationAddress());\n\n s = RandomUtil.randomString();\n conf.setClusterUser(s);\n Assert.assertEquals(s, conf.getClusterUser());\n\n i = RandomUtil.randomInt();\n conf.setIDCacheSize(i);\n Assert.assertEquals(i, conf.getIDCacheSize());\n\n b = RandomUtil.randomBoolean();\n conf.setPersistIDCache(b);\n Assert.assertEquals(b, conf.isPersistIDCache());\n\n i = RandomUtil.randomInt();\n conf.setJournalCompactMinFiles(i);\n Assert.assertEquals(i, conf.getJournalCompactMinFiles());\n\n i = RandomUtil.randomInt();\n conf.setJournalCompactPercentage(i);\n Assert.assertEquals(i, conf.getJournalCompactPercentage());\n\n i = RandomUtil.randomInt();\n conf.setJournalBufferSize_AIO(i);\n Assert.assertEquals(i, conf.getJournalBufferSize_AIO());\n\n i = RandomUtil.randomInt();\n conf.setJournalBufferTimeout_AIO(i);\n Assert.assertEquals(i, conf.getJournalBufferTimeout_AIO());\n\n i = RandomUtil.randomInt();\n conf.setJournalBufferSize_NIO(i);\n Assert.assertEquals(i, conf.getJournalBufferSize_NIO());\n\n i = RandomUtil.randomInt();\n conf.setJournalBufferTimeout_NIO(i);\n Assert.assertEquals(i, conf.getJournalBufferTimeout_NIO());\n\n b = RandomUtil.randomBoolean();\n conf.setLogJournalWriteRate(b);\n Assert.assertEquals(b, conf.isLogJournalWriteRate());\n\n i = RandomUtil.randomInt();\n conf.setJournalPerfBlastPages(i);\n Assert.assertEquals(i, conf.getJournalPerfBlastPages());\n\n l = RandomUtil.randomLong();\n conf.setServerDumpInterval(l);\n Assert.assertEquals(l, conf.getServerDumpInterval());\n\n s = RandomUtil.randomString();\n conf.setPagingDirectory(s);\n Assert.assertEquals(s, conf.getPagingDirectory());\n\n s = RandomUtil.randomString();\n conf.setLargeMessagesDirectory(s);\n Assert.assertEquals(s, conf.getLargeMessagesDirectory());\n\n b = RandomUtil.randomBoolean();\n conf.setWildcardRoutingEnabled(b);\n Assert.assertEquals(b, conf.isWildcardRoutingEnabled());\n\n l = RandomUtil.randomLong();\n conf.setTransactionTimeout(l);\n Assert.assertEquals(l, conf.getTransactionTimeout());\n\n b = RandomUtil.randomBoolean();\n conf.setMessageCounterEnabled(b);\n Assert.assertEquals(b, conf.isMessageCounterEnabled());\n\n l = RandomUtil.randomPositiveLong();\n conf.setMessageCounterSamplePeriod(l);\n Assert.assertEquals(l, conf.getMessageCounterSamplePeriod());\n\n i = RandomUtil.randomInt();\n conf.setMessageCounterMaxDayHistory(i);\n Assert.assertEquals(i, conf.getMessageCounterMaxDayHistory());\n\n l = RandomUtil.randomLong();\n conf.setTransactionTimeoutScanPeriod(l);\n Assert.assertEquals(l, conf.getTransactionTimeoutScanPeriod());\n\n s = RandomUtil.randomString();\n conf.setClusterPassword(s);\n Assert.assertEquals(s, conf.getClusterPassword());\n }\n }\n\n @Test\n public void testGetSetInterceptors() {\n final String name1 = \"uqwyuqywuy\";\n final String name2 = \"yugyugyguyg\";\n\n conf.getIncomingInterceptorClassNames().add(name1);\n conf.getIncomingInterceptorClassNames().add(name2);\n\n Assert.assertTrue(conf.getIncomingInterceptorClassNames().contains(name1));\n Assert.assertTrue(conf.getIncomingInterceptorClassNames().contains(name2));\n Assert.assertFalse(conf.getIncomingInterceptorClassNames().contains(\"iijij\"));\n }\n\n @Test\n public void testSerialize() throws Exception {\n boolean b = RandomUtil.randomBoolean();\n\n conf.setHAPolicyConfiguration(new LiveOnlyPolicyConfiguration());\n\n int i = RandomUtil.randomInt();\n conf.setScheduledThreadPoolMaxSize(i);\n Assert.assertEquals(i, conf.getScheduledThreadPoolMaxSize());\n\n long l = RandomUtil.randomLong();\n conf.setSecurityInvalidationInterval(l);\n Assert.assertEquals(l, conf.getSecurityInvalidationInterval());\n\n b = RandomUtil.randomBoolean();\n conf.setSecurityEnabled(b);\n Assert.assertEquals(b, conf.isSecurityEnabled());\n\n String s = RandomUtil.randomString();\n conf.setBindingsDirectory(s);\n Assert.assertEquals(s, conf.getBindingsDirectory());\n\n b = RandomUtil.randomBoolean();\n conf.setCreateBindingsDir(b);\n Assert.assertEquals(b, conf.isCreateBindingsDir());\n\n s = RandomUtil.randomString();\n conf.setJournalDirectory(s);\n Assert.assertEquals(s, conf.getJournalDirectory());\n\n b = RandomUtil.randomBoolean();\n conf.setCreateJournalDir(b);\n Assert.assertEquals(b, conf.isCreateJournalDir());\n\n i = RandomUtil.randomInt() % 2;\n JournalType journal = i == 0 ? JournalType.ASYNCIO : JournalType.NIO;\n conf.setJournalType(journal);\n Assert.assertEquals(journal, conf.getJournalType());\n\n b = RandomUtil.randomBoolean();\n conf.setJournalSyncTransactional(b);\n Assert.assertEquals(b, conf.isJournalSyncTransactional());\n\n b = RandomUtil.randomBoolean();\n conf.setJournalSyncNonTransactional(b);\n Assert.assertEquals(b, conf.isJournalSyncNonTransactional());\n\n i = RandomUtil.randomInt();\n conf.setJournalFileSize(i);\n Assert.assertEquals(i, conf.getJournalFileSize());\n\n i = RandomUtil.randomInt();\n conf.setJournalMinFiles(i);\n Assert.assertEquals(i, conf.getJournalMinFiles());\n\n i = RandomUtil.randomInt();\n conf.setJournalMaxIO_AIO(i);\n Assert.assertEquals(i, conf.getJournalMaxIO_AIO());\n\n i = RandomUtil.randomInt();\n conf.setJournalMaxIO_NIO(i);\n Assert.assertEquals(i, conf.getJournalMaxIO_NIO());\n\n s = RandomUtil.randomString();\n conf.setManagementAddress(new SimpleString(s));\n Assert.assertEquals(s, conf.getManagementAddress().toString());\n\n i = RandomUtil.randomInt();\n conf.setMessageExpiryThreadPriority(i);\n Assert.assertEquals(i, conf.getMessageExpiryThreadPriority());\n\n l = RandomUtil.randomLong();\n conf.setMessageExpiryScanPeriod(l);\n Assert.assertEquals(l, conf.getMessageExpiryScanPeriod());\n\n b = RandomUtil.randomBoolean();\n conf.setPersistDeliveryCountBeforeDelivery(b);\n Assert.assertEquals(b, conf.isPersistDeliveryCountBeforeDelivery());\n\n b = RandomUtil.randomBoolean();\n conf.setEnabledAsyncConnectionExecution(b);\n Assert.assertEquals(b, conf.isAsyncConnectionExecutionEnabled());\n\n b = RandomUtil.randomBoolean();\n conf.setPersistenceEnabled(b);\n Assert.assertEquals(b, conf.isPersistenceEnabled());\n\n b = RandomUtil.randomBoolean();\n conf.setJMXManagementEnabled(b);\n Assert.assertEquals(b, conf.isJMXManagementEnabled());\n\n l = RandomUtil.randomLong();\n conf.setFileDeployerScanPeriod(l);\n Assert.assertEquals(l, conf.getFileDeployerScanPeriod());\n\n l = RandomUtil.randomLong();\n conf.setConnectionTTLOverride(l);\n Assert.assertEquals(l, conf.getConnectionTTLOverride());\n\n i = RandomUtil.randomInt();\n conf.setThreadPoolMaxSize(i);\n Assert.assertEquals(i, conf.getThreadPoolMaxSize());\n\n SimpleString ss = RandomUtil.randomSimpleString();\n conf.setManagementNotificationAddress(ss);\n Assert.assertEquals(ss, conf.getManagementNotificationAddress());\n\n s = RandomUtil.randomString();\n conf.setClusterUser(s);\n Assert.assertEquals(s, conf.getClusterUser());\n\n i = RandomUtil.randomInt();\n conf.setIDCacheSize(i);\n Assert.assertEquals(i, conf.getIDCacheSize());\n\n b = RandomUtil.randomBoolean();\n conf.setPersistIDCache(b);\n Assert.assertEquals(b, conf.isPersistIDCache());\n\n i = RandomUtil.randomInt();\n conf.setJournalCompactMinFiles(i);\n Assert.assertEquals(i, conf.getJournalCompactMinFiles());\n\n i = RandomUtil.randomInt();\n conf.setJournalCompactPercentage(i);\n Assert.assertEquals(i, conf.getJournalCompactPercentage());\n\n i = RandomUtil.randomInt();\n conf.setJournalBufferSize_AIO(i);\n Assert.assertEquals(i, conf.getJournalBufferSize_AIO());\n\n i = RandomUtil.randomInt();\n conf.setJournalBufferTimeout_AIO(i);\n Assert.assertEquals(i, conf.getJournalBufferTimeout_AIO());\n\n i = RandomUtil.randomInt();\n conf.setJournalBufferSize_NIO(i);\n Assert.assertEquals(i, conf.getJournalBufferSize_NIO());\n\n i = RandomUtil.randomInt();\n conf.setJournalBufferTimeout_NIO(i);\n Assert.assertEquals(i, conf.getJournalBufferTimeout_NIO());\n\n b = RandomUtil.randomBoolean();\n conf.setLogJournalWriteRate(b);\n Assert.assertEquals(b, conf.isLogJournalWriteRate());\n\n i = RandomUtil.randomInt();\n conf.setJournalPerfBlastPages(i);\n Assert.assertEquals(i, conf.getJournalPerfBlastPages());\n\n l = RandomUtil.randomLong();\n conf.setServerDumpInterval(l);\n Assert.assertEquals(l, conf.getServerDumpInterval());\n\n s = RandomUtil.randomString();\n conf.setPagingDirectory(s);\n Assert.assertEquals(s, conf.getPagingDirectory());\n\n s = RandomUtil.randomString();\n conf.setLargeMessagesDirectory(s);\n Assert.assertEquals(s, conf.getLargeMessagesDirectory());\n\n b = RandomUtil.randomBoolean();\n conf.setWildcardRoutingEnabled(b);\n Assert.assertEquals(b, conf.isWildcardRoutingEnabled());\n\n l = RandomUtil.randomLong();\n conf.setTransactionTimeout(l);\n Assert.assertEquals(l, conf.getTransactionTimeout());\n\n b = RandomUtil.randomBoolean();\n conf.setMessageCounterEnabled(b);\n Assert.assertEquals(b, conf.isMessageCounterEnabled());\n\n l = RandomUtil.randomPositiveLong();\n conf.setMessageCounterSamplePeriod(l);\n Assert.assertEquals(l, conf.getMessageCounterSamplePeriod());\n\n i = RandomUtil.randomInt();\n conf.setMessageCounterMaxDayHistory(i);\n Assert.assertEquals(i, conf.getMessageCounterMaxDayHistory());\n\n l = RandomUtil.randomLong();\n conf.setTransactionTimeoutScanPeriod(l);\n Assert.assertEquals(l, conf.getTransactionTimeoutScanPeriod());\n\n s = RandomUtil.randomString();\n conf.setClusterPassword(s);\n Assert.assertEquals(s, conf.getClusterPassword());\n\n // This will use serialization to perform a deep copy of the object\n Configuration conf2 = conf.copy();\n\n Assert.assertTrue(conf.equals(conf2));\n }\n\n @Test\n public void testResolvePath() throws Throwable {\n // Validate that the resolve method will work even with artemis.instance doesn't exist\n\n String oldProperty = System.getProperty(\"artemis.instance\");\n\n try {\n System.setProperty(\"artemis.instance\", \"/tmp/\" + RandomUtil.randomString());\n ConfigurationImpl configuration = new ConfigurationImpl();\n configuration.setJournalDirectory(\"./data-journal\");\n File journalLocation = configuration.getJournalLocation();\n Assert.assertFalse(\"This path shouldn't resolve to a real folder\", journalLocation.exists());\n }\n finally {\n if (oldProperty == null) {\n System.clearProperty(\"artemis.instance\");\n }\n else {\n System.setProperty(\"artemis.instance\", oldProperty);\n }\n }\n\n }\n\n @Test\n public void testAbsolutePath() throws Throwable {\n // Validate that the resolve method will work even with artemis.instance doesn't exist\n\n String oldProperty = System.getProperty(\"artemis.instance\");\n\n File tempFolder = null;\n try {\n System.setProperty(\"artemis.instance\", \"/tmp/\" + RandomUtil.randomString());\n tempFolder = File.createTempFile(\"journal-folder\", \"\");\n tempFolder.delete();\n\n tempFolder = new File(tempFolder.getAbsolutePath());\n tempFolder.mkdirs();\n\n System.out.println(\"TempFolder = \" + tempFolder.getAbsolutePath());\n\n ConfigurationImpl configuration = new ConfigurationImpl();\n configuration.setJournalDirectory(tempFolder.getAbsolutePath());\n File journalLocation = configuration.getJournalLocation();\n\n Assert.assertTrue(journalLocation.exists());\n }\n finally {\n if (oldProperty == null) {\n System.clearProperty(\"artemis.instance\");\n }\n else {\n System.setProperty(\"artemis.instance\", oldProperty);\n }\n\n if (tempFolder != null) {\n tempFolder.delete();\n }\n }\n\n }\n\n @Override\n @Before\n public void setUp() throws Exception {\n super.setUp();\n\n conf = createConfiguration();\n }\n\n protected Configuration createConfiguration() throws Exception {\n return new ConfigurationImpl();\n }\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '234dc968e36131531af8b5c60b1588ee', 'timestamp': '', 'source': 'github', 'line_count': 546, 'max_line_length': 147, 'avg_line_length': 42.663003663003664, 'alnum_prop': 0.7165364471537735, 'repo_name': 'waysact/activemq-artemis', 'id': '447d51bb9bfabc36bcbee452805b663354e9af63', 'size': '24093', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '5879'}, {'name': 'C', 'bytes': '23262'}, {'name': 'C++', 'bytes': '1032'}, {'name': 'CMake', 'bytes': '4260'}, {'name': 'CSS', 'bytes': '11732'}, {'name': 'HTML', 'bytes': '19113'}, {'name': 'Java', 'bytes': '22819589'}, {'name': 'Shell', 'bytes': '11911'}]}"}}},{"rowIdx":849781,"cells":{"text":{"kind":"string","value":"\n\n\n\n\n\nD - 索引 (android API)\n\n\n\n\n\n\n\n\n
\n\n\n\n\n\n\n\n
\n
\n\n\n\n
\n\n
\n\n\n
\n\n
A&nbsp;B&nbsp;C&nbsp;D&nbsp;E&nbsp;F&nbsp;G&nbsp;H&nbsp;I&nbsp;J&nbsp;L&nbsp;M&nbsp;N&nbsp;O&nbsp;P&nbsp;R&nbsp;S&nbsp;T&nbsp;U&nbsp;V&nbsp;W&nbsp;\n\n\n

D

\n
\n
declineInvitation(String, String, String, BasicCallback) - 类 中的静态方法cn.jpush.im.android.api.ContactManager
\n
\n
拒绝对方的好友请求
\n
\n
delChatRoomAdmin(long, List&lt;UserInfo&gt;, BasicCallback) - 类 中的静态方法cn.jpush.im.android.api.ChatRoomManager
\n
\n
取消指定用户的聊天室房管身份,只有房主有此权限
\n
\n
delChatRoomBlacklist(long, List&lt;UserInfo&gt;, BasicCallback) - 类 中的静态方法cn.jpush.im.android.api.ChatRoomManager
\n
\n
将用户从聊天室黑名单中移除,只有聊天室的房主和房管有此权限
\n
\n
delChatRoomSilence(long, Collection&lt;UserInfo&gt;, BasicCallback) - 类 中的静态方法cn.jpush.im.android.api.ChatRoomManager
\n
\n
将指定用户从聊天室禁言列表中移除(批量设置一次最多500个)\n 只有房主和管理员可设置,取消成功聊天室成员会收到ChatRoomNotificationEvent
\n
\n
deleteAllMessage() - 类 中的方法cn.jpush.im.android.api.model.Conversation
\n
\n
删除会话中的所有消息,但不会删除会话本身。
\n
\n
deleteChatRoomConversation(long) - 类 中的静态方法cn.jpush.im.android.api.JMessageClient
\n
\n
删除聊天室会话,同时删除掉本地相关缓存文件
\n
\n
deleteGroupConversation(long) - 类 中的静态方法cn.jpush.im.android.api.JMessageClient
\n
\n
删除群聊的会话,同时删除掉本地聊天记录
\n
\n
deleteMessage(int) - 类 中的方法cn.jpush.im.android.api.model.Conversation
\n
\n
删除会话中指定messageId的消息\n \n 由于聊天室类型会话中所有消息都不会保存到本地,调用此接口将固定返回false
\n
\n
deleteSingleConversation(String) - 类 中的静态方法cn.jpush.im.android.api.JMessageClient
\n
\n
删除单聊的会话,同时删除掉本地聊天记录。
\n
\n
deleteSingleConversation(String, String) - 类 中的静态方法cn.jpush.im.android.api.JMessageClient
\n
\n
删除与指定appkey下username的单聊的会话,同时删除掉本地聊天记录。
\n
\n
delGroupAnnouncement(int, BasicCallback) - 类 中的方法cn.jpush.im.android.api.model.GroupInfo
\n
\n
删除群内指定id的公告,只有群主和管理员有权限删除
\n 删除群公告成功时群内所有成员会收到GroupAnnouncementChangedEvent
\n
\n
delGroupBlacklist(List&lt;UserInfo&gt;, BasicCallback) - 类 中的方法cn.jpush.im.android.api.model.GroupInfo
\n
\n
将用户从群组黑名单中移除,只有群主和管理员有此权限.
\n
\n
delGroupSilence(Collection&lt;UserInfo&gt;, BasicCallback) - 类 中的方法cn.jpush.im.android.api.model.GroupInfo
\n
\n
取消群成员禁言(批量设置一次最多500个),取消禁言成功后会以系统消息形式通知群内成员
\n
\n
delUsersFromBlacklist(List&lt;String&gt;, BasicCallback) - 类 中的静态方法cn.jpush.im.android.api.JMessageClient
\n
\n
将用户移出黑名单。
\n
\n
delUsersFromBlacklist(List&lt;String&gt;, String, BasicCallback) - 类 中的静态方法cn.jpush.im.android.api.JMessageClient
\n
\n
将用户移出黑名单,通过指定appKey可以实现跨应用将用户移出黑名单
\n
\n
DeviceInfo - cn.jpush.im.android.api.model中的类
\n
\n
设备状态信息,使用JMessageClient.login(String, String, RequestCallback)可以返回账号所登陆过的设备信息。
\n
\n
DeviceInfo(long, PlatformType, int, int, boolean, int) - 类 的构造器cn.jpush.im.android.api.model.DeviceInfo
\n
&nbsp;
\n
doCompleteCallBackToUser(BasicCallback, int, String, Object...) - 类 中的静态方法cn.jpush.im.android.api.jmrtc.JMRTCInternalUse
\n
&nbsp;
\n
DownloadAvatarCallback - cn.jpush.im.android.api.callback中的类
\n
&nbsp;
\n
DownloadCompletionCallback - cn.jpush.im.android.api.callback中的类
\n
&nbsp;
\n
downloadFile(Message, DownloadCompletionCallback) - 类 中的方法cn.jpush.im.android.api.content.FileContent
\n
\n
下载消息中文件。
\n
\n
downloadOriginImage(Message, DownloadCompletionCallback) - 类 中的方法cn.jpush.im.android.api.content.ImageContent
\n
\n
下载图片消息中的原图,下载过程中想要取消的话调用ImageContent.cancelDownload(Message)
\n
\n
downloadThumbImage(Message, DownloadCompletionCallback) - 类 中的方法cn.jpush.im.android.api.content.VideoContent
\n
\n
下载视频消息的缩略图(如果视频消息发送者有指定的话)\n \n 对于用户在线期间收到的视频消息:sdk会在接收到视频消息时自动下载缩略图文件。
\n
\n
downloadThumbnailImage(Message, DownloadCompletionCallback) - 类 中的方法cn.jpush.im.android.api.content.ImageContent
\n
\n
下载图片消息中原图对应的缩略图\n \n 对于用户在线期间收到的图片消息:sdk会在接收到图片消息时自动下载缩略图。
\n
\n
downloadVideoFile(Message, DownloadCompletionCallback) - 类 中的方法cn.jpush.im.android.api.content.VideoContent
\n
\n
下载视频消息中的视频文件,下载过程中如果想取消调用VideoContent.cancelDownload(Message)\n \n 注意:sdk收到文件消息后,不会自动下载视频文件附件,需要用户主动调用此接口完成下载。
\n
\n
downloadVoiceFile(Message, DownloadCompletionCallback) - 类 中的方法cn.jpush.im.android.api.content.VoiceContent
\n
\n
下载语音消息中的语音文件。
\n
\n
\nA&nbsp;B&nbsp;C&nbsp;D&nbsp;E&nbsp;F&nbsp;G&nbsp;H&nbsp;I&nbsp;J&nbsp;L&nbsp;M&nbsp;N&nbsp;O&nbsp;P&nbsp;R&nbsp;S&nbsp;T&nbsp;U&nbsp;V&nbsp;W&nbsp;
\n\n
\n\n\n\n\n\n\n\n
\n
\n\n\n\n
\n\n
\n\n\n
\n\n\n\n"},"meta":{"kind":"string","value":"{'content_hash': '36e7cc4973dd70aa81446e393ec0d201', 'timestamp': '', 'source': 'github', 'line_count': 232, 'max_line_length': 770, 'avg_line_length': 74.23706896551724, 'alnum_prop': 0.7189804331417291, 'repo_name': 'Aoyunyun/jpush-docs', 'id': 'e5b2bbf466a87e9d736d91aff40835a1fdc491ff', 'size': '19169', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'zh/jmessage/client/im_android_api_docs/index-files/index-4.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '143254'}, {'name': 'HTML', 'bytes': '7277764'}, {'name': 'JavaScript', 'bytes': '195949'}, {'name': 'Python', 'bytes': '4590'}, {'name': 'Shell', 'bytes': '2945'}]}"}}},{"rowIdx":849782,"cells":{"text":{"kind":"string","value":"\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nDEFINE_BAKERY_LOCK(tegra_fiq_lock);\n\n/*******************************************************************************\n * Static variables\n ******************************************************************************/\nstatic uint64_t ns_fiq_handler_addr;\nstatic unsigned int fiq_handler_active;\nstatic pcpu_fiq_state_t fiq_state[PLATFORM_CORE_COUNT];\n\n/*******************************************************************************\n * Handler for FIQ interrupts\n ******************************************************************************/\nstatic uint64_t tegra_fiq_interrupt_handler(uint32_t id,\n\t\t\t\t\t uint32_t flags,\n\t\t\t\t\t void *handle,\n\t\t\t\t\t void *cookie)\n{\n\tcpu_context_t *ctx = cm_get_context(NON_SECURE);\n\tel3_state_t *el3state_ctx = get_el3state_ctx(ctx);\n\tint cpu = plat_my_core_pos();\n\tuint32_t irq;\n\n\tbakery_lock_get(&tegra_fiq_lock);\n\n\t/*\n\t * The FIQ was generated when the execution was in the non-secure\n\t * world. Save the context registers to start with.\n\t */\n\tcm_el1_sysregs_context_save(NON_SECURE);\n\n\t/*\n\t * Save elr_el3 and spsr_el3 from the saved context, and overwrite\n\t * the context with the NS fiq_handler_addr and SPSR value.\n\t */\n\tfiq_state[cpu].elr_el3 = read_ctx_reg(el3state_ctx, CTX_ELR_EL3);\n\tfiq_state[cpu].spsr_el3 = read_ctx_reg(el3state_ctx, CTX_SPSR_EL3);\n\n\t/*\n\t * Set the new ELR to continue execution in the NS world using the\n\t * FIQ handler registered earlier.\n\t */\n\tassert(ns_fiq_handler_addr);\n\twrite_ctx_reg(el3state_ctx, CTX_ELR_EL3, ns_fiq_handler_addr);\n\n\t/*\n\t * Mark this interrupt as complete to avoid a FIQ storm.\n\t */\n\tirq = plat_ic_acknowledge_interrupt();\n\tif (irq < 1022)\n\t\tplat_ic_end_of_interrupt(irq);\n\n\tbakery_lock_release(&tegra_fiq_lock);\n\n\treturn 0;\n}\n\n/*******************************************************************************\n * Setup handler for FIQ interrupts\n ******************************************************************************/\nvoid tegra_fiq_handler_setup(void)\n{\n\tuint64_t flags;\n\tint rc;\n\n\t/* return if already registered */\n\tif (fiq_handler_active)\n\t\treturn;\n\n\t/*\n\t * Register an interrupt handler for FIQ interrupts generated for\n\t * NS interrupt sources\n\t */\n\tflags = 0;\n\tset_interrupt_rm_flag(flags, NON_SECURE);\n\trc = register_interrupt_type_handler(INTR_TYPE_EL3,\n\t\t\t\ttegra_fiq_interrupt_handler,\n\t\t\t\tflags);\n\tif (rc)\n\t\tpanic();\n\n\t/* handler is now active */\n\tfiq_handler_active = 1;\n}\n\n/*******************************************************************************\n * Validate and store NS world's entrypoint for FIQ interrupts\n ******************************************************************************/\nvoid tegra_fiq_set_ns_entrypoint(uint64_t entrypoint)\n{\n\tns_fiq_handler_addr = entrypoint;\n}\n\n/*******************************************************************************\n * Handler to return the NS EL1/EL0 CPU context\n ******************************************************************************/\nint tegra_fiq_get_intr_context(void)\n{\n\tcpu_context_t *ctx = cm_get_context(NON_SECURE);\n\tgp_regs_t *gpregs_ctx = get_gpregs_ctx(ctx);\n\tel1_sys_regs_t *el1state_ctx = get_sysregs_ctx(ctx);\n\tint cpu = plat_my_core_pos();\n\tuint64_t val;\n\n\t/*\n\t * We store the ELR_EL3, SPSR_EL3, SP_EL0 and SP_EL1 registers so\n\t * that el3_exit() sends these values back to the NS world.\n\t */\n\twrite_ctx_reg(gpregs_ctx, CTX_GPREG_X0, fiq_state[cpu].elr_el3);\n\twrite_ctx_reg(gpregs_ctx, CTX_GPREG_X1, fiq_state[cpu].spsr_el3);\n\n\tval = read_ctx_reg(gpregs_ctx, CTX_GPREG_SP_EL0);\n\twrite_ctx_reg(gpregs_ctx, CTX_GPREG_X2, val);\n\n\tval = read_ctx_reg(el1state_ctx, CTX_SP_EL1);\n\twrite_ctx_reg(gpregs_ctx, CTX_GPREG_X3, val);\n\n\treturn 0;\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '018b19a27ee8c559c10cac6c56424a38', 'timestamp': '', 'source': 'github', 'line_count': 134, 'max_line_length': 80, 'avg_line_length': 29.350746268656717, 'alnum_prop': 0.5542842613780828, 'repo_name': 'sbranden/arm-trusted-firmware', 'id': '7fcc114c0624c9f7498ed9d6b6008613845a9209', 'size': '5489', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'plat/nvidia/tegra/common/tegra_fiq_glue.c', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Assembly', 'bytes': '583601'}, {'name': 'C', 'bytes': '3262969'}, {'name': 'C++', 'bytes': '67409'}, {'name': 'Makefile', 'bytes': '188703'}, {'name': 'Objective-C', 'bytes': '2286'}]}"}}},{"rowIdx":849783,"cells":{"text":{"kind":"string","value":"Plugin.define \"Sendcard\" do\nauthor \"Brendan Coles \" # 2011-03-15\nversion \"0.1\"\ndescription \"Sendcard is a multi-database (It currently supports 9 different databases!) ecards script or virtual postcard program written in PHP. Suitable for large or small sites, it is very easy to setup, and comes with an installation wizard.\"\nwebsite \"http://www.sendcard.org/\"\n\n# Google results as at 2011-03-15 #\n# 255 for scscsc320\n# 141 for \"Powered by sendcard - an advanced PHP e-card program\" -dork\n\n# Dorks #\ndorks [\n'\"scscsc320\"',\n'\"Powered by sendcard - an advanced PHP e-card program\" -dork'\n]\n\n\n\n# Matches #\nmatches [\n\n# Powered by logo link\n{ :regexp=>/]+alt=\"Powered by sendcard - an advanced PHP e-card program\"[^>]*><\\/a>/ },\n\n# Powered by logo\n{ :certainty=>25, :regexp=>/]+alt=\"Powered by sendcard - an advanced PHP e-card program\">/ },\n\n# HTML Comment\n{ :text=>\"\" },\n\n# \"scscsc320\" string provided for Google hackers as per HTML comment:\n# \n{ :text=>'
scscsc320
' },\n\n]\n\nend\n\n\n"},"meta":{"kind":"string","value":"{'content_hash': 'a35083c153883f03f780719ff531005d', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 247, 'avg_line_length': 36.38461538461539, 'alnum_prop': 0.7110641296687809, 'repo_name': 'Yukinoshita47/Yuki-Chan-The-Auto-Pentest', 'id': '77dc8022f9eecbfb14770b54a2738d79d0ed511c', 'size': '1664', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'Module/WhatWeb/plugins/sendcard.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '36211'}, {'name': 'JavaScript', 'bytes': '3038'}, {'name': 'Makefile', 'bytes': '1360'}, {'name': 'Perl', 'bytes': '108876'}, {'name': 'Python', 'bytes': '3034585'}, {'name': 'Roff', 'bytes': '6738'}, {'name': 'Ruby', 'bytes': '2693582'}, {'name': 'Shell', 'bytes': '53755'}, {'name': 'XSLT', 'bytes': '5475'}]}"}}},{"rowIdx":849784,"cells":{"text":{"kind":"string","value":"using namespace boost::python;\nusing namespace GafferUIBindings;\nusing namespace GafferUI;\n\nstruct NodeGadgetCreator\n{\n\tNodeGadgetCreator( object fn )\n\t\t:\tm_fn( fn )\n\t{\n\t}\n\t\n\tNodeGadgetPtr operator()( Gaffer::NodePtr node )\n\t{\n\t\tIECorePython::ScopedGILLock gilLock;\n\t\tNodeGadgetPtr result = extract( m_fn( node ) );\n\t\treturn result;\n\t}\n\t\n\tprivate :\n\t\n\t\tobject m_fn;\n\n};\n\nstatic void registerNodeGadget( IECore::TypeId nodeType, object creator )\n{\n\tNodeGadget::registerNodeGadget( nodeType, NodeGadgetCreator( creator ) );\n}\n\nstatic Gaffer::NodePtr node( NodeGadget &nodeGadget )\n{\n\treturn nodeGadget.node();\n}\n\nvoid GafferUIBindings::bindNodeGadget()\n{\n\ttypedef NodeGadgetWrapper Wrapper;\n\tIE_CORE_DECLAREPTR( Wrapper );\n\n\tNodeGadgetClass()\n\t\t.def( \"node\", &node )\n\t\t.def( \"create\", &NodeGadget::create ).staticmethod( \"create\" )\n\t\t.def( \"registerNodeGadget\", &registerNodeGadget ).staticmethod( \"registerNodeGadget\" )\n\t;\n}\n"},"meta":{"kind":"string","value":"{'content_hash': 'b03efdedcd10c91e68db05ee4b2a9ce2', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 88, 'avg_line_length': 21.666666666666668, 'alnum_prop': 0.7323076923076923, 'repo_name': 'davidsminor/gaffer', 'id': 'a5bc00d968cbfbe477a92edc7d487d2655f1afda', 'size': '3104', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/GafferUIBindings/NodeGadgetBinding.cpp', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '9286'}, {'name': 'C++', 'bytes': '3358250'}, {'name': 'COBOL', 'bytes': '64449'}, {'name': 'CSS', 'bytes': '28027'}, {'name': 'Python', 'bytes': '3267354'}, {'name': 'Shell', 'bytes': '7055'}, {'name': 'Slash', 'bytes': '35200'}]}"}}},{"rowIdx":849785,"cells":{"text":{"kind":"string","value":"SYNONYM\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull"},"meta":{"kind":"string","value":"{'content_hash': '4a36ae6a2cb1fdfc88bba833ad633512', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': '5f083f0131bb95cb5adce1dd72d19debc17ef419', 'size': '186', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Liliopsida/Poales/Cyperaceae/Carex/Carex austroalpina/ Syn. Carex sempervirens tenax/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}"}}},{"rowIdx":849786,"cells":{"text":{"kind":"string","value":"package com.lfk.justwetools.View.NewPaint;\nimport android.app.Application;\n\nimport java.util.ArrayList;\n\n/**\n * Created by liufengkai on 15/8/25.\n */\npublic class PathNode extends Application{\n public class Node{\n public Node() {}\n public float x;\n public float y;\n public int PenColor;\n public int TouchEvent;\n public int PenWidth;\n public boolean IsPaint;\n public long time;\n public int EraserWidth;\n\n }\n private ArrayList PathList;\n\n\n public ArrayList getPathList() {\n return PathList;\n }\n\n public void addNode(Node node){\n PathList.add(node);\n }\n\n public Node NewAnode(){\n return new Node();\n }\n\n\n public void clearList(){\n PathList.clear();\n }\n\n @Override\n public void onCreate() {\n super.onCreate();\n PathList = new ArrayList();\n }\n\n public void setPathList(ArrayList pathList) {\n PathList = pathList;\n }\n\n public Node getTheLastNote(){\n return PathList.get(PathList.size()-1);\n }\n\n public void deleteTheLastNote(){\n PathList.remove(PathList.size()-1);\n }\n\n public PathNode() {\n PathList = new ArrayList();\n }\n\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '068a025dc9c566f5ebea5e91fdc4b62a', 'timestamp': '', 'source': 'github', 'line_count': 64, 'max_line_length': 55, 'avg_line_length': 19.5, 'alnum_prop': 0.5985576923076923, 'repo_name': 'xxzj990/Reader', 'id': 'c61ac53384e81f8b78f2c7a16495fba5202238e3', 'size': '1248', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/java/com/lfk/justwetools/View/NewPaint/PathNode.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '30096'}, {'name': 'HTML', 'bytes': '962'}, {'name': 'Java', 'bytes': '267523'}, {'name': 'JavaScript', 'bytes': '24085'}]}"}}},{"rowIdx":849787,"cells":{"text":{"kind":"string","value":"\n \n \n\n\n\n
\n\n\n\n

\n Data from - \n San Francisco COVID-19 Data Tracker\n
\n\n Powered by their API\n

\n\n"},"meta":{"kind":"string","value":"{'content_hash': 'fea9ad793f6e7ffc8feac5c90eca7972', 'timestamp': '', 'source': 'github', 'line_count': 101, 'max_line_length': 132, 'avg_line_length': 21.019801980198018, 'alnum_prop': 0.5925577013659915, 'repo_name': 'richieM/richieM.github.io', 'id': 'f16de43944991bedf7cbe4a76e400e96f9ce33db', 'size': '2123', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'SF-COVID/index.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '222889'}, {'name': 'HTML', 'bytes': '5423416'}, {'name': 'JavaScript', 'bytes': '13239197'}, {'name': 'SCSS', 'bytes': '58835'}]}"}}},{"rowIdx":849788,"cells":{"text":{"kind":"string","value":" 'cachesession1',\n ],\n [\n 'host' => 'cachesession2',\n ],\n ];\n}\n\n/**\n * @return mixed соединение с пулом кешей хранения сессий пользователя\n */\nfunction session_getconnection() {\n $connection = null;\n $config = session_config();\n foreach($config as $v) {\n if (is_null($connection)) {\n $connection = memcache_connect($v['host']);\n } else {\n memcache_add_server($connection, $v['host']);\n }\n }\n return $connection;\n}\n\n/**\n * Функция получения данных сессии\n * @param string $sessionId идентификатор сессии\n * @return mixed данные и сессии\n */\nfunction session_get($sessionId) {\n $connection = session_getconnection();\n return memcache_get($connection, $sessionId);\n}\n\n"},"meta":{"kind":"string","value":"{'content_hash': '285d4004f32f53d750a7ad0c9521d6ab', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 70, 'avg_line_length': 21.6, 'alnum_prop': 0.588477366255144, 'repo_name': 'alxmslwork/order', 'id': '551690cbabddd35aba6898f0f739a64d571d5f5e', 'size': '1157', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'source/ordr/session/session.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '11281'}, {'name': 'Nginx', 'bytes': '51'}, {'name': 'PHP', 'bytes': '80832'}, {'name': 'Shell', 'bytes': '4738'}]}"}}},{"rowIdx":849789,"cells":{"text":{"kind":"string","value":"LogDefaults();\n\n // Get the TeamService.\n $teamService = $user->GetService('TeamService', 'v201502');\n\n // Create an array to store local team objects.\n $teams = array();\n\n for ($i = 0; $i < 5; $i++) {\n $team = new Team();\n $team->name = 'Team #' . uniqid();\n $team->hasAllCompanies = false;\n $team->hasAllInventory = false;\n $teams[] = $team;\n }\n\n // Create the teams on the server.\n $teams = $teamService->createTeams($teams);\n\n // Display results.\n if (isset($teams)) {\n foreach ($teams as $team) {\n print 'A team with ID \"' . $team->id\n . '\" and name \"'. $team->name\n . '\" was created.\"' . \"\\n\";\n }\n } else {\n print \"No teams created.\\n\";\n }\n} catch (OAuth2Exception $e) {\n ExampleUtils::CheckForOAuth2Errors($e);\n} catch (ValidationException $e) {\n ExampleUtils::CheckForOAuth2Errors($e);\n} catch (Exception $e) {\n print $e->getMessage() . \"\\n\";\n}\n\n"},"meta":{"kind":"string","value":"{'content_hash': 'fd625e16de48a27d137bbf9ac82132c4', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 69, 'avg_line_length': 27.196428571428573, 'alnum_prop': 0.6080105055810899, 'repo_name': 'Adslive/googleads-php-lib', 'id': 'c9d76efb943be05bb090688f27fdb130b7e3934e', 'size': '2558', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'examples/Dfp/v201502/TeamService/CreateTeams.php', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'PHP', 'bytes': '45961097'}, {'name': 'XSLT', 'bytes': '17842'}]}"}}},{"rowIdx":849790,"cells":{"text":{"kind":"string","value":"extensions = []\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix(es) of source filenames.\n# You can specify multiple suffix as a list of string:\n#\n# source_suffix = ['.rst', '.md']\nsource_suffix = '.rst'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'django-cruds-adminlte'\ncopyright = u'2017, Óscar M. Lage'\nauthor = u'Óscar M. Lage'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = u'0.0.3'\n# The full version, including alpha/beta/rc tags.\nrelease = u'0.0.3'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#\n# This is also used if you do content translation via gettext catalogs.\n# Usually you set \"language\" from the command line for these cases.\nlanguage = None\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\n# This patterns also effect to html_static_path and html_extra_path\nexclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# If true, `todo` and `todoList` produce output, else they produce nothing.\ntodo_include_todos = False\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages. See the documentation for\n# a list of builtin themes.\n#\nhtml_theme = 'default'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further. For a list of options available for each theme, see the\n# documentation.\n#\n# html_theme_options = {}\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n\n# -- Options for HTMLHelp output ------------------------------------------\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'django-cruds-adminltedoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n # The paper size ('letterpaper' or 'a4paper').\n #\n # 'papersize': 'letterpaper',\n\n # The font size ('10pt', '11pt' or '12pt').\n #\n # 'pointsize': '10pt',\n\n # Additional stuff for the LaTeX preamble.\n #\n # 'preamble': '',\n\n # Latex figure (float) alignment\n #\n # 'figure_align': 'htbp',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n# author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n (master_doc, 'django-cruds-adminlte.tex',\n u'django-cruds-adminlte Documentation',\n u'Óscar M. Lage', 'manual'),\n]\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n (master_doc, 'django-cruds-adminlte',\n u'django-cruds-adminlte Documentation',\n [author], 1)\n]\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n# dir menu entry, description, category)\ntexinfo_documents = [\n (master_doc, 'django-cruds-adminlte',\n u'django-cruds-adminlte Documentation',\n author, 'django-cruds-adminlte', 'One line description of project.',\n 'Miscellaneous'),\n]\n"},"meta":{"kind":"string","value":"{'content_hash': '5535439e650c68c140006eabd35e66d3', 'timestamp': '', 'source': 'github', 'line_count': 124, 'max_line_length': 78, 'avg_line_length': 30.588709677419356, 'alnum_prop': 0.6659636171895598, 'repo_name': 'luisza/django-cruds-adminlte', 'id': '719ef65b9b562727198456bdb6e17ae819513028', 'size': '4862', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/conf.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '246689'}, {'name': 'HTML', 'bytes': '75891'}, {'name': 'JavaScript', 'bytes': '246595'}, {'name': 'Python', 'bytes': '57039'}]}"}}},{"rowIdx":849791,"cells":{"text":{"kind":"string","value":"using System;\nusing System.Linq;\nusing System.Linq.Expressions;\nusing System.Reflection;\n\nnamespace Naxis.Core.Extensions\n{\n /// \n /// Type扩展\n /// \n public static class TypeExtensions\n {\n /// \n /// 返回类型的实例\n /// \n /// \n /// \n /// \n public static object CreateInstance(this Type type, params object[] args)\n {\n return Activator.CreateInstance(type, args);\n }\n\n /// \n /// 返回泛型的实例\n /// \n /// \n /// \n /// \n /// \n public static T CreateInstance(this Type type, params object[] args)\n {\n return (T)type.CreateInstance(args);\n }\n\n /// \n /// 获取属性信息\n /// \n /// \n /// \n public static MemberInfo GetMemberInfo(this Expression expression)\n {\n var lambda = (LambdaExpression)expression;\n\n MemberExpression memberExpression;\n\n var body = lambda.Body as UnaryExpression;\n if (body != null)\n {\n var unaryExpression = body;\n\n memberExpression = (MemberExpression)unaryExpression.Operand;\n }\n else\n {\n memberExpression = (MemberExpression)lambda.Body;\n }\n\n return memberExpression.Member;\n }\n\n /// \n /// 类型是否有指定特性\n /// \n /// \n /// \n /// \n public static bool HasAttribute(this Type type, Type attributeType)\n {\n return type.GetCustomAttributes(attributeType, false).Length > 0;\n }\n\n /// \n /// 方法是否有指定特性\n /// \n /// \n /// \n /// \n public static bool HasMethodsWithAttribute(this Type type, Type attributeType)\n {\n return type.GetMethods().Any(methodInfo => methodInfo.GetCustomAttributes(attributeType, false).Length > 0);\n }\n\n /// \n /// 属性是否有指定特性\n /// \n /// \n /// \n /// \n public static bool HasAttribute(this MethodInfo methodInfo, Type attributeType)\n {\n return methodInfo.GetCustomAttributes(attributeType, false).Length > 0;\n }\n\n /// \n /// 是否能转换到另一个类型\n /// \n /// \n /// \n /// \n public static bool CanBeCastTo(this Type type)\n {\n if (type == null)\n {\n return false;\n }\n\n var destinationType = typeof(T);\n\n return CanBeCastTo(type, destinationType);\n }\n\n /// \n /// 是否能转换到另一个类型\n /// \n /// \n /// \n /// \n public static bool CanBeCastTo(this Type type, Type destinationType)\n {\n if (type == null)\n {\n return false;\n }\n\n return type == destinationType || destinationType.IsAssignableFrom(type);\n }\n\n /// \n /// 是否对象实例\n /// \n /// \n /// \n public static bool IsConcrete(this Type type)\n {\n if (type == null)\n {\n return false;\n }\n\n return !type.IsAbstract && !type.IsInterface;\n }\n\n /// \n /// 非对象实例(接口/抽象类)\n /// \n /// \n /// \n public static bool IsNotConcrete(this Type type)\n {\n return !type.IsConcrete();\n }\n }\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '1f0bb5e0d76dfb38c38809bbb5f05b84', 'timestamp': '', 'source': 'github', 'line_count': 154, 'max_line_length': 120, 'avg_line_length': 28.42207792207792, 'alnum_prop': 0.5058259081562714, 'repo_name': 'swpudp/Naxis', 'id': 'dbcd299964c6dd269767ada0ffd079b670dc2cb3', 'size': '4553', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Naxis.Common/Extensions/TypeExtensions.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '96'}, {'name': 'C#', 'bytes': '994969'}, {'name': 'CSS', 'bytes': '842932'}, {'name': 'HTML', 'bytes': '167343'}, {'name': 'JavaScript', 'bytes': '610860'}, {'name': 'TypeScript', 'bytes': '394'}]}"}}},{"rowIdx":849792,"cells":{"text":{"kind":"string","value":"//\n// (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying \"License.txt\" for licensed use.\n//\n\n\n#ifndef JLS_INTERFACE\n#define JLS_INTERFACE\n\n#include \"pubtypes.h\"\n#include \"dcmtk/ofstd/ofstd.h\" /* for size_t */\n#include \"dcmtk/ofstd/ofdefine.h\" /* for DCMTK_DECL_EXPORT */\n\n\n#ifdef charls_EXPORTS\n#define DCMTK_CHARLS_EXPORT DCMTK_DECL_EXPORT\n#else\n#define DCMTK_CHARLS_EXPORT DCMTK_DECL_IMPORT\n#endif\n\n#ifndef CHARLS_IMEXPORT\n#define CHARLS_IMEXPORT(returntype) DCMTK_CHARLS_EXPORT returntype\n#endif\n\n\n#ifdef __cplusplus\nextern \"C\"\n{\n#endif\n CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsEncode(void* compressedData, size_t compressedLength, size_t* pcbyteWritten,\n\t const void* uncompressedData, size_t uncompressedLength, struct JlsParameters* pparams);\n\n CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsDecode(void* uncompressedData, size_t uncompressedLength,\n\t\tconst void* compressedData, size_t compressedLength,\n\t\tstruct JlsParameters* info);\n\n\n CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsDecodeRect(void* uncompressedData, size_t uncompressedLength,\n\t\tconst void* compressedData, size_t compressedLength,\n\t\tstruct JlsRect rect, struct JlsParameters* info);\n\n CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsReadHeader(const void* uncompressedData, size_t uncompressedLength,\n\t\tstruct JlsParameters* pparams);\n\n CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsVerifyEncode(const void* uncompressedData, size_t uncompressedLength,\n\t\tconst void* compressedData, size_t compressedLength);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n"},"meta":{"kind":"string","value":"{'content_hash': 'd1ccf9eaad720240f7bd9c719eccb932', 'timestamp': '', 'source': 'github', 'line_count': 51, 'max_line_length': 116, 'avg_line_length': 29.705882352941178, 'alnum_prop': 0.7768976897689769, 'repo_name': 'NCIP/annotation-and-image-markup', 'id': '1a7bd4b9259183c2270e10dd26578801ee7ae0d1', 'size': '1515', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'AIMToolkit_v4.1.0_rv44/source/dcmtk-3.6.1_20121102/dcmjpls/libcharls/intrface.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '31363450'}, {'name': 'C#', 'bytes': '5152916'}, {'name': 'C++', 'bytes': '148605530'}, {'name': 'CSS', 'bytes': '85406'}, {'name': 'Java', 'bytes': '2039090'}, {'name': 'Objective-C', 'bytes': '381107'}, {'name': 'Perl', 'bytes': '502054'}, {'name': 'Shell', 'bytes': '11832'}, {'name': 'Tcl', 'bytes': '30867'}]}"}}},{"rowIdx":849793,"cells":{"text":{"kind":"string","value":"'use strict';\n\n// global events\nvar EVENTS = require('../events');\n\nvar ViewModel = require('./models/getFeatureInfo');\n\nvar View = require('./views/getFeatureInfo');\n\nvar UI_Panel = require('./panel');\n\nvar Controller = function(options) {\n // initialize VM, and that's all a controller should EVER do, everything\n // else is handled by the vm and model\n this.vm = new ViewModel(options);\n};\n\nvar GetFeatureInfo = function(options) {\n this.options = {\n // initial module options\n };\n\n // override and extend default options\n for (var opt in options) {\n if (options.hasOwnProperty(opt)) {\n this.options[opt] = options[opt];\n }\n }\n\n this.init();\n\n return {\n controller: this.controller,\n view: this.view\n };\n};\n\nGetFeatureInfo.prototype = {\n\n init: function() {\n var gfi_controller = new Controller(this.options);\n var gfi_view = View;\n\n var panel = new UI_Panel(this.options, {\n title: 'Rezultati',\n component: {controller: gfi_controller, view: gfi_view},\n width: '200px',\n top: '56px',\n right: '10px'\n });\n\n this.controller = panel.controller;\n this.view = panel.view;\n\n EVENTS.on('getFeatureInfo.results', function(options) {\n gfi_controller.vm.set(options.features);\n });\n\n gfi_controller.vm.events.on('results.show', function(options) {\n panel.controller.vm.show();\n });\n gfi_controller.vm.events.on('results.hide', function(options) {\n panel.controller.vm.hide();\n });\n\n gfi_controller.vm.events.on('result.click', function(options) {\n EVENTS.emit('getFeatureInfo.result.clicked', options);\n });\n\n panel.controller.vm.events.on('panel.closed', function () {\n EVENTS.emit('getFeatureInfo.results.closed');\n });\n\n EVENTS.on('getFeatureInfo.tool.deactivate', function () {\n panel.controller.vm.hide();\n });\n }\n};\n\nmodule.exports = GetFeatureInfo;\n"},"meta":{"kind":"string","value":"{'content_hash': '93412c864f5f8d7c266ca53c0bb1a596', 'timestamp': '', 'source': 'github', 'line_count': 80, 'max_line_length': 76, 'avg_line_length': 26.025, 'alnum_prop': 0.5840537944284342, 'repo_name': 'candela-it/sunlumo', 'id': 'c849c6d2067692610e72c2863f156a0621516057', 'size': '2082', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'django_project/lib_js/lib/ui/getFeatureInfo.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '394728'}, {'name': 'HTML', 'bytes': '2964'}, {'name': 'JavaScript', 'bytes': '364730'}, {'name': 'Python', 'bytes': '99692'}, {'name': 'Ruby', 'bytes': '900'}, {'name': 'Shell', 'bytes': '446'}]}"}}},{"rowIdx":849794,"cells":{"text":{"kind":"string","value":"\n\n npm-init\n \n \n \n \n\n \n
\n\n

npm-init

create a package.json file

\n

SYNOPSIS

\n
npm init [--force|-f|--yes|-y|--scope]\nnpm init &lt;@scope&gt; (same as `npx &lt;@scope&gt;/create`)\nnpm init [&lt;@scope&gt;/]&lt;name&gt; (same as `npx [&lt;@scope&gt;/]create-&lt;name&gt;`)

EXAMPLES

\n

Create a new React-based project using create-react-app:

\n
$ npm init react-app ./my-react-app

Create a new esm-compatible package using create-esm:

\n
$ mkdir my-esm-lib &amp;&amp; cd my-esm-lib\n$ npm init esm --yes

Generate a plain old package.json using legacy init:

\n
$ mkdir my-npm-pkg &amp;&amp; cd my-npm-pkg\n$ git init\n$ npm init

Generate it without having it ask any questions:

\n
$ npm init -y

DESCRIPTION

\n

npm init &lt;initializer&gt; can be used to set up a new or existing npm package.

\n

initializer in this case is an npm package named create-&lt;initializer&gt;, which\nwill be installed by npx(1), and then have its main bin\nexecuted -- presumably creating or updating package.json and running any other\ninitialization-related operations.

\n

The init command is transformed to a corresponding npx operation as follows:

\n
    \n
  • npm init foo -&gt; npx create-foo
  • \n
  • npm init @usr/foo -&gt; npx @usr/create-foo
  • \n
  • npm init @usr -&gt; npx @usr/create
  • \n
\n

Any additional options will be passed directly to the command, so npm init foo\n--hello will map to npx create-foo --hello.

\n

If the initializer is omitted (by just calling npm init), init will fall back\nto legacy init behavior. It will ask you a bunch of questions, and then write a\npackage.json for you. It will attempt to make reasonable guesses based on\nexisting fields, dependencies, and options selected. It is strictly additive, so\nit will keep any fields and values that were already set. You can also use\n-y/--yes to skip the questionnaire altogether. If you pass --scope, it\nwill create a scoped package.

\n

SEE ALSO

\n\n\n
\n\n\n\n\n\n\n\n\n\n\n

npm-init &mdash; npm@6.8.0-next.0

\n\n"},"meta":{"kind":"string","value":"{'content_hash': 'b814ace278ccc8d889d4d84a040e636a', 'timestamp': '', 'source': 'github', 'line_count': 65, 'max_line_length': 807, 'avg_line_length': 82.63076923076923, 'alnum_prop': 0.7013591509960901, 'repo_name': 'joegesualdo/dotfiles', 'id': 'af9d321cf10c183d2fbc88d707f9c2a8e834ab02', 'size': '5371', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'npm-global/lib/node_modules/npm/html/doc/cli/npm-init.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '712'}, {'name': 'CoffeeScript', 'bytes': '386'}, {'name': 'Elm', 'bytes': '332785'}, {'name': 'JavaScript', 'bytes': '115864'}, {'name': 'Ruby', 'bytes': '5718'}, {'name': 'Shell', 'bytes': '24929'}, {'name': 'Vim script', 'bytes': '90842'}]}"}}},{"rowIdx":849795,"cells":{"text":{"kind":"string","value":".. aiohttp documentation master file, created by\n sphinx-quickstart on Wed Mar 5 12:35:35 2014.\n You can adapt this file completely to your liking, but it should at least\n contain the root `toctree` directive.\n\naiohttp\n=======\n\nHTTP client/server for :term:`asyncio` (:pep:`3156`).\n\n.. _GitHub: https://github.com/KeepSafe/aiohttp\n.. _Freenode: http://freenode.net\n\n\nFeatures\n--------\n\n- Supports both :ref:`aiohttp-client` and :ref:`HTTP Server `.\n- Supports both :ref:`Server WebSockets ` and\n :ref:`Client WebSockets ` out-of-the-box.\n- Web-server has :ref:`aiohttp-web-middlewares`,\n :ref:`aiohttp-web-signals` and pluggable routing.\n\nLibrary Installation\n--------------------\n\n::\n\n $ pip install aiohttp\n\nYou may want to install *optional* :term:`cchardet` library as faster\nreplacement for :term:`chardet`::\n\n $ pip install cchardet\n\nGetting Started\n---------------\n\nClient example::\n\n import asyncio\n import aiohttp\n\n async def fetch_page(session, url):\n with aiohttp.Timeout(10):\n async with session.get(url) as response:\n assert response.status == 200\n return await response.read()\n\n loop = asyncio.get_event_loop()\n with aiohttp.ClientSession(loop=loop) as session:\n content = loop.run_until_complete(\n fetch_page(session, 'http://python.org'))\n print(content)\n\nServer example::\n\n from aiohttp import web\n\n async def handle(request):\n name = request.match_info.get('name', \"Anonymous\")\n text = \"Hello, \" + name\n return web.Response(body=text.encode('utf-8'))\n\n app = web.Application()\n app.router.add_route('GET', '/{name}', handle)\n\n web.run_app(app)\n\n.. note::\n\n Throughout this documentation, examples utilize the `async/await` syntax\n introduced by :pep:`492` that is only valid for Python 3.5+.\n\n If you are using Python 3.4, please replace ``await`` with\n ``yield from`` and ``async def`` with a ``@coroutine`` decorator.\n For example, this::\n\n async def coro(...):\n ret = await f()\n\n should be replaced by::\n\n @asyncio.coroutine\n def coro(...):\n ret = yield from f()\n\n\nSource code\n-----------\n\nThe project is hosted on GitHub_\n\nPlease feel free to file an issue on the `bug tracker\n`_ if you have found a bug\nor have some suggestion in order to improve the library.\n\nThe library uses `Travis `_ for\nContinuous Integration.\n\n\nDependencies\n------------\n\n- Python Python 3.4.1+\n- *chardet* library\n- *Optional* :term:`cchardet` library as faster replacement for\n :term:`chardet`.\n\n Install it explicitly via::\n\n $ pip install cchardet\n\n\nDiscussion list\n---------------\n\n*aio-libs* google group: https://groups.google.com/forum/#!forum/aio-libs\n\nFeel free to post your questions and ideas here.\n\nContributing\n------------\n\nPlease read the :ref:`instructions for contributors`\nbefore making a Pull Request.\n\n\nAuthors and License\n-------------------\n\nThe ``aiohttp`` package is written mostly by Nikolay Kim and Andrew Svetlov.\n\nIt's *Apache 2* licensed and freely available.\n\nFeel free to improve this package and send a pull request to GitHub_.\n\nContents\n--------\n\n.. toctree::\n\n client\n client_reference\n web\n web_reference\n server\n multidict\n multipart\n api\n logging\n gunicorn\n faq\n new_router\n contributing\n changes\n glossary\n\nIndices and tables\n==================\n\n* :ref:`genindex`\n* :ref:`modindex`\n* :ref:`search`\n\n\n.. disqus::\n"},"meta":{"kind":"string","value":"{'content_hash': 'ec27cce6b36b5d6bed4a4728df978ac9', 'timestamp': '', 'source': 'github', 'line_count': 167, 'max_line_length': 76, 'avg_line_length': 21.802395209580837, 'alnum_prop': 0.6550398242241142, 'repo_name': 'decentfox/aiohttp', 'id': '3117ab2550044523d559d9c759cc6fd0df4bbdd4', 'size': '3641', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/index.rst', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '838'}, {'name': 'CSS', 'bytes': '112'}, {'name': 'HTML', 'bytes': '1060'}, {'name': 'Makefile', 'bytes': '2272'}, {'name': 'PLpgSQL', 'bytes': '765'}, {'name': 'Python', 'bytes': '995177'}, {'name': 'Shell', 'bytes': '550'}]}"}}},{"rowIdx":849796,"cells":{"text":{"kind":"string","value":"var mraa = require('mraa');\n\nfunction Womprat(config){\n if(!this.config) this.config = config;\n\n};\n\nWomprat.prototype.constructor = womprat;\n/* contrains a value to a minimum and maximum range\n * @param {Number} value\n * @param {Number} min\n * @param {Number} max\n * @return {Number}\n */\nWomprat.prototype.constrain = function (value, min, max){\n if(value < min) return min;\n else if (value > max) return max;\n else return value;\n};\n/* maps a value from an old range to a new range\n * @param {Number} x\n * @param {Number} in_min\n * @param {Number} in_max\n * @param {Number} out_min\n * @param {Number} out_max\n * @return {Number}\n */\nWomprat.prototype.map = function (x, in_min, in_max, out_min, out_max){\n return(x-in_min)*(out_max - out_min)/(in_max - in_min)+out_min;\n};\n\nmodule.exports = Womprat;\n"},"meta":{"kind":"string","value":"{'content_hash': 'dee5935dadf0f3eaeb1797f0a0e722ab', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 71, 'avg_line_length': 25.46875, 'alnum_prop': 0.6539877300613497, 'repo_name': 'Foxman13/womprat', 'id': 'ac42f1303778fa3d2500bd72ba797fb8bc697915', 'size': '815', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'js/index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '947'}]}"}}},{"rowIdx":849797,"cells":{"text":{"kind":"string","value":"(function() {\n 'use strict';\n\n var root = this;\n\n root.define([\n 'views/edit/contact',\n 'models/contact'\n ],\n function( EditContact, Contact ) {\n describe('EditContact Itemview', function () {\n\n it('should be an instance of EditContact Itemview', function () {\n var contact = new Contact({\n firstName: 'Foo',\n lastName: 'Bar',\n phoneNumber: '0000000000'\n });\n var editContact = new EditContact({\n model: contact\n });\n expect( editContact ).to.be.an.instanceOf( EditContact );\n });\n });\n });\n\n}).call( this );\n"},"meta":{"kind":"string","value":"{'content_hash': 'b1ffeeee9d0edf70edb0aad56c7ed211', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 81, 'avg_line_length': 29.62962962962963, 'alnum_prop': 0.41625, 'repo_name': 'shaine/marionette-gentle-introduction-requirejs', 'id': '3a5e4e557fff20804e438aefef1e38654e4a5870', 'size': '800', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/spec/views/edit/contact.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '181878'}, {'name': 'JavaScript', 'bytes': '63052'}]}"}}},{"rowIdx":849798,"cells":{"text":{"kind":"string","value":"using System;\r\nusing System.Linq;\r\n\r\nusing Microsoft.VisualStudio.Language.StandardClassification;\r\n\r\nnamespace ILSupport\r\n{\r\n public static partial class ILParser\r\n {\r\n private class Span\r\n {\r\n public Span ( string @class, string start, string end, string escape = null )\r\n {\r\n Class = @class;\r\n Start = start;\r\n End = end;\r\n Escape = escape;\r\n }\r\n\r\n public readonly string Class;\r\n public readonly string Start;\r\n public readonly string End;\r\n public readonly string Escape;\r\n }\r\n\r\n private static Span IdentifySpan ( string text, int position )\r\n {\r\n var part = text.Substring ( position, Math.Min ( spanStartMaxLength, text.Length - position ) );\r\n foreach ( var span in spans )\r\n if ( part.StartsWith ( span.Start ) )\r\n return span;\r\n\r\n return null;\r\n }\r\n\r\n private static readonly Span [ ] spans = { new Span ( PredefinedClassificationTypeNames.Comment, \"/*\", \"*/\", null ),\r\n new Span ( PredefinedClassificationTypeNames.Comment, \"//\", \"\\n\", null ),\r\n new Span ( PredefinedClassificationTypeNames.String, \"@\\\"\", \"\\\"\", \"\\\"\\\"\" ),\r\n new Span ( PredefinedClassificationTypeNames.String, \"\\\"\", \"\\\"\", \"\\\\\\\"\" ),\r\n new Span ( PredefinedClassificationTypeNames.Character, \"'\", \"'\", \"\\\\\\'\" ) };\r\n\r\n private static readonly int spanStartMaxLength = spans.Max ( s => s.Start.Length );\r\n }\r\n}"},"meta":{"kind":"string","value":"{'content_hash': '0261a301cd077685a561dacb9d79d96d', 'timestamp': '', 'source': 'github', 'line_count': 44, 'max_line_length': 131, 'avg_line_length': 40.43181818181818, 'alnum_prop': 0.4867903316469927, 'repo_name': 'ins0mniaque/ILSupport', 'id': 'a9ccc0edcb3c15d2def5443d56d8238348fbead3', 'size': '1779', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'IL Support/Parser/Parser.span.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '47122'}, {'name': 'F#', 'bytes': '1132'}, {'name': 'Visual Basic .NET', 'bytes': '16886'}]}"}}},{"rowIdx":849799,"cells":{"text":{"kind":"string","value":"namespace CefSharp\n{\n /// \n /// The manner in which a link click should be opened.\n /// \n public enum WindowOpenDisposition\n {\n /// \n /// An enum constant representing the unknown option.\n /// \n Unknown,\n /// \n /// An enum constant representing the current tab option.\n /// \n CurrentTab,\n /// \n /// Indicates that only one tab with the url should exist in the same window\n /// \n SingletonTab,\n /// \n /// An enum constant representing the new foreground tab option.\n /// \n NewForegroundTab,\n /// \n /// An enum constant representing the new background tab option.\n /// \n NewBackgroundTab,\n /// \n /// An enum constant representing the new popup option.\n /// \n NewPopup,\n /// \n /// An enum constant representing the new window option.\n /// \n NewWindow,\n /// \n /// An enum constant representing the save to disk option.\n /// \n SaveToDisk,\n /// \n /// An enum constant representing the off the record option.\n /// \n OffTheRecord,\n /// \n /// An enum constant representing the ignore action option.\n /// \n IgnoreAction\n }\n}\n"},"meta":{"kind":"string","value":"{'content_hash': '61dbebd8c86f0b05e34583980201e383', 'timestamp': '', 'source': 'github', 'line_count': 49, 'max_line_length': 84, 'avg_line_length': 31.06122448979592, 'alnum_prop': 0.5440210249671484, 'repo_name': 'Livit/CefSharp', 'id': 'c2722845bd36a635ad5939606fa575f56a0c392a', 'size': '1691', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'CefSharp/Enums/WindowOpenDisposition.cs', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '335'}, {'name': 'C#', 'bytes': '919437'}, {'name': 'C++', 'bytes': '468798'}, {'name': 'CSS', 'bytes': '92244'}, {'name': 'HTML', 'bytes': '85258'}, {'name': 'JavaScript', 'bytes': '2653'}, {'name': 'PowerShell', 'bytes': '9677'}]}"}}}],"truncated":false,"partial":true},"paginationData":{"pageIndex":8497,"numItemsPerPage":100,"numTotalItems":850000,"offset":849700,"length":100}},"jwt":"eyJhbGciOiJFZERTQSJ9.eyJyZWFkIjp0cnVlLCJwZXJtaXNzaW9ucyI6eyJyZXBvLmNvbnRlbnQucmVhZCI6dHJ1ZX0sImlhdCI6MTc1NjIyNjgxNSwic3ViIjoiL2RhdGFzZXRzL3RvZ2V0aGVyY29tcHV0ZXIvUmVkUGFqYW1hLURhdGEtMVQtU2FtcGxlIiwiZXhwIjoxNzU2MjMwNDE1LCJpc3MiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvIn0.PiFazbiYevCn3I8sTiQzKaXFLYpeR_5oVsQbUInvYzT5ssZeoGRuYEeuCqbiRZafMuhOuJF7zxbImONdPkyrDA","displayUrls":true},"discussionsStats":{"closed":2,"open":4,"total":6},"fullWidth":true,"hasGatedAccess":true,"hasFullAccess":true,"isEmbedded":false,"savedQueries":{"community":[],"user":[]}}">
text
stringlengths
4
5.48M
meta
stringlengths
14
6.54k
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' inventory: yaml version_added: "2.4" short_description: Uses a specifically YAML file as inventory source. description: - "YAML based inventory, starts with the 'all' group and has hosts/vars/children entries." - Host entries can have sub-entries defined, which will be treated as variables. - Vars entries are normal group vars. - "Children are 'child groups', which can also have their own vars/hosts/children and so on." - File MUST have a valid extension, defined in configuration notes: - It takes the place of the previously hardcoded YAML inventory. - To function it requires being whitelisted in configuration. options: yaml_extensions: description: list of 'valid' extensions for files containing YAML type: list default: ['.yaml', '.yml', '.json'] ''' EXAMPLES = ''' all: # keys must be unique, i.e. only one 'hosts' per group hosts: test1: test2: var1: value1 vars: group_var1: value2 children: # key order does not matter, indentation does other_group: children: group_x: hosts: test5 vars: g2_var2: value3 hosts: test4: ansible_host: 127.0.0.1 last_group: hosts: test1 # same host as above, additional group membership vars: last_var: MYVALUE ''' import os from collections import MutableMapping from ansible import constants as C from ansible.errors import AnsibleParserError from ansible.module_utils.six import string_types from ansible.module_utils._text import to_native from ansible.parsing.utils.addresses import parse_address from ansible.plugins.inventory import BaseFileInventoryPlugin, detect_range, expand_hostname_range class InventoryModule(BaseFileInventoryPlugin): NAME = 'yaml' def __init__(self): super(InventoryModule, self).__init__() def verify_file(self, path): valid = False if super(InventoryModule, self).verify_file(path): file_name, ext = os.path.splitext(path) if not ext or ext in C.YAML_FILENAME_EXTENSIONS: valid = True return valid def parse(self, inventory, loader, path, cache=True): ''' parses the inventory file ''' super(InventoryModule, self).parse(inventory, loader, path) try: data = self.loader.load_from_file(path) except Exception as e: raise AnsibleParserError(e) if not data: raise AnsibleParserError('Parsed empty YAML file') elif not isinstance(data, MutableMapping): raise AnsibleParserError('YAML inventory has invalid structure, it should be a dictionary, got: %s' % type(data)) elif data.get('plugin'): raise AnsibleParserError('Plugin configuration YAML file, not YAML inventory') # We expect top level keys to correspond to groups, iterate over them # to get host, vars and subgroups (which we iterate over recursivelly) if isinstance(data, MutableMapping): for group_name in data: self._parse_group(group_name, data[group_name]) else: raise AnsibleParserError("Invalid data from file, expected dictionary and got:\n\n%s" % to_native(data)) def _parse_group(self, group, group_data): self.inventory.add_group(group) if isinstance(group_data, MutableMapping): # make sure they are dicts for section in ['vars', 'children', 'hosts']: if section in group_data: # convert strings to dicts as these are allowed if isinstance(group_data[section], string_types): group_data[section] = {group_data[section]: None} if not isinstance(group_data[section], MutableMapping): raise AnsibleParserError('Invalid %s entry for %s group, requires a dictionary, found %s instead.' % (section, group, type(group_data[section]))) if group_data.get('vars', False): for var in group_data['vars']: self.inventory.set_variable(group, var, group_data['vars'][var]) if group_data.get('children', False): for subgroup in group_data['children']: self._parse_group(subgroup, group_data['children'][subgroup]) self.inventory.add_child(group, subgroup) if group_data.get('hosts', False): for host_pattern in group_data['hosts']: hosts, port = self._parse_host(host_pattern) self.populate_host_vars(hosts, group_data['hosts'][host_pattern] or {}, group, port) def _parse_host(self, host_pattern): ''' Each host key can be a pattern, try to process it and add variables as needed ''' (hostnames, port) = self._expand_hostpattern(host_pattern) return hostnames, port def _expand_hostpattern(self, hostpattern): ''' Takes a single host pattern and returns a list of hostnames and an optional port number that applies to all of them. ''' # Can the given hostpattern be parsed as a host with an optional port # specification? try: (pattern, port) = parse_address(hostpattern, allow_ranges=True) except: # not a recognizable host pattern pattern = hostpattern port = None # Once we have separated the pattern, we expand it into list of one or # more hostnames, depending on whether it contains any [x:y] ranges. if detect_range(pattern): hostnames = expand_hostname_range(pattern) else: hostnames = [pattern] return (hostnames, port)
{'content_hash': 'a57de84a0063c5b7480b1c315205fd2e', 'timestamp': '', 'source': 'github', 'line_count': 163, 'max_line_length': 125, 'avg_line_length': 37.987730061349694, 'alnum_prop': 0.6007751937984496, 'repo_name': 'e-gob/plataforma-kioscos-autoatencion', 'id': 'f991a973478919257f49e0854c00f028c6f00a67', 'size': '6323', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/inventory/yaml.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '41110'}, {'name': 'C++', 'bytes': '3804'}, {'name': 'CSS', 'bytes': '34823'}, {'name': 'CoffeeScript', 'bytes': '8521'}, {'name': 'HTML', 'bytes': '61168'}, {'name': 'JavaScript', 'bytes': '7206'}, {'name': 'Makefile', 'bytes': '1347'}, {'name': 'PowerShell', 'bytes': '584344'}, {'name': 'Python', 'bytes': '25506593'}, {'name': 'Ruby', 'bytes': '245726'}, {'name': 'Shell', 'bytes': '5075'}]}
/** * Created by King Lee on 15-3-26. */ var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res) { res.render('announcement_240_000020', { title: 'Express' }); }); module.exports = router;
{'content_hash': '40b9ebafed66151f58cc2563730c3100', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 64, 'avg_line_length': 22.833333333333332, 'alnum_prop': 0.5985401459854015, 'repo_name': 'HelloKevinTian/notice_server', 'id': '44943a1796d6245f607493612e0e83b8719c700b', 'size': '274', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'routes/announcement_240_000020.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '251816'}, {'name': 'HTML', 'bytes': '711288'}, {'name': 'JavaScript', 'bytes': '103222'}]}
/* -*- mode: c++; indent-tabs-mode: nil -*- */ /* ------------------------------------------------------------------------- ATS License: see $ATS_DIR/COPYRIGHT Author: Ethan Coon Standard base for most diffusion-dominated PKs, this combines both domains/meshes of PKPhysicalBase and Explicit methods of PKExplicitBase. ------------------------------------------------------------------------- */ #ifndef AMANZI_PK_PHYSICAL_EXPLICIT_DEFAULT_HH_ #define AMANZI_PK_PHYSICAL_EXPLICIT_DEFAULT_HH_ #include "errors.hh" #include "PK.hh" #include "pk_explicit_default.hh" #include "pk_physical_default.hh" namespace Amanzi { class PK_Physical_Explicit_Default : public PK_Explicit_Default, public PK_Physical_Default { public: PK_Physical_Explicit_Default(Teuchos::ParameterList& pk_tree, const Teuchos::RCP<Teuchos::ParameterList>& glist, const Teuchos::RCP<State>& S, const Teuchos::RCP<TreeVector>& solution) : PK(pk_tree, glist, S, solution), PK_Explicit_Default(pk_tree, glist, S, solution), PK_Physical_Default(pk_tree, glist, S, solution) {} virtual void Setup() override { PK_Physical_Default::Setup(); PK_Explicit_Default::Setup(); } // initialize. Note both ExplicitBase and PhysicalBase have initialize() // methods, so we need a unique overrider. virtual void Initialize() override { PK_Physical_Default::Initialize(); PK_Explicit_Default::Initialize(); } // -- Advance from state S0 to state S1 at time S0.time + dt. virtual bool AdvanceStep(double t_old, double t_new, bool reinit) override { PK_Explicit_Default::AdvanceStep(t_old, t_new, reinit); ChangedSolutionPK(tag_next_); return false; } virtual void FailStep(double t_old, double t_new, const Tag& tag) override { PK_Physical_Default::FailStep(t_old, t_new, tag); } }; } #endif
{'content_hash': '23e74ff0e68825933fa1e20004f5ca86', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 93, 'avg_line_length': 30.806451612903224, 'alnum_prop': 0.6261780104712041, 'repo_name': 'amanzi/ats-dev', 'id': '6c9a39cd026d1d152abfdf20334add1b7706a602', 'size': '1910', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/pks/pk_physical_explicit_default.hh', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '3360'}, {'name': 'C++', 'bytes': '2842879'}, {'name': 'CMake', 'bytes': '97837'}, {'name': 'Fortran', 'bytes': '8905'}, {'name': 'Python', 'bytes': '6272'}]}
import abc from typing import Dict, Generic, List, Union from backend.common.consts.api_version import ApiMajorVersion from backend.common.helpers.listify import delistify, listify from backend.common.profiler import Span from backend.common.queries.types import DictQueryReturn, QueryReturn class ConverterBase(abc.ABC, Generic[QueryReturn, DictQueryReturn]): # Used to version cached outputs SUBVERSIONS: Dict[ApiMajorVersion, int] _query_return: QueryReturn def __init__(self, query_return: QueryReturn): self._query_return = query_return def convert( self, version: ApiMajorVersion ) -> Union[None, DictQueryReturn, List[DictQueryReturn]]: with Span("{}.convert".format(self.__class__.__name__)): if self._query_return is None: return None converted_query_return = self._convert_list( listify(self._query_return), version ) if isinstance(self._query_return, list): return converted_query_return else: return delistify(converted_query_return) @classmethod @abc.abstractmethod def _convert_list( cls, model_list: List, version: ApiMajorVersion ) -> List[DictQueryReturn]: return [{} for model in model_list] @classmethod def constructLocation_v3(cls, model) -> Dict: """ Works for teams and events """ has_nl = ( model.nl and model.nl.city and model.nl.state_prov_short and model.nl.country_short_if_usa ) return { "city": model.nl.city if has_nl else model.city, "state_prov": model.nl.state_prov_short if has_nl else model.state_prov, "country": model.nl.country_short_if_usa if has_nl else model.country, "postal_code": model.nl.postal_code if has_nl else model.postalcode, "lat": model.nl.lat_lng.lat if has_nl else None, "lng": model.nl.lat_lng.lon if has_nl else None, "location_name": model.nl.name if has_nl else None, "address": model.nl.formatted_address if has_nl else None, "gmaps_place_id": model.nl.place_id if has_nl else None, "gmaps_url": model.nl.place_details.get("url") if has_nl else None, }
{'content_hash': 'b4dd0bb7e395d5a571ba7661aca57239', 'timestamp': '', 'source': 'github', 'line_count': 63, 'max_line_length': 84, 'avg_line_length': 37.46031746031746, 'alnum_prop': 0.6194915254237288, 'repo_name': 'the-blue-alliance/the-blue-alliance', 'id': 'bac7f5ea73694d4fbdc66df92af13c582b17f1b8', 'size': '2360', 'binary': False, 'copies': '1', 'ref': 'refs/heads/py3', 'path': 'src/backend/common/queries/dict_converters/converter_base.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '359032'}, {'name': 'Dockerfile', 'bytes': '2503'}, {'name': 'HTML', 'bytes': '5877313'}, {'name': 'JavaScript', 'bytes': '755910'}, {'name': 'Less', 'bytes': '244218'}, {'name': 'PHP', 'bytes': '10727'}, {'name': 'Pug', 'bytes': '1857'}, {'name': 'Python', 'bytes': '4321885'}, {'name': 'Ruby', 'bytes': '4677'}, {'name': 'Shell', 'bytes': '27698'}]}
The repo maintains my course projects/assignments of Computer Networks course delivered by SDU in spring, 2017. ## Assignment 1 See [here](assignment-1/README.md). ## Assignment 2 See [here](assignment-2/README.md). ## Co-authors Zhang Yinan and [Zhao Yue](https://github.com/z-jack). ## License [MIT](LICENSE)
{'content_hash': '1233dc53943030a5fc59f71ed779a38e', 'timestamp': '', 'source': 'github', 'line_count': 17, 'max_line_length': 111, 'avg_line_length': 18.764705882352942, 'alnum_prop': 0.7272727272727273, 'repo_name': 'chengluyu/SDU-Computer-Networks', 'id': 'f0c2a6848ef2c1da7281dc7526e8e77df3490fac', 'size': '340', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Python', 'bytes': '17952'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>gappa: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.15.0 / gappa - 1.4.4</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> gappa <small> 1.4.4 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-10-01 08:46:06 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-10-01 08:46:06 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base conf-findutils 1 Virtual package relying on findutils conf-gmp 4 Virtual package relying on a GMP lib system installation coq 8.15.0 Formal proof management system dune 3.4.1 Fast, portable, and opinionated build system ocaml 4.06.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.06.1 Official 4.06.1 release ocaml-config 1 OCaml Switch Configuration ocaml-secondary-compiler 4.08.1-1 OCaml 4.08.1 Secondary Switch Compiler ocamlfind 1.9.1 A library manager for OCaml ocamlfind-secondary 1.9.1 Adds support for ocaml-secondary-compiler to ocamlfind zarith 1.12 Implements arithmetic and logical operations over arbitrary-precision integers # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://gappa.gitlabpages.inria.fr/&quot; dev-repo: &quot;git+https://gitlab.inria.fr/gappa/coq.git&quot; bug-reports: &quot;https://gitlab.inria.fr/gappa/coq/issues&quot; license: &quot;LGPL-3.0-or-later&quot; patches: [ &quot;remake.patch&quot; ] build: [ [&quot;autoconf&quot;] {dev} [&quot;./configure&quot;] [&quot;./remake&quot; &quot;-j%{jobs}%&quot;] ] install: [&quot;./remake&quot; &quot;install&quot;] depends: [ &quot;ocaml&quot; &quot;coq&quot; {&gt;= &quot;8.8.1&quot; &amp; &lt; &quot;8.13~&quot;} &quot;coq-flocq&quot; {&gt;= &quot;3.0&quot; &amp; &lt; &quot;4~&quot;} &quot;conf-autoconf&quot; {build &amp; dev} (&quot;conf-g++&quot; {build} | &quot;conf-clang&quot; {build}) ] tags: [ &quot;keyword:floating-point arithmetic&quot; &quot;keyword:interval arithmetic&quot; &quot;keyword:decision procedure&quot; &quot;category:Computer Science/Decision Procedures and Certified Algorithms/Decision procedures&quot; &quot;logpath:Gappa&quot; &quot;date:2020-06-13&quot; ] authors: [ &quot;Guillaume Melquiond &lt;[email protected]&gt;&quot; ] synopsis: &quot;A Coq tactic for discharging goals about floating-point arithmetic and round-off errors using the Gappa prover&quot; url { src: &quot;https://gappa.gitlabpages.inria.fr/releases/gappalib-coq-1.4.4.tar.gz&quot; checksum: &quot;sha512=910cb7d8f084fc93a8e59c2792093f252f1c8e9f7b63aa408c03de41dced1ff64b4cf2c9ee9610729f7885bdf42dd68c85a9a844c63781ba9fe8cfdfc5192665&quot; } </pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-gappa.1.4.4 coq.8.15.0</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.15.0). The following dependencies couldn&#39;t be met: - coq-gappa -&gt; coq &lt; 8.13~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-gappa.1.4.4</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{'content_hash': '9d19ef07cede800f4136339bbbf4ac9c', 'timestamp': '', 'source': 'github', 'line_count': 180, 'max_line_length': 159, 'avg_line_length': 42.19444444444444, 'alnum_prop': 0.5526003949967083, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': '0bd65c7ab53c8d08a01c5fdb9c461c1801589ce5', 'size': '7620', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.06.1-2.0.5/released/8.15.0/gappa/1.4.4.html', 'mode': '33188', 'license': 'mit', 'language': []}
using System; using System.Collections.Generic; using System.Text; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI; using System.Web; using System.Data; using System.IO; using Zenntrix_Silverlight_Toolkit; [assembly: TagPrefix("Zenntrix", "Zenntrix")] namespace Zenntrix_Toolkit { /// <summary> /// To Do: /// /// 1. Create Context menu with the items as shown below /// 1. Download /// 2. New Foler /// 3. Upload Document /// 4. Rename /// 5. Move /// 6. Delete /// 2. Create file uploader control /// 3. Reduce Viewstate usage /// </summary> [ToolboxData("<{0}:Zenntrix_Directory_View ID=\"ZDV_{0}\" runat=\"server\" ShowFoldersInViewer=\"true\"></{0}:Zenntrix_Directory_View>")] public class Zenntrix_Directory_Viewer : System.Web.UI.Control { public event FileSelectedEventHandler FileSelected; public event FolderSelectedEventHandler FolderSelected; #region /* Controls */ HtmlGenericControl DivDirectoryContainer = new HtmlGenericControl(); Panel PanelFolderStructureContainer = new Panel(); HtmlGenericControl DivFolderStructureContainerContainer = new HtmlGenericControl(); HtmlGenericControl DivClear = new HtmlGenericControl(); TreeView TreeViewFolderView = new TreeView(); Panel PanelFileContainer = new Panel(); Repeater RepeaterFiles = new Repeater(); Zenntrix_File_Uploader FileUploader = new Zenntrix_File_Uploader(); HtmlGenericControl DivContextMenuTitle = new HtmlGenericControl(); Button ContextButtonUploadFiles = new Button(); Button ContextButtonNewFolder = new Button(); Panel PanelContextMenu = new Panel(); Zenntrix_ContextMenu_Extender ZCE_ContextMenu = new Zenntrix_ContextMenu_Extender(); #endregion #region /* Variables */ private Files FilesMapping { get { Files FilesSaved = new Files(); FilesSaved.DataSource = ((DataSet)ViewState["DsFiles"]).Tables[0]; FilesSaved.Name = ViewState["DsFilesName"].ToString(); FilesSaved.Size = ViewState["DsFilesSize"].ToString(); FilesSaved.DateCreated = ViewState["DsFilesDateCreated"].ToString(); FilesSaved.DateModified = ViewState["DsFilesDateModified"].ToString(); FilesSaved.StructureId = ViewState["DsFilesStructureID"].ToString(); return FilesSaved; } set { Files FilesSaved = new Files(); FilesSaved = value; DataSet DsFiles = new DataSet(); DsFiles.Tables.Add(FilesSaved.DataSource); ViewState["DsFiles"] = DsFiles; ViewState["DsFilesName"] = FilesSaved.Name; ViewState["DsFilesSize"] = FilesSaved.Size; ViewState["DsFilesDateCreated"] = FilesSaved.DateCreated; ViewState["DsFilesDateModified"] = FilesSaved.DateModified; ViewState["DsFilesStructureID"] = FilesSaved.StructureId; } } private Directories DirectoriesMapping { get { Directories DirectoriesSaved = new Directories(); DirectoriesSaved.DataSource = ((DataSet)ViewState["DsDirs"]).Tables[0]; DirectoriesSaved.Name = ViewState["DsDirsName"].ToString(); DirectoriesSaved.StructureId = ViewState["DsDirsStructureId"].ToString(); DirectoriesSaved.ParentStructureId = ViewState["DsDirsParentStructureId"].ToString(); DirectoriesSaved.Path = ViewState["DsDirsPath"].ToString(); return DirectoriesSaved; } set { Directories DirectoriesSaved = new Directories(); DirectoriesSaved = value; DataSet DsDirs = new DataSet(); DsDirs.Tables.Add(DirectoriesSaved.DataSource); ViewState["DsDirs"] = DsDirs; ViewState["DsDirsName"] = DirectoriesSaved.Name; ViewState["DsDirsStructureId"] = DirectoriesSaved.StructureId; ViewState["DsDirsParentStructureId"] = DirectoriesSaved.ParentStructureId; ViewState["DsDirsPath"] = DirectoriesSaved.Path; } } private string currentPath { get { if (ViewState["_currentPath"] != null) { return ViewState["_currentPath"].ToString(); } else { return rootPath; } } set { ViewState["_currentPath"] = value; } } private string rootPath { get { if (ViewState["_rootPath"] != null) { return ViewState["_rootPath"].ToString(); } else { return ""; } } set { ViewState["_rootPath"] = value; } } private string SortDirection { get { if (ViewState["_SortDirection"] != null) { return ViewState["_SortDirection"].ToString(); } else { return "ASC"; } } set { ViewState["_SortDirection"] = value; } } private string SortOrder { get { if (ViewState["_SortOrder"] != null) { return ViewState["_SortOrder"].ToString(); } else { return "LinkButtonSortName"; } } set { ViewState["_SortOrder"] = value; } } private string CurrentFolderId { get { if (ViewState["_CurrentFolderId"] != null) { return ViewState["_CurrentFolderId"].ToString(); } else { return ""; } } set { ViewState["_CurrentFolderId"] = value; } } public string Width { get { if (ViewState["_Width"] != null) { return ViewState["_Width"].ToString(); } else { return Unit.Pixel(900).ToString() + "px"; } } set { if (Unit.Parse(value).Type == UnitType.Pixel) { if (int.Parse(value.ToLower().Replace("px", "")) < 600) { ViewState["_Width"] = "600px"; } else { ViewState["_Width"] = value; } } else { ViewState["_Width"] = value; } } } public Unit Height { get { if (ViewState["_height"] != null) { return ((Unit)ViewState["_height"]); } else { return Unit.Pixel(440); } } set { ViewState["_height"] = value; } } public bool ShowFoldersInViewer { get { if (ViewState["_ShowFoldersInView"] != null) { return ((bool)ViewState["_ShowFoldersInView"]); } else { return false; } } set { ViewState["_ShowFoldersInView"] = value; } } #endregion protected void Format_Controls() { FileUploader.ID = "ZFU_FileUpload"; FileUploader.UploadCompleted += new UploadCompletedHandler(FileUploader_Completed); FileUploader.Title = "Zenntrix File Uploader"; FileUploader.FileTypes = "*"; FileUploader.UploadFileSizeLimit = 0; FileUploader.TotalUploadSizeLimit = 0; FileUploader.FileSaveDirectory = currentPath; DivDirectoryContainer.TagName = "div"; DivDirectoryContainer.Style["width"] = Width; DivDirectoryContainer.Attributes.Add("class", "ZDV_DirectoryContainer"); PanelFolderStructureContainer.Style.Value = "height:" + Height.Value + "px;"; PanelFolderStructureContainer.ID = "PanelFolderStructureContainer"; PanelFolderStructureContainer.CssClass = "ZDV_FolderStructureContainer"; DivFolderStructureContainerContainer.TagName = "div"; DivFolderStructureContainerContainer.Attributes.Add("class", "ZDV_Left ZDV_FolderStructureContainerWidth"); DivFolderStructureContainerContainer.ID = "DivFolderStructureContainerContainer"; DivFolderStructureContainerContainer.Attributes.Add("oncontextmenu", "return false;"); TreeViewFolderView.ID = "TreeViewFolderView"; TreeViewFolderView.SelectedNodeStyle.CssClass = "Zenntrix_AdminTreeView_Selected"; TreeViewFolderView.SelectedNodeChanged += new EventHandler(TreeViewFolderView_SelectedNodeChanged); PanelFileContainer.ID = "PanelFileContainer"; PanelFileContainer.CssClass = "ZDV_Left ZDV_FileContainerWidth"; PanelFileContainer.Attributes.Add("oncontextmenu", "return false;"); RepeaterFiles.ID = "RepeaterFiles"; Repeater_Files_ITemplate FilesITemplate = new Repeater_Files_ITemplate(); FilesITemplate.FolderSelected += new FolderSelectedEventHandler(OnFolderSelected); FilesITemplate.FileSelected += new FileSelectedEventHandler(OnFileSelected); FilesITemplate.FileMap(FilesMapping); RepeaterFiles.ItemTemplate = FilesITemplate; Repeater_Files_HeaderITemplate FilesHeaderITemplate = new Repeater_Files_HeaderITemplate(); FilesHeaderITemplate.ColumnSorted += new EventHandler(OnColumnSorted); FilesHeaderITemplate.Set_SortOrder(SortOrder, SortDirection); RepeaterFiles.HeaderTemplate = FilesHeaderITemplate; RepeaterFiles.FooterTemplate = new Repeater_Files_FooterITemplate(); DivClear.TagName = "div"; DivClear.Attributes.Add("class", "ZDV_Clear"); } protected void FileUploader_Completed(object sender, EventArgs e) { } protected void OnColumnSorted(object sender, EventArgs e) { if (SortDirection == "ASC" && SortOrder == ((LinkButton)sender).ID) SortDirection = "DESC"; else SortDirection = "ASC"; SortOrder = ((LinkButton)sender).ID; Format_Controls(); Load_Files(CurrentFolderId); } protected void Add_Controls() { Literal LiteralCssLink = new Literal(); LiteralCssLink.Text = "<link href=\"" + this.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), "Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.main.css") + "\" type=\"text/css\" media=\"all\" rel=\"Stylesheet\"/>"; this.Page.Header.Controls.Add(LiteralCssLink); PanelFolderStructureContainer.Controls.Add(TreeViewFolderView); PanelFileContainer.Controls.Add(RepeaterFiles); DivFolderStructureContainerContainer.Controls.Add(PanelFolderStructureContainer); DivDirectoryContainer.Controls.Add(DivFolderStructureContainerContainer); DivDirectoryContainer.Controls.Add(PanelFileContainer); DivDirectoryContainer.Controls.Add(DivClear); Controls.Add(DivDirectoryContainer); Controls.Add(FileUploader); } protected void CreateContextMenu() { #region /* Context Menu Formatting */ DivContextMenuTitle.TagName = "div"; DivContextMenuTitle.Attributes.Add("class", "ZDV_ContextMenu_Header"); DivContextMenuTitle.InnerText = "Actions"; ZCE_ContextMenu.ID = "ZCE_ContextMenu"; ZCE_ContextMenu.ContextMenu = "PanelContextMenu"; ZCE_ContextMenu.TargetControl = "PanelFileContainer"; ZCE_ContextMenu.ContextMenuShown += new Zenntrix_ContextMenu_Extender.ContextMenuShownEventHandler(ZCE_ContextMenu_ContextMenuShown); ContextButtonUploadFiles.ID = "ContextButtonUploadFiles"; ContextButtonUploadFiles.Text = "Upload file"; ContextButtonUploadFiles.CssClass = "ZDV_ContextMenu_Full"; ContextButtonUploadFiles.Click += new EventHandler(ContextButtonUploadFiles_Click); ContextButtonNewFolder.ID = "ContextButtonNewFolder"; ContextButtonNewFolder.Text = "New folder"; ContextButtonNewFolder.CssClass = "ZDV_ContextMenu_Full"; ContextButtonNewFolder.Click += new EventHandler(ContextButtonNewFolder_Click); PanelContextMenu.ID = "PanelContextMenu"; PanelContextMenu.CssClass = "ZDV_ContextMenu_Container"; #endregion PanelContextMenu.Controls.Add(DivContextMenuTitle); PanelContextMenu.Controls.Add(ContextButtonUploadFiles); PanelContextMenu.Controls.Add(ContextButtonNewFolder); Controls.Add(PanelContextMenu); Controls.Add(ZCE_ContextMenu); } protected override void OnInit(EventArgs e) { CreateContextMenu(); base.OnInit(e); } protected override void OnLoad(EventArgs e) { Format_Controls(); Add_Controls(); base.OnLoad(e); } protected override void Render(HtmlTextWriter writer) { this.Page.ClientScript.RegisterForEventValidation(ContextButtonUploadFiles.UniqueID); base.Render(writer); } protected void ZCE_ContextMenu_ContextMenuShown(object sender, EventArgs e) { } protected void ContextButtonUploadFiles_Click(object sender, EventArgs e) { Upload(); } protected void ContextButtonNewFolder_Click(object sender, EventArgs e) { //Show popup for new folder name entry } protected void Upload() { FileUploader.FileSaveDirectory = currentPath; FileUploader.Show(); } public void Load_Structure(Directories Directories, Files Files, string RootPath) { if (RootPath.EndsWith("//") == false) { rootPath = RootPath + "//"; } else { rootPath = RootPath; } rootPath = RootPath; FilesMapping = Files; DataTable DataTableFiles = FilesMapping.DataSource; if (Files.DataSource.Columns["Zenntrix_Directory_Viewer_File_Type"] == null) { DataTableFiles.Columns.Add("Zenntrix_Directory_Viewer_File_Type"); } FilesMapping.DataSource = DataTableFiles; Format_Controls(); Add_Controls(); Load_Directories(Directories); Load_Files("0"); } public void Load_Structure(string FullPath) { Directories GetDirectories = new Directories(); GetDirectories.DataSource = Scan_Directory(FullPath); GetDirectories.Name = "Name"; GetDirectories.ParentStructureId = "Parent"; GetDirectories.StructureId = "Location"; GetDirectories.Path = "Location"; Files GetFiles = new Files(); GetFiles.DataSource = Scan_Directory_For_Files(FullPath); GetFiles.Name = "Name"; GetFiles.Size = "Size"; GetFiles.StructureId = "Location"; GetFiles.DateCreated = "CreatedDate"; GetFiles.DateModified = "ModifiedDate"; Load_Structure(GetDirectories, GetFiles, rootPath); } public DataTable Scan_Directory(string FileDirectory) { DataTable DataTableNewDirectory = new DataTable(); DataTableNewDirectory.Columns.Add("Location"); DataTableNewDirectory.Columns.Add("Parent"); DataTableNewDirectory.Columns.Add("Name"); DataTableNewDirectory.Columns.Add("Status"); DirectoryInfo DirectoryToScan = new DirectoryInfo(FileDirectory); foreach (DirectoryInfo D in DirectoryToScan.GetDirectories()) { DataRow NewDataRow = DataTableNewDirectory.NewRow(); NewDataRow["Name"] = D.Name; NewDataRow["Parent"] = D.Parent.FullName.Replace(FileDirectory, ""); NewDataRow["Location"] = D.FullName.Replace(FileDirectory, ""); DataTableNewDirectory.Rows.Add(NewDataRow); Get_Children_Directories(DataTableNewDirectory, D, FileDirectory); } return DataTableNewDirectory; } protected void Get_Children_Directories(DataTable DataTableToLoadInto, DirectoryInfo DirectoryToScan, string RootFileDirectory) { foreach (DirectoryInfo D in DirectoryToScan.GetDirectories()) { DataRow NewDataRow = DataTableToLoadInto.NewRow(); NewDataRow["Name"] = D.Name; NewDataRow["Parent"] = D.Parent.FullName.Replace(RootFileDirectory, ""); NewDataRow["Location"] = D.FullName.Replace(RootFileDirectory, ""); DataTableToLoadInto.Rows.Add(NewDataRow); Get_Children_Directories(DataTableToLoadInto, D, RootFileDirectory); } } #region /* Directories */ protected void Load_Directories(Directories Directories) { DataTable DirectoryStructure = Directories.DataSource; TreeViewFolderView.Nodes.Clear(); DirectoryStructure.PrimaryKey = new DataColumn[] { DirectoryStructure.Columns[Directories.StructureId] }; Directories.DataSource = DirectoryStructure; DirectoriesMapping = Directories; TreeNode TNRoot = new TreeNode(); TNRoot.Text = "..root"; TNRoot.Value = "0"; TNRoot.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), "Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Folder.png"); TNRoot.Selected = true; TNRoot.Expanded = true; TNRoot.SelectAction = TreeNodeSelectAction.SelectExpand; foreach (DataRow R in DirectoriesMapping.DataSource.Rows) { if (R[Directories.ParentStructureId].ToString() == "0" || R[Directories.ParentStructureId].ToString() == "") { TreeNode TNNodes = new TreeNode(); TNNodes.Text = R[Directories.Name].ToString(); TNNodes.Value = R[Directories.StructureId].ToString(); TNNodes.Expanded = false; TNNodes.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), "Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Folder.png"); TNNodes.SelectAction = TreeNodeSelectAction.SelectExpand; Add_Children_Structure(TNNodes, Directories); TNRoot.ChildNodes.Add(TNNodes); } } TreeViewFolderView.Nodes.Add(TNRoot); } protected void Add_Children_Structure(TreeNode Parent, Directories Directories) { DataTable DirectoryStructure = Directories.DataSource; foreach (DataRow R in DirectoryStructure.Rows) { if (R[Directories.ParentStructureId].ToString() == Parent.Value) { TreeNode TNChildNode = new TreeNode(); TNChildNode.Text = R[Directories.Name].ToString(); TNChildNode.Value = R[Directories.StructureId].ToString(); TNChildNode.Expanded = false; TNChildNode.SelectAction = TreeNodeSelectAction.SelectExpand; TNChildNode.ImageUrl = this.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), "Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Folder.png"); Add_Children_Structure(TNChildNode, Directories); Parent.ChildNodes.Add(TNChildNode); } } } public class Directories { private DataTable _Directories; private string _Name; private string _Id; private string _Path; private string _ParentId; /// <summary> /// The datatable holding the directories /// </summary> public DataTable DataSource { get { return _Directories; } set { _Directories = value; } } /// <summary> /// The column name that contains the name to be displayed /// </summary> public string Name { get { return _Name; } set { _Name = value; } } public string Path { get { return _Path; } set { _Path = value; } } /// <summary> /// The Id of the current directory /// </summary> public string StructureId { get { return _Id; } set { _Id = value; } } /// <summary> /// The parent id of the current directory /// </summary> public string ParentStructureId { get { return _ParentId; } set { _ParentId = value; } } } #endregion #region /* Files */ protected void Set_Selected_TreeNode(TreeView TV, string SelectedValue) { foreach (TreeNode TN in TV.Nodes) { if (TN.Value == SelectedValue) { TN.Parent.Expanded = true; TN.Select(); TN.Selected = true; break; } else { Set_Selected_TreeNode(TN, SelectedValue); } } } public void Set_Selected_Directory(string SelectedValue) { foreach (TreeNode TN in TreeViewFolderView.Nodes) { if (TN.Value == SelectedValue) { TN.Parent.Expanded = true; TN.Select(); TN.Selected = true; Load_Files(TN.Value); break; } else { Set_Selected_TreeNode(TN, SelectedValue); } } } protected void Set_Selected_TreeNode(TreeNode TN, string SelectedValue) { foreach (TreeNode CTN in TN.ChildNodes) { if (CTN.Value == SelectedValue) { CTN.Parent.Expanded = true; CTN.Select(); CTN.Selected = true; break; } else { Set_Selected_TreeNode(CTN, SelectedValue); } } } protected void Load_Files(string ID) { DataTable DataTableFilesToOutput = FilesMapping.DataSource.Clone(); DataTableFilesToOutput.Columns[FilesMapping.Size].DataType = typeof(int); #region /* Set Sort */ string stringSort = string.Empty; switch (SortOrder) { case "LinkButtonSortName": stringSort = FilesMapping.Name + " " + SortDirection; break; case "LinkButtonSortSize": stringSort = FilesMapping.Size + " " + SortDirection; break; case "LinkButtonSortCreated": stringSort = FilesMapping.DateCreated + " " + SortDirection; break; case "LinkButtonSortModified": stringSort = FilesMapping.DateModified + " " + SortDirection; break; } #endregion #region /* Load Files */ foreach (DataRow R in FilesMapping.DataSource.Rows) { if (ID == "0") { if (R[FilesMapping.StructureId].ToString() == "") { DataRow NewDataRow = DataTableFilesToOutput.NewRow(); NewDataRow[FilesMapping.StructureId] = R[FilesMapping.StructureId]; NewDataRow[FilesMapping.Name] = R[FilesMapping.Name]; NewDataRow[FilesMapping.Size] = R[FilesMapping.Size]; NewDataRow[FilesMapping.DateModified] = R[FilesMapping.DateModified]; NewDataRow[FilesMapping.DateCreated] = R[FilesMapping.DateCreated]; DataTableFilesToOutput.Rows.Add(NewDataRow); } } if (R[FilesMapping.StructureId].ToString() == ID) { DataRow NewDataRow = DataTableFilesToOutput.NewRow(); NewDataRow[FilesMapping.StructureId] = R[FilesMapping.StructureId]; NewDataRow[FilesMapping.Name] = R[FilesMapping.Name]; NewDataRow[FilesMapping.Size] = R[FilesMapping.Size]; NewDataRow[FilesMapping.DateModified] = R[FilesMapping.DateModified]; NewDataRow[FilesMapping.DateCreated] = R[FilesMapping.DateCreated]; DataTableFilesToOutput.Rows.Add(NewDataRow); } } #endregion #region /* Load Folders */ if (ShowFoldersInViewer) { foreach (DataRow R in DirectoriesMapping.DataSource.Rows) { if (R[DirectoriesMapping.ParentStructureId].ToString() == ID) { DataRow NewDataRow = DataTableFilesToOutput.NewRow(); NewDataRow[FilesMapping.StructureId] = R[DirectoriesMapping.StructureId]; NewDataRow[FilesMapping.Name] = R[DirectoriesMapping.Name]; NewDataRow[FilesMapping.Size] = Get_Folder_Size(R[DirectoriesMapping.StructureId].ToString()); NewDataRow["Zenntrix_Directory_Viewer_File_Type"] = "Folder"; DataTableFilesToOutput.Rows.Add(NewDataRow); } else if (ID == "0" && R[DirectoriesMapping.ParentStructureId].ToString() == "") { DataRow NewDataRow = DataTableFilesToOutput.NewRow(); NewDataRow[FilesMapping.StructureId] = R[DirectoriesMapping.StructureId]; NewDataRow[FilesMapping.Name] = R[DirectoriesMapping.Name]; NewDataRow[FilesMapping.Size] = Get_Folder_Size(R[DirectoriesMapping.StructureId].ToString()); NewDataRow["Zenntrix_Directory_Viewer_File_Type"] = "Folder"; DataTableFilesToOutput.Rows.Add(NewDataRow); } } } #endregion DataTable DataTableSorted = FilesMapping.DataSource.Clone(); foreach (DataRow R in DataTableFilesToOutput.Select("", "Zenntrix_Directory_Viewer_File_Type desc," + stringSort)) { DataRow NewDataRow = DataTableSorted.NewRow(); NewDataRow[FilesMapping.StructureId] = R[FilesMapping.StructureId]; NewDataRow[FilesMapping.Name] = R[FilesMapping.Name]; NewDataRow[FilesMapping.Size] = R[FilesMapping.Size]; NewDataRow[FilesMapping.DateCreated] = R[FilesMapping.DateCreated]; NewDataRow[FilesMapping.DateModified] = R[FilesMapping.DateModified]; NewDataRow["Zenntrix_Directory_Viewer_File_Type"] = R["Zenntrix_Directory_Viewer_File_Type"]; DataTableSorted.Rows.Add(NewDataRow); } RepeaterFiles.DataSource = DataTableSorted; RepeaterFiles.DataBind(); } protected int Get_Folder_Size(string ID) { int intFolderSize = 0; foreach (DataRow R in FilesMapping.DataSource.Rows) { if (ID == "0") { if (R[FilesMapping.StructureId].ToString() == "") { intFolderSize += int.Parse(R[FilesMapping.Size].ToString()); } } if (R[FilesMapping.StructureId].ToString() == ID) { intFolderSize += int.Parse(R[FilesMapping.Size].ToString()); } } foreach (DataRow R in DirectoriesMapping.DataSource.Rows) { if (R[DirectoriesMapping.ParentStructureId].ToString() == ID) { intFolderSize += Get_Folder_Size(R[DirectoriesMapping.StructureId].ToString()); } } return intFolderSize; } public DataTable Scan_Directory_For_Files(string FileDirectory) { DataTable DataTableFiles = new DataTable(); DataTableFiles.Columns.Add("Name"); DataTableFiles.Columns.Add("Extension"); DataTableFiles.Columns.Add("ModifiedDate"); DataTableFiles.Columns.Add("CreatedDate"); DataTableFiles.Columns.Add("Size"); DataTableFiles.Columns.Add("Location"); DataTableFiles.Columns.Add("LocationAndFile"); DataTableFiles.Columns.Add("Status"); DirectoryInfo DirectoryToSearch = new DirectoryInfo(FileDirectory); foreach (FileInfo Fi in DirectoryToSearch.GetFiles()) { DataRow NewDataRow = DataTableFiles.NewRow(); NewDataRow["Name"] = Fi.Name; NewDataRow["Extension"] = Fi.Extension; NewDataRow["ModifiedDate"] = Fi.LastWriteTime; NewDataRow["CreatedDate"] = Fi.CreationTime; NewDataRow["Size"] = (Fi.Length / 1024); NewDataRow["Location"] = Fi.Directory.FullName.Replace(FileDirectory, ""); NewDataRow["LocationAndFile"] = Fi.Directory.FullName.Replace(FileDirectory, "") + "\\" + Fi.Name; DataTableFiles.Rows.Add(NewDataRow); } foreach (DirectoryInfo D in DirectoryToSearch.GetDirectories()) { Get_Children_Files(DataTableFiles, D, FileDirectory); } return DataTableFiles; } protected void Get_Children_Files(DataTable DataTableToLoadInto, DirectoryInfo DirectoryToScan, string RootFileDirectory) { foreach (FileInfo Fi in DirectoryToScan.GetFiles()) { DataRow NewDataRow = DataTableToLoadInto.NewRow(); NewDataRow["Name"] = Fi.Name; NewDataRow["Extension"] = Fi.Extension; NewDataRow["ModifiedDate"] = Fi.LastWriteTime; NewDataRow["CreatedDate"] = Fi.CreationTime; NewDataRow["Size"] = (Fi.Length / 1024); NewDataRow["Location"] = Fi.Directory.FullName.Replace(RootFileDirectory, ""); NewDataRow["LocationAndFile"] = Fi.Directory.FullName.Replace(RootFileDirectory, "") + "\\" + Fi.Name; DataTableToLoadInto.Rows.Add(NewDataRow); } foreach (DirectoryInfo D in DirectoryToScan.GetDirectories()) { Get_Children_Files(DataTableToLoadInto, D, RootFileDirectory); } } public class Files { private DataTable _Files; private string _StructureId; private string _Name; private string _Size; private string _DateCreated; private string _DateModified; /// <summary> /// The datatable holding the files /// </summary> public DataTable DataSource { get { return _Files; } set { _Files = value; } } /// <summary> /// The column that contains the structure id it is linked to. /// </summary> public string StructureId { get { return _StructureId; } set { _StructureId = value; } } /// <summary> /// The column name that contains the name to be displayed /// </summary> public string Name { get { return _Name; } set { _Name = value; } } /// <summary> /// The column that contains the file size in KiloBytes. (Interger Field) /// </summary> public string Size { get { return _Size; } set { _Size = value; } } /// <summary> /// The column that contains the date created (DateTime Field) /// </summary> public string DateCreated { get { return _DateCreated; } set { _DateCreated = value; } } /// <summary> /// The column that contains the date modified (DateTime Field) /// </summary> public string DateModified { get { return _DateModified; } set { _DateModified = value; } } } #endregion protected void OnFileSelected(object sender, ZentrixDirectoryViewFileSelected e) { if (FileSelected != null) { foreach (DataRow R in FilesMapping.DataSource.Rows) { if (e.FileName == R[FilesMapping.Name].ToString() && e.FileStructureID == R[FilesMapping.StructureId].ToString()) { e.FileSize = int.Parse(R[FilesMapping.Size].ToString()); e.FileCreated = DateTime.Parse(R[FilesMapping.DateCreated].ToString()); e.FileModified = DateTime.Parse(R[FilesMapping.DateModified].ToString()); string stringFolderPath = ""; if (e.FileStructureID != "") stringFolderPath = DirectoriesMapping.DataSource.Rows.Find(e.FileStructureID)[DirectoriesMapping.Path].ToString(); e.FilePath = rootPath + "\\" + stringFolderPath + "\\" + e.FileName; FileStream MyFileStream = new FileStream(e.FilePath, FileMode.Open); byte[] Buffer = new byte[(int)MyFileStream.Length]; MyFileStream.Read(Buffer, 0, (int)MyFileStream.Length); MyFileStream.Close(); this.Page.Response.ContentType = "application/octet-stream"; this.Page.Response.AddHeader("content-disposition", "attachment; filename=\"" + e.FileName + "\""); this.Page.Response.BinaryWrite(Buffer); this.Page.Response.End(); break; } } FileSelected(sender, e); } } protected void SetCurrentFilePath(string stringCurrentFolderId) { if (stringCurrentFolderId != "0" && stringCurrentFolderId != "") { DataTable DataTableFolders = DirectoriesMapping.DataSource; DataTableFolders.PrimaryKey = new DataColumn[] { DataTableFolders.Columns[DirectoriesMapping.StructureId] }; currentPath = rootPath + DataTableFolders.Rows.Find(CurrentFolderId)[DirectoriesMapping.Path].ToString(); } else { currentPath = rootPath; } FileUploader.FileSaveDirectory = currentPath; } protected void OnFolderSelected(object sender, ZentrixDirectoryViewFolderSelected e) { CurrentFolderId = ((LinkButton)sender).CommandArgument.ToString(); Set_Selected_TreeNode(TreeViewFolderView, CurrentFolderId); SetCurrentFilePath(CurrentFolderId); Load_Files(CurrentFolderId); if (FolderSelected != null) { e.FolderSize = Get_Folder_Size(CurrentFolderId); FolderSelected(sender, e); } } protected void TreeViewFolderView_SelectedNodeChanged(object sender, EventArgs e) { CurrentFolderId = TreeViewFolderView.SelectedNode.Value; ZentrixDirectoryViewFolderSelected Event = new ZentrixDirectoryViewFolderSelected(); Event.FolderName = TreeViewFolderView.SelectedNode.Text; Event.FolderId = CurrentFolderId; Event.FolderSize = Get_Folder_Size(CurrentFolderId); SetCurrentFilePath(CurrentFolderId); FolderSelected(sender, Event); Load_Files(TreeViewFolderView.SelectedNode.Value); } protected class Repeater_Files_ITemplate : ITemplate { private Zenntrix_Directory_Viewer.Files FileMapping; public void FileMap(Zenntrix_Directory_Viewer.Files FileMap) { FileMapping = FileMap; } public void InstantiateIn(Control ControlSender) { RepeaterItem RepeaterItemContainer = ((RepeaterItem)ControlSender); HtmlGenericControl Container = new HtmlGenericControl(); Container.TagName = "div"; Container.Attributes.Add("class", "ZDV_RepeaterFilesContainer"); if (RepeaterItemContainer.ItemType == ListItemType.Item || RepeaterItemContainer.ItemType == ListItemType.AlternatingItem) { #region /* File Name Column */ HtmlGenericControl DivNameColumn = new HtmlGenericControl(); DivNameColumn.TagName = "div"; DivNameColumn.Attributes.Add("class", "ZDV_Left ZDV_RepeaterFilesNameContainer"); HtmlGenericControl DivImageContainer = new HtmlGenericControl(); DivImageContainer.TagName = "div"; DivImageContainer.Attributes.Add("class", "ZDV_Left ZDV_RepeaterFilesImage"); HtmlImage FileImage = new HtmlImage(); FileImage.Attributes.Add("FileNameColumn", FileMapping.Name); FileImage.DataBinding += new EventHandler(FileImage_Bound); HtmlGenericControl DivFileNameContainer = new HtmlGenericControl(); DivFileNameContainer.TagName = "div"; DivFileNameContainer.Attributes.Add("class", "ZDV_Left ZDV_RepeaterFilesName"); LinkButton LinkButtonFilename = new LinkButton(); LinkButtonFilename.ID = "LinkButtonFilename"; LinkButtonFilename.Attributes.Add("ColumnName", FileMapping.Name); LinkButtonFilename.Attributes.Add("IdColumnName", FileMapping.StructureId); LinkButtonFilename.DataBinding += new EventHandler(LinkButtonFilename_Bound); LinkButtonFilename.Click += new EventHandler(LinkButtonFilename_Click); DivImageContainer.Controls.Add(FileImage); DivFileNameContainer.Controls.Add(LinkButtonFilename); DivNameColumn.Controls.Add(DivImageContainer); DivNameColumn.Controls.Add(DivFileNameContainer); Container.Controls.Add(DivNameColumn); #endregion #region /* Size Column */ HtmlGenericControl DivSizeColumn = new HtmlGenericControl(); DivSizeColumn.TagName = "div"; DivSizeColumn.Attributes.Add("class", "ZDV_Left ZDV_RepeaterFilesSize"); DivSizeColumn.Attributes.Add("ColumnName", FileMapping.Size); DivSizeColumn.DataBinding += new EventHandler(Size_Bound); Container.Controls.Add(DivSizeColumn); #endregion #region /* Date Created Column */ HtmlGenericControl DivDateCreatedColumn = new HtmlGenericControl(); DivDateCreatedColumn.TagName = "div"; DivDateCreatedColumn.Attributes.Add("class", "ZDV_Left ZDV_RepeaterFilesDateCreated"); DivDateCreatedColumn.Attributes.Add("ColumnName", FileMapping.DateCreated); DivDateCreatedColumn.DataBinding += new EventHandler(Field_Bound); Container.Controls.Add(DivDateCreatedColumn); #endregion #region /* Date Modified Column */ HtmlGenericControl DivDateModifiedColumn = new HtmlGenericControl(); DivDateModifiedColumn.TagName = "div"; DivDateModifiedColumn.Attributes.Add("class", "ZDV_Left ZDV_RepeaterFilesDateModified"); DivDateModifiedColumn.Attributes.Add("ColumnName", FileMapping.DateModified); DivDateModifiedColumn.DataBinding += new EventHandler(Field_Bound); Container.Controls.Add(DivDateModifiedColumn); #endregion #region /* Div Cleaner */ HtmlGenericControl DivClean = new HtmlGenericControl(); DivClean.TagName = "div"; DivClean.Attributes.Add("class", "ZDV_Clear"); Container.Controls.Add(DivClean); #endregion RepeaterItemContainer.Controls.Add(Container); } } public event FolderSelectedEventHandler FolderSelected; public event FileSelectedEventHandler FileSelected; protected void Size_Bound(object sender, EventArgs e) { HtmlGenericControl DivColumn = (HtmlGenericControl)sender; RepeaterItem RepeaterItemContainer = ((RepeaterItem)DivColumn.NamingContainer); string stringFileSize = string.Empty; int intFileSize = 0; int.TryParse(DataBinder.Eval(RepeaterItemContainer.DataItem, DivColumn.Attributes["ColumnName"].ToString()).ToString(), out intFileSize); if (intFileSize >= 1048576) stringFileSize = (intFileSize / 1048576).ToString() + " GB"; else if (intFileSize >= 1024) stringFileSize = (intFileSize / 1024).ToString() + " MB"; else stringFileSize = intFileSize.ToString() + " KB"; DivColumn.InnerText = stringFileSize; } protected void Field_Bound(object sender, EventArgs e) { string ControlType = sender.GetType().Name; RepeaterItem RepeaterItemContainer = ((RepeaterItem)((Control)sender).NamingContainer); switch (ControlType) { case "HtmlGenericControl": HtmlGenericControl Column = (HtmlGenericControl)sender; if (Column.Attributes["ColumnName"] != null) { Column.InnerText = DataBinder.Eval(RepeaterItemContainer.DataItem, Column.Attributes["ColumnName"].ToString()).ToString(); } break; case "LinkButton": LinkButton LinkButtonColumn = (LinkButton)sender; if (LinkButtonColumn.Attributes["ColumnName"] != null) { LinkButtonColumn.Text = DataBinder.Eval(RepeaterItemContainer.DataItem, LinkButtonColumn.Attributes["ColumnName"].ToString()).ToString(); } break; } } protected void LinkButtonFilename_Bound(object sender, EventArgs e) { RepeaterItem RepeaterItemContainer = ((RepeaterItem)((LinkButton)sender).NamingContainer); LinkButton Column = (LinkButton)sender; if (Column.Attributes["ColumnName"] != null) { Column.ToolTip = DataBinder.Eval(RepeaterItemContainer.DataItem, Column.Attributes["ColumnName"].ToString()).ToString(); Column.Text = DataBinder.Eval(RepeaterItemContainer.DataItem, Column.Attributes["ColumnName"].ToString()).ToString(); Column.CommandArgument = DataBinder.Eval(RepeaterItemContainer.DataItem, Column.Attributes["IdColumnName"].ToString()).ToString(); Column.CommandName = DataBinder.Eval(RepeaterItemContainer.DataItem, "Zenntrix_Directory_Viewer_File_Type").ToString(); } } protected void FileImage_Bound(object sender, EventArgs e) { RepeaterItem RepeaterItemContainer = ((RepeaterItem)((HtmlImage)sender).NamingContainer); HtmlImage Column = (HtmlImage)sender; string stringFileExtension = string.Empty; if (Column.Attributes["FileNameColumn"] != null && DataBinder.Eval(RepeaterItemContainer.DataItem, "Zenntrix_Directory_Viewer_File_Type").ToString() == "") { FileInfo FileInfoGetExtension = new FileInfo(DataBinder.Eval(RepeaterItemContainer.DataItem, Column.Attributes["FileNameColumn"].ToString()).ToString()); stringFileExtension = FileInfoGetExtension.Extension.ToString(); } string stringImageLocation = string.Empty; if (stringFileExtension == "" && DataBinder.Eval(RepeaterItemContainer.DataItem, "Zenntrix_Directory_Viewer_File_Type").ToString() == "Folder") { stringImageLocation = RepeaterItemContainer.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), "Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Folder.png"); } else { stringImageLocation = stringFileExtension; if (!File.Exists(stringImageLocation)) { stringImageLocation = RepeaterItemContainer.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), "Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.File.png"); } } Column.Src = stringImageLocation; } protected void LinkButtonFilename_Click(object sender, EventArgs e) { if (((LinkButton)sender).CommandName == "Folder") { if (FolderSelected != null) { ZentrixDirectoryViewFolderSelected Event = new ZentrixDirectoryViewFolderSelected(); Event.FolderName = ((LinkButton)sender).Text; Event.FolderId = ((LinkButton)sender).CommandArgument; FolderSelected(sender, Event); } } else { if (FileSelected != null) { ZentrixDirectoryViewFileSelected Event = new ZentrixDirectoryViewFileSelected(); Event.FileName = ((LinkButton)sender).Text; Event.FileStructureID = ((LinkButton)sender).CommandArgument; FileSelected(sender, Event); } } } } protected class Repeater_Files_HeaderITemplate : ITemplate { public event EventHandler ColumnSorted; public string SortOrder = ""; public string SortDirection = ""; public void Set_SortOrder(string Order, string Direction) { SortOrder = Order; SortDirection = Direction; } public void InstantiateIn(Control ControlSender) { RepeaterItem RepeaterItemContainer = ((RepeaterItem)ControlSender); HtmlGenericControl Container = new HtmlGenericControl(); Container.TagName = "div"; Container.Attributes.Add("class", "ZDV_RepeaterFilesHeaderContainer"); if (RepeaterItemContainer.ItemType == ListItemType.Header) { LinkButton LinkButtonSortName = new LinkButton(); LinkButtonSortName.Text = "Name"; LinkButtonSortName.ID = "LinkButtonSortName"; LinkButtonSortName.CssClass = "ZDV_RepeaterFilesSortButton"; LinkButtonSortName.Click += new EventHandler(Column_Sort); LinkButtonSortName.DataBinding += new EventHandler(ColumnHeader_Bound); HtmlGenericControl NameContainer = new HtmlGenericControl(); NameContainer.TagName = "div"; NameContainer.Attributes.Add("class", "ZDV_Left ZDV_RepeaterFilesHeaderName"); NameContainer.Controls.Add(LinkButtonSortName); LinkButton LinkButtonSortSize = new LinkButton(); LinkButtonSortSize.Text = "Size"; LinkButtonSortSize.ID = "LinkButtonSortSize"; LinkButtonSortSize.CssClass = "ZDV_RepeaterFilesSortButton"; LinkButtonSortSize.Click += new EventHandler(Column_Sort); LinkButtonSortSize.DataBinding += new EventHandler(ColumnHeader_Bound); HtmlGenericControl SizeContainer = new HtmlGenericControl(); SizeContainer.TagName = "div"; SizeContainer.Attributes.Add("class", "ZDV_Left ZDV_RepeaterFilesHeaderSize"); SizeContainer.Controls.Add(LinkButtonSortSize); LinkButton LinkButtonSortCreated = new LinkButton(); LinkButtonSortCreated.Text = "Date Created"; LinkButtonSortCreated.ID = "LinkButtonSortCreated"; LinkButtonSortCreated.CssClass = "ZDV_RepeaterFilesSortButton"; LinkButtonSortCreated.Click += new EventHandler(Column_Sort); LinkButtonSortCreated.DataBinding += new EventHandler(ColumnHeader_Bound); HtmlGenericControl DateCreatedContainer = new HtmlGenericControl(); DateCreatedContainer.TagName = "div"; DateCreatedContainer.Attributes.Add("class", "ZDV_Left ZDV_RepeaterFilesHeaderDateCreated"); DateCreatedContainer.Controls.Add(LinkButtonSortCreated); LinkButton LinkButtonSortModified = new LinkButton(); LinkButtonSortModified.Text = "Date Modified"; LinkButtonSortModified.ID = "LinkButtonSortModified"; LinkButtonSortModified.CssClass = "ZDV_RepeaterFilesSortButton"; LinkButtonSortModified.Click += new EventHandler(Column_Sort); LinkButtonSortModified.DataBinding += new EventHandler(ColumnHeader_Bound); HtmlGenericControl DateModifiedContainer = new HtmlGenericControl(); DateModifiedContainer.TagName = "div"; DateModifiedContainer.Attributes.Add("class", "ZDV_Left ZDV_RepeaterFilesHeaderDateModified"); DateModifiedContainer.Controls.Add(LinkButtonSortModified); HtmlGenericControl DivClear = new HtmlGenericControl(); DivClear.TagName = "div"; DivClear.Attributes.Add("class", "ZDV_Clear"); Literal DivOpenItems = new Literal(); DivOpenItems.Text = "<div style=\"height:419px;\" class=\"ZDV_RepeaterFilesOpenItems\">"; Container.Controls.Add(NameContainer); Container.Controls.Add(SizeContainer); Container.Controls.Add(DateCreatedContainer); Container.Controls.Add(DateModifiedContainer); Container.Controls.Add(DivClear); RepeaterItemContainer.Controls.Add(Container); RepeaterItemContainer.Controls.Add(DivOpenItems); } } protected void ColumnHeader_Bound(object sender, EventArgs e) { LinkButton LinkButtonSelected = (LinkButton)sender; if (LinkButtonSelected.ID == SortOrder) { if (SortDirection == "ASC") LinkButtonSelected.Style["background-image"] = "url('" + LinkButtonSelected.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), "Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Arrow_Down.png") + "');"; else LinkButtonSelected.Style["background-image"] = "url('" + LinkButtonSelected.Page.ClientScript.GetWebResourceUrl(typeof(Zenntrix_Directory_Viewer), "Zenntrix_Toolkit.Zenntrix_Directory_Viewer_Resources.Arrow_Up.png") + "');"; LinkButtonSelected.Style["background-position"] = "right"; LinkButtonSelected.Style["background-repeat"] = "no-repeat"; } else { LinkButtonSelected.Style.Remove("background-image"); } } public void Column_Sort(object sender, EventArgs e) { if (ColumnSorted != null) { ColumnSorted(sender, e); } } } protected class Repeater_Files_FooterITemplate : ITemplate { public void InstantiateIn(Control ControlSender) { RepeaterItem RepeaterItemContainer = ((RepeaterItem)ControlSender); if (RepeaterItemContainer.ItemType == ListItemType.Footer) { Literal DivCloseItems = new Literal(); DivCloseItems.Text = "</div>"; RepeaterItemContainer.Controls.Add(DivCloseItems); } } } } public delegate void FolderSelectedEventHandler(object sender, ZentrixDirectoryViewFolderSelected e); public class ZentrixDirectoryViewFolderSelected : EventArgs { new public static ZentrixDirectoryViewFolderSelected Empty = new ZentrixDirectoryViewFolderSelected(); public string FolderName = ""; public string FolderId = ""; public string FolderPath = ""; /// <summary> /// Returns the selected folder size in KB /// </summary> public int FolderSize; public ZentrixDirectoryViewFolderSelected() { } } public delegate void FileSelectedEventHandler(object sender, ZentrixDirectoryViewFileSelected e); public class ZentrixDirectoryViewFileSelected : EventArgs { new public static ZentrixDirectoryViewFileSelected Empty = new ZentrixDirectoryViewFileSelected(); public string FileName = ""; public string FileStructureID = ""; public string FilePath = ""; public DateTime FileCreated; public DateTime FileModified; /// <summary> /// Returns the selected file size in KB /// </summary> public int FileSize; public ZentrixDirectoryViewFileSelected() { } } }
{'content_hash': '4347d99f6d0b389143bc192a032529a4', 'timestamp': '', 'source': 'github', 'line_count': 1355, 'max_line_length': 253, 'avg_line_length': 43.29594095940959, 'alnum_prop': 0.5418470664439369, 'repo_name': 'zenntrix/Web_Toolkit', 'id': '0966ef9e1efb933ad7fb54ca7ea1366ce11c8e6d', 'size': '58668', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Zenntrix_Directory_Viewer/Zenntrix_Directory_Viewer/Zenntrix_Directory_Viewer.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '223786'}, {'name': 'CSS', 'bytes': '3785'}, {'name': 'JavaScript', 'bytes': '6077'}, {'name': 'Shell', 'bytes': '780'}]}
from test_framework.test_framework import PresidentielcoinTestFramework from test_framework.util import * import zmq import struct import http.client import urllib.parse class ZMQTest (PresidentielcoinTestFramework): def __init__(self): super().__init__() self.num_nodes = 4 port = 28370 def setup_nodes(self): self.zmqContext = zmq.Context() self.zmqSubSocket = self.zmqContext.socket(zmq.SUB) self.zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashblock") self.zmqSubSocket.setsockopt(zmq.SUBSCRIBE, b"hashtx") self.zmqSubSocket.connect("tcp://127.0.0.1:%i" % self.port) return start_nodes(self.num_nodes, self.options.tmpdir, extra_args=[ ['-zmqpubhashtx=tcp://127.0.0.1:'+str(self.port), '-zmqpubhashblock=tcp://127.0.0.1:'+str(self.port)], [], [], [] ]) def run_test(self): self.sync_all() genhashes = self.nodes[0].generate(1) self.sync_all() print("listen...") msg = self.zmqSubSocket.recv_multipart() topic = msg[0] assert_equal(topic, b"hashtx") body = msg[1] nseq = msg[2] msgSequence = struct.unpack('<I', msg[-1])[-1] assert_equal(msgSequence, 0) #must be sequence 0 on hashtx msg = self.zmqSubSocket.recv_multipart() topic = msg[0] body = msg[1] msgSequence = struct.unpack('<I', msg[-1])[-1] assert_equal(msgSequence, 0) #must be sequence 0 on hashblock blkhash = bytes_to_hex_str(body) assert_equal(genhashes[0], blkhash) #blockhash from generate must be equal to the hash received over zmq n = 10 genhashes = self.nodes[1].generate(n) self.sync_all() zmqHashes = [] blockcount = 0 for x in range(0,n*2): msg = self.zmqSubSocket.recv_multipart() topic = msg[0] body = msg[1] if topic == b"hashblock": zmqHashes.append(bytes_to_hex_str(body)) msgSequence = struct.unpack('<I', msg[-1])[-1] assert_equal(msgSequence, blockcount+1) blockcount += 1 for x in range(0,n): assert_equal(genhashes[x], zmqHashes[x]) #blockhash from generate must be equal to the hash received over zmq #test tx from a second node hashRPC = self.nodes[1].sendtoaddress(self.nodes[0].getnewaddress(), 1.0) self.sync_all() # now we should receive a zmq msg because the tx was broadcast msg = self.zmqSubSocket.recv_multipart() topic = msg[0] body = msg[1] hashZMQ = "" if topic == b"hashtx": hashZMQ = bytes_to_hex_str(body) msgSequence = struct.unpack('<I', msg[-1])[-1] assert_equal(msgSequence, blockcount+1) assert_equal(hashRPC, hashZMQ) #blockhash from generate must be equal to the hash received over zmq if __name__ == '__main__': ZMQTest ().main ()
{'content_hash': '6836605ffe7188faf1b60098ae766a24', 'timestamp': '', 'source': 'github', 'line_count': 91, 'max_line_length': 121, 'avg_line_length': 33.417582417582416, 'alnum_prop': 0.5830318974021703, 'repo_name': 'presidentielcoin/presidentielcoin', 'id': 'dec14f5f9d58e3d91a694d9885872e89eb05476d', 'size': '3291', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'qa/rpc-tests/zmq_test.py', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Assembly', 'bytes': '133972'}, {'name': 'Batchfile', 'bytes': '3647'}, {'name': 'C', 'bytes': '729310'}, {'name': 'C++', 'bytes': '9505273'}, {'name': 'CSS', 'bytes': '99380'}, {'name': 'HTML', 'bytes': '50621'}, {'name': 'Java', 'bytes': '32471'}, {'name': 'M4', 'bytes': '187790'}, {'name': 'Makefile', 'bytes': '125005'}, {'name': 'Objective-C', 'bytes': '5974'}, {'name': 'Objective-C++', 'bytes': '7276'}, {'name': 'Protocol Buffer', 'bytes': '2825'}, {'name': 'Python', 'bytes': '1032557'}, {'name': 'QMake', 'bytes': '2020'}, {'name': 'Roff', 'bytes': '31176'}, {'name': 'Shell', 'bytes': '95914'}]}
<!-- Post Layout Start --> <!DOCTYPE html> <html lang="{{ site.lang }}"> {% include head.html %} <body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top" data-offset="151"> {% include navigation.html %} {% include post.html %} {% include footer.html %} {% include js.html %} </body> </html> <!-- Post Layout End -->
{'content_hash': 'a94c7f6c08bb6d143eb92331c6eb4f15', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 91, 'avg_line_length': 18.894736842105264, 'alnum_prop': 0.5766016713091922, 'repo_name': 'alexandrucoman/labs.cloudbase.it', 'id': 'a8624a85632860c4e813ea6e4f098f0dc1d7cca2', 'size': '359', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '_layouts/post.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '442014'}, {'name': 'HTML', 'bytes': '39852'}, {'name': 'Ruby', 'bytes': '3280'}]}
require 'OpenNebulaJSON/JSONUtils' module OpenNebulaJSON class HostJSON < OpenNebula::Host include JSONUtils def create(template_json) host_hash = parse_json(template_json, 'host') if OpenNebula.is_error?(host_hash) return host_hash end self.allocate(host_hash['name'], host_hash['im_mad'], host_hash['vm_mad'], host_hash['vnm_mad'], host_hash['cluster_id'].to_i) end def delete if self['HOST_SHARE/RUNNING_VMS'].to_i != 0 OpenNebula::Error.new("Host still has associated VMs, aborting delete.") else super end end def perform_action(template_json) action_hash = parse_json(template_json, 'action') if OpenNebula.is_error?(action_hash) return action_hash end rc = case action_hash['perform'] when "enable" then self.enable when "disable" then self.disable when "update" then self.update(action_hash['params']) else error_msg = "#{action_hash['perform']} action not " << " available for this resource" OpenNebula::Error.new(error_msg) end end def update(params=Hash.new) super(params['template_raw']) end end end
{'content_hash': '2ce28e507ce682fd8ec9a07879a6a050', 'timestamp': '', 'source': 'github', 'line_count': 50, 'max_line_length': 88, 'avg_line_length': 31.22, 'alnum_prop': 0.4875080076873799, 'repo_name': 'bcec/opennebula3.4.1', 'id': '3ca11ecb0beb20deb3efb30614255bd048174eb5', 'size': '2747', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/sunstone/models/OpenNebulaJSON/HostJSON.rb', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '721757'}, {'name': 'C++', 'bytes': '1502569'}, {'name': 'Java', 'bytes': '262511'}, {'name': 'JavaScript', 'bytes': '906638'}, {'name': 'Python', 'bytes': '2832'}, {'name': 'Ruby', 'bytes': '1090866'}, {'name': 'Shell', 'bytes': '154875'}]}
<?php namespace app\models\db; use Yii; /** * Admin model * * @property AdminAuthLog[] $authLogs */ class Admin extends Identity { /** * {@inheritdoc} */ public static function tableName() { return 'Admin'; } /** * {@inheritdoc} */ public function rules() { return array_merge(parent::rules(), [ // add extra validation here ]); } /** * {@inheritdoc} */ public function attributeLabels() { return array_merge(parent::attributeLabels(), [ // add extra labels here ]); } /** * {@inheritdoc} */ public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if ($insert) { $this->sendNewAdminEmail(); } } // Relations : /** * @return \yii\db\ActiveQuery */ public function getAuthLogs() { return $this->hasMany(AdminAuthLog::class, ['adminId' => 'id']); } // Logic : /** * Sends email notification about account creation. * @return boolean success. */ public function sendNewAdminEmail() { return Yii::$app->mailer->compose('newAdmin', ['admin' => $this]) ->setTo($this->email) ->setFrom([Yii::$app->params['appEmail'] => Yii::$app->name]) ->setSubject(Yii::t('admin', 'Your administration account at {appName}', ['appName' => Yii::$app->name])) ->send(); } /** * {@inheritdoc} */ public function sendSuspendEmail() { return Yii::$app->mailer->compose('suspendAdmin', ['admin' => $this]) ->setTo($this->email) ->setFrom([Yii::$app->params['appEmail'] => Yii::$app->name]) ->setSubject(Yii::t('admin', 'Your administration account at {appName} has been suspended', ['appName' => Yii::$app->name])) ->send(); } }
{'content_hash': 'e29b32bbd9d866a4980930d1a12a9882', 'timestamp': '', 'source': 'github', 'line_count': 89, 'max_line_length': 136, 'avg_line_length': 22.235955056179776, 'alnum_prop': 0.5194542698332492, 'repo_name': 'yii2tech/project-template', 'id': 'bae26ca8f13866d10ddabb939a95ec78e145b1e7', 'size': '1979', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'models/db/Admin.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '1030'}, {'name': 'CSS', 'bytes': '3244'}, {'name': 'PHP', 'bytes': '188077'}]}
<?php namespace hnr\sircimBundle\Tests\Controller; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; class RolOpcionSistemaControllerTest extends WebTestCase { /* public function testCompleteScenario() { // Create a new client to browse the application $client = static::createClient(); // Create a new entry in the database $crawler = $client->request('GET', '/rolopcionsistema/'); $this->assertEquals(200, $client->getResponse()->getStatusCode(), "Unexpected HTTP status code for GET /rolopcionsistema/"); $crawler = $client->click($crawler->selectLink('Create a new entry')->link()); // Fill in the form and submit it $form = $crawler->selectButton('Create')->form(array( 'hnr_sircimbundle_rolopcionsistematype[field_name]' => 'Test', // ... other fields to fill )); $client->submit($form); $crawler = $client->followRedirect(); // Check data in the show view $this->assertGreaterThan(0, $crawler->filter('td:contains("Test")')->count(), 'Missing element td:contains("Test")'); // Edit the entity $crawler = $client->click($crawler->selectLink('Edit')->link()); $form = $crawler->selectButton('Edit')->form(array( 'hnr_sircimbundle_rolopcionsistematype[field_name]' => 'Foo', // ... other fields to fill )); $client->submit($form); $crawler = $client->followRedirect(); // Check the element contains an attribute with value equals "Foo" $this->assertGreaterThan(0, $crawler->filter('[value="Foo"]')->count(), 'Missing element [value="Foo"]'); // Delete the entity $client->submit($crawler->selectButton('Delete')->form()); $crawler = $client->followRedirect(); // Check the entity has been delete on the list $this->assertNotRegExp('/Foo/', $client->getResponse()->getContent()); } */ }
{'content_hash': '657d1849d76ae5513769e287effdda8a', 'timestamp': '', 'source': 'github', 'line_count': 55, 'max_line_length': 132, 'avg_line_length': 36.07272727272727, 'alnum_prop': 0.6129032258064516, 'repo_name': 'B9lly/TG2013', 'id': '0b6aed5d9f94c8636efb3f2614a1e3896dc7ca9b', 'size': '1984', 'binary': False, 'copies': '1', 'ref': 'refs/heads/billy', 'path': 'src/hnr/sircimBundle/Tests/Controller/RolOpcionSistemaControllerTest.php', 'mode': '33188', 'license': 'mit', 'language': []}
<!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_151) on Wed Jul 17 13:50:52 MST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Uses of Interface org.wildfly.swarm.undertow.WARArchive (BOM: * : All 2.5.0.Final API)</title> <meta name="date" content="2019-07-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="Uses of Interface org.wildfly.swarm.undertow.WARArchive (BOM: * : All 2.5.0.Final API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/wildfly/swarm/undertow/WARArchive.html" title="interface in org.wildfly.swarm.undertow">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-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">Thorntail API, 2.5.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/undertow/class-use/WARArchive.html" target="_top">Frames</a></li> <li><a href="WARArchive.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> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Interface org.wildfly.swarm.undertow.WARArchive" class="title">Uses of Interface<br>org.wildfly.swarm.undertow.WARArchive</h2> </div> <div class="classUseContainer">No usage of org.wildfly.swarm.undertow.WARArchive</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../org/wildfly/swarm/undertow/WARArchive.html" title="interface in org.wildfly.swarm.undertow">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../../../../../overview-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">Thorntail API, 2.5.0.Final</div> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?org/wildfly/swarm/undertow/class-use/WARArchive.html" target="_top">Frames</a></li> <li><a href="WARArchive.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> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright &#169; 2019 <a href="http://www.jboss.org">JBoss by Red Hat</a>. All rights reserved.</small></p> </body> </html>
{'content_hash': '6614f195380ee557c977bb58296d80ba', 'timestamp': '', 'source': 'github', 'line_count': 128, 'max_line_length': 145, 'avg_line_length': 37.546875, 'alnum_prop': 0.614856429463171, 'repo_name': 'wildfly-swarm/wildfly-swarm-javadocs', 'id': 'fc3422d3d78bece4bddf2a92af35725c9165c445', 'size': '4806', 'binary': False, 'copies': '1', 'ref': 'refs/heads/gh-pages', 'path': '2.5.0.Final/apidocs/org/wildfly/swarm/undertow/class-use/WARArchive.html', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
!External articles * [[Retail example|http://philip.greenspun.com/sql/data-warehousing.html]] * [[Star vs Snowflake|http://www.simple-talk.com/content/print.aspx?article=592]] *[[Download|http://sourceforge.net/projects/pentaho/files/]] *[[Dashboard Tools - Webdetails|http://www.webdetails.pt/]] *[[Pentaho HTML5 Integration|http://forums.pentaho.com/archive/index.php/t-78268.html]] *[[Classic dashboards|http://wiki.pentaho.com/display/COM/A+Dashboard+Framework+for+the+Pentaho+BI+Platform]] *[[Run Kettle Job for each Row|http://type-exit.org/adventures-with-open-source-bi/2010/06/run-kettle-job-for-each-row/]] *[[Loops in Kettle Jobs|http://type-exit.org/adventures-with-open-source-bi/2010/06/kettle-quick-hint-loops-in-kettle-jobs/]] *[[Develop Dashboards with CDE|http://www.tikalk.com/incubator/blog/creating-bugzilla-dashboard-%E2%80%93-hands-cde-tutorial-%E2%80%93-fuse-day-3-session-summary]] !My cheat sheets [[Install-Pentaho|install-pentaho-server]] [[Manual configuration Hibernate|pentaho-hibernate-configuration]] [[Publish Mondrian Schemas|publish-pentaho-mondrian-schemes]] [[Change Password in Admin Console|change-pentaho-password-admin-console]] # getting started # Set your directories of work `/opt/pentaho/administration-console/resource/config/console.xml` <console> <solution-path>../biserver-ce/pentaho-solutions</solution-path> <war-path>../biserver-ce/tomcat/webapps/pentaho</war-path> ... Add your IP server in /opt/pentaho/biserver-ce/tomcat/webapps/pentaho/WEB-INF/web.xml <param-name>solution-path</param-name> <param-value>/opt/pentaho/biserver-ce/pentaho-solutions/</param-value> ... <param-name>fully-qualified-server-url</param-name> <param-value>http://localhost:8080/pentaho/</param-value> ... <param-name>TrustedIpAddrs</param-name> <param-value>10.0.0.138,127.0.0.1</param-value> ... You have to login with the same user/pass on both bi-server and admin-console Config MySQL Driver/URL in `/opt/pentaho/biserver-ce/pentaho-solutions/system/applicationContext-spring-security-jdbc.xml` org.hsqldb.jdbcDriver --> com.mysql.jdbc.Driver jdbc:hsqldb:hsql://localhost:9001/hibernate --> jdbc:mysql://localhost:3306/hibernate At the end it should look like this: <!-- This is only for Hypersonic. Please update this section for any other database you are using --> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/hibernate" /> <property name="username" value="hibuser" /> <property name="password" value="password" /> </bean> Change the file `/opt/pentaho/biserver-ce/pentaho-solutions/system/applicationContext-spring-security-hibernate.properties` jdbc.driver==com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/hibernate jdbc.username=hibuser jdbc.password=password hibernate.dialect=org.hibernate.dialect.MySQLDialect Change to MySQL driver in `/opt/pentaho/biserver-ce/pentaho-solutions/system/hibernate/hibernate-settings.xml` <config-file>system/hibernate/mysql5.hibernate.cfg.xml</config-file> Change `/opt/pentaho/biserver-ce/tomcat/webapps/pentaho/META-INF/context.xml` <?xml version="1.0" encoding="UTF-8"?> <Context path="/pentaho" docbase="webapps/pentaho/"> <Resource name="jdbc/Hibernate" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5" maxWait="10000" username="hibuser" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/hibernate" validationQuery="select 1" /> <Resource name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5" maxWait="10000" username="pentaho_user" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/quartz" validationQuery="select 1"/> </Context> Config Email in `/opt/pentaho/bi-server/pentaho-solutions/system/smtp-email/email_config.xml` Disable HSQLDB: Comment in `/opt/pentaho/biserver-ce/tomcat/webapps/pentaho/WEB-INF/web.xml` <context-param> <param-name>hsqldb-databases</param-name> <param-value>sampledata@../../data/hsqldb/sampledata,hibernate@../../data/hsqldb/hibernate,quartz@../../data/hsqldb/quartz</param-value> </context-param> ... <listener> <listener-class>org.pentaho.platform.web.http.context.HsqldbStartupListener</listener-class> </listener> ... * Disable Login List 1. In the file `/opt/pentaho/biserver-ce/tomcat/webapps/pentaho/mantleLogin/loginsettings.properties` 2. Change `#showUsersList=true` to `showUsersList=false`
{'content_hash': '819026d309d585f16ef578f8eb570378', 'timestamp': '', 'source': 'github', 'line_count': 104, 'max_line_length': 167, 'avg_line_length': 49.81730769230769, 'alnum_prop': 0.7006369426751592, 'repo_name': 'iwxfer/wikitten', 'id': '84da2393b51f727661d3329343bd2795d5e347a8', 'size': '5181', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'library/pentaho/pentaho.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '168'}, {'name': 'C', 'bytes': '2393'}, {'name': 'C++', 'bytes': '6927'}, {'name': 'CSS', 'bytes': '12370'}, {'name': 'CoffeeScript', 'bytes': '1043'}, {'name': 'Erlang', 'bytes': '2982'}, {'name': 'HTML', 'bytes': '2410'}, {'name': 'JavaScript', 'bytes': '24553'}, {'name': 'PHP', 'bytes': '139733'}, {'name': 'Python', 'bytes': '37939'}, {'name': 'Ruby', 'bytes': '2472'}, {'name': 'Shell', 'bytes': '43175'}]}
package main import ( "encoding/json" "log" "strings" "text/template" "../../../gen" ) func main() { t, err := template.New("").Parse(tmpl) if err != nil { log.Fatal(err) } var j js if err := gen.Gen("clock", &j, t); err != nil { log.Fatal(err) } } // The JSON structure we expect to be able to umarshal into type js struct { Groups []testGroup `json:"Cases"` } type testGroup struct { Description string Cases []json.RawMessage `property:"RAW"` CreateCases []struct { Description string Hour, Minute int Expected string } `property:"create"` AddCases []struct { Description string Hour, Minute, Add int Expected string } `property:"add"` EqCases []struct { Description string Clock1, Clock2 struct{ Hour, Minute int } Expected bool } `property:"equal"` } func (groups testGroup) GroupShortName() string { return strings.ToLower(strings.Fields(groups.Description)[0]) } var tmpl = `package clock {{.Header}} {{range .J.Groups}} // {{ .Description }} {{- if .CreateCases }} var timeTests = []struct { h, m int want string }{ {{- range .CreateCases }} { {{.Hour}}, {{.Minute}}, {{.Expected | printf "%#v"}}}, // {{.Description}} {{- end }} } {{- end }} {{- if .AddCases }} var {{ .GroupShortName }}Tests = []struct { h, m, a int want string }{ {{- range .AddCases }} { {{.Hour}}, {{.Minute}}, {{.Add}}, {{.Expected | printf "%#v"}}}, // {{.Description}} {{- end }} } {{- end }} {{- if .EqCases }} type hm struct{ h, m int } var eqTests = []struct { c1, c2 hm want bool }{ {{- range .EqCases }} // {{.Description}} { hm{ {{.Clock1.Hour}}, {{.Clock1.Minute}}}, hm{ {{.Clock2.Hour}}, {{.Clock2.Minute}}}, {{.Expected}}, }, {{- end }} } {{- end }} {{end}} `
{'content_hash': 'bb7b0b401de66b76b6cfa0ef23805741', 'timestamp': '', 'source': 'github', 'line_count': 98, 'max_line_length': 90, 'avg_line_length': 18.79591836734694, 'alnum_prop': 0.5564603691639523, 'repo_name': 'robphoenix/exercism-go', 'id': '0dc2dc73199a290ff3b1606c86cc185c563c396d', 'size': '1842', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'exercises/clock/.meta/gen.go', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Go', 'bytes': '463409'}, {'name': 'Shell', 'bytes': '2482'}]}
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_loop_66b.c Label Definition File: CWE122_Heap_Based_Buffer_Overflow__c_CWE805.string.label.xml Template File: sources-sink-66b.tmpl.c */ /* * @description * CWE: 122 Heap Based Buffer Overflow * BadSource: Allocate using malloc() and set data pointer to a small buffer * GoodSource: Allocate using malloc() and set data pointer to a large buffer * Sinks: loop * BadSink : Copy string to data using a loop * Flow Variant: 66 Data flow: data passed in an array from one function to another in different source files * * */ #include "std_testcase.h" #include <wchar.h> #ifndef OMITBAD void CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_loop_66b_badSink(wchar_t * dataArray[]) { /* copy data out of dataArray */ wchar_t * data = dataArray[2]; { size_t i; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ /* POTENTIAL FLAW: Possible buffer overflow if source is larger than data */ for (i = 0; i < 100; i++) { data[i] = source[i]; } data[100-1] = L'\0'; /* Ensure the destination buffer is null terminated */ printWLine(data); free(data); } } #endif /* OMITBAD */ #ifndef OMITGOOD /* goodG2B uses the GoodSource with the BadSink */ void CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_loop_66b_goodG2BSink(wchar_t * dataArray[]) { wchar_t * data = dataArray[2]; { size_t i; wchar_t source[100]; wmemset(source, L'C', 100-1); /* fill with L'C's */ source[100-1] = L'\0'; /* null terminate */ /* POTENTIAL FLAW: Possible buffer overflow if source is larger than data */ for (i = 0; i < 100; i++) { data[i] = source[i]; } data[100-1] = L'\0'; /* Ensure the destination buffer is null terminated */ printWLine(data); free(data); } } #endif /* OMITGOOD */
{'content_hash': '86325c9a2431a8f268084112edb439cf', 'timestamp': '', 'source': 'github', 'line_count': 67, 'max_line_length': 109, 'avg_line_length': 31.91044776119403, 'alnum_prop': 0.5958840037418148, 'repo_name': 'JianpingZeng/xcc', 'id': '3c2d0b7dc0142206574e0faa702a37957bc110a3', 'size': '2138', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'xcc/test/juliet/testcases/CWE122_Heap_Based_Buffer_Overflow/s08/CWE122_Heap_Based_Buffer_Overflow__c_CWE805_wchar_t_loop_66b.c', 'mode': '33188', 'license': 'bsd-3-clause', 'language': []}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <head> <!-- Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 only, as published by the Free Software Foundation. Oracle designates this particular file as subject to the "Classpath" exception as provided by Oracle in the LICENSE file that accompanied this code. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License version 2 for more details (a copy is included in the LICENSE file that accompanied this code). You should have received a copy of the GNU General Public License version 2 along with this work; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA or visit www.oracle.com if you need additional information or have any questions. --> </head> <body bgcolor="white"> This package presents a framework that allows application developers to make use of security services like authentication, data integrity and data confidentiality from a variety of underlying security mechanisms like Kerberos, using a unified API. The security mechanisms that an application can chose to use are identified with unique object identifiers. One example of such a mechanism is the Kerberos v5 GSS-API mechanism (object identifier 1.2.840.113554.1.2.2). This mechanism is available through the default instance of the GSSManager class.<p> The GSS-API is defined in a language independent way in <a href=http://www.ietf.org/rfc/rfc2743.txt>RFC 2743</a>. The Java language bindings are defined in <a href=http://www.ietf.org/rfc/rfc2853.txt>RFC 2853</a><p> An application starts out by instantiating a <code>GSSManager</code> which then serves as a factory for a security context. An application can use specific principal names and credentials that are also created using the GSSManager; or it can instantiate a context with system defaults. It then goes through a context establishment loop. Once a context is established with the peer, authentication is complete. Data protection such as integrity and confidentiality can then be obtained from this context.<p> The GSS-API does not perform any communication with the peer. It merely produces tokens that the application must somehow transport to the other end.<p> <h3>Credential Acquisition</h3> <a name=useSubjectCredsOnly> The GSS-API itself does not dictate how an underlying mechanism obtains the credentials that are needed for authentication. It is assumed that prior to calling the GSS-API, these credentials are obtained and stored in a location that the mechanism provider is aware of. However, the default model in the Java platform will be that mechanism providers must obtain credentials only from the private or public credential sets associated with the {@link javax.security.auth.Subject Subject} in the current access control context. The Kerberos v5 mechanism will search for the required INITIATE and ACCEPT credentials ({@link javax.security.auth.kerberos.KerberosTicket KerberosTicket} and {@link javax.security.auth.kerberos.KerberosKey KerberosKey}) in the private credential set where as some other mechanism might look in the public set or in both. If the desired credential is not present in the appropriate sets of the current Subject, the GSS-API call must fail.<p> This model has the advantage that credential management is simple and predictable from the applications point of view. An application, given the right permissions, can purge the credentials in the Subject or renew them using standard Java API's. If it purged the credentials, it would be sure that the JGSS mechanism would fail, or if it renewed a time based credential it would be sure that a JGSS mechanism would succeed.<p> This model does require that a {@link javax.security.auth.login JAAS login} be performed in order to authenticate and populate a Subject that the JGSS mechnanism can later utilize. However, applications have the ability to relax this restiction by means of a system property: <code>javax.security.auth.useSubjectCredsOnly</code>. By default this system property will be assumed to be <code>true</code> (even when it is unset) indicating that providers must only use the credentials that are present in the current Subject. However, if this property is explicitly set to false by the application, then it indicates that the provider is free to use any credentials cache of its choice. Such a credential cache might be a disk cache, an in-memory cache, or even just the current Subject itself. </a> <h2>Related Documentation</h2> <p> For an online tutorial on using Java GSS-API, please see <a href="../../../../technotes/guides/security/jgss/tutorials/index.html">Introduction to JAAS and Java GSS-API</a>. </p> <!-- <h2>Package Specification</h2> ##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT ##### <ul> <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a> </ul> <h2>Related Documentation</h2> For overviews, tutorials, examples, guides, and tool documentation, please see: <ul> <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a> </ul> --> @since 1.4 </body> </html>
{'content_hash': 'e2f1f80b36d1b0edf37304474f70c28a', 'timestamp': '', 'source': 'github', 'line_count': 127, 'max_line_length': 116, 'avg_line_length': 45.874015748031496, 'alnum_prop': 0.7518022657054583, 'repo_name': 'andreagenso/java2scala', 'id': '098b1cce4f2b4b237cd29accbfe7cf5f494d01e3', 'size': '5826', 'binary': False, 'copies': '34', 'ref': 'refs/heads/master', 'path': 'test/J2s/java/openjdk-6-src-b27/jdk/src/share/classes/org/ietf/jgss/package.html', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '8983'}, {'name': 'Awk', 'bytes': '26041'}, {'name': 'Batchfile', 'bytes': '1796'}, {'name': 'C', 'bytes': '20159882'}, {'name': 'C#', 'bytes': '7630'}, {'name': 'C++', 'bytes': '4513460'}, {'name': 'CSS', 'bytes': '5128'}, {'name': 'DTrace', 'bytes': '68220'}, {'name': 'HTML', 'bytes': '1302117'}, {'name': 'Haskell', 'bytes': '244134'}, {'name': 'Java', 'bytes': '129267130'}, {'name': 'JavaScript', 'bytes': '182900'}, {'name': 'Makefile', 'bytes': '711241'}, {'name': 'Objective-C', 'bytes': '66163'}, {'name': 'Python', 'bytes': '137817'}, {'name': 'Roff', 'bytes': '2630160'}, {'name': 'Scala', 'bytes': '25599'}, {'name': 'Shell', 'bytes': '888136'}, {'name': 'SourcePawn', 'bytes': '78'}]}
package com.networknt.eventuate.account.view.handler; import com.networknt.exception.ApiException; import com.networknt.exception.ClientException; import org.junit.ClassRule; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class HealthGetHandlerTest { @ClassRule public static TestServer server = TestServer.getInstance(); static final Logger logger = LoggerFactory.getLogger(HealthGetHandlerTest.class); static final boolean enableHttp2 = server.getServerConfig().isEnableHttp2(); static final boolean enableHttps = server.getServerConfig().isEnableHttps(); static final int httpPort = server.getServerConfig().getHttpPort(); static final int httpsPort = server.getServerConfig().getHttpsPort(); static final String url = enableHttp2 || enableHttps ? "https://localhost:" + httpsPort : "http://localhost:" + httpPort; @Test public void testHealthGetHandlerTest() throws ClientException, ApiException { /* final Http2Client client = Http2Client.getInstance(); final CountDownLatch latch = new CountDownLatch(1); final ClientConnection connection; try { connection = client.connect(new URI(url), Http2Client.WORKER, Http2Client.SSL, Http2Client.BUFFER_POOL, enableHttp2 ? OptionMap.create(UndertowOptions.ENABLE_HTTP2, true): OptionMap.EMPTY).get(); } catch (Exception e) { throw new ClientException(e); } final AtomicReference<ClientResponse> reference = new AtomicReference<>(); try { ClientRequest request = new ClientRequest().setPath("/v1/health").setMethod(Methods.GET); connection.sendRequest(request, client.createClientCallback(reference, latch)); latch.await(); } catch (Exception e) { logger.error("Exception: ", e); throw new ClientException(e); } finally { IoUtils.safeClose(connection); } int statusCode = reference.get().getResponseCode(); String body = reference.get().getAttachment(Http2Client.RESPONSE_BODY); Assert.assertEquals(200, statusCode); Assert.assertNotNull(body); */ } }
{'content_hash': 'e0249668c295c19c90b2a3777bcb6ddf', 'timestamp': '', 'source': 'github', 'line_count': 54, 'max_line_length': 207, 'avg_line_length': 41.166666666666664, 'alnum_prop': 0.692757534862798, 'repo_name': 'networknt/light-java-example', 'id': 'fa2588fb819283a1279e39d5491738fedddc5dc6', 'size': '2223', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'eventuate/account-management/account-view-service/src/test/java/com/networknt/eventuate/account/view/handler/HealthGetHandlerTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '1251'}, {'name': 'Java', 'bytes': '562730'}, {'name': 'JavaScript', 'bytes': '20118'}, {'name': 'PLSQL', 'bytes': '1936'}]}
package com.s4game.server.io; /** * @Author [email protected] * @sine 2015年5月5日 下午9:56:13 * */ public class IoConstants { public static final String ROLE_KEY = "role_key"; public static final String IP_KEY = "ip_key"; public static final String SESSION_KEY = "session_key"; }
{'content_hash': '9d5e0fde805614002c565f6033dd76db', 'timestamp': '', 'source': 'github', 'line_count': 16, 'max_line_length': 56, 'avg_line_length': 18.75, 'alnum_prop': 0.68, 'repo_name': 'zuesgooogle/HappyCard', 'id': 'e31212fd2a6a63f032dab541896d239d6828e3f3', 'size': '310', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'card-server/src/main/java/com/s4game/server/io/IoConstants.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '976104'}]}
RubbishRelease::RubbishRelease(SSDB *ssdb){ this->ssdb = ssdb; this->thread_quit = false; this->list_name = RUBBISH_LIST_KEY; this->queue_first_version = 0; this->start(); } RubbishRelease::~RubbishRelease(){ Locking l(&this->mutex); this->stop(); ssdb = NULL; } void RubbishRelease::start(){ thread_quit = false; pthread_t tid; int err = pthread_create(&tid, NULL, &RubbishRelease::thread_func, this); if(err != 0){ log_fatal("can't create clear rubbishrelese thread: %s", strerror(err)); exit(0); } } void RubbishRelease::stop(){ thread_quit = true; for(int i=0; i<100; i++){ if(!thread_quit){ break; } usleep(10 * 1000); } } int RubbishRelease::push_clear_queue(TMH &metainfo, const Bytes &name){ std::string s_ver = str(metainfo.version); std::string s_key = encode_release_key(metainfo.datatype, name); //尝试将那么name加入垃圾收集队列中 int ret = this->ssdb->hset_rubbish_queue(this->list_name, s_key, s_ver); //log_debug("push_clear_queue key:%s, hset_rubbish_queue ret:%d", name.data(), ret); if(ret < 0){ return -1; } //成功就删除meta信息 std::string metalkey = EncodeMetaKey(name); ssdb->getBinlog()->Delete(metalkey); static_cast<SSDBImpl *>(ssdb)->expiration->del_ttl(name); //是否发送同步信息,函数外配置TODO:slot不准 //ssdb->calculateSlotRefer(Slots::encode_slot_id(name), -1); if(metainfo.version < queue_first_version){ queue_first_version = metainfo.version; } return 1; } int RubbishRelease::push_clear_queue(const Bytes &name, const char log_type, const char cmd_type, bool clearttl){ Transaction trans(ssdb->getBinlog()); //找出name的meta信息 TMH metainfo = {0}; //ignore ttl,del_ttl will called this function if (ssdb->loadobjectbyname(&metainfo, name, 0, false) <= 0){ return 0; } std::string s_ver = str(metainfo.version); std::string s_key = encode_release_key(metainfo.datatype, name); //尝试将那么name加入垃圾收集队列中 int ret = this->ssdb->hset_rubbish_queue(this->list_name, s_key, s_ver); //log_debug("push_clear_queue key:%s, hset_rubbish_queue ret:%d", name.data(), ret); if(ret < 0){ return -1; } //成功就删除meta信息 std::string metalkey = EncodeMetaKey(name); ssdb->getBinlog()->Delete(metalkey); if (clearttl){ static_cast<SSDBImpl *>(ssdb)->expiration->del_ttl(name); } //是否发送同步信息,函数外配置 ssdb->calculateSlotRefer(Slots::encode_slot_id(name), -1); ssdb->getBinlog()->add_log(log_type, cmd_type, metalkey); leveldb::Status s = ssdb->getBinlog()->commit(); if(!s.ok()){ return 0; }else if(!s.ok()){ return -1; } if(metainfo.version < queue_first_version){ queue_first_version = metainfo.version; } // //不为空才进入,否则还会操作一次,在load_expiration_keys_from_db中 // if(!fast_queues.empty() && fast_queues.size() < BATCH_SIZE){ // //因为是队列.不需要pop最后一个判断,后进入的肯定版本高 // fast_queues.add(s_key, metainfo.version); // } return 1; } void RubbishRelease::load_expiration_keys_from_db(int num){ Iterator *it = nullptr; int ret = ssdb->hscan(&it, this->list_name, "", "\xff", num); int n = 0; if (ret > 0){ while(it->next()){ n ++; const std::string &key = it->key(); int64_t version = str_to_int64(it->value()); fast_queues.add(key, version); char type = 0; std::string name; decode_release_key(key, &type, &name); log_debug("add clear queue:%s:%c", name.c_str(), type); } delete it; } log_debug("load %d keys into clear queue", n); } void RubbishRelease::expire_loop(){ //Locking l(&this->mutex); if(!this->ssdb){ return; } if(this->fast_queues.empty()){ this->load_expiration_keys_from_db(BATCH_SIZE); if(this->fast_queues.empty()){ this->queue_first_version = INT64_MAX; return; } } int64_t version; std::string key; if(this->fast_queues.front(&key, &version)){ log_debug("clear name: %s, version: %llu", hexmem(key.c_str(), key.size()).data(), version); if (lazy_clear(key, version) > 0){ log_debug("continue clear key:%s,%llu", key.c_str(), version); }else{ fast_queues.pop_front(); this->ssdb->hdel(this->list_name, key, BinlogType::NONE); } } } void* RubbishRelease::thread_func(void *arg){ RubbishRelease *handler = (RubbishRelease *)arg; while(!handler->thread_quit){ usleep(10000); if(handler->queue_first_version > time_us()){ continue; } handler->expire_loop(); } log_debug("rubbishrelease thread quit"); handler->thread_quit = false; return (void *)NULL; } int RubbishRelease::lazy_clear(const Bytes &raw_key, int64_t version) { char type; std::string name; if (decode_release_key(raw_key, &type, &name)){ return -1; } std::string key_start = encode_data_key_start(type, name, version); std::string key_end = encode_data_key_end(type, name, version); Iterator *it = IteratorFactory::iterator(this->ssdb, dataType2IterType2(type), name, version, key_start, key_end, 500); int num = 0; leveldb::WriteBatch batch; while(it->next()){ //log_debug("-----------del:%s, %llu, value:%s", it->key().c_str(), it->seq(), it->value().c_str()); switch(type){ case DataType::ZSIZE:{ batch.Delete(EncodeSortSetScoreKey(name, it->key(), it->score(), version)); batch.Delete(EncodeSortSetKey(name, it->key(), version)); break; } case DataType::HSIZE:{ batch.Delete(EncodeHashKey(name, it->key(), version)); break; } case DataType::LSIZE:{ batch.Delete(EncodeListKey(name, it->seq(), version)); break; } case DataType::TABLE:{ batch.Delete(it->key()); //log_debug("clear version: %lld, key: %s", it->version(), hexmem(it->key().c_str(), it->key().size()).data()); break; } } num++; } delete it; leveldb::Status s = ssdb->getlDb()->Write(leveldb::WriteOptions(), &batch); if(!s.ok()){ log_error("clear_rubbish_queue error:%s", s.ToString().data()); return -1; } //清除数据应该CompactRange一次,但是如果CompactRange时间超过100毫秒就应该报警,并且可配停止CompactRange动作。 int64_t ts = time_us(); leveldb::Slice slice_s(key_start); leveldb::Slice slice_e(key_end); ssdb->getlDb()->CompactRange(&slice_s, &slice_e); int64_t te = time_us(); if ( te-ts > 100000 ) { log_info("rubbish compactRange time to long :%s -> %lld", key_start.data(), te - ts); } return num; } std::string RubbishRelease::encode_data_key_start(const char type, const Bytes &name, int64_t version){ std::string key_s; switch(type){ case DataType::ZSIZE:{ key_s = EncodeSortSetScoreKey(name, "", SSDB_SCORE_MIN, version); break; } case DataType::LSIZE:{ key_s = EncodeListKey(name, "", version); break; } case DataType::HSIZE:{ key_s = EncodeHashKey(name, "", version); break; } } return key_s; } std::string RubbishRelease::encode_data_key_end(const char type, const Bytes &name, int64_t version){ std::string key_e; switch(type){ case DataType::ZSIZE:{ key_e = EncodeSortSetScoreKey(name, "\xff", SSDB_SCORE_MAX, version); break; } case DataType::LSIZE:{ key_e = EncodeListKey(name, "\xff", version); break; } case DataType::HSIZE:{ key_e = EncodeHashKey(name, "\xff", version); break; } } return key_e; }
{'content_hash': '5125c0c945c527fb907c23e0952565b6', 'timestamp': '', 'source': 'github', 'line_count': 271, 'max_line_length': 124, 'avg_line_length': 26.800738007380073, 'alnum_prop': 0.6288035247143053, 'repo_name': 'carryLabs/carrydb', 'id': 'c76cc73a55b62edc8280c30ee4ff0468e9d8273a', 'size': '7695', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/db/rubbish_release.cpp', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '12538'}, {'name': 'C++', 'bytes': '575941'}, {'name': 'COBOL', 'bytes': '27584'}, {'name': 'Makefile', 'bytes': '6950'}, {'name': 'PHP', 'bytes': '36293'}, {'name': 'Python', 'bytes': '280578'}, {'name': 'Shell', 'bytes': '4898'}]}
""" Test Manager / Suite Self Test #4 - Testing result overflow handling. """ __copyright__ = \ """ Copyright (C) 2010-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation, in version 2 as it comes in the "COPYING" file of the VirtualBox OSE distribution. VirtualBox OSE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. The contents of this file may alternatively be used under the terms of the Common Development and Distribution License Version 1.0 (CDDL) only, as it comes in the "COPYING.CDDL" file of the VirtualBox OSE distribution, in which case the provisions of the CDDL are applicable instead of those of the GPL. You may elect to license modified versions of this file under the terms and conditions of either the GPL or the CDDL or both. """ __version__ = "$Revision: 100880 $" # Standard Python imports. import os; import sys; # Only the main script needs to modify the path. try: __file__ except: __file__ = sys.argv[0]; g_ksValidationKitDir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))); sys.path.append(g_ksValidationKitDir); # Validation Kit imports. from testdriver import reporter; from testdriver.base import TestDriverBase, InvalidOption; class tdSelfTest4(TestDriverBase): """ Test Manager / Suite Self Test #4 - Testing result overflow handling. """ ## Valid tests. kasValidTests = [ 'immediate-sub-tests', 'total-sub-tests', 'immediate-values', 'total-values', 'immediate-messages']; def __init__(self): TestDriverBase.__init__(self); self.sOptWhich = 'immediate-sub-tests'; def parseOption(self, asArgs, iArg): if asArgs[iArg] == '--test': iArg = self.requireMoreArgs(1, asArgs, iArg); if asArgs[iArg] not in self.kasValidTests: raise InvalidOption('Invalid test name "%s". Must be one of: %s' % (asArgs[iArg], ', '.join(self.kasValidTests),)); self.sOptWhich = asArgs[iArg]; else: return TestDriverBase.parseOption(self, asArgs, iArg); return iArg + 1; def actionExecute(self): # Too many immediate sub-tests. if self.sOptWhich == 'immediate-sub-tests': reporter.testStart('Too many immediate sub-tests (negative)'); for i in range(1024): reporter.testStart('subsub%d' % i); reporter.testDone(); # Too many sub-tests in total. elif self.sOptWhich == 'total-sub-tests': reporter.testStart('Too many sub-tests (negative)'); # 32 * 256 = 2^(5+8) = 2^13 = 8192. for i in range(32): reporter.testStart('subsub%d' % i); for j in range(256): reporter.testStart('subsubsub%d' % j); reporter.testDone(); reporter.testDone(); # Too many immediate values. elif self.sOptWhich == 'immediate-values': reporter.testStart('Too many immediate values (negative)'); for i in range(512): reporter.testValue('value%d' % i, i, 'times'); # Too many values in total. elif self.sOptWhich == 'total-values': reporter.testStart('Too many sub-tests (negative)'); for i in range(256): reporter.testStart('subsub%d' % i); for j in range(64): reporter.testValue('value%d' % j, i * 10000 + j, 'times'); reporter.testDone(); # Too many failure reasons (only immediate since the limit is extremely low). elif self.sOptWhich == 'immediate-messages': reporter.testStart('Too many immediate messages (negative)'); for i in range(16): reporter.testFailure('Detail %d' % i); else: reporter.testStart('Unknown test %s' % (self.sOptWhich,)); reporter.error('Invalid test selected: %s' % (self.sOptWhich,)); reporter.testDone(); return True; if __name__ == '__main__': sys.exit(tdSelfTest4().main(sys.argv));
{'content_hash': '4e88c40e4ff25fa2e63c48472477c424', 'timestamp': '', 'source': 'github', 'line_count': 111, 'max_line_length': 122, 'avg_line_length': 39.630630630630634, 'alnum_prop': 0.6203682655148898, 'repo_name': 'egraba/vbox_openbsd', 'id': '3eccb9e73b5b7086e48ede6a0d1973d65acac46d', 'size': '4470', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'VirtualBox-5.0.0/src/VBox/ValidationKit/tests/selftests/tdSelfTest4.py', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'Ada', 'bytes': '88714'}, {'name': 'Assembly', 'bytes': '4303680'}, {'name': 'AutoIt', 'bytes': '2187'}, {'name': 'Batchfile', 'bytes': '95534'}, {'name': 'C', 'bytes': '192632221'}, {'name': 'C#', 'bytes': '64255'}, {'name': 'C++', 'bytes': '83842667'}, {'name': 'CLIPS', 'bytes': '5291'}, {'name': 'CMake', 'bytes': '6041'}, {'name': 'CSS', 'bytes': '26756'}, {'name': 'D', 'bytes': '41844'}, {'name': 'DIGITAL Command Language', 'bytes': '56579'}, {'name': 'DTrace', 'bytes': '1466646'}, {'name': 'GAP', 'bytes': '350327'}, {'name': 'Groff', 'bytes': '298540'}, {'name': 'HTML', 'bytes': '467691'}, {'name': 'IDL', 'bytes': '106734'}, {'name': 'Java', 'bytes': '261605'}, {'name': 'JavaScript', 'bytes': '80927'}, {'name': 'Lex', 'bytes': '25122'}, {'name': 'Logos', 'bytes': '4941'}, {'name': 'Makefile', 'bytes': '426902'}, {'name': 'Module Management System', 'bytes': '2707'}, {'name': 'NSIS', 'bytes': '177212'}, {'name': 'Objective-C', 'bytes': '5619792'}, {'name': 'Objective-C++', 'bytes': '81554'}, {'name': 'PHP', 'bytes': '58585'}, {'name': 'Pascal', 'bytes': '69941'}, {'name': 'Perl', 'bytes': '240063'}, {'name': 'PowerShell', 'bytes': '10664'}, {'name': 'Python', 'bytes': '9094160'}, {'name': 'QMake', 'bytes': '3055'}, {'name': 'R', 'bytes': '21094'}, {'name': 'SAS', 'bytes': '1847'}, {'name': 'Shell', 'bytes': '1460572'}, {'name': 'SourcePawn', 'bytes': '4139'}, {'name': 'TypeScript', 'bytes': '142342'}, {'name': 'Visual Basic', 'bytes': '7161'}, {'name': 'XSLT', 'bytes': '1034475'}, {'name': 'Yacc', 'bytes': '22312'}]}
pjlong-home =========== My Home Site
{'content_hash': 'ee9abe7ac1feb97e37c6114faa37d305', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 12, 'avg_line_length': 9.5, 'alnum_prop': 0.5263157894736842, 'repo_name': 'pjlong/pjlong-home', 'id': '28424dc1ac6d152367491ecc72ed0f65442e6abf', 'size': '38', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'README.md', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '17477'}, {'name': 'HTML', 'bytes': '11675'}, {'name': 'JavaScript', 'bytes': '8921'}, {'name': 'Python', 'bytes': '5855'}, {'name': 'Shell', 'bytes': '103'}]}
<!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_102) on Wed Nov 02 19:52:52 IST 2016 --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Uses of Class org.apache.solr.client.solrj.io.stream.TopicStream (Solr 6.3.0 API)</title> <meta name="date" content="2016-11-02"> <link rel="stylesheet" type="text/css" href="../../../../../../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../../../../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="Uses of Class org.apache.solr.client.solrj.io.stream.TopicStream (Solr 6.3.0 API)"; } } catch(err) { } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/TopicStream.html" title="class in org.apache.solr.client.solrj.io.stream">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/apache/solr/client/solrj/io/stream/class-use/TopicStream.html" target="_top">Frames</a></li> <li><a href="TopicStream.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> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="header"> <h2 title="Uses of Class org.apache.solr.client.solrj.io.stream.TopicStream" class="title">Uses of Class<br>org.apache.solr.client.solrj.io.stream.TopicStream</h2> </div> <div class="classUseContainer">No usage of org.apache.solr.client.solrj.io.stream.TopicStream</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../../../../overview-summary.html">Overview</a></li> <li><a href="../package-summary.html">Package</a></li> <li><a href="../../../../../../../../org/apache/solr/client/solrj/io/stream/TopicStream.html" title="class in org.apache.solr.client.solrj.io.stream">Class</a></li> <li class="navBarCell1Rev">Use</li> <li><a href="../package-tree.html">Tree</a></li> <li><a href="../../../../../../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../../../../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li>Prev</li> <li>Next</li> </ul> <ul class="navList"> <li><a href="../../../../../../../../index.html?org/apache/solr/client/solrj/io/stream/class-use/TopicStream.html" target="_top">Frames</a></li> <li><a href="TopicStream.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> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small> <i>Copyright &copy; 2000-2016 Apache Software Foundation. All Rights Reserved.</i> <script src='../../../../../../../../prettify.js' type='text/javascript'></script> <script type='text/javascript'> (function(){ var oldonload = window.onload; if (typeof oldonload != 'function') { window.onload = prettyPrint; } else { window.onload = function() { oldonload(); prettyPrint(); } } })(); </script> </small></p> </body> </html>
{'content_hash': '4b4856dea8d67f9e39716e6f507bdd5c', 'timestamp': '', 'source': 'github', 'line_count': 140, 'max_line_length': 164, 'avg_line_length': 37.65, 'alnum_prop': 0.583760197306014, 'repo_name': 'johannesbraun/clm_autocomplete', 'id': '438536c289b8e661600b62baa023f8e4773d15bc', 'size': '5271', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/solr-solrj/org/apache/solr/client/solrj/io/stream/class-use/TopicStream.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'AMPL', 'bytes': '291'}, {'name': 'Batchfile', 'bytes': '63061'}, {'name': 'CSS', 'bytes': '238996'}, {'name': 'HTML', 'bytes': '230318'}, {'name': 'JavaScript', 'bytes': '1224188'}, {'name': 'Jupyter Notebook', 'bytes': '638688'}, {'name': 'Python', 'bytes': '3829'}, {'name': 'Roff', 'bytes': '34741083'}, {'name': 'Shell', 'bytes': '96828'}, {'name': 'XSLT', 'bytes': '124838'}]}
package ie.kieranhogan.dayvinrosssoundboard; import android.media.MediaPlayer; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import java.io.IOException; import java.util.ArrayList; public class MainActivity extends AppCompatActivity { MediaPlayer a_theme, b_roundbrush, c_time, d_welcome, e_bother, f_brush, g_nomistakes, h_colours, i_noise1, j_whack; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); MediaPlayer intro = MediaPlayer.create(getApplicationContext(), R.raw.b_roundbrush); intro.start(); a_theme = MediaPlayer.create(this, R.raw.a_theme); b_roundbrush = MediaPlayer.create(this, R.raw.b_roundbrush); c_time = MediaPlayer.create(this, R.raw.c_time); d_welcome = MediaPlayer.create(this, R.raw.d_welcome); e_bother = MediaPlayer.create(this, R.raw.e_bother); f_brush = MediaPlayer.create(this, R.raw.f_brush); g_nomistakes = MediaPlayer.create(this, R.raw.g_nomistakes); h_colours = MediaPlayer.create(this, R.raw.h_colours); i_noise1 = MediaPlayer.create(this, R.raw.i_noise1); j_whack = MediaPlayer.create(this, R.raw.j_whack); } public void a_theme(View view) { if (a_theme.isPlaying()){ a_theme.seekTo(0); } else { a_theme.start(); } } public void b_roundbrush(View view) { if (b_roundbrush.isPlaying()){ b_roundbrush.seekTo(0); } else { b_roundbrush.start(); } } public void c_time(View view) { if (c_time.isPlaying()){ c_time.seekTo(0); } else { c_time.start(); } } public void d_welcome(View view) { if (d_welcome.isPlaying()){ d_welcome.seekTo(0); } else { d_welcome.start(); } } public void e_bother(View view) { if (e_bother.isPlaying()){ e_bother.seekTo(0); } else { e_bother.start(); } } public void f_brush(View view) { if (f_brush.isPlaying()){ f_brush.seekTo(0); } else { f_brush.start(); } } public void g_nomistakes(View view) { if (g_nomistakes.isPlaying()){ g_nomistakes.seekTo(0); } else { g_nomistakes.start(); } } public void h_colours(View view) { if (h_colours.isPlaying()){ h_colours.seekTo(0); } else { h_colours.start(); } } public void i_noise1(View view) { if (i_noise1.isPlaying()){ i_noise1.seekTo(0); } else { i_noise1.start(); } } public void j_whack(View view) { if (j_whack.isPlaying()){ j_whack.seekTo(0); } else { j_whack.start(); } } }
{'content_hash': 'e1bc56a404d6acf6d9445575f5902bdf', 'timestamp': '', 'source': 'github', 'line_count': 109, 'max_line_length': 92, 'avg_line_length': 27.91743119266055, 'alnum_prop': 0.5514295103516267, 'repo_name': 'kieranhogan13/Java', 'id': '291dc3353382775d1a389d71c5907d17ed2edeb5', 'size': '3043', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Android Development/DayvinRossSoundboard/app/src/main/java/ie/kieranhogan/dayvinrosssoundboard/MainActivity.java', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Batchfile', 'bytes': '799'}, {'name': 'CSS', 'bytes': '23981'}, {'name': 'HTML', 'bytes': '265575'}, {'name': 'Java', 'bytes': '328051'}, {'name': 'JavaScript', 'bytes': '827'}]}
classdef (Sealed) HebiJoystick < handle % HebiJoystick creates a joystick object % % HebiJoystick is an alternative to MATLAB's built-in 'vrjoystick' % for users who don't have access to the Simulink 3D Modelling % Toolbox. The API is identical to 'vrjoystick' and can serve mostly % as a drop-in replacement. % % Note that the ordering of axes and buttons may be different on % various operating systems, and that it may also be different from % vrjoystick. % % HebiJoystick Methods: % % loadLibs - loads the required Java library % % read - reads the status of axes, buttons, and POVs % axis - reads the status of selected axes % button - reads the status of selected buttons % pov - reads the status of selected POV (point of view) % caps - returns a structure of joystick capabilities % close - closes and invalidates the joystick object % force - applies force feedback to selected axes % % Example: % % Connect to the first joystick and read its state % joy = HebiJoystick(1); % [axes, buttons, povs] = read(joy); % % See also vrjoystick, loadLibs, read % Copyright (c) 2016-2017 HEBI Robotics properties (SetAccess = private) Name Axes Buttons POVs Forces end properties (Access = private) joy end methods (Static, Access = public) function loadLibs() % Loads the backing Java files and native binaries. This % method assumes that the jar file is located in the same % directory as this class-script, and that the file name % matches the string below. jarFileName = 'matlab-input-1.2.jar'; % Load only once if ~exist('us.hebi.matlab.input.HebiJoystick', 'class') localDir = fileparts(mfilename('fullpath')); % Add binary libs java.lang.System.setProperty(... 'net.java.games.input.librarypath', ... fullfile(localDir, 'lib')); % Add Java library javaaddpath(fullfile(localDir, jarFileName)); end end end methods (Access = public) function this = HebiJoystick(index, ~) % creates a joystick object if nargin < 2 % be compatible with the original API end % Create backing Java object HebiJoystick.loadLibs(); this.joy = us.hebi.matlab.input.HebiJoystick(index); if ~ismac() % Increase event queue to not have to poll as often. % Doesn't work on mac. this.joy.setEventQueueSize(200); end % Set properties caps = this.caps(); this.Name = this.joy.getName(); this.Axes = caps.Axes; this.Buttons = caps.Buttons; this.POVs = caps.POVs; this.Forces = caps.Forces; end function varargout = read(this) % reads the status of axes, buttons, and POVs % % Example % joy = HebiJoystick(1); % [axes, buttons, povs] = read(joy); varargout = read(this.joy); end function axes = axis(this, mask) % reads the status of selected axes [axes, ~, ~] = read(this); if nargin > 1 axes = axes(mask); end end function buttons = button(this, mask) % reads the status of selected buttons [~, buttons, ~] = read(this); if nargin > 1 buttons = buttons(mask); end end function povs = pov(this, mask) % reads the status of selected POV (point of view) [~, ~, povs] = read(this); if nargin > 1 povs = povs(mask); end end function out = caps(this) % returns a structure of joystick capabilities out = struct(caps(this.joy)); end function [] = close(this) % closes and invalidates the joystick object close(this.joy); end function [] = force(this, indices, value) % applies force feedback to selected axes force(this.joy, indices, value); end end % Hide inherited methods (handle) from auto-complete % and docs methods(Access = public, Hidden = true) function [] = delete(this) % destructor disposes this instance close(this); end function varargout = addlistener(varargin) varargout{:} = addlistener@handle(varargin{:}); end function varargout = eq(varargin) varargout{:} = eq@handle(varargin{:}); end function varargout = findobj(varargin) varargout{:} = findobj@handle(varargin{:}); end function varargout = findprop(varargin) varargout{:} = findprop@handle(varargin{:}); end function varargout = ge(varargin) varargout{:} = ge@handle(varargin{:}); end function varargout = gt(varargin) varargout{:} = gt@handle(varargin{:}); end function varargout = le(varargin) varargout{:} = le@handle(varargin{:}); end function varargout = lt(varargin) varargout{:} = lt@handle(varargin{:}); end function varargout = ne(varargin) varargout{:} = ne@handle(varargin{:}); end function varargout = notify(varargin) varargout{:} = notify@handle(varargin{:}); end end end
{'content_hash': 'c632228e1f2e0faed5429d1c03f35bc6', 'timestamp': '', 'source': 'github', 'line_count': 190, 'max_line_length': 74, 'avg_line_length': 32.526315789473685, 'alnum_prop': 0.5158576051779935, 'repo_name': 'HebiRobotics/hebi-matlab-examples', 'id': '71cdccd605875a66ab7d8e55b19e9b603cee5d1a', 'size': '6180', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'kits/igor/tools/input/HebiJoystick.m', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '126'}, {'name': 'MATLAB', 'bytes': '665332'}, {'name': 'Shell', 'bytes': '1677'}]}
#import "ThoMoNetworkStub.h" #import <arpa/inet.h> #import "ThoMoTCPConnection.h" #import <pthread.h> NSString *const kThoMoNetworkInfoKeyUserMessage = @"kThoMoNetworkInfoKeyUserMessage"; NSString *const kThoMoNetworkInfoKeyData = @"kThoMoNetworkInfoKeyData"; NSString *const kThoMoNetworkInfoKeyRemoteConnectionIdString = @"kThoMoNetworkInfoKeyRemoteConnectionIdString"; NSString *const kThoMoNetworkInfoKeyLocalNetworkStub = @"kThoMoNetworkInfoKeyLocalNetworkStub"; NSString *const kThoMoNetworkPrefScopeSpecifierKey = @"kThoMoNetworkPrefScopeSpecifierKey"; // interface category for main thread relay methods @interface ThoMoNetworkStub (RelayMethods) -(void)networkStubDidShutDownRelayMethod; -(void)netServiceProblemRelayMethod:(NSDictionary *)infoDict; -(void)didReceiveDataRelayMethod:(NSDictionary *)infoDict; -(void)connectionEstablishedRelayMethod:(NSDictionary *)infoDict; -(void)connectionLostRelayMethod:(NSDictionary *)infoDict; -(void)connectionClosedRelayMethod:(NSDictionary *)infoDict; @end @interface ThoMoNetworkStub () -(void)sendDataWithInfoDict:(NSDictionary *)theInfoDict; @end // ===================================================================================================================== #pragma mark - #pragma mark Public Methods // --------------------------------------------------------------------------------------------------------------------- @implementation ThoMoNetworkStub #pragma mark Housekeeping -(id)initWithProtocolIdentifier:(NSString *)theProtocolIdentifier; { self = [super init]; if (self != nil) { // check if there is a scope specifier present in the user defaults and add it to the protocolId NSString *scopeSpecifier = [[NSUserDefaults standardUserDefaults] stringForKey:kThoMoNetworkPrefScopeSpecifierKey]; if (scopeSpecifier) { protocolIdentifier = [scopeSpecifier stringByAppendingFormat:@"-%@", theProtocolIdentifier]; NSLog(@"Warning: ThoMo Networking Protocol Prefix in effect! If your app cannot connect to its counterpart that may be the reason."); } else { protocolIdentifier = [theProtocolIdentifier copy]; } if ([protocolIdentifier length] > 14) { // clean up internally [NSException raise:@"ThoMoInvalidArgumentException" format:@"The protocol identifier plus the optional scoping prefix (\"%@\") exceed" " Bonjour's maximum allowed length of fourteen characters!", protocolIdentifier]; } connections = [[NSMutableDictionary alloc] init]; } return self; } -(id)init; { return [self initWithProtocolIdentifier:@"thoMoNetworkStubDefaultIdentifier"]; } // these methods are called on the main thread #pragma mark Control -(void) start; { if ([networkThread isExecuting]) { [NSException raise:@"ThoMoStubAlreadyRunningException" format:@"The client stub had already been started before and cannot be started twice."]; } // TODO: check if we cannot run a start-stop-start cycle NSAssert(networkThread == nil, @"Network thread not released properly"); networkThread = [[NSThread alloc] initWithTarget:self selector:@selector(networkThreadEntry) object:nil]; [networkThread start]; } -(void) stop; { [networkThread cancel]; // TODO: check if we can release the networkthread here } -(NSArray *)activeConnections; { NSArray *result; @synchronized(self) { result = [[connections allKeys] copy]; } return result; } -(void)send:(id<NSCoding>)theData toConnection:(NSString *)theConnectionIdString; { NSData *sendData = [NSKeyedArchiver archivedDataWithRootObject:theData]; [self sendByteData:sendData toConnection:theConnectionIdString]; } -(void)sendByteData:(NSData *)sendData toConnection:(NSString *)theConnectionIdString; { NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys: sendData, @"DATA", theConnectionIdString, @"ID", nil]; [self performSelector:@selector(sendDataWithInfoDict:) onThread:networkThread withObject:infoDict waitUntilDone:NO]; } #pragma mark Send Data Relay // only call on network thread -(void)sendDataWithInfoDict:(NSDictionary *)theInfoDict; { NSData *sendData = [theInfoDict objectForKey:@"DATA"]; NSString *theConnectionIdString = [theInfoDict objectForKey:@"ID"]; ThoMoTCPConnection *connection = nil; @synchronized(self) { connection = [connections valueForKey:theConnectionIdString]; } if (!connection) { [NSException raise:@"ThoMoInvalidArgumentException" format:@"No connection found for id %@", theConnectionIdString]; } else { [connection enqueueNextSendObject:sendData]; } } #pragma mark Threading Methods -(void)networkThreadEntry { #ifndef NDEBUG #ifdef THOMO_PTHREAD_NAMING_AVAILABLE pthread_setname_np("ThoMoNetworking Dispatch Thread"); #endif #endif @autoreleasepool { if([self setup]) { while (![networkThread isCancelled]) { NSDate *inOneSecond = [[NSDate alloc] initWithTimeIntervalSinceNow:1]; // catch exceptions and propagate to main thread @try { [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:inOneSecond]; } @catch (NSException * e) { [e performSelectorOnMainThread:@selector(raise) withObject:nil waitUntilDone:YES]; } } [self teardown]; } [self performSelectorOnMainThread:@selector(networkStubDidShutDownRelayMethod) withObject:nil waitUntilDone:NO]; } } #pragma mark - #pragma mark Connection Delegate Methods /// Delegate method that gets called from ThoMoTCPConnections whenever they did receive data. /** Takes the received data and relays it to a method on the main thread. This method is typically overridden in the subclasses of ThoMoNetworkStub and then directly called from there. \param[in] theData reference to the received data \param[in] theConnection reference to the connection that received the data */ -(void)didReceiveData:(NSData *)theData onConnection:(ThoMoTCPConnection *)theConnection; { // look up the connection NSString *connectionKey = [self keyForConnection:theConnection]; // unarchive the data id receivedData = [NSKeyedUnarchiver unarchiveObjectWithData:theData]; // package the parameters into an info dict and relay them to the main thread NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys: connectionKey, kThoMoNetworkInfoKeyRemoteConnectionIdString, self, kThoMoNetworkInfoKeyLocalNetworkStub, receivedData, kThoMoNetworkInfoKeyData, nil]; [self performSelectorOnMainThread:@selector(didReceiveDataRelayMethod:) withObject:infoDict waitUntilDone:NO]; } -(void)streamsDidOpenOnConnection:(ThoMoTCPConnection *)theConnection; { // look up the connection NSString *connectionKey = [self keyForConnection:theConnection]; // package the parameters into an info dict and relay them to the main thread NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys: self, kThoMoNetworkInfoKeyLocalNetworkStub, connectionKey, kThoMoNetworkInfoKeyRemoteConnectionIdString, nil]; [self performSelectorOnMainThread:@selector(connectionEstablishedRelayMethod:) withObject:infoDict waitUntilDone:NO]; } -(void)streamEndEncountered:(NSStream *)theStream onConnection:(ThoMoTCPConnection *)theConnection; { NSString *connectionKey = [self keyForConnection:theConnection]; NSString *userMessage = [NSString stringWithFormat:@"Stream end event encountered on stream to %@! Closing connection.", connectionKey]; [theConnection close]; @synchronized(self) { [connections removeObjectForKey:connectionKey]; } NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys: self, kThoMoNetworkInfoKeyLocalNetworkStub, connectionKey, kThoMoNetworkInfoKeyRemoteConnectionIdString, userMessage, kThoMoNetworkInfoKeyUserMessage, nil]; [self performSelectorOnMainThread:@selector(connectionClosedRelayMethod:) withObject:infoDict waitUntilDone:NO]; } -(void)streamErrorEncountered:(NSStream *)theStream onConnection:(ThoMoTCPConnection *)theConnection; { NSString *connectionKey = [self keyForConnection:theConnection]; NSError *theError = [theStream streamError]; NSString *userMessage = [NSString stringWithFormat:@"Error %li: \"%@\" on stream to %@! Terminating connection.", (long)[theError code], [theError localizedDescription], connectionKey]; [theConnection close]; @synchronized(self) { [connections removeObjectForKey:connectionKey]; } NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys: self, kThoMoNetworkInfoKeyLocalNetworkStub, connectionKey, kThoMoNetworkInfoKeyRemoteConnectionIdString, userMessage, kThoMoNetworkInfoKeyUserMessage, nil]; [self performSelectorOnMainThread:@selector(connectionLostRelayMethod:) withObject:infoDict waitUntilDone:NO]; } // ===================================================================================================================== #pragma mark - #pragma mark Protected Methods // --------------------------------------------------------------------------------------------------------------------- -(BOOL)setup { return YES; } -(void)teardown { // close all open connections @synchronized(self) { for (ThoMoTCPConnection *connection in [connections allValues]) { [connection close]; } [connections removeAllObjects]; } } -(NSString *)keyStringFromAddress:(NSData *)addr; { // get the peer socket address from the NSData object // NOTE: there actually is a struct sockaddr in there, NOT a struct sockaddr_in! // I heard from beej (<http://www.retran.com/beej/sockaddr_inman.html>) that they share the same 15 first bytes so casting should not be a problem. // You've been warned, though... struct sockaddr_in *peerSocketAddress = (struct sockaddr_in *)[addr bytes]; // convert in_addr to ascii (note: returns a pointer to a statically allocated buffer inside inet_ntoa! calling again will overwrite) char *humanReadableAddress = inet_ntoa(peerSocketAddress->sin_addr); NSString *peerAddress = [NSString stringWithCString:humanReadableAddress encoding:NSUTF8StringEncoding]; NSString *peerPort = [NSString stringWithFormat:@"%d", ntohs(peerSocketAddress->sin_port)]; NSString *peerKey = [NSString stringWithFormat:@"%@:%@", peerAddress, peerPort]; return peerKey; } -(NSString *)keyForConnection:(ThoMoTCPConnection *)theConnection; { NSString *connectionKey; NSArray *keys; @synchronized(self) { keys = [connections allKeysForObject:theConnection]; NSAssert([keys count] == 1, @"More than one connection record in dict for a single connection."); connectionKey = [[keys objectAtIndex:0] copy]; } return connectionKey; } -(void) openNewConnection:(NSString *)theConnectionKey inputStream:(NSInputStream *)istr outputStream:(NSOutputStream *)ostr; { // create a new ThoMoTCPConnection object and set ourselves as the delegate to forward the incoming data to our own delegate ThoMoTCPConnection *newConnection = [[ThoMoTCPConnection alloc] initWithDelegate:self inputStream:istr outputStream:ostr]; // store in our dictionary, open, and release our copy @synchronized(self) { // it should never happen that we overwrite a connection NSAssert(![connections valueForKey:theConnectionKey], @"ERROR: Tried to create a connection with an IP and port that we already have a connection for."); [connections setValue:newConnection forKey:theConnectionKey]; } [newConnection open]; } @end #pragma mark - #pragma mark Main Thread Relay Methods @implementation ThoMoNetworkStub (RelayMethods) -(void)networkStubDidShutDownRelayMethod { NSLog(@"%@ :: %@", [self description], NSStringFromSelector(_cmd)); } -(void)netServiceProblemRelayMethod:(NSDictionary *)infoDict { NSLog(@"%@ :: %@", [self description], NSStringFromSelector(_cmd)); } -(void)didReceiveDataRelayMethod:(NSDictionary *)infoDict; { NSLog(@"%@ :: %@", [self description], NSStringFromSelector(_cmd)); } -(void)connectionEstablishedRelayMethod:(NSDictionary *)infoDict; { NSLog(@"%@ :: %@", [self description], NSStringFromSelector(_cmd)); } -(void)connectionLostRelayMethod:(NSDictionary *)infoDict; { NSLog(@"%@ :: %@", [self description], NSStringFromSelector(_cmd)); } -(void)connectionClosedRelayMethod:(NSDictionary *)infoDict; { NSLog(@"%@ :: %@", [self description], NSStringFromSelector(_cmd)); } #pragma mark - #pragma mark Debugging @end
{'content_hash': 'bc4e762d833ebf42e367c0a37f77f3b7', 'timestamp': '', 'source': 'github', 'line_count': 399, 'max_line_length': 186, 'avg_line_length': 31.340852130325814, 'alnum_prop': 0.7266693322670932, 'repo_name': 'i10/ThoMoNetworking', 'id': '9eb6fab97c3b8ab810a6d310cd39e34cbd652464', 'size': '13780', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Classes/ThoMoNetworkStub.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Objective-C', 'bytes': '86966'}]}
/** * \addtogroup pubsub * @{ */ #ifndef __M2ETIS_PUBSUB_FILTER_FILTEREXPRESSIONS_LESSTHANATTRIBUTEFILTER_H__ #define __M2ETIS_PUBSUB_FILTER_FILTEREXPRESSIONS_LESSTHANATTRIBUTEFILTER_H__ #include "m2etis/pubsub/filter/filterexpressions/AttributeFilter.h" namespace m2etis { namespace pubsub { namespace filter { template<typename EventType, typename AttributeType> class EqualsAttributeFilter; template<typename EventType, typename AttributeType> class NotEqualsAttributeFilter; template<typename EventType, typename AttributeType> class GreaterThanAttributeFilter; template<typename EventType, typename AttributeType> class LessThanAttributeFilter : public AttributeFilter<EventType, AttributeType> { public: typedef EventType schema; // needed for operator overloading LessThanAttributeFilter() : AttributeFilter<EventType, AttributeType>(-1, {}) {} // needed for boost serialization LessThanAttributeFilter(const AttributeName attribute_id, const AttributeType & constants) : AttributeFilter<EventType, AttributeType>(attribute_id, {constants}) {} virtual ~LessThanAttributeFilter() {} virtual void getAttributeType(FilterVisitor<EventType> & visitor) const override { visitor.getAttributeType(this); } // function called to match against an event virtual bool matchAttribute(const AttributeType & attribute) const override { return attribute < this->get_constants()[0]; // attribute type has to implement "<"-operator } using AttributeFilter<EventType, AttributeType>::overlaps; virtual bool overlaps(const AttributeFilter<EventType, AttributeType> * other_filter) const override { if (this->get_attribute_id() != other_filter->get_attribute_id()) { return true; // AttributeFilters for different attributes overlap } if (typeid(EqualsAttributeFilter<EventType, AttributeType>) == typeid(*other_filter)) { return other_filter->overlaps(this); } if (typeid(NotEqualsAttributeFilter<EventType, AttributeType>) == typeid(*other_filter)) { return other_filter->overlaps(this); } if (typeid(GreaterThanAttributeFilter<EventType, AttributeType>) == typeid(*other_filter)) { return other_filter->overlaps(this); // TODO: (Roland) check for numeric_limits } if (typeid(LessThanAttributeFilter<EventType, AttributeType>) == typeid(*other_filter)) { return true; } return true; } private: friend class boost::serialization::access; template<typename Archive> void serialize(Archive & ar, const unsigned int) { ar & boost::serialization::base_object<AttributeFilter<EventType, AttributeType>>(*this); } }; // LessThanAttributeFilter } /* namespace filter */ } /* namespace pubsub */ } /* namespace m2etis */ #endif /* __M2ETIS_PUBSUB_FILTER_FILTEREXPRESSIONS_LESSTHANATTRIBUTEFILTER_H__ */ /** * @} */
{'content_hash': 'b630a95e6d33de5a71db00ea6e97365a', 'timestamp': '', 'source': 'github', 'line_count': 77, 'max_line_length': 166, 'avg_line_length': 36.62337662337662, 'alnum_prop': 0.7531914893617021, 'repo_name': 'ClockworkOrigins/m2etis', 'id': '7b7a778d241f4813a65348e233a3d01cff2cbfba', 'size': '3425', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'library/include/m2etis/pubsub/filter/filterexpressions/LessThanAttributeFilter.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '13275'}, {'name': 'C++', 'bytes': '1044746'}, {'name': 'CMake', 'bytes': '187386'}, {'name': 'Python', 'bytes': '136028'}, {'name': 'Shell', 'bytes': '1079'}]}
/** * @fileoverview Prevent missing parentheses around multilines JSX * @author Yannick Croissant */ 'use strict'; // ------------------------------------------------------------------------------ // Constants // ------------------------------------------------------------------------------ var DEFAULTS = { declaration: true, assignment: true, return: true }; // ------------------------------------------------------------------------------ // Rule Definition // ------------------------------------------------------------------------------ module.exports = { meta: { docs: {}, fixable: 'code', schema: [{ type: 'object', properties: { declaration: { type: 'boolean' }, assignment: { type: 'boolean' }, return: { type: 'boolean' } }, additionalProperties: false }] }, create: function(context) { var sourceCode = context.getSourceCode(); function isParenthesised(node) { var previousToken = sourceCode.getTokenBefore(node); var nextToken = sourceCode.getTokenAfter(node); return previousToken && nextToken && previousToken.value === '(' && previousToken.range[1] <= node.range[0] && nextToken.value === ')' && nextToken.range[0] >= node.range[1]; } function isMultilines(node) { return node.loc.start.line !== node.loc.end.line; } function check(node) { if (!node || node.type !== 'JSXElement') { return; } if (!isParenthesised(node) && isMultilines(node)) { context.report({ node: node, message: 'Missing parentheses around multilines JSX', fix: function(fixer) { return fixer.replaceText(node, '(' + sourceCode.getText(node) + ')'); } }); } } function isEnabled(type) { var userOptions = context.options[0] || {}; if (({}).hasOwnProperty.call(userOptions, type)) { return userOptions[type]; } return DEFAULTS[type]; } // -------------------------------------------------------------------------- // Public // -------------------------------------------------------------------------- return { VariableDeclarator: function(node) { if (isEnabled('declaration')) { check(node.init); } }, AssignmentExpression: function(node) { if (isEnabled('assignment')) { check(node.right); } }, ReturnStatement: function(node) { if (isEnabled('return')) { check(node.argument); } } }; } };
{'content_hash': 'e7042691a107b355128e6a110251b7b4', 'timestamp': '', 'source': 'github', 'line_count': 110, 'max_line_length': 81, 'avg_line_length': 24.327272727272728, 'alnum_prop': 0.44170403587443946, 'repo_name': 'lencioni/eslint-plugin-react', 'id': 'bca54662dda45c5038c738bdf2f0287a454959eb', 'size': '2676', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/rules/jsx-wrap-multilines.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '495876'}]}
using System.Reflection; [assembly: AssemblyTitle("Effort.Extra")] [assembly: AssemblyKeyFile("../Effort.Extra.snk")]
{'content_hash': 'eb1908157dc9698a8adf44d59c564383', 'timestamp': '', 'source': 'github', 'line_count': 4, 'max_line_length': 50, 'avg_line_length': 29.75, 'alnum_prop': 0.7563025210084033, 'repo_name': 'christophano/Effort.Extra', 'id': '67eee67b645b101c5ba46a6db9ff68313a9a47fc', 'size': '121', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Effort.Extra.StrongName/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C#', 'bytes': '44318'}]}
const express = require('express'), router = express.Router(), service = require('./services/book'); router.get('/', service.find); router.get('/:id', service.show); router.post('/', service.create); router.put('/:id', service.update); router.patch('/:id', service.update); router.delete('/:id', service.destroy); module.exports = router;
{'content_hash': '92f32bf92bb677f062f58c45a0d1e76d', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 43, 'avg_line_length': 29.416666666666668, 'alnum_prop': 0.660056657223796, 'repo_name': 'leonanluppi/express-mongo', 'id': '5462a88d0cac0e63a996ad9d00074b4f653d8512', 'size': '353', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'api/books/index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '7932'}]}
<!doctype html> <html class="no-js" lang="en" dir="ltr"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Foundation for Sites</title> <link rel="stylesheet" href="css/foundation.css"> <link rel="stylesheet" href="css/app.css"> </head> <body> <div class="row"> <div class="large-12 columns"> <a href="">[email protected]</a> </div> </div> <script src="js/vendor/jquery.js"></script> <script src="js/vendor/what-input.js"></script> <script src="js/vendor/foundation.js"></script> <script src="js/app.js"></script> <script> </script> </body> </html>
{'content_hash': '9fa6b8531a901dfd21bd7b3c5ba720a3', 'timestamp': '', 'source': 'github', 'line_count': 34, 'max_line_length': 78, 'avg_line_length': 24.88235294117647, 'alnum_prop': 0.541371158392435, 'repo_name': 'surendias/Replace-on-page-emails-with-a-popup-form', 'id': 'ff530d63b01e46f754c56b82eadbfc5b0f537aac', 'size': '846', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'index.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '846'}, {'name': 'JavaScript', 'bytes': '5625'}]}
package com.lin.web.service.impl; import java.util.ArrayList; import java.util.Calendar; import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.logging.Logger; import com.google.api.ads.dfp.jaxws.factory.DfpServices; import com.google.api.ads.dfp.jaxws.utils.v201403.StatementBuilder; import com.google.api.ads.dfp.jaxws.v201403.ComputedStatus; import com.google.api.ads.dfp.jaxws.v201403.DateTime; import com.google.api.ads.dfp.jaxws.v201403.Forecast; import com.google.api.ads.dfp.jaxws.v201403.ForecastServiceInterface; import com.google.api.ads.dfp.jaxws.v201403.LineItem; import com.google.api.ads.dfp.jaxws.v201403.LineItemPage; import com.google.api.ads.dfp.jaxws.v201403.LineItemServiceInterface; import com.google.api.ads.dfp.jaxws.v201403.Money; import com.google.api.ads.dfp.jaxws.v201403.Statement; import com.google.api.ads.dfp.jaxws.v201403.TargetPlatform; import com.google.api.ads.dfp.lib.client.DfpSession; import com.google.api.client.util.Lists; import com.google.visualization.datasource.base.TypeMismatchException; import com.google.visualization.datasource.datatable.ColumnDescription; import com.google.visualization.datasource.datatable.DataTable; import com.google.visualization.datasource.datatable.value.DateValue; import com.google.visualization.datasource.datatable.value.NumberValue; import com.google.visualization.datasource.datatable.value.ValueType; import com.google.visualization.datasource.render.JsonRenderer; import com.lin.persistance.dao.ILinMobileDAO; import com.lin.persistance.dao.IUserDetailsDAO; import com.lin.persistance.dao.impl.LinMobileDAO; import com.lin.persistance.dao.impl.UserDetailsDAO; import com.lin.server.Exception.DataServiceException; import com.lin.server.bean.ActualAdvertiserObj; import com.lin.server.bean.AdvertiserByLocationObj; import com.lin.server.bean.AdvertiserByMarketObj; import com.lin.server.bean.AdvertiserReportObj; import com.lin.server.bean.AgencyAdvertiserObj; import com.lin.server.bean.CompanyObj; import com.lin.server.bean.CustomLineItemObj; import com.lin.server.bean.ForcastedAdvertiserObj; import com.lin.server.bean.OrderLineItemObj; import com.lin.server.bean.PerformanceMetricsObj; import com.lin.server.bean.PublisherChannelObj; import com.lin.server.bean.PublisherInventoryRevenueObj; import com.lin.server.bean.PublisherPropertiesObj; import com.lin.server.bean.PublisherSummaryObj; import com.lin.server.bean.ReallocationDataObj; import com.lin.server.bean.SellThroughDataObj; import com.lin.web.dto.AdvertiserPerformerDTO; import com.lin.web.dto.CommonDTO; import com.lin.web.dto.ForcastLineItemDTO; import com.lin.web.dto.LeftMenuDTO; import com.lin.web.dto.LineChartDTO; import com.lin.web.dto.LineItemDTO; import com.lin.web.dto.PopUpDTO; import com.lin.web.dto.PropertyDropDownDTO; import com.lin.web.dto.PublisherReallocationHeaderDTO; import com.lin.web.dto.PublisherReportChannelPerformanceDTO; import com.lin.web.dto.PublisherReportComputedValuesDTO; import com.lin.web.dto.PublisherReportHeaderDTO; import com.lin.web.dto.PublisherReportPerformanceByPropertyDTO; import com.lin.web.dto.PublisherTrendAnalysisHeaderDTO; import com.lin.web.dto.PublisherViewDTO; import com.lin.web.dto.QueryDTO; import com.lin.web.dto.ReconciliationDataDTO; import com.lin.web.service.ILinMobileBusinessService; import com.lin.web.service.IQueryService; import com.lin.web.service.IUserService; import com.lin.web.util.AdvertiserViewMostActiveComparator; import com.lin.web.util.AdvertiserViewNonPerformerComparator; import com.lin.web.util.AdvertiserViewPerformerComparator; import com.lin.web.util.DateUtil; import com.lin.web.util.EncriptionUtil; import com.lin.web.util.LinMobileConstants; import com.lin.web.util.LinMobileVariables; import com.lin.web.util.MemcacheUtil; import com.lin.web.util.StringUtil; public class LinMobileBusinessService implements ILinMobileBusinessService{ private static final Logger log = Logger.getLogger(LinMobileBusinessService.class.getName()); public List<LineItemDTO> getLineItems(long orderId){ List<LineItemDTO> lineItemDTOList=null; return lineItemDTOList; } private String ChannelsInQString(List<String> allChannelName, StringBuilder memcacheKeySubstring) { String Channel = ""; if (allChannelName.size() != 0) { int channelListSize = allChannelName.size(); int i = 0; if (channelListSize == 1) { Channel = Channel + "channel_name = '" + allChannelName.get(i) + "' "; memcacheKeySubstring.append(allChannelName.get(i)); } else { Channel = Channel + "("; for (i = 0; i < channelListSize; i++) { Channel = Channel + "channel_name = '" + allChannelName.get(i) + "'"; memcacheKeySubstring.append(allChannelName.get(i)); if (i != channelListSize - 1) { Channel = Channel + " OR "; } } Channel = Channel + " ) "; } } log.info("Channels:"+Channel); return Channel; } @Override public String getPublisherBQId(String publisherName) { log.info("publisherName : "+publisherName); Map<String, String> publisherMap = new HashMap<>(); String publisherIdInBQ = ""; publisherMap.put(LinMobileConstants.LIN_MEDIA_PUBLISHER_NAME, LinMobileConstants.LIN_MEDIA_PUBLISHER_ID); publisherMap.put(LinMobileConstants.TRIBUNE_DFP_PUBLISHER_NAME, LinMobileConstants.TRIBUNE_DFP_PUBLISHER_ID); publisherMap.put(LinMobileConstants.LIN_DIGITAL_PUBLISHER_NAME, LinMobileConstants.LIN_DIGITAL_PUBLISHER_ID); publisherMap.put(LinMobileConstants.LIN_MOBILE_PUBLISHER_NAME, LinMobileConstants.LIN_MOBILE_PUBLISHER_ID); publisherIdInBQ = publisherMap.get(publisherName); log.info("publisherIdInBQ : "+publisherIdInBQ); return publisherIdInBQ; } public String getChannelsBQId(String channels) { log.info("channels : "+channels); Map<String, String> channelMap = new HashMap<>(); StringBuilder channelIdString = new StringBuilder(); channelMap.put("Google Ad exchange", "7"); channelMap.put("House", "8"); channelMap.put("LSN", "10"); channelMap.put("Local Sales Direct", "4"); channelMap.put("Mojiva", "3"); channelMap.put("National Sales Direct", "5"); channelMap.put("Nexage", "2"); channelMap.put("Undertone", "6"); if(channels != null && channels.trim().length() > 0) { String[] channelArray = channels.split(","); for(String channel : channelArray){ channel = channel.replaceAll("'", ""); channel = channelMap.get(channel.trim()); if(channel.length() > 0) { if((channelIdString.toString()).length() > 0) { channelIdString.append(","+channel); } else { channelIdString.append(channel); } } } } log.info("channelIdString : "+channelIdString); return channelIdString.toString(); } public QueryDTO getQueryDTO(String publisherIdInBQ, String startDate, String endDate, String schema) { log.info("publisherId : "+ publisherIdInBQ+", startDate : "+ startDate+", endDate : "+ endDate+", schema : "+ schema); QueryDTO queryDTO = null; if(publisherIdInBQ.length() > 0) { IQueryService queryService = (IQueryService) BusinessServiceLocator.locate(IQueryService.class); if(startDate.contains("00:00:00")) { startDate = startDate.replaceAll("00:00:00", ""); } if(endDate.contains("00:00:00")) { endDate = endDate.replaceAll("00:00:00", ""); } startDate = startDate.trim(); endDate = endDate.trim(); queryDTO = queryService.createQueryFromClause(publisherIdInBQ, startDate, endDate, schema); } if(queryDTO != null && !queryDTO.getQueryData().isEmpty()) { log.info("queryDTO.getQueryData() : "+queryDTO.getQueryData()); } else { log.info("queryDTO : null or queryDTO.getQueryData() is empty"); log.info("putting dummy data"); String projectId=null; String serviceAccountEmail=null; String servicePrivateKey=null; String dataSetId=LinMobileVariables.GOOGLE_BIGQUERY_DATASET_ID; StringBuffer queryData=new StringBuffer(); if(schema.equals(LinMobileConstants.BQ_CORE_PERFORMANCE)) { queryData.append("LIN_QA.CorePerformance_2014_01,LIN_QA.CorePerformance_2014_02,LIN_QA.CorePerformance_2014_03"); } else if(schema.equals(LinMobileConstants.BQ_DFP_TARGET)) { queryData.append("LIN_QA.DFPTarget_2014_01,LIN_QA.DFPTarget_2014_02,LIN_QA.DFPTarget_2014_03"); } else if(schema.equals(LinMobileConstants.BQ_PERFORMANCE_BY_LOCATION)) { queryData.append("LIN_QA.PerformanceByLocation_2014_01,LIN_QA.PerformanceByLocation_2014_02,LIN_QA.PerformanceByLocation_2014_03"); } else if(schema.equals(LinMobileConstants.BQ_SELL_THROUGH)) { queryData.append("LIN.Sell_Through"); } switch(publisherIdInBQ) { case "1": projectId=LinMobileConstants.LIN_MEDIA_GOOGLE_API_PROJECT_ID; serviceAccountEmail=LinMobileConstants.LIN_MEDIA_GOOGLE_API_SERVICE_ACCOUNT_EMAIL_ADDRESS; servicePrivateKey=LinMobileConstants.LIN_MEDIA_GOOGLE_BQ_SERVICE_ACCOUNT_PRIVATE_KEY; break; case "2": projectId=LinMobileConstants.LIN_DIGITAL_GOOGLE_API_PROJECT_ID; serviceAccountEmail=LinMobileConstants.LIN_DIGITAL_GOOGLE_API_SERVICE_ACCOUNT_EMAIL_ADDRESS; servicePrivateKey=LinMobileConstants.LIN_DIGITAL_GOOGLE_BQ_SERVICE_ACCOUNT_PRIVATE_KEY; break; case "5": projectId=LinMobileConstants.LIN_MOBILE_GOOGLE_API_PROJECT_ID; serviceAccountEmail=LinMobileConstants.LIN_MOBILE_GOOGLE_API_SERVICE_ACCOUNT_EMAIL_ADDRESS; servicePrivateKey=LinMobileConstants.LIN_MOBILE_GOOGLE_BQ_SERVICE_ACCOUNT_PRIVATE_KEY; break; default: log.warning("There is no project configured for this publisherId :"+publisherIdInBQ); return queryDTO; } queryDTO=new QueryDTO(serviceAccountEmail, servicePrivateKey, projectId,dataSetId, queryData.toString()); log.info("queryDTO.getQueryData() : "+queryDTO.getQueryData()); // } return queryDTO; } public String getChannelAndDataSourceQuery(List<String> selectedChannelName, StringBuilder memcacheKeySubstring, boolean allChannels) throws Exception { log.info("Inside getChannelAndDataSourceQuery in LinMobileDAO"); String QUERY = " and (( data_source = '' and channel_name = ''))"; int length = 0; IUserDetailsDAO userDetailsDAO = new UserDetailsDAO(); List<CompanyObj> demandPartnersList = userDetailsDAO.getAllDemandPartners(MemcacheUtil.getAllCompanyList()); if(allChannels && demandPartnersList != null) { length = demandPartnersList.size(); } else if(!allChannels && selectedChannelName != null && selectedChannelName.size() > 0) { length = selectedChannelName.size(); } QUERY = ""; for (int i=0; i<length; i++) { CompanyObj demandPartnerCompany = null; if(allChannels && demandPartnersList != null) { demandPartnerCompany = demandPartnersList.get(i); } else if(!allChannels && selectedChannelName != null && selectedChannelName.size() > 0) { demandPartnerCompany = userDetailsDAO.getCompanyByName(selectedChannelName.get(i).trim(), demandPartnersList); } if(demandPartnerCompany!=null && demandPartnerCompany.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && demandPartnerCompany.getCompanyName() != null && !demandPartnerCompany.getCompanyName().trim().equalsIgnoreCase("") && demandPartnerCompany.getDataSource() != null && !demandPartnerCompany.getDataSource().trim().equalsIgnoreCase("")){ memcacheKeySubstring.append(demandPartnerCompany.getCompanyName().trim()); if(i==0 && length == 1) { QUERY = QUERY+" and (( data_source = '"+demandPartnerCompany.getDataSource().trim()+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"'))"; } else if(i==0) { QUERY = QUERY+" and (( data_source = '"+demandPartnerCompany.getDataSource().trim()+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"')"; } else if(i == length-1) { QUERY = QUERY+" or ( data_source = '"+demandPartnerCompany.getDataSource().trim()+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"'))"; } else { QUERY = QUERY+" or ( data_source = '"+demandPartnerCompany.getDataSource().trim()+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"')"; } } } return QUERY; } /*public String getAllChannelAndDataSourceQuery(StringBuilder memcacheKeySubstring) throws Exception { log.info("Inside getAllChannelAndDataSourceQuery in LinMobileDAO"); String QUERY = ""; IUserDetailsDAO userDetailsDAO = new UserDetailsDAO(); List<CompanyObj> demandPartnersList = userDetailsDAO.getAllDemandPartners(MemcacheUtil.getAllCompanyList()); if(demandPartnersList != null && demandPartnersList.size() > 0) { int length = demandPartnersList.size(); for (int i=0; i<length; i++) { CompanyObj demandPartnerCompany = demandPartnersList.get(i); if(demandPartnerCompany!=null && demandPartnerCompany.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && demandPartnerCompany.getCompanyName() != null && !demandPartnerCompany.getCompanyName().trim().equalsIgnoreCase("") && demandPartnerCompany.getDataSource() != null && !demandPartnerCompany.getDataSource().trim().equalsIgnoreCase("")){ memcacheKeySubstring.append(demandPartnerCompany.getCompanyName().trim()); if(i==0 && length == 1) { QUERY = QUERY+" and (( data_source = '"+demandPartnerCompany.getDataSource().trim()+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"'))"; } else if(i==0) { QUERY = QUERY+" and (( data_source = '"+demandPartnerCompany.getDataSource().trim()+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"')"; } else if(i == length-1) { QUERY = QUERY+" or ( data_source = '"+demandPartnerCompany.getDataSource().trim()+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"'))"; } else { QUERY = QUERY+" or ( data_source = '"+demandPartnerCompany.getDataSource().trim()+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"')"; } } } } return QUERY; }*/ /*public String getChannelWithDataSourceDFPQuery(StringBuilder memcacheKeySubstring) throws Exception { log.info("Inside getAllChannelAndDataSourceQuery in LinMobileDAO"); String QUERY = ""; IUserDetailsDAO userDetailsDAO = new UserDetailsDAO(); List<CompanyObj> demandPartnersList = userDetailsDAO.getAllDemandPartners(MemcacheUtil.getAllCompanyList()); if(demandPartnersList != null && demandPartnersList.size() > 0) { int length = demandPartnersList.size(); for (int i=0; i<length; i++) { CompanyObj demandPartnerCompany = demandPartnersList.get(i); if(demandPartnerCompany!=null && demandPartnerCompany.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && demandPartnerCompany.getCompanyName() != null && !demandPartnerCompany.getCompanyName().trim().equalsIgnoreCase("") && demandPartnerCompany.getDataSource() != null && !demandPartnerCompany.getDataSource().trim().equalsIgnoreCase("")){ memcacheKeySubstring.append(demandPartnerCompany.getCompanyName().trim()); if(i==0 && length == 1) { QUERY = QUERY+" and (( data_source = '"+LinMobileConstants.DEFAULT_DATASOURE_NAME+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"'))"; } else if(i==0) { QUERY = QUERY+" and (( data_source = '"+LinMobileConstants.DEFAULT_DATASOURE_NAME+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"')"; } else if(i == length-1) { QUERY = QUERY+" or ( data_source = '"+LinMobileConstants.DEFAULT_DATASOURE_NAME+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"'))"; } else { QUERY = QUERY+" or ( data_source = '"+LinMobileConstants.DEFAULT_DATASOURE_NAME+"' and channel_name = '"+demandPartnerCompany.getCompanyName().trim()+"')"; } } } } return QUERY; }*/ public String getSelectedDFPPropertiesQuery(long publisherId, long userId, StringBuilder memcacheKeySubstring) throws Exception { /*log.info("Inside getSelectedDFPPropertiesQuery in LinMobileDAO"); StringBuilder QUERY = new StringBuilder(); QUERY.append(" and ( site_name = '' )"); IUserDetailsDAO userDetailsDAO = new UserDetailsDAO(); List<PropertyEntityObj> propertyObjList = userDetailsDAO.getSelectedPropertiesByUserIdAndPublisherId(userId, (Long.valueOf(publisherId)).toString().trim()); if(propertyObjList != null && propertyObjList.size() > 0) { int length = propertyObjList.size(); if(length > 0) { QUERY = new StringBuilder(); for (int i=0; i<length; i++) { PropertyEntityObj propertyObj = propertyObjList.get(i); if(propertyObj != null && propertyObj.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && propertyObj.getDFPPropertyName() != null && !propertyObj.getDFPPropertyName().trim().equalsIgnoreCase("")) { memcacheKeySubstring.append(propertyObj.getDFPPropertyName().trim()); if(i==0) { QUERY.append(" and ( site_name = '"+propertyObj.getDFPPropertyName().trim()+"' "); } else { QUERY.append(" or site_name = '"+propertyObj.getDFPPropertyName().trim()+"' "); } } } QUERY.append(" ) "); } } return QUERY.toString();*/ return ""; } public List<AdvertiserReportObj> loadPerformingLineItems(String lowerDate,String upperDate){ List<AdvertiserReportObj> advertiserReportList=null; List<AdvertiserReportObj> subList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { advertiserReportList=linDAO.loadPerformingLineItemsForAdvertiser(5,lowerDate,upperDate); if(advertiserReportList !=null){ log.info("Found objects from datastore :"+advertiserReportList.size()+" , going to sort by CTR using comperator."); AdvertiserViewPerformerComparator performerComperator= new AdvertiserViewPerformerComparator(); Collections.sort(advertiserReportList, performerComperator); if(advertiserReportList.size()>5){ subList=advertiserReportList.subList(0, 5); log.info("fetched sorted subList with 5 objects from advertiserReportList."); return subList; }else{ return advertiserReportList; } }else{ log.info("Found objects from datastore :null"); return advertiserReportList; } } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<AdvertiserReportObj> loadNonPerformingLineItems(String lowerDate,String upperDate){ List<AdvertiserReportObj> advertiserReportList=null; List<AdvertiserReportObj> subList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { advertiserReportList=linDAO.loadNonPerformingLineItemsForAdvertiser(5,lowerDate,upperDate); if(advertiserReportList !=null){ log.info("Found objects from datastore :"+advertiserReportList.size()+" , going to sort by delivery indicator using comparator."); double upperCap=100; Iterator itr=advertiserReportList.iterator(); AdvertiserReportObj obj=null; while(itr.hasNext()){ obj=(AdvertiserReportObj) itr.next(); //log.info("obj.getDeliveryIndicator():"+obj.getDeliveryIndicator()); if(obj.getDeliveryIndicator() >= upperCap){ //log.info("Removing lineitem with delivery indicator ::"+obj.getDeliveryIndicator()); itr.remove(); } } AdvertiserViewNonPerformerComparator nonPerformerComperator= new AdvertiserViewNonPerformerComparator(); Collections.sort(advertiserReportList, nonPerformerComperator); if(advertiserReportList !=null && advertiserReportList.size()>5){ subList=advertiserReportList.subList(0, 5); log.info("fetched sorted subList with 5 objects from advertiserReportList."); return subList; }else{ return advertiserReportList; } }else{ log.info("Found objects from datastore :null"); return advertiserReportList; } } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<String> loadAgencies(){ log.info("Service :loading agencies..."); List<AgencyAdvertiserObj> agencyAdvertiserList=null; List<String> agencyList=new ArrayList<String>(); ILinMobileDAO linDAO=new LinMobileDAO(); try { agencyAdvertiserList=linDAO.loadAllAgencies(); for(AgencyAdvertiserObj obj:agencyAdvertiserList){ String agencyName=obj.getAgencyName(); if(agencyName!=null && (!agencyName.equals("0")) && !agencyList.contains(agencyName)){ agencyList.add(agencyName); }else{ //log.info("already added.."+agencyList); } } } catch (DataServiceException e) { log.severe("Falied to load all agencies: DataServiceException:"+e.getMessage()); } return agencyList; } public List<AgencyAdvertiserObj> loadAdvertisers(String agencyName){ List<AgencyAdvertiserObj> agencyAdvertiserList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { agencyAdvertiserList=linDAO.loadAllAdvertisers(agencyName); } catch (DataServiceException e) { log.severe("Falied to load all advertisers: DataServiceException:"+e.getMessage()); } return agencyAdvertiserList; } public List<CustomLineItemObj> getMostActiveLineItems(String lowerDate,String upperDate){ List<CustomLineItemObj> resultList=null; List<CustomLineItemObj> subList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadMostActiveLineItem(5,lowerDate,upperDate); if(resultList !=null){ log.info("Found objects from datastore :"+resultList.size()+" , going to sort by delivery indicator using comperator."); AdvertiserViewMostActiveComparator mostActiveComparator= new AdvertiserViewMostActiveComparator(); Collections.sort(resultList, mostActiveComparator); if(resultList.size()>5){ subList=resultList.subList(0, 5); log.info("fetched sorted subList with 5 objects from mostActiveList."); return subList; }else{ return resultList; } }else{ log.info("Found objects from datastore :null"); return resultList; } } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<CustomLineItemObj> getTopGainersLineItems(String lowerDate,String upperDate){ List<CustomLineItemObj> resultList=null; List<CustomLineItemObj> subList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadMostActiveLineItem(5,lowerDate,upperDate); if(resultList !=null){ log.info("Found objects from datastore :"+resultList.size()+" , going to sort by delivery indicator using comperator."); AdvertiserViewMostActiveComparator mostActiveComparator= new AdvertiserViewMostActiveComparator(); Collections.sort(resultList, mostActiveComparator); if(resultList.size()>5){ subList=resultList.subList(0, 5); log.info("fetched sorted subList with 5 objects from mostActiveList."); return subList; }else{ return resultList; } }else{ log.info("Found objects from datastore :null"); return resultList; } } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<CustomLineItemObj> getTopLosersLineItems(String lowerDate,String upperDate){ List<CustomLineItemObj> resultList=null; List<CustomLineItemObj> subList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadMostActiveLineItem(5,lowerDate,upperDate); if(resultList !=null){ log.info("Found objects from datastore :"+resultList.size()+" , going to sort by delivery indicator using comperator."); AdvertiserViewMostActiveComparator mostActiveComparator= new AdvertiserViewMostActiveComparator(); Collections.sort(resultList, mostActiveComparator); if(resultList.size()>5){ subList=resultList.subList(0, 5); log.info("fetched sorted subList with 5 objects from mostActiveList."); return subList; }else{ return resultList; } }else{ log.info("Found objects from datastore :null"); return resultList; } } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public void insertPublisherViewDTO(List<PublisherViewDTO> publisherViewList) { LinMobileDAO linDao = new LinMobileDAO(); for(PublisherViewDTO publisherView : publisherViewList) { try { linDao.saveObject(publisherView); } catch (DataServiceException e) { // TODO Auto-generated catch block } } } public List<PublisherViewDTO> getPublisherViewDTO() { LinMobileDAO linDao = new LinMobileDAO(); try { return linDao.getPublisherViewDTO(); } catch (DataServiceException e) { log.info(":exception: "+e.getMessage()); return null; } } public List<PublisherViewDTO> getPublisherViewDTO(int pageNo) { LinMobileDAO linDao = new LinMobileDAO(); try { return linDao.getPublisherView(pageNo); } catch (DataServiceException e) { log.info(":exception: "+e.getMessage()); return null; } } public void insertLeftMenuDTO(List<LeftMenuDTO> leftMenuItemList) { LinMobileDAO linDao = new LinMobileDAO(); for(LeftMenuDTO leftMenuDTO : leftMenuItemList) { try { linDao.saveObject(leftMenuDTO); } catch (DataServiceException e) { // TODO Auto-generated catch block } } } public List<LeftMenuDTO> getLeftMenuList() { LinMobileDAO linDao = new LinMobileDAO(); try { return linDao.getLeftMenuList(); } catch (DataServiceException e) { log.info(":exception: "+e.getMessage()); return null; } } public List<PerformanceMetricsObj> getAdvertiserPerformanceMetrics(int counter,String lowerDate,String upperDate){ List<PerformanceMetricsObj> resultList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadAdvertiserPerformanceMetrics(counter,lowerDate,upperDate); return resultList; } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<PerformanceMetricsObj> getAdvertiserPerformanceMetrics(String lowerDate,String upperDate){ List<PerformanceMetricsObj> resultList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadAdvertiserPerformanceMetrics(lowerDate,upperDate); return resultList; } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public void loadAdvertisersByLocationData(String lowerDate,String upperDate,StringBuilder sbStr ){ try{ List<AdvertiserByLocationObj> advertiserByLocationObjList =null; LinMobileDAO linDao = new LinMobileDAO(); advertiserByLocationObjList = linDao.loadAdvertisersByLocationData(lowerDate, upperDate); sbStr.append("[['State', 'Impression', 'CTR(%)']"); for (AdvertiserByLocationObj object : advertiserByLocationObjList) { sbStr.append(",["); sbStr.append("'"+object.getState()+"',"+object.getImpression()+","+object.getCtrPercent()); sbStr.append("]"); } sbStr.append("]"); }catch(Exception e){ log.severe("Exception :"+e.getMessage()); } } public void loadAdvertisersByMarketData(String lowerDate,String upperDate,StringBuilder sbStr){ try{ List<AdvertiserByMarketObj> advertiserBymarketObjList =null; LinMobileDAO linDao = new LinMobileDAO(); advertiserBymarketObjList = linDao.loadAdvertisersBymarketData(lowerDate, upperDate); sbStr.append("[['State', 'lin-property', 'CTR(%)']"); for (AdvertiserByMarketObj object : advertiserBymarketObjList) { sbStr.append(",["); sbStr.append("'"+object.getState()+"','"+object.getLinProperty()+"',"+object.getCtrPercent()); sbStr.append("]"); } sbStr.append("]"); }catch(Exception e){ log.severe("Exception :"+e.getMessage()); } } /* * Load advertiser details by advertiserId * @see com.lin.web.service.ILinMobileBusinessService#loadAdvertiserDetails(long) */ public List<AgencyAdvertiserObj> loadAdvertiserDetails(long advertiserId){ List<AgencyAdvertiserObj> agencyAdvertiserList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { agencyAdvertiserList=linDAO.loadAdvertiserById(advertiserId); } catch (DataServiceException e) { log.severe("Falied to load all advertisers: DataServiceException:"+e.getMessage()); } return agencyAdvertiserList; } /* public List<PublisherChannelObj> getChannelPerformanceList(String lowerDate, String upperDate, String compareStartDate, String compareEndDate, String allChannelName, String publisher){ List<PublisherChannelObj> resultList=null; List<PublisherChannelObj> publisherList=new ArrayList<PublisherChannelObj>(); List<String> channelNameList=new ArrayList<String>(); ILinMobileDAO linDAO=new LinMobileDAO(); List<String> channelArrList = new ArrayList<String>(); String[] str = allChannelName.split(","); if(str!=null){ for (String channel : str) { channelArrList.add(channel.trim()); } } try { resultList=linDAO.loadChannelPerformanceList(lowerDate,upperDate,compareStartDate,compareEndDate, channelArrList,publisher ); if(resultList != null && resultList.size() > 0) { for(PublisherChannelObj obj:resultList){ if(!channelNameList.contains(obj.getChannelName())){ channelNameList.add(obj.getChannelName()); publisherList.add(obj); } } } return publisherList; } catch (Exception e) { log.severe("Exception in getChannelPerformanceList in LinMobileBusinessService :"+e.getMessage()); return publisherList; } }*/ public List<PublisherPropertiesObj> getPerformanceByPropertyList(int limit,String lowerDate,String upperDate) { List<PublisherPropertiesObj> resultList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadPerformanceByPropertyList(limit,lowerDate,upperDate); return resultList; } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<PublisherPropertiesObj> getPerformanceByPropertyList(String lowerDate,String upperDate){ List<PublisherPropertiesObj> resultList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadPerformanceByPropertyList(lowerDate,upperDate); return resultList; } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<PublisherPropertiesObj> getPerformanceByPropertyList(String lowerDate,String upperDate, String compareStartDate, String compareEndDate, String channel, String publisher){ List<PublisherPropertiesObj> resultList=null; ILinMobileDAO linDAO=new LinMobileDAO(); IUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class); try { StringBuilder memcacheKeysubstring = new StringBuilder(); String channelAndDataSourceQuery = getChannelAndDataSourceQuery(userService.CommaSeperatedStringToList(channel), memcacheKeysubstring, false); resultList=linDAO.loadPerformanceByPropertyList(lowerDate,upperDate,compareStartDate,compareEndDate, channel, publisher, channelAndDataSourceQuery); return resultList; } catch (Exception e) { log.severe("Exception :"+e.getMessage()); return null; } } public List<SellThroughDataObj> getSellThroughDataList(String lowerDate,String upperDate, String publisherName, long publisherId, long userId) { List<SellThroughDataObj> resultList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { String publisherBQId = getPublisherBQId(publisherName); StringBuilder DFP_Properties_MemcacheKeyPart = new StringBuilder(); String selectedDFPPropertiesQuery = getSelectedDFPPropertiesQuery(publisherId, userId, DFP_Properties_MemcacheKeyPart); resultList = MemcacheUtil.getSellThroughData(lowerDate, upperDate, publisherBQId, DFP_Properties_MemcacheKeyPart.toString()); if(resultList == null || resultList.size() <= 0) { QueryDTO queryDTO = getQueryDTO(publisherBQId, lowerDate, upperDate, LinMobileConstants.BQ_SELL_THROUGH); log.info("Sell through data not found in memcache, get from bigquery.."); resultList=linDAO.loadSellThroughDataList(lowerDate,upperDate, selectedDFPPropertiesQuery, queryDTO); if(resultList != null && resultList.size()>0) { MemcacheUtil.setSellThroughData(resultList, lowerDate, upperDate, publisherBQId, DFP_Properties_MemcacheKeyPart.toString()); } } return resultList; } catch (Exception e) { log.severe("Exception : "+e.getMessage()); return null; } } /* * Get LineItem by id * @Param - String lowerDate,String upperDate,long lineItemId * @Return - PopUpDTO popUpObj */ public PopUpDTO getLineItemForPopUP(String lowerDate,String upperDate,long lineItemId){ List<AdvertiserReportObj> resultList=null; PopUpDTO popUpObj=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { popUpObj=new PopUpDTO(); resultList=linDAO.loadLineItem(lowerDate,upperDate,lineItemId); popUpObj.setId(String.valueOf(lineItemId)); if(resultList !=null && resultList.size()>0){ log.info("Got lineItems:"+resultList.size()); AdvertiserReportObj obj=resultList.get(0); popUpObj.setBookedImpression(String.valueOf(obj.getGoalQuantity())); popUpObj.setImpressionDeliveredLifeTime(String.valueOf(obj.getLineItemLifeItemImpressions())); popUpObj.setImpressionDeliveredInSelectedTime(String.valueOf(obj.getAdServerImpressions())); popUpObj.setClicksInSelectedTime(String.valueOf(obj.getAdServerClicks())); popUpObj.setClicksLifeTime(String.valueOf(obj.getLineItemLifeTimeClicks())); popUpObj.setCtrLifeTime(String.valueOf(obj.getAdServerCTR())); popUpObj.setCtrInSelectedTime(String.valueOf(obj.getAdServerCTR())); popUpObj.seteCPM(String.valueOf(obj.getAdServerECPM())); popUpObj.setTitle(obj.getLineItemName()); StringBuffer strBuffer=new StringBuffer(); strBuffer.append("[['Days', 'Impression']"); for (AdvertiserReportObj object:resultList) { strBuffer.append(",["); strBuffer.append("'"+DateUtil.getFormatedDate(object.getDate(), "yyyy-MM-dd", "MM/dd")+"',"+object.getAdServerImpressions()); strBuffer.append("]"); } strBuffer.append("]"); log.info("strBuffer.toString():"+strBuffer.toString()); popUpObj.setChartData(strBuffer.toString()); }else{ log.info("No lineitem found for lineItemId:"+lineItemId+" and time: lowerDate:"+lowerDate+" and upperDate:"+upperDate); } } catch (DataServiceException e) { log.severe("Exception in loading lineItem with id:"+lineItemId+" : "+e.getMessage()); } return popUpObj; } public List<String> getPublishers(){ List<PublisherChannelObj> resultList=null; List<String> publisherList=new ArrayList<String>(); ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadPublisherDataList(); for(PublisherChannelObj obj:resultList){ if(!publisherList.contains(obj.getPublisherName())){ publisherList.add(obj.getPublisherName()); } } return publisherList; } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<PublisherChannelObj> getPublisherDataList(String publisherName){ List<PublisherChannelObj> resultList=null; List<String> publisherList=new ArrayList<String>(); List<PublisherChannelObj> publisherObjList=new ArrayList<PublisherChannelObj>(); ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadPublisherDataList(); for(PublisherChannelObj obj:resultList){ if( (!publisherList.contains(obj.getPublisherName())) && (publisherName.equalsIgnoreCase(obj.getPublisherName())) ){ publisherList.add(obj.getPublisherName()); publisherObjList.add(obj); break; } } return publisherObjList; } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<PublisherChannelObj> loadChannelsByPublisher(String publisherName){ List<PublisherChannelObj> resultList=null; List<PublisherChannelObj> channelObjList=new ArrayList<PublisherChannelObj>(); List<String> channelList=new ArrayList<String>(); ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadChannels(publisherName); for(PublisherChannelObj obj:resultList){ if(!channelList.contains(obj.getChannelName())){ channelList.add(obj.getChannelName()); channelObjList.add(obj); } } return channelObjList; } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<PublisherChannelObj> loadChannelsByName(String channelName){ List<PublisherChannelObj> resultList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadChannelsByName(channelName); return resultList; } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } /* * Get LineItem by id * @Param - String lowerDate,String upperDate,String lineItemName * @Return - PopUpDTO popUpObj */ public PopUpDTO getLineItemForPopUP(String lowerDate,String upperDate,String lineItemName){ List<CustomLineItemObj> resultList=null; PopUpDTO popUpObj=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { popUpObj=new PopUpDTO(); resultList=linDAO.loadLineItem(lowerDate,upperDate,lineItemName); if(resultList !=null && resultList.size()>0){ log.info("Got lineItems:"+resultList.size()); CustomLineItemObj obj=resultList.get(0); String bookedImpressions=(obj.getDeliveredImpressions()*2)+""; popUpObj.setBookedImpression(bookedImpressions); popUpObj.setImpressionDeliveredLifeTime(String.valueOf(obj.getDeliveredImpressions()*3/2)); popUpObj.setImpressionDeliveredInSelectedTime(String.valueOf(obj.getDeliveredImpressions())); String clicks=(Math.round(obj.getDeliveredImpressions()/5))+""; String clicksLifeTime=(Math.round((obj.getDeliveredImpressions()/5)))+""; popUpObj.setClicksInSelectedTime(String.valueOf(clicks)); popUpObj.setClicksLifeTime(clicksLifeTime); popUpObj.setCtrLifeTime(String.valueOf(obj.getCTR()*2)); popUpObj.setCtrInSelectedTime(String.valueOf(obj.getCTR())); String cpm=String.valueOf(obj.getCTR()*20); if(cpm.indexOf("-")>=0){ cpm=cpm.replace("-", ""); } popUpObj.seteCPM(cpm); popUpObj.setTitle(obj.getLineItemName()); String revenueDelivered=(Math.round(obj.getDeliveryIndicator()*1500)/100)+""; //dummy data String revenueRemaining=(Math.round(obj.getDeliveryIndicator()*1000)/100)+""; //dummy data String revenueDeliveredLifeTime=(Math.round(obj.getDeliveryIndicator()*2000)/100)+""; //dummy data String revenueRemainingLifeTime=(Math.round((obj.getDeliveryIndicator()*1500)/100))+""; //dummy data popUpObj.setRevenueDeliveredInSelectedTime(revenueDelivered); popUpObj.setRevenueDeliveredLifeTime(revenueDeliveredLifeTime); popUpObj.setRevenueRemainingInSelectedTime(revenueRemaining); popUpObj.setRevenueRemainingLifeTime(revenueRemainingLifeTime); StringBuffer strBuffer=new StringBuffer(); strBuffer.append("[['Days', 'Impression']"); for (CustomLineItemObj object:resultList) { strBuffer.append(",["); strBuffer.append("'"+DateUtil.getFormatedDate(object.getDate(), "yyyy-MM-dd", "MM/dd")+"',"+object.getDeliveredImpressions()); strBuffer.append("]"); } strBuffer.append("]"); popUpObj.setChartData(strBuffer.toString()); log.info("strBuffer.toString():"+strBuffer.toString()); }else{ log.info("No lineitem found for lineItemName:"+lineItemName+" and time: lowerDate:"+lowerDate+" and upperDate:"+upperDate); } } catch (DataServiceException e) { log.severe("Exception in loading lineItem with lineItemName:"+lineItemName+" : "+e.getMessage()); } return popUpObj; } /* * getPerformanceMetricLineItemForPopUP * @Param - String lowerDate,String upperDate,String lineItemName * @Return - PopUpDTO popUpObj */ public PopUpDTO getPerformanceMetricLineItemForPopUP(String lowerDate,String upperDate,String lineItemName){ List<PerformanceMetricsObj> resultList=null; PopUpDTO popUpObj=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { popUpObj=new PopUpDTO(); resultList=linDAO.loadLineItemForPerformanceMetrics(lowerDate,upperDate,lineItemName); if(resultList!=null && resultList.size()>0){ log.info("Got lineItems:"+resultList.size()); PerformanceMetricsObj obj=resultList.get(0); String bookedImpressions=(obj.getImpressionsBooked())+""; popUpObj.setBookedImpression(bookedImpressions); popUpObj.setImpressionDeliveredLifeTime(String.valueOf(obj.getImpressionsDelivered()*3/2)); popUpObj.setImpressionDeliveredInSelectedTime(String.valueOf(obj.getImpressionsDelivered())); String clicks=(Math.round(obj.getClicks()/5))+""; String clicksLifeTime=(obj.getClicks())+""; popUpObj.setClicksInSelectedTime(String.valueOf(clicks)); popUpObj.setClicksLifeTime(clicksLifeTime); popUpObj.setCtrLifeTime(String.valueOf(obj.getCTR())); popUpObj.setCtrInSelectedTime(String.valueOf(obj.getCTR())); String cpm=String.valueOf(Math.round(obj.getCTR()*2000)/100); if(cpm.indexOf("-")>=0){ cpm=cpm.replace("-", ""); } popUpObj.seteCPM(cpm); popUpObj.setTitle(obj.getLineItemName()); String revenueDelivered=(Math.round(obj.getRevenueRecoByDay()*100)/100)+""; //dummy data String revenueRemaining=(Math.round(obj.getRevenueLeftByDay()*100)/100)+""; //dummy data String revenueDeliveredLifeTime=(Math.round(obj.getRevenueRecoByDay()*200)/100)+""; //dummy data String revenueRemainingLifeTime=(Math.round((obj.getRevenueLeftByDay()*150)/100))+""; //dummy data popUpObj.setRevenueDeliveredInSelectedTime(revenueDelivered); popUpObj.setRevenueDeliveredLifeTime(revenueDeliveredLifeTime); popUpObj.setRevenueRemainingInSelectedTime(revenueRemaining); popUpObj.setRevenueRemainingLifeTime(revenueRemainingLifeTime); StringBuffer strBuffer=new StringBuffer(); strBuffer.append("[['Days', 'Impression']"); for (PerformanceMetricsObj metricsObj:resultList) { strBuffer.append(",["); strBuffer.append("'"+DateUtil.getFormatedDate(metricsObj.getDate(), "yyyy-MM-dd", "MM/dd")+"',"+metricsObj.getImpressionsDelivered()); strBuffer.append("]"); } strBuffer.append("]"); popUpObj.setChartData(strBuffer.toString()); log.info("strBuffer.toString():"+strBuffer.toString()); }else{ log.info("No lineitem found for lineItemName:"+lineItemName+" and time: lowerDate:"+lowerDate+" and upperDate:"+upperDate); } } catch (DataServiceException e) { log.severe("Exception in loading lineItem with lineItemName:"+lineItemName+" : "+e.getMessage()); } return popUpObj; } public List<String> loadOrders(){ List<OrderLineItemObj> orderNameList=null; List<String> orderList=new ArrayList<String>(); ILinMobileDAO linDAO=new LinMobileDAO(); try { orderNameList=linDAO.loadAllOrders(); for(OrderLineItemObj obj:orderNameList){ String orderName=obj.getOrderName(); if(orderName!=null && (!orderName.equals("0")) && !orderList.contains(orderName)){ orderList.add(orderName); log.info("order list....."+orderList.size()); } } } catch (DataServiceException e) { log.severe("Falied to load all agencies: DataServiceException:"+e.getMessage()); } return orderList; } public List<OrderLineItemObj> loadLineItemName(String orderName){ List<OrderLineItemObj> lineItemList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { lineItemList=linDAO.loadAllLineItems(orderName); } catch (DataServiceException e) { log.severe("Falied to load all advertisers: DataServiceException:"+e.getMessage()); } return lineItemList; } public List<OrderLineItemObj> loadLineItemName(long orderId){ List<OrderLineItemObj> lineItemList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { lineItemList=linDAO.loadAllLineItems(orderId); } catch (DataServiceException e) { log.severe("Falied to load all advertisers: DataServiceException:"+e.getMessage()); } return lineItemList; } public List<OrderLineItemObj> loadLineItem(long lineItemId){ List<OrderLineItemObj> lineItemList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { lineItemList=linDAO.loadLineItem(lineItemId); } catch (DataServiceException e) { log.severe("Falied to load all advertisers: DataServiceException:"+e.getMessage()); } return lineItemList; } public List<ReallocationDataObj> loadReallocationItems(String lowerDate,String upperDate){ List<ReallocationDataObj> reallocationReportList=null; List<ReallocationDataObj> subList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { reallocationReportList=linDAO.loadReallocationItemsForAdvertiser(5,lowerDate,upperDate); if(reallocationReportList !=null){ log.info("Found objects from datastore :"+reallocationReportList.size()+" , going to sort by CTR using comperator."); /*AdvertiserViewPerformerComparator performerComperator= new AdvertiserViewPerformerComparator(); Collections.sort(reallocationReportList, performerComperator);*/ if(reallocationReportList.size()>5){ subList=reallocationReportList.subList(0, 5); log.info("fetched sorted subList with 5 objects from advertiserReportList."); return subList; }else{ return reallocationReportList; } }else{ log.info("Found objects from datastore :null"); return reallocationReportList; } } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<ActualAdvertiserObj> loadActualAdvertiserData(String lowerDate,String upperDate){ List<ActualAdvertiserObj> actualAdvertiserList=null; List<ActualAdvertiserObj> subList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { actualAdvertiserList=linDAO.loadActualDataForAdvertiser(5,lowerDate,upperDate); if(actualAdvertiserList !=null){ log.info("Found objects from datastore :"+actualAdvertiserList.size()+" , going to sort by CTR using comperator."); /*AdvertiserViewPerformerComparator performerComperator= new AdvertiserViewPerformerComparator(); Collections.sort(reallocationReportList, performerComperator);*/ if(actualAdvertiserList.size()>15){ subList=actualAdvertiserList.subList(0, 15); log.info("fetched sorted subList with 5 objects from actualAdvertiserList."); return subList; }else{ return actualAdvertiserList; } }else{ log.info("Found objects from datastore :null"); return actualAdvertiserList; } } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<ForcastedAdvertiserObj> loadForcastAdvertiserData(String lowerDate,String upperDate){ List<ForcastedAdvertiserObj> forcastAdvertiserList=null; List<ForcastedAdvertiserObj> subList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { forcastAdvertiserList=linDAO.loadForcastDataForAdvertiser(5,lowerDate,upperDate); if(forcastAdvertiserList !=null){ log.info("Found objects from datastore :"+forcastAdvertiserList.size()+" , going to sort by CTR using comperator."); /*AdvertiserViewPerformerComparator performerComperator= new AdvertiserViewPerformerComparator(); Collections.sort(reallocationReportList, performerComperator);*/ if(forcastAdvertiserList.size()>15){ subList=forcastAdvertiserList.subList(0, 15); log.info("fetched sorted subList with 5 objects from actualAdvertiserList."); return subList; }else{ return forcastAdvertiserList; } }else{ log.info("Found objects from datastore :null"); return forcastAdvertiserList; } } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<PublisherChannelObj> loadActualPublisherData(String lowerDate,String upperDate,String publisherName,String channelName){ List<PublisherChannelObj> actualPublisherList=null; ILinMobileDAO linDAO=new LinMobileDAO(); //String channelAndDataSourceQuery = ""; //IUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class); //List<String> channelArrList = new ArrayList<String>(); try { String replaceStr = "\\\\'"; if(channelName!=null){ //StringBuilder memcacheKeySubstring = new StringBuilder(); //channelAndDataSourceQuery = getChannelAndDataSourceQuery(userService.CommaSeperatedStringToList(channelName), memcacheKeySubstring, false); channelName = channelName.replaceAll("'", replaceStr); channelName = channelName.replaceAll(",", "','"); }else{ channelName = ""; } String channelId = getChannelsBQId(channelName); String publisherId = getPublisherBQId(publisherName); actualPublisherList = MemcacheUtil.getTrendsAnalysisActualDataPublisher(lowerDate, upperDate, publisherId, channelId); if(actualPublisherList==null || actualPublisherList.size()<=0) { QueryDTO queryDTO = getQueryDTO(publisherId, lowerDate, upperDate, LinMobileConstants.BQ_CORE_PERFORMANCE); if(queryDTO != null && queryDTO.getQueryData() != null && queryDTO.getQueryData().length() > 0) { actualPublisherList=linDAO.loadActualDataForPublisher(lowerDate,upperDate,channelId, queryDTO); MemcacheUtil.setTrendsAnalysisActualDataPublisher(lowerDate, upperDate, publisherId, channelId, actualPublisherList); } } return actualPublisherList; } catch (Exception e) { log.severe("Exception :"+e.getMessage()); return null; } } public List<PublisherChannelObj> loadReallocationPublisherData(String lowerDate,String upperDate,String publisherName){ List<PublisherChannelObj> reallocationPublisherList=null; List<PublisherChannelObj> reallocationPublisherAlteredList= new ArrayList<PublisherChannelObj>(); List<String> networkList=new ArrayList<String>(); List<PublisherChannelObj> subList=null; PublisherChannelObj channelObj = new PublisherChannelObj(); ILinMobileDAO linDAO=new LinMobileDAO(); try { reallocationPublisherList=linDAO.loadReallocationDataForPublisher(5,lowerDate,upperDate,publisherName); if(reallocationPublisherList !=null){ Iterator<PublisherChannelObj> iterator = reallocationPublisherList.iterator(); while(iterator.hasNext()){ channelObj = iterator.next(); double ecpm = channelObj.geteCPM(); double ctr = channelObj.getCTR(); double cpc = ecpm/(1000*ctr); double floorCPM = 1000 * ctr * cpc; channelObj.setCPC(cpc); channelObj.setFloorCPM(floorCPM); if(!networkList.contains(channelObj.getChannelName())){ reallocationPublisherAlteredList.add(channelObj); networkList.add(channelObj.getChannelName()); } } log.info("Networks: "+networkList); log.info("Found objects from datastore :"+reallocationPublisherAlteredList.size()); return reallocationPublisherAlteredList; }else{ log.info("Found objects from datastore :null"); return reallocationPublisherAlteredList; } } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } public List<PublisherChannelObj> loadReallocationGraphPublisherData(String lowerDate,String upperDate,String publisherName){ List<PublisherChannelObj> reallocationPublisherList= null; ILinMobileDAO linDAO=new LinMobileDAO(); try { reallocationPublisherList=linDAO.loadReallocationDataForPublisher(5,lowerDate,upperDate,publisherName); return reallocationPublisherList; } catch (DataServiceException e) { log.severe("DataServiceException :"+e.getMessage()); return null; } } /* * Get ChannelPerformancePopUP * @Param - String lowerDate,String upperDate,String channelName * @Return - PopUpDTO popUpObj */ public PopUpDTO getChannelPerformancePopUP(String lowerDate,String upperDate,String channelName, String publisher){ String preUpperDate=DateUtil.getModifiedDateStringByDays(lowerDate, -1, "yyyy-MM-dd"); int days=(int)DateUtil.getDifferneceBetweenTwoDates(lowerDate, upperDate, "yyyy-MM-dd")+1; String preLowerDate=DateUtil.getModifiedDateStringByDays(preUpperDate, -days, "yyyy-MM-dd"); String monthToDateEnd=DateUtil.getCurrentTimeStamp("yyyy-MM-dd"); String[] dayArray=monthToDateEnd.split("-"); int year=Integer.parseInt(dayArray[0]); int month=Integer.parseInt(dayArray[1])-1; // subtract 1 from day String as day starts from 0 to 11 in Calender class String monthToDateStart=DateUtil.getDateByYearMonthDays(year,month,1,"yyyy-MM-dd");; log.info("Service: (startDate:"+lowerDate+" and endDate:"+upperDate+") and (preLowerDate="+preLowerDate+", preUpperDate="+preUpperDate+") and (monthToDateStart="+monthToDateStart+", monthToDateEnd="+monthToDateEnd+")"); PopUpDTO popUpObj = null; String chartData = null; try{ popUpObj=new PopUpDTO(); chartData=loadPerformanceChannelPopUpGraphDataFromBigQuery(lowerDate, upperDate, channelName, publisher); popUpObj.setChartData(chartData); }catch (Exception e) { log.severe("Exception in loading channel:"+channelName+" : "+e.getMessage()); } return popUpObj; } public String loadPerformanceChannelPopUpGraphDataFromBigQuery(String lowerDate,String upperDate,String channelName, String publisher){ List<PopUpDTO> resultList=null; IUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class); StringBuilder memcacheKeysubstring = new StringBuilder(); String chartData = ""; try { String channelId = getChannelsBQId(channelName); String publisherId = getPublisherBQId(publisher); chartData=MemcacheUtil.getPublisherChannelPopUpGraphData(lowerDate, upperDate, channelId, publisherId); if(chartData == null ){ log.info("Chart data not found in memcache, going to fetch from bigquery.."); ILinMobileDAO linDAO=new LinMobileDAO(); try { QueryDTO queryDTO = getQueryDTO(publisherId, lowerDate, upperDate, LinMobileConstants.BQ_CORE_PERFORMANCE); if(queryDTO != null && queryDTO.getQueryData() != null && queryDTO.getQueryData().length() > 0) { resultList=linDAO.loadChannelsPerformancePopUpGraphData(lowerDate, upperDate, channelId, publisherId, queryDTO); StringBuffer strBuffer=new StringBuffer(); strBuffer.append("[['Days', 'Impression']"); for (PopUpDTO object:resultList) { strBuffer.append(",["); strBuffer.append("'"+DateUtil.getFormatedDate(object.getDate(), "yyyy-MM-dd", "MM/dd")+"',"+object.getImpressionDeliveredLifeTime()); strBuffer.append("]"); } strBuffer.append("]"); chartData=strBuffer.toString(); log.info("Going to set this in memcache, chartData:"+chartData); MemcacheUtil.setPublisherChannelPopUpGraphData(chartData,lowerDate, upperDate, channelId, publisherId); } } catch (Exception e) { log.severe("Exception :"+e.getMessage()); } }else{ log.info("Chart data found from memcache:"+chartData); } }catch (Exception e) { log.severe("Exception in loadPerformanceChannelPopUpGraphDataFromBigQuery : "+e.getMessage()); } return chartData; } /* * loadActualPublisherData by channel name, selected time interval * @see com.lin.web.service.ILinMobileBusinessService#loadActualPublisherData(java.lang.String, java.lang.String, java.lang.String) */ public List<PublisherChannelObj> loadActualPublisherData(String lowerDate,String upperDate,String channelName){ List<PublisherChannelObj> resultList=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { resultList=linDAO.loadChannels(lowerDate, upperDate, channelName); }catch (DataServiceException e) { log.severe("Exception in loadActualPublisherData :"+channelName+" : "+e.getMessage()); } return resultList; } /* * Get getSellThroughPopUP * @Param - String lowerDate,String upperDate,String channelName * @Return - PopUpDTO popUpObj */ public PopUpDTO getSellThroughPopUP(String lowerDate,String upperDate,String propertyName){ List<SellThroughDataObj> resultList=null; PopUpDTO popUpObj=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { popUpObj=new PopUpDTO(); resultList=linDAO.loadSellThroughDataByProperty(lowerDate, upperDate, propertyName); if(resultList !=null && resultList.size()>0){ log.info("Got property :"+resultList.size()); SellThroughDataObj obj=resultList.get(0); popUpObj.setImpressionReserved(String.valueOf((obj.getReservedImpressions()))); popUpObj.setImpressionAvailable(String.valueOf((obj.getAvailableImpressions())) ); popUpObj.setImpressionForcasted(String.valueOf((obj.getForecastedImpressions()))); popUpObj.setSellThroughRate(String.valueOf((obj.getSellThroughRate()))); StringBuffer strBuffer=new StringBuffer(); strBuffer.append("[['Days', 'Impression']"); for (SellThroughDataObj object:resultList) { strBuffer.append(",["); strBuffer.append("'"+DateUtil.getFormatedDate(object.getDate(), "yyyy-MM-dd", "MM/dd")+"',"+object.getAvailableImpressions()); strBuffer.append("]"); } strBuffer.append("]"); log.info("strBuffer.toString():"+strBuffer.toString()); popUpObj.setChartData(strBuffer.toString()); }else{ log.info("No property found:"+propertyName+" and time: lowerDate:"+lowerDate+" and upperDate:"+upperDate); } } catch (DataServiceException e) { log.severe("Exception in loading property:"+propertyName+" : "+e.getMessage()); } return popUpObj; } public PopUpDTO getPropertyPopup(String lowerDate,String upperDate,String propertyName){ List<PublisherPropertiesObj> resultList=null; PopUpDTO popUpObj=null; ILinMobileDAO linDAO=new LinMobileDAO(); try { popUpObj=new PopUpDTO(); resultList=linDAO.loadPerformanceByPropertyList(lowerDate, upperDate, propertyName); if(resultList !=null && resultList.size()>0){ log.info("Got property :"+resultList.size()); PublisherPropertiesObj obj=resultList.get(0); popUpObj.seteCPM(String.valueOf(obj.geteCPM())); popUpObj.setClicksInSelectedTime(String.valueOf(obj.getClicks())); popUpObj.setImpressionDeliveredInSelectedTime(String.valueOf(obj.getImpressionsDelivered())); popUpObj.setPayout(String.valueOf(obj.getPayout())); popUpObj.setChangeCTRInSelectedTime(String.valueOf(obj.getCHG())); StringBuffer strBuffer=new StringBuffer(); strBuffer.append("[['Days', 'Impression']"); for (PublisherPropertiesObj object:resultList) { strBuffer.append(",["); strBuffer.append("'"+DateUtil.getFormatedDate(object.getDate(), "yyyy-MM-dd", "MM/dd")+"',"+object.getImpressionsDelivered()); strBuffer.append("]"); } strBuffer.append("]"); log.info("strBuffer.toString():"+strBuffer.toString()); popUpObj.setChartData(strBuffer.toString()); }else{ log.info("No property found:"+propertyName+" and time: lowerDate:"+lowerDate+" and upperDate:"+upperDate); } } catch (DataServiceException e) { log.severe("Exception in loading property:"+propertyName+" : "+e.getMessage()); } return popUpObj; } public List<PublisherTrendAnalysisHeaderDTO> loadTrendAnalysisHeaderData(String lowerDate,String upperDate,String publisherName,String channelName){ List<PublisherTrendAnalysisHeaderDTO> list = new ArrayList<PublisherTrendAnalysisHeaderDTO>(); ILinMobileDAO linDAO=new LinMobileDAO(); IUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class); String replaceStr = "\\\\'"; String channelAndDataSourceQuery = ""; try { if(channelName!=null){ StringBuilder memcacheKeysubstring = new StringBuilder(); channelAndDataSourceQuery = getChannelAndDataSourceQuery(userService.CommaSeperatedStringToList(channelName), memcacheKeysubstring, false); channelName = channelName.replaceAll("'", replaceStr); channelName = channelName.replaceAll(",", "','"); }else{ channelName = ""; } list = linDAO.loadTrendAnalysisHeaderData(lowerDate, upperDate, publisherName, channelName, channelAndDataSourceQuery); } catch (Exception e) { log.severe("Exception in loadTrendAnalysisHeaderData of LinMobileBusinessService : "+e.getMessage()); } return list; } public List<PublisherInventoryRevenueObj> loadInventoryRevenueHeaderData(String lowerDate,String upperDate,String publisherName,String channelName){ List<PublisherInventoryRevenueObj> list = new ArrayList<PublisherInventoryRevenueObj>(); ILinMobileDAO linDAO=new LinMobileDAO(); IUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class); List<String> channelArrList = null; try { channelArrList = userService.CommaSeperatedStringToList(channelName); StringBuilder memcacheKeysubstring = new StringBuilder(); String channelAndDataSourceQuery = getChannelAndDataSourceQuery(channelArrList, memcacheKeysubstring, false); String ChannelsStr = ChannelsInQString(channelArrList, memcacheKeysubstring); list = linDAO.loadInventoryRevenueHeaderData(lowerDate, upperDate, publisherName, ChannelsStr, channelAndDataSourceQuery); } catch (Exception e) { log.severe("Exception in loadInventoryRevenueHeaderData of LinMobileBusinessService : "+e.getMessage()); } return list; } public List<PublisherSummaryObj> loadPublisherSummaryData(String lowerDate,String upperDate,String publisherName, long dataStorePublisherId, long userId, String channelNames) { List<PublisherSummaryObj> list = new ArrayList<PublisherSummaryObj>(); ILinMobileDAO linDAO=new LinMobileDAO(); //IUserService userService = (IUserService) BusinessServiceLocator.locate(IUserService.class); try { if(lowerDate == null && upperDate== null) { // get MTD data String monthToDateEnd=DateUtil.getCurrentTimeStamp("yyyy-MM-dd"); String[] dayArray=monthToDateEnd.split("-"); int year=Integer.parseInt(dayArray[0]); int month=Integer.parseInt(dayArray[1])-1; // subtract 1 from day String as day starts from 0 to 11 in Calender class String monthToDateStart=DateUtil.getDateByYearMonthDays(year,month,1,"yyyy-MM-dd"); lowerDate = monthToDateStart; upperDate = monthToDateEnd; } String channelIds = getChannelsBQId(channelNames); String publisherId = getPublisherBQId(publisherName); QueryDTO queryDTO = getQueryDTO(publisherId, lowerDate, upperDate, LinMobileConstants.BQ_CORE_PERFORMANCE); if(queryDTO != null && queryDTO.getQueryData() != null && queryDTO.getQueryData().length() > 0) { //StringBuilder allChannelAndDataSourceDFP_MemcacheKeyPart = new StringBuilder(); StringBuilder DFP_Properties_MemcacheKeyPart = new StringBuilder(); String selectedDFPPropertiesQuery = getSelectedDFPPropertiesQuery(dataStorePublisherId, userId, DFP_Properties_MemcacheKeyPart); //String selectedDFPPropertiesQuery = ""; //String allChannelAndDataSourceQuery = getChannelAndDataSourceQuery(userService.CommaSeperatedStringToList(channelNames), allChannelAndDataSourceDFP_MemcacheKeyPart, true); list = linDAO.loadPublisherSummaryData(lowerDate, upperDate, selectedDFPPropertiesQuery, channelIds, queryDTO); } } catch (Exception e) { log.severe("Exception in loadPublisherSummaryData of LinMobileBusinessService : "+e.getMessage()); } return list; } public Map<String,List<PublisherPropertiesObj>> loadAllPerformanceByProperty(String lowerDate,String upperDate,String publisherName, long dataStorePublisherId, long userId,String channels,String applyFlag) throws Exception { List<PublisherPropertiesObj> list = new ArrayList<PublisherPropertiesObj>(); List<PublisherPropertiesObj> allPerformanceByPropertyTempList = new ArrayList<PublisherPropertiesObj>(); List<PublisherPropertiesObj> allPerformanceByPropertyList = new ArrayList<PublisherPropertiesObj>(); List<PublisherPropertiesObj> allPerformanceByPropertyBySiteNameList = new ArrayList<PublisherPropertiesObj>(); List<PublisherPropertiesObj> performanceByPropertyDFPObjectList = new ArrayList<PublisherPropertiesObj>(); List<PublisherPropertiesObj> performanceByPropertyNonDFPObjectList = new ArrayList<PublisherPropertiesObj>(); ILinMobileDAO linDAO=new LinMobileDAO(); Map<String,Double> totalImpByChannelMap = new HashMap<String,Double>(); Map<String,PublisherPropertiesObj> dataBySiteMap = new HashMap<String,PublisherPropertiesObj>(); Map<String,List<PublisherPropertiesObj>> performanceByPropertyMap = new HashMap<String,List<PublisherPropertiesObj>>(); Map<String,PublisherPropertiesObj> DFPObjectMap = new HashMap<String,PublisherPropertiesObj>(); Map<String,PublisherPropertiesObj> nonDFPObjectMap = new HashMap<String,PublisherPropertiesObj>(); double totalImpDelByChannel = 0; //StringBuilder allChannelAndDataSource_MemcacheKeyPart = new StringBuilder(); StringBuilder DFP_Properties_MemcacheKeyPart = new StringBuilder(); //StringBuilder channelWithDataSourceDFP_MemcacheKeyPart = new StringBuilder(); //String allChannelAndDataSourceQuery = getChannelAndDataSourceQuery(null, allChannelAndDataSource_MemcacheKeyPart, true); String selectedDFPPropertiesQuery = getSelectedDFPPropertiesQuery(dataStorePublisherId, userId, DFP_Properties_MemcacheKeyPart); //String selectedDFPSource = getChannelWithDataSourceDFPQuery(channelWithDataSourceDFP_MemcacheKeyPart); String channelIds = getChannelsBQId(channels); String publisherId = getPublisherBQId(publisherName); list = MemcacheUtil.getAllPerformanceByPropertyList(lowerDate, upperDate,publisherId, channelIds, DFP_Properties_MemcacheKeyPart.toString()); if(list==null || list.size()<=0){ QueryDTO queryDTO = getQueryDTO(publisherId, lowerDate, upperDate, LinMobileConstants.BQ_CORE_PERFORMANCE); if(queryDTO != null && queryDTO.getQueryData() != null && queryDTO.getQueryData().length() > 0) { list = linDAO.loadAllPerformanceByProperty(lowerDate, upperDate, channelIds, selectedDFPPropertiesQuery, queryDTO); MemcacheUtil.setAllPerformanceByPropertyList(list, lowerDate, upperDate,publisherId, channelIds, DFP_Properties_MemcacheKeyPart.toString()); } } if(list!=null && list.size()>0){ IUserDetailsDAO userDetailsDAO = new UserDetailsDAO(); List<CompanyObj> demandPartnersList = userDetailsDAO.getAllDemandPartners(MemcacheUtil.getAllCompanyList()); for (PublisherPropertiesObj publisherPropertiesObj : list) { if(publisherPropertiesObj!=null){ CompanyObj demandPartnerCompany = userDetailsDAO.getCompanyByName(publisherPropertiesObj.getChannelName().trim(), demandPartnersList); if(demandPartnerCompany!=null && demandPartnerCompany.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && demandPartnerCompany.getCompanyName() != null && !demandPartnerCompany.getCompanyName().trim().equalsIgnoreCase("") && demandPartnerCompany.getDataSource() != null && !demandPartnerCompany.getDataSource().trim().equalsIgnoreCase("")){ publisherPropertiesObj.setDataSource(demandPartnerCompany.getDataSource().trim()); } if( !totalImpByChannelMap.containsKey(publisherPropertiesObj.getChannelName()) && !publisherPropertiesObj.getDataSource().equals(LinMobileConstants.DEFAULT_DATASOURE_NAME)){ totalImpByChannelMap.put(publisherPropertiesObj.getChannelName(), Math.round(publisherPropertiesObj.getImpressionsDelivered())+0.0); }else if(totalImpByChannelMap.size()!=0 && totalImpByChannelMap.containsKey(publisherPropertiesObj.getChannelName())){ totalImpDelByChannel = totalImpByChannelMap.get(publisherPropertiesObj.getChannelName())+ Math.round(publisherPropertiesObj.getImpressionsDelivered()); totalImpByChannelMap.put(publisherPropertiesObj.getChannelName(), totalImpDelByChannel); } } allPerformanceByPropertyTempList.add(publisherPropertiesObj); } } if(allPerformanceByPropertyTempList!=null && allPerformanceByPropertyTempList.size()>0){ for (PublisherPropertiesObj publisherPropertiesObj : allPerformanceByPropertyTempList) { if(publisherPropertiesObj!=null){ if(totalImpByChannelMap!=null && totalImpByChannelMap.containsKey(publisherPropertiesObj.getChannelName())){ publisherPropertiesObj.setTotalImpressionsDeliveredByChannelName(totalImpByChannelMap.get(publisherPropertiesObj.getChannelName())); } } allPerformanceByPropertyList.add(publisherPropertiesObj); } performanceByPropertyMap.put("allData", allPerformanceByPropertyList); } MemcacheUtil.setAllPerformanceByPropertyCalculatedList(allPerformanceByPropertyList,lowerDate,upperDate,publisherId, channelIds, DFP_Properties_MemcacheKeyPart.toString()); if(allPerformanceByPropertyList!=null && allPerformanceByPropertyList.size()>0){ List<String> channelArrList = new ArrayList<String>(); String[] str = channels.split(","); if(str!=null){ for (String channel : str) { channelArrList.add(channel); } } for (PublisherPropertiesObj publisherPropertiesObjBySiteName : allPerformanceByPropertyList) { if( channelArrList!=null && channelArrList.contains(publisherPropertiesObjBySiteName.getChannelName())){ if(publisherPropertiesObjBySiteName!=null && publisherPropertiesObjBySiteName.getDataSource().equals(LinMobileConstants.DEFAULT_DATASOURE_NAME)){ performanceByPropertyDFPObjectList.add(publisherPropertiesObjBySiteName); }else{ performanceByPropertyNonDFPObjectList.add(publisherPropertiesObjBySiteName); } } } } if(performanceByPropertyDFPObjectList!=null && performanceByPropertyDFPObjectList.size()>0){ for (PublisherPropertiesObj publisherPropertiesObj : performanceByPropertyDFPObjectList) { if(!DFPObjectMap.containsKey(publisherPropertiesObj.getSite())){ DFPObjectMap.put(publisherPropertiesObj.getSite(), publisherPropertiesObj); }else{ PublisherPropertiesObj propertiesObj = copyObject(DFPObjectMap.get(publisherPropertiesObj.getSite())); double impressions = publisherPropertiesObj.getImpressionsDelivered(); double payout = publisherPropertiesObj.getDFPPayout(); long clicks = publisherPropertiesObj.getClicks(); propertiesObj.setImpressionsDelivered(impressions + propertiesObj.getImpressionsDelivered()); propertiesObj.setClicks(clicks + propertiesObj.getClicks()); propertiesObj.setDFPPayout(payout + propertiesObj.getDFPPayout()); if(propertiesObj.getImpressionsDelivered()!=0){ double ecpm = (propertiesObj.getDFPPayout()/propertiesObj.getImpressionsDelivered())*1000; propertiesObj.seteCPM(ecpm); } DFPObjectMap.put(propertiesObj.getSite(), propertiesObj); } } Iterator iterator = DFPObjectMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry mapEntry = (Map.Entry) iterator.next(); allPerformanceByPropertyBySiteNameList.add((PublisherPropertiesObj) mapEntry.getValue()); } } if(performanceByPropertyNonDFPObjectList!=null && performanceByPropertyNonDFPObjectList.size()>0) { for (PublisherPropertiesObj publisherPropertiesObj : performanceByPropertyNonDFPObjectList) { //PublisherPropertiesObj propertiesObj = copyObject(dataBySiteMap.get(publisherPropertiesObj.getSite())); if(!nonDFPObjectMap.containsKey(publisherPropertiesObj.getSite())){ nonDFPObjectMap.put(publisherPropertiesObj.getSite(), publisherPropertiesObj); double requestWeightage = 0.0; double impressions = 0.0; double payout = 0.0; PublisherPropertiesObj propertiesObj = copyObject(nonDFPObjectMap.get(publisherPropertiesObj.getSite())); if(propertiesObj.getTotalImpressionsDeliveredByChannelName()!=0){ requestWeightage = propertiesObj.getImpressionsDelivered()/propertiesObj.getTotalImpressionsDeliveredByChannelName(); } long clicks = publisherPropertiesObj.getClicks(); impressions = (requestWeightage * propertiesObj.getTotalImpressionsDeliveredBySiteName()); payout = requestWeightage * propertiesObj.getPayout(); propertiesObj.setImpressionsDelivered((impressions)); propertiesObj.setPayout(payout); propertiesObj.setClicks(clicks + propertiesObj.getClicks()); if(propertiesObj.getImpressionsDelivered()!=0){ double ecpm = (propertiesObj.getPayout()/propertiesObj.getImpressionsDelivered())*1000; propertiesObj.seteCPM(ecpm); } nonDFPObjectMap.put(propertiesObj.getSite(), propertiesObj); }else{ double requestWeightage = 0.0; double impressions = 0.0; double payout = 0.0; PublisherPropertiesObj propertiesObj = copyObject(nonDFPObjectMap.get(publisherPropertiesObj.getSite())); if(publisherPropertiesObj.getTotalImpressionsDeliveredByChannelName()!=0){ requestWeightage = publisherPropertiesObj.getImpressionsDelivered()/publisherPropertiesObj.getTotalImpressionsDeliveredByChannelName(); } long clicks = publisherPropertiesObj.getClicks(); impressions = (requestWeightage * publisherPropertiesObj.getTotalImpressionsDeliveredBySiteName()); payout = requestWeightage * publisherPropertiesObj.getPayout(); propertiesObj.setImpressionsDelivered(impressions+propertiesObj.getImpressionsDelivered()); propertiesObj.setPayout(payout+propertiesObj.getPayout()); propertiesObj.setClicks(clicks + propertiesObj.getClicks()); if(propertiesObj.getImpressionsDelivered()!=0){ double ecpm = (propertiesObj.getPayout()/propertiesObj.getImpressionsDelivered())*1000; propertiesObj.seteCPM(ecpm); } nonDFPObjectMap.put(propertiesObj.getSite(), propertiesObj); } } Iterator iterator = nonDFPObjectMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry mapEntry = (Map.Entry) iterator.next(); allPerformanceByPropertyBySiteNameList.add((PublisherPropertiesObj) mapEntry.getValue()); } } if(allPerformanceByPropertyBySiteNameList!=null && allPerformanceByPropertyBySiteNameList.size()>0){ for (PublisherPropertiesObj publisherPropertiesObj : allPerformanceByPropertyBySiteNameList) { if(!dataBySiteMap.containsKey(publisherPropertiesObj.getSite())){ dataBySiteMap.put(publisherPropertiesObj.getSite(), publisherPropertiesObj); PublisherPropertiesObj propertiesObj = copyObject(dataBySiteMap.get(publisherPropertiesObj.getSite())); if(propertiesObj.getDataSource().equals(LinMobileConstants.DEFAULT_DATASOURE_NAME)){ double payout = propertiesObj.getDFPPayout(); propertiesObj.setPayout(payout); dataBySiteMap.put(publisherPropertiesObj.getSite(), propertiesObj); } }else{ double payout = 0.0; double previousPayout = 0.0; PublisherPropertiesObj propertiesObj = copyObject(dataBySiteMap.get(publisherPropertiesObj.getSite())); long clicks = publisherPropertiesObj.getClicks(); double impressions = Math.round(publisherPropertiesObj.getImpressionsDelivered()) + 0.0; if(!publisherPropertiesObj.getDataSource().equals(LinMobileConstants.DEFAULT_DATASOURE_NAME)){ payout = publisherPropertiesObj.getPayout(); }else{ payout = publisherPropertiesObj.getDFPPayout(); } if(!propertiesObj.getDataSource().equals(LinMobileConstants.DEFAULT_DATASOURE_NAME)){ previousPayout = propertiesObj.getPayout(); }else{ previousPayout = propertiesObj.getDFPPayout(); } propertiesObj.setImpressionsDelivered(impressions + Math.round(propertiesObj.getImpressionsDelivered())+0.0); propertiesObj.setPayout(payout + previousPayout); propertiesObj.setClicks(clicks + propertiesObj.getClicks()); if(propertiesObj.getImpressionsDelivered()!=0){ double ecpm = (propertiesObj.getPayout()/propertiesObj.getImpressionsDelivered())*1000; propertiesObj.seteCPM(ecpm); } dataBySiteMap.put(propertiesObj.getSite(), propertiesObj); } } Iterator iterator = dataBySiteMap.entrySet().iterator(); allPerformanceByPropertyBySiteNameList = new ArrayList<PublisherPropertiesObj>(); while (iterator.hasNext()) { Map.Entry mapEntry = (Map.Entry) iterator.next(); allPerformanceByPropertyBySiteNameList.add((PublisherPropertiesObj) mapEntry.getValue()); } performanceByPropertyMap.put("allDataBySiteName", allPerformanceByPropertyBySiteNameList); } return performanceByPropertyMap; } public List<PublisherReallocationHeaderDTO> loadReallocationHeaderData(String lowerDate,String upperDate,String publisherName,String channelName) { List<PublisherReallocationHeaderDTO> list = new ArrayList<PublisherReallocationHeaderDTO>(); ILinMobileDAO linDAO=new LinMobileDAO(); List<String> channelArrList = new ArrayList<String>(); String[] str = channelName.split(","); if(str!=null){ for (String channel : str) { channelArrList.add(channel); } } list = linDAO.loadReallocationHeaderData(lowerDate, upperDate, publisherName, channelArrList); return list; } public List<PropertyDropDownDTO> loadPublisherPropertyDropDownList(String publisherName,long userId,String str) { List<PropertyDropDownDTO> propertyList = new ArrayList<PropertyDropDownDTO>(); String replaceStr = "\\\\'"; if(str!=null){ str = str.replaceAll("'", replaceStr); } if(publisherName!=null){ publisherName = publisherName.replaceAll("'", replaceStr); } /*ILinMobileDAO linDAO=new LinMobileDAO(); 24.08.2013 propertyList = linDAO.loadPublisherPropertyDropDownList(publisherName,userId,str);*/ IUserDetailsDAO dao = new UserDetailsDAO(); propertyList = dao.loadPropertyDropDownList(publisherName,userId,str); if(propertyList!=null && propertyList.size()>0){ return propertyList; } return new ArrayList<PropertyDropDownDTO>(); } @Override public List<CommonDTO> getAllPublishersByPublisherIdAndUserId(String selectedPublisherId, List<String> channelsNameList, long userId) { log.info("Inside getAllPublishersByPublisherIdAndUserId in LinMobileBusinessService"); IUserDetailsDAO dao = new UserDetailsDAO(); List<String> publisherIdList = new ArrayList<String>(); List<CommonDTO> allPublishersList = new ArrayList<CommonDTO>(0); try { List<CompanyObj> companyObjList = MemcacheUtil.getAllCompanyList(); List<CompanyObj> publisherList = dao.getAllPublishers(companyObjList); List<CompanyObj> selectedPublishersList = dao.getSelectedPublishersByUserId(userId, publisherIdList, publisherList); if(!selectedPublisherId.trim().equalsIgnoreCase("")) { CompanyObj publisherCompany = dao.getCompanyById(Long.valueOf(selectedPublisherId), publisherList); if(publisherCompany != null && publisherIdList.contains(String.valueOf(publisherCompany.getId())) && publisherCompany.getStatus().trim().equals(LinMobileConstants.STATUS_ARRAY[0]) && publisherCompany.getCompanyName() != null) { allPublishersList.add(new CommonDTO(selectedPublisherId.trim(), publisherCompany.getCompanyName().trim())); } } if(selectedPublishersList != null && selectedPublishersList.size() > 0) { for (CompanyObj publisherCompany : selectedPublishersList) { if(publisherCompany != null && publisherCompany.getStatus().trim().equalsIgnoreCase(LinMobileConstants.STATUS_ARRAY[0]) && publisherCompany.getCompanyName() != null && !publisherCompany.getCompanyName().trim().equalsIgnoreCase("")) { if(!selectedPublisherId.trim().equalsIgnoreCase("") && selectedPublisherId.trim().equals(String.valueOf(publisherCompany.getId()))) { //do nothing } else { allPublishersList.add(new CommonDTO(String.valueOf(publisherCompany.getId()),publisherCompany.getCompanyName().trim())); } } } } if(allPublishersList != null && allPublishersList.size() > 0) { selectedPublisherId = allPublishersList.get(0).getId(); String commaSeperatedChannelsName = getCommaSeperatedChannelsNameByPublisherIdAndUserId(selectedPublisherId, userId, companyObjList); if(commaSeperatedChannelsName != null && !commaSeperatedChannelsName.trim().equalsIgnoreCase("")) { channelsNameList.add(commaSeperatedChannelsName); } } } catch (Exception e) { log.severe("Exception in getAllPublishersByPublisherIdAndUserId of LinMobileBusinessService"+e.getMessage()); } return allPublishersList; } @Override public String getCommaSeperatedChannelsNameByPublisherIdAndUserId(String publisherId, long userId, List<CompanyObj> companyObjList) throws Exception { log.info("Inside getCommaSeperatedChannelsNameByPublisherIdAndUserId in LinMobileBusinessService"); IUserDetailsDAO dao = new UserDetailsDAO(); List<String> commaSeperatedChannelsNameList = new ArrayList<String>(0); String commaSeperatedChannelsName = ""; List<CompanyObj> demandPartnersList = dao.getActiveDemandPartnersByPublisherCompanyId(publisherId); if(demandPartnersList != null && demandPartnersList.size() > 0) { log.info("demandPartnersIdList.size : "+demandPartnersList.size()); for (CompanyObj demandPartner : demandPartnersList) { if(demandPartner != null && !commaSeperatedChannelsNameList.contains(demandPartner.getCompanyName().trim())) { commaSeperatedChannelsNameList.add(demandPartner.getCompanyName().trim()); commaSeperatedChannelsName = commaSeperatedChannelsName + demandPartner.getCompanyName().trim() + ","; } } if(commaSeperatedChannelsName.lastIndexOf(",") != -1) { commaSeperatedChannelsName = commaSeperatedChannelsName.substring(0, commaSeperatedChannelsName.lastIndexOf(",")); } } return commaSeperatedChannelsName; } public List<PropertyDropDownDTO> loadAdvertiserPropertyDropDownList(String publisherId,long userId,String str) { List<PropertyDropDownDTO> propertyList = new ArrayList<PropertyDropDownDTO>(); String replaceStr = "\\\\'"; if(str!=null){ str = str.replaceAll("'", replaceStr); } IUserDetailsDAO dao = new UserDetailsDAO(); propertyList = dao.loadPropertyDropDownList(publisherId,userId,str); if(propertyList!=null && propertyList.size()>0){ return propertyList; } return new ArrayList<PropertyDropDownDTO>(); } @Override public String getCommaSeperatedChannelsNameByChannelIdList(List<String> channelIdList) throws Exception { log.info("Inside getCommaSeperatedChannelsNameByChannelIdList of LinMobileBussinessService"); String commaSeperatedChannelNames = ""; IUserDetailsDAO userDetailsDAO = new UserDetailsDAO(); List<CompanyObj> demandPartnersList = userDetailsDAO.getAllDemandPartners(MemcacheUtil.getAllCompanyList()); if(channelIdList != null && channelIdList.size() > 0) { for (String channelId : channelIdList) { CompanyObj demandPartnerCompany = userDetailsDAO.getCompanyById(Long.valueOf(channelId), demandPartnersList); if(demandPartnerCompany != null && demandPartnerCompany.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && demandPartnerCompany.getCompanyName() != null) { commaSeperatedChannelNames = commaSeperatedChannelNames + demandPartnerCompany.getCompanyName().trim() + ","; } } } if(commaSeperatedChannelNames.lastIndexOf(",") != -1) { commaSeperatedChannelNames = commaSeperatedChannelNames.substring(0, commaSeperatedChannelNames.lastIndexOf(",")); } return commaSeperatedChannelNames; } @Override public String getCommaSeperatedChannelsName(String publisherName) throws Exception { log.info("Inside getCommaSeperatedChannelsName of LinMobileBussinessService"); String commaSeperatedChannelNames = ""; IUserDetailsDAO userDetailsDAO = new UserDetailsDAO(); List<CompanyObj> companyObjList = MemcacheUtil.getAllCompanyList(); List<CompanyObj> demandPartnersList = userDetailsDAO.getAllDemandPartners(companyObjList); CompanyObj publisherCompany = userDetailsDAO.getCompanyObjByNameAndCompanyType(publisherName, LinMobileConstants.COMPANY_TYPE[0], companyObjList); if(publisherCompany != null && publisherCompany.getStatus().trim().equalsIgnoreCase(LinMobileConstants.STATUS_ARRAY[0]) && publisherCompany.getDemandPartnerId() != null) { List<String> channelIdList = publisherCompany.getDemandPartnerId(); if(channelIdList != null && channelIdList.size() > 0) { for (String channelId : channelIdList) { CompanyObj demandPartnerCompany = userDetailsDAO.getCompanyById(Long.valueOf(channelId), demandPartnersList); if(demandPartnerCompany != null && demandPartnerCompany.getStatus().equals(LinMobileConstants.STATUS_ARRAY[0]) && demandPartnerCompany.getCompanyName() != null) { commaSeperatedChannelNames = commaSeperatedChannelNames + demandPartnerCompany.getCompanyName().trim() + ","; } } } } if(commaSeperatedChannelNames.lastIndexOf(",") != -1) { commaSeperatedChannelNames = commaSeperatedChannelNames.substring(0, commaSeperatedChannelNames.lastIndexOf(",")); } return commaSeperatedChannelNames; } public List<ReconciliationDataDTO> createSummaryData(List<ReconciliationDataDTO> reconciliationDataDTOList, String channelName, List<String> passBackList) { log.info("Inside createSummaryData of LinMobileBussinessService"); List<ReconciliationDataDTO> tempReconciliationSummaryDataList = new ArrayList<ReconciliationDataDTO>(); long DFP_requests = 0; long DFP_delivered = 0; long DFP_passback = 0; long demandPartnerRequests = 0; long demandPartnerDelivered = 0; long demandPartnerPassbacks = 0; double varianceRequests = 0; double varianceDelivered = 0; double variancePassbacks = 0; if(reconciliationDataDTOList != null && reconciliationDataDTOList.size() > 0) { for (ReconciliationDataDTO reconciliationDataDTO : reconciliationDataDTOList) { if(reconciliationDataDTO != null) { DFP_requests = DFP_requests +reconciliationDataDTO.getDFP_requests(); DFP_delivered = DFP_delivered +reconciliationDataDTO.getDFP_delivered(); DFP_passback = DFP_passback +reconciliationDataDTO.getDFP_passback(); demandPartnerRequests = demandPartnerRequests +reconciliationDataDTO.getDemandPartnerRequests(); demandPartnerDelivered = demandPartnerDelivered +reconciliationDataDTO.getDemandPartnerDelivered(); demandPartnerPassbacks = demandPartnerPassbacks +reconciliationDataDTO.getDemandPartnerPassbacks(); } } if(DFP_requests != 0) { varianceRequests = Double.valueOf((demandPartnerRequests - DFP_requests)*100)/DFP_requests; } if(DFP_delivered != 0) { varianceDelivered = Double.valueOf((demandPartnerDelivered - DFP_delivered)*100)/DFP_delivered; } if(DFP_passback != 0) { variancePassbacks = Double.valueOf((demandPartnerPassbacks - DFP_passback)*100)/DFP_passback; } if(DFP_requests == 0) { DFP_delivered = 0; varianceRequests = 0; varianceDelivered = 0; } if(demandPartnerRequests == 0) { demandPartnerPassbacks = 0; varianceRequests = 0; variancePassbacks = 0; } ReconciliationDataDTO dto = new ReconciliationDataDTO(); if(passBackList == null || passBackList.size() == 0) { dto.setSiteType("NA"); } dto.setChannelName(channelName); dto.setDFP_requests(DFP_requests); dto.setDFP_delivered(DFP_delivered); dto.setDFP_passback(DFP_passback); dto.setDemandPartnerRequests(demandPartnerRequests); dto.setDemandPartnerDelivered(demandPartnerDelivered); dto.setDemandPartnerPassbacks(demandPartnerPassbacks); dto.setVarianceRequests(varianceRequests); dto.setVarianceDelivered(varianceDelivered); dto.setVariancePassbacks(variancePassbacks); tempReconciliationSummaryDataList.add(dto); } return tempReconciliationSummaryDataList; } @Override public void loadAllReconciliationData(String startDate, String endDate, String publisherId, long userId, List<ReconciliationDataDTO> reconciliationSummaryDataList, List<ReconciliationDataDTO> reconciliationDetailsDataList) throws Exception { log.info("Inside loadAllReconciliationData of LinMobileBussinessService"); ILinMobileDAO linDAO=new LinMobileDAO(); IUserDetailsDAO userDetailsDAO = new UserDetailsDAO(); List<ReconciliationDataDTO> tempSubList = null; List<Date> dateList = new ArrayList<Date>(); List<ReconciliationDataDTO> reconciliationDataDTOList = null; List<ReconciliationDataDTO> resultList = null; List<CommonDTO> channelsInfo = new ArrayList<CommonDTO>(); HashMap<String, List<String>> channelPassbackSiteTypeMap = new HashMap<String, List<String>>(); String publisherName = ""; int tempCount = 0; List<CompanyObj> companyObjList = MemcacheUtil.getAllCompanyList(); CompanyObj publisherCompany = userDetailsDAO.getCompanyObjByIdAndCompanyType(publisherId, LinMobileConstants.COMPANY_TYPE[0], companyObjList); if(publisherCompany != null && publisherCompany.getStatus().trim().equalsIgnoreCase(LinMobileConstants.STATUS_ARRAY[0]) && publisherCompany.getCompanyName() != null && !publisherCompany.getCompanyName().equalsIgnoreCase("")) { List<CompanyObj> demandPartnersList = userDetailsDAO.getActiveDemandPartnersByPublisherCompanyId(publisherId); if(demandPartnersList != null && demandPartnersList.size() > 0) { List<String> passbackValues = userDetailsDAO.getPassbackValues(demandPartnersList); String hashedPassbackValueString = ""; String lineItemQuery = "line_item =''"; if(passbackValues != null && passbackValues.size() > 0) { lineItemQuery = ""; for(String passbackValue : passbackValues) { hashedPassbackValueString = hashedPassbackValueString + passbackValue.trim(); lineItemQuery = lineItemQuery + "line_item ='"+passbackValue.trim()+"' or "; } if(lineItemQuery.lastIndexOf("or") != -1) { lineItemQuery = lineItemQuery.substring(0, lineItemQuery.lastIndexOf("or")); } hashedPassbackValueString = EncriptionUtil.getEncriptedStrMD5(hashedPassbackValueString); } publisherName = publisherCompany.getCompanyName(); String publisherBQId = getPublisherBQId(publisherName); QueryDTO queryDTO = getQueryDTO(publisherBQId, startDate, endDate, LinMobileConstants.BQ_CORE_PERFORMANCE); resultList = MemcacheUtil.getReconciliationDataList(startDate, endDate, publisherBQId, hashedPassbackValueString); if(resultList != null && resultList.size()> 0) { reconciliationDataDTOList =resultList; } else { resultList = linDAO.loadAllRecociliationData(startDate, endDate, lineItemQuery, queryDTO); if(resultList != null && resultList.size()> 0) { MemcacheUtil.setReconciliationDataList(resultList, startDate, endDate, publisherBQId, hashedPassbackValueString); reconciliationDataDTOList =resultList; } } if(reconciliationDataDTOList != null && reconciliationDataDTOList.size() > 0) { for (CompanyObj demandPartner : demandPartnersList) { if(demandPartner != null && !demandPartner.getDataSource().trim().equals(LinMobileConstants.DFP_DATA_SOURCE)) { if(demandPartner.getPassback_Site_type() != null && demandPartner.getPassback_Site_type().size() > 0) { channelPassbackSiteTypeMap.put(demandPartner.getCompanyName().trim(), demandPartner.getPassback_Site_type()); } else { channelPassbackSiteTypeMap.put(demandPartner.getCompanyName().trim(), new ArrayList<String>()); } CommonDTO commonDTO = new CommonDTO(); commonDTO.setChannelName(demandPartner.getCompanyName().trim()); commonDTO.setChannelDataSource(demandPartner.getDataSource().trim()); channelsInfo.add(commonDTO); } } if(channelsInfo != null && channelsInfo.size() > 0) { List<String> tempDateList = new ArrayList<String>(); for (ReconciliationDataDTO reconciliationDataDTO : reconciliationDataDTOList) { if(reconciliationDataDTO != null && reconciliationDataDTO.getDate() != null && !tempDateList.contains(reconciliationDataDTO.getFormattedDate().trim())) { tempDateList.add(reconciliationDataDTO.getFormattedDate().trim()); dateList.add(reconciliationDataDTO.getDate()); } } if(dateList != null && dateList.size() > 0) { for(CommonDTO channelInfo : channelsInfo) { List<ReconciliationDataDTO> tempReconciliationDetailsDataList = new ArrayList<ReconciliationDataDTO>(); String channel = channelInfo.getChannelName().trim(); String channelDataSource = channelInfo.getChannelDataSource().trim(); List<String> passBackList = channelPassbackSiteTypeMap.get(channel); tempSubList = reconciliationDataDTOList.subList(0, reconciliationDataDTOList.size()-1); tempCount = 0; for(Date date : dateList) { long DFP_requests = 0; long DFP_delivered = 0; long DFP_passback = 0; long demandPartnerRequests = 0; long demandPartnerDelivered = 0; long demandPartnerPassbacks = 0; double varianceRequests = 0; double varianceDelivered = 0; double variancePassbacks = 0; for (ReconciliationDataDTO reconciliationDataDTO : tempSubList) { if(reconciliationDataDTO != null && reconciliationDataDTO.getDate() != null) { if(reconciliationDataDTO.getDate().compareTo(date) > 0) { // create detail data if(passBackList == null || passBackList.size() == 0) { DFP_requests = 0; DFP_delivered = 0; DFP_passback = 0; demandPartnerRequests = 0; demandPartnerDelivered = 0; demandPartnerPassbacks = 0; varianceRequests = 0; varianceDelivered = 0; variancePassbacks = 0; } DFP_delivered = DFP_requests - DFP_passback; demandPartnerPassbacks = demandPartnerRequests - demandPartnerDelivered; if(DFP_requests != 0) { varianceRequests = Double.valueOf((demandPartnerRequests - DFP_requests)*100)/DFP_requests; } if(DFP_delivered != 0) { varianceDelivered = Double.valueOf((demandPartnerDelivered - DFP_delivered)*100)/DFP_delivered; } if(DFP_passback != 0) { variancePassbacks = Double.valueOf((demandPartnerPassbacks - DFP_passback)*100)/DFP_passback; } if(DFP_requests == 0) { DFP_delivered = 0; varianceRequests = 0; varianceDelivered = 0; } if(demandPartnerRequests == 0) { demandPartnerPassbacks = 0; varianceRequests = 0; variancePassbacks = 0; } ReconciliationDataDTO dto = new ReconciliationDataDTO(); dto.setChannelName(channel); dto.setFormattedDate(DateUtil.getFormatedStringDateYYYYMMDD(date)); dto.setDFP_requests(DFP_requests); dto.setDFP_delivered(DFP_delivered); dto.setDFP_passback(DFP_passback); dto.setDemandPartnerRequests(demandPartnerRequests); dto.setDemandPartnerDelivered(demandPartnerDelivered); dto.setDemandPartnerPassbacks(demandPartnerPassbacks); dto.setVarianceRequests(varianceRequests); dto.setVarianceDelivered(varianceDelivered); dto.setVariancePassbacks(variancePassbacks); tempReconciliationDetailsDataList.add(dto); tempSubList = reconciliationDataDTOList.subList(tempCount, reconciliationDataDTOList.size()-1); break; } tempCount++; // calculate Data if(reconciliationDataDTO.getDataSource().trim().equalsIgnoreCase(LinMobileConstants.DFP_DATA_SOURCE) && reconciliationDataDTO.getChannelName().trim().equals(channel)) { DFP_requests = DFP_requests + reconciliationDataDTO.getRequests(); } if(reconciliationDataDTO.getDataSource().trim().equalsIgnoreCase(LinMobileConstants.DFP_DATA_SOURCE) && passBackList.contains(reconciliationDataDTO.getSiteType().trim())) { DFP_passback = DFP_passback + reconciliationDataDTO.getDelivered(); } if(reconciliationDataDTO.getDataSource().trim().equals(channelDataSource) && reconciliationDataDTO.getChannelName().trim().equals(channel)) { demandPartnerRequests = demandPartnerRequests + reconciliationDataDTO.getRequests(); demandPartnerDelivered = demandPartnerDelivered + reconciliationDataDTO.getDelivered(); } if(tempCount == reconciliationDataDTOList.size()-1) { if(passBackList == null || passBackList.size() == 0) { DFP_requests = 0; DFP_delivered = 0; DFP_passback = 0; demandPartnerRequests = 0; demandPartnerDelivered = 0; demandPartnerPassbacks = 0; varianceRequests = 0; varianceDelivered = 0; variancePassbacks = 0; } DFP_delivered = DFP_requests - DFP_passback; demandPartnerPassbacks = demandPartnerRequests - demandPartnerDelivered; if(DFP_requests != 0) { varianceRequests = Double.valueOf((demandPartnerRequests - DFP_requests)*100)/DFP_requests; } if(DFP_delivered != 0) { varianceDelivered = Double.valueOf((demandPartnerDelivered - DFP_delivered)*100)/DFP_delivered; } if(DFP_passback != 0) { variancePassbacks = Double.valueOf((demandPartnerPassbacks - DFP_passback)*100)/DFP_passback; } if(DFP_requests == 0) { DFP_delivered = 0; varianceRequests = 0; varianceDelivered = 0; } if(demandPartnerRequests == 0) { demandPartnerPassbacks = 0; varianceRequests = 0; variancePassbacks = 0; } ReconciliationDataDTO dto = new ReconciliationDataDTO(); dto.setChannelName(channel); dto.setFormattedDate(DateUtil.getFormatedStringDateYYYYMMDD(date)); dto.setDFP_requests(DFP_requests); dto.setDFP_delivered(DFP_delivered); dto.setDFP_passback(DFP_passback); dto.setDemandPartnerRequests(demandPartnerRequests); dto.setDemandPartnerDelivered(demandPartnerDelivered); dto.setDemandPartnerPassbacks(demandPartnerPassbacks); dto.setVarianceRequests(varianceRequests); dto.setVarianceDelivered(varianceDelivered); dto.setVariancePassbacks(variancePassbacks); tempReconciliationDetailsDataList.add(dto); tempSubList = reconciliationDataDTOList.subList(tempCount, reconciliationDataDTOList.size()-1); } } } } reconciliationDetailsDataList.addAll(tempReconciliationDetailsDataList); // create summary data List<ReconciliationDataDTO> tempReconciliationSummaryDataList = createSummaryData(tempReconciliationDetailsDataList, channel, passBackList); if(tempReconciliationSummaryDataList !=null && tempReconciliationSummaryDataList.size() > 0) { reconciliationSummaryDataList.addAll(tempReconciliationSummaryDataList); } } } } } } } } public List<LineItemDTO> loadCampaignTraffickingData(DfpServices dfpServices,DfpSession session,String lowerDate, String upperDate,long userId)throws Exception { log.info("inside loadCampaignTraffickingData() of LinMobileBusinessService class"); LineItemServiceInterface lineItemService = dfpServices.get(session, LineItemServiceInterface.class); List<LineItemDTO> totalLineItemDTOList=new ArrayList<LineItemDTO>(); List<LineItem> lineItemList=new ArrayList<LineItem>(); Statement lineItemStatement=new Statement(); LineItemPage page = null; String query = ""; /*Getting DELIVERING lineitems*/ try { List<LineItemDTO> deliveringCampaignList = MemcacheUtil.getDeliveringCampaignList(lowerDate,upperDate); if(deliveringCampaignList == null || deliveringCampaignList.size() <= 0) { query="WHERE status = '"+ComputedStatus.DELIVERING+"' AND targetPlatform = '"+TargetPlatform.MOBILE+"' AND startDateTime = '"+lowerDate+"' AND endDateTime = '"+upperDate+"'"; log.info("loadCampaignTraffickingData Query 1 (DELIVERING): "+query); lineItemStatement.setQuery(query); int j=0; do{ page=lineItemService.getLineItemsByStatement(lineItemStatement); List<LineItem> result = page.getResults(); if(result !=null && result.size()>0) { deliveringCampaignList = getLineItemDTOList(result); log.info("Delivering Campaigns = "+deliveringCampaignList.size()); } else { log.warning("No line items found for query (DELIVERING):"+query); } }while(page.getResults()== null && j<=3); MemcacheUtil.setDeliveringCampaignList(deliveringCampaignList,lowerDate,upperDate); } if(deliveringCampaignList != null && deliveringCampaignList.size() > 0) { totalLineItemDTOList.addAll(deliveringCampaignList); } }catch(Exception e) { log.severe("exception in loadCampaignTraffickingData LinMobileBusinessService (DELIVERING): "+e.getMessage()); } /*Getting READY lineitems*/ try { List<LineItemDTO> readyCampaignList = MemcacheUtil.getReadyCampaignList(); if(readyCampaignList == null || readyCampaignList.size() <= 0) { query="WHERE status = '"+ComputedStatus.READY+"' AND targetPlatform = '"+TargetPlatform.MOBILE+"'"; log.info("loadCampaignTraffickingData Query 2 (READY): "+query); lineItemStatement.setQuery(query); int j=0; do{ page=lineItemService.getLineItemsByStatement(lineItemStatement); List<LineItem> result = page.getResults(); if(result !=null && result.size()>0) { readyCampaignList = getLineItemDTOList(result); log.info("Ready Campaigns = "+readyCampaignList.size()); } else { log.warning("No line items found for quer (READY): "+query); } }while(page.getResults()== null && j<=3); MemcacheUtil.setReadyCampaignList(readyCampaignList); } if(readyCampaignList != null && readyCampaignList.size() > 0) { totalLineItemDTOList.addAll(readyCampaignList); } }catch(Exception e) { log.severe("exception in loadCampaignTraffickingData LinMobileBusinessService (READY): "+e.getMessage()); } /*Getting DRAFTS & NEEDS_CREATIVES lineitems*/ try { List<LineItemDTO> draftAndNeedCreativesCampaignList = MemcacheUtil.getDraftAndNeedCreativesCampaignList(); if(draftAndNeedCreativesCampaignList == null || draftAndNeedCreativesCampaignList.size() <= 0) { query="WHERE ( status = '"+ComputedStatus.DRAFT+"' " + "or status = '"+ComputedStatus.NEEDS_CREATIVES+"'" + ")" + " AND targetPlatform = '"+TargetPlatform.MOBILE+"'"; log.info("loadCampaignTraffickingData Query 3 (DRAFT & NEEDS_CREATIVES):"+query); lineItemStatement.setQuery(query); int j=0; do{ page=lineItemService.getLineItemsByStatement(lineItemStatement); List<LineItem> result = page.getResults(); if(result !=null && result.size()>0) { draftAndNeedCreativesCampaignList = getLineItemDTOList(result); log.info("Draft and Need Creatives Campaigns = "+draftAndNeedCreativesCampaignList.size()); } else { log.warning("No line items found for query (DRAFT & NEEDS_CREATIVES): "+query); } }while(page.getResults()== null && j<=3); MemcacheUtil.setDraftAndNeedCreativesCampaignList(draftAndNeedCreativesCampaignList); } if(draftAndNeedCreativesCampaignList != null && draftAndNeedCreativesCampaignList.size() > 0) { totalLineItemDTOList.addAll(draftAndNeedCreativesCampaignList); } }catch(Exception e) { log.severe("exception in loadCampaignTraffickingData RichMediaAdvertiserService (DRAFT & NEEDS_CREATIVES): "+e.getMessage()); } /*Getting PAUSED & PAUSED_INVENTORY_RELEASED lineitems*/ try { List<LineItemDTO> pausedAndInventoryReleasedCampaignList = MemcacheUtil.getPausedAndInventoryReleasedCampaignList(); if(pausedAndInventoryReleasedCampaignList == null || pausedAndInventoryReleasedCampaignList.size() <= 0) { query="WHERE (" + "status = '"+ComputedStatus.PAUSED+"' " + "or status = '"+ComputedStatus.PAUSED_INVENTORY_RELEASED+"' " + ") " + "AND targetPlatform = '"+TargetPlatform.MOBILE+"'"; log.info("loadCampaignTraffickingData Query 4 (PAUSED & PAUSED_INVENTORY_RELEASED): "+query); lineItemStatement.setQuery(query); int j=0; do{ page=lineItemService.getLineItemsByStatement(lineItemStatement); List<LineItem> result = page.getResults(); if(result != null && result.size() > 0) { pausedAndInventoryReleasedCampaignList = getLineItemDTOList(result); log.info("Paused And Inventory Released Campaigns = "+pausedAndInventoryReleasedCampaignList.size()); } else { log.warning("No line items found for query 5 (PAUSED & PAUSED_INVENTORY_RELEASED):"+query); } }while(page.getResults()== null && j<=3); MemcacheUtil.setPausedAndInventoryReleasedCampaignList(pausedAndInventoryReleasedCampaignList); } if(pausedAndInventoryReleasedCampaignList != null && pausedAndInventoryReleasedCampaignList.size() > 0) { totalLineItemDTOList.addAll(pausedAndInventoryReleasedCampaignList); } }catch(Exception e) { log.severe("exception in loadCampaignTraffickingData LinMobileBusinessService (PAUSED & PAUSED_INVENTORY_RELEASED): "+e.getMessage()); } /*Getting PENDING_APPROVAL lineitems*/ try { List<LineItemDTO> pendingApprovalCampaignList = MemcacheUtil.getPendingApprovalCampaignList(); if(pendingApprovalCampaignList == null || pendingApprovalCampaignList.size() <= 0) { query="WHERE status = '"+ComputedStatus.PENDING_APPROVAL+"' AND targetPlatform = '"+TargetPlatform.MOBILE+"'"; log.info("loadCampaignTraffickingData Query 6 (PENDING_APPROVAL): "+query); lineItemStatement.setQuery(query); int j=0; do{ page=lineItemService.getLineItemsByStatement(lineItemStatement); List<LineItem> result = page.getResults(); if(result !=null && result.size()>0) { pendingApprovalCampaignList = getLineItemDTOList(result); log.info("Pending Approval Campaigns = "+pendingApprovalCampaignList.size()); } else { log.warning("No line items found for query (PENDING_APPROVAL) :"+query); } }while(page.getResults()== null && j<=3); MemcacheUtil.setPendingApprovalCampaignList(pendingApprovalCampaignList); } if(pendingApprovalCampaignList != null && pendingApprovalCampaignList.size() > 0) { totalLineItemDTOList.addAll(pendingApprovalCampaignList); } }catch(Exception e) { log.severe("exception in loadCampaignTraffickingData LinMobileBusinessService (PENDING_APPROVAL): "+e.getMessage()); } return totalLineItemDTOList; } private List<LineItemDTO> getLineItemDTOList(List<LineItem> lineItemList) { List<LineItemDTO> list = new ArrayList<LineItemDTO>(); try{ if(lineItemList!=null && lineItemList.size()>0){ Iterator<LineItem> iterator = lineItemList.iterator(); while(iterator.hasNext()) { LineItem lineItemObj = iterator.next(); if(!lineItemObj.isIsArchived()){ LineItemDTO lineItem= new LineItemDTO(); lineItem.setLineItemId(lineItemObj.getId()); lineItem.setStatus(lineItemObj.getStatus().toString()); lineItem.setName(lineItemObj.getName()); lineItem.setGoalQuantity(lineItemObj.getUnitsBought()); Money money = lineItemObj.getCostPerUnit(); lineItem.setCpm(money.getMicroAmount() / 1000000); if (lineItemObj.getStartDateTime()!= null){ com.google.api.ads.dfp.jaxws.v201403.Date startDateTime = lineItemObj.getStartDateTime().getDate(); lineItem.setStartDateTime(startDateTime.getMonth()+"/"+startDateTime.getDay()+"/"+startDateTime.getYear()); } else{ lineItem.setStartDateTime(null); } if (lineItemObj.getEndDateTime()!= null){ com.google.api.ads.dfp.jaxws.v201403.Date endDateTime = lineItemObj.getEndDateTime().getDate(); lineItem.setEndDateTime(endDateTime.getMonth()+"/"+endDateTime.getDay()+"/"+endDateTime.getYear()); } else{ lineItem.setEndDateTime(null); } list.add(lineItem); }//end of if }//end of while } }catch(Exception e) { log.severe("exception in loadCampaignTraffickingData LinMobileBusinessService : "+e.getMessage()); } return list; } public List<ForcastLineItemDTO> getLineItemForcasts(DfpServices dfpServices,DfpSession session,String[] lineItemIds){ log.info("inside getLineItemForcasts of LinMobile Business Service"); List<ForcastLineItemDTO> forcastLineItemDTOList = new ArrayList<ForcastLineItemDTO>(); long deliveredImpressions = 0; long bookedImpressions = 0; long impressionsToBeDelivered = 0; LineItemServiceInterface lineItemService = null; ForecastServiceInterface forecastService = null; try { int j=0; do{ lineItemService = dfpServices.get(session, LineItemServiceInterface.class); }while(lineItemService == null && j < 3); }catch(Exception e) { } try{ int k=0; do{ forecastService = dfpServices.get(session, ForecastServiceInterface.class); }while(forecastService == null && k < 3); }catch(Exception e){ } for(String id : lineItemIds){ log.info("IDs = "+id); ForcastLineItemDTO forcastLineItemDTO = new ForcastLineItemDTO(); LineItem lineItem =null; try{ StatementBuilder statementBuilder = new StatementBuilder() .where(" id = :id") .withBindVariableValue("id",Long.valueOf(id)); LineItemPage lineItemPage = lineItemService.getLineItemsByStatement(statementBuilder.toStatement()); if(lineItemPage != null && lineItemPage.getResults().size()>0){ List<LineItem> lineItemList=lineItemPage.getResults(); lineItem=lineItemList.get(0); if(lineItem.getStats()!=null){ if(lineItem.getStats().getImpressionsDelivered().toString()!=null){ deliveredImpressions = lineItem.getStats().getImpressionsDelivered(); } } if(lineItem.getUnitsBought()!=0){ bookedImpressions = lineItem.getUnitsBought(); forcastLineItemDTO.setBookedImpressions(String.valueOf(lineItem.getUnitsBought())); } if(deliveredImpressions>=0 && bookedImpressions>=0 ){ impressionsToBeDelivered = bookedImpressions - deliveredImpressions; } if(lineItem.getCostPerUnit().toString()!=null){ double costPerUnit = ((double) lineItem.getCostPerUnit() .getMicroAmount() / 1000000); forcastLineItemDTO.setECPM(String.valueOf(costPerUnit)); } if(lineItem.getName()!=null && !lineItem.getName().equals("")){ forcastLineItemDTO.setLineItem(lineItem.getName()); } if(lineItem!=null && lineItem.getStartDateTime().toString()!=null){ forcastLineItemDTO.setStartDate(getCustomDate(lineItem.getStartDateTime())); } if(lineItem!=null && lineItem.getEndDateTime().toString()!=null){ forcastLineItemDTO.setEndDate(getCustomDate(lineItem.getEndDateTime())); } } else { log.info("FOUND NULL from lineItemService.getLineItem(Long.valueOf(id))"); } }catch(Exception e) { log.info("1. UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED Exception found"); } log.info("Before getting lineitem forcast data"); Forecast forecast = null; try{ forecast = forecastService.getForecastById(Long.valueOf(id)); if(forecast!=null) { if(forecast.getId()!=null) { forcastLineItemDTO.setLineItemId(forecast.getId()); log.info(forecast.getId().toString()); } if(forecast.getAvailableUnits()!=null) { forcastLineItemDTO.setAvailableUnit(forecast.getAvailableUnits()); log.info("AvailableUnits : "+forecast.getAvailableUnits().toString()); } if(forecast.getDeliveredUnits()!=null) { forcastLineItemDTO.setDeliveredUnit((forecast.getDeliveredUnits())); log.info("DeliveredUnits : "+forecast.getDeliveredUnits().toString()); } if(forecast.getMatchedUnits()!=null) { forcastLineItemDTO.setMatchedUnit(forecast.getMatchedUnits()); log.info("MatchedUnits : "+forecast.getMatchedUnits().toString()); } if(forecast.getPossibleUnits()!=null) { forcastLineItemDTO.setPossibleUnit(forecast.getPossibleUnits()); log.info("PossibleUnits : "+forecast.getPossibleUnits().toString()); } if(forcastLineItemDTO.getAvailableUnit()!=null && impressionsToBeDelivered>=0 ) { if(forcastLineItemDTO.getAvailableUnit()>=impressionsToBeDelivered) { forcastLineItemDTO.setStatus(true); } } else { forcastLineItemDTO.setStatus(false); } forcastLineItemDTO.setArchived("no"); } else { log.info("FOUND NULL from forecastService.getForecastById(Long.valueOf(id))"); } }catch(Exception e) { forcastLineItemDTO.setDeliveredUnit(impressionsToBeDelivered); forcastLineItemDTO.setArchived("yes"); log.info("2. UPDATE_ARCHIVED_LINE_ITEM_NOT_ALLOWED Exception found"); } forcastLineItemDTOList.add(forcastLineItemDTO); } lineItemService = null; forecastService = null; log.info("forcastLineItemDTOList.size() = "+forcastLineItemDTOList.size()); return forcastLineItemDTOList; } public static String getCustomDate(DateTime dfpDateTime) { String customDateStr = ""; if (dfpDateTime != null) { Calendar calendar = Calendar.getInstance(); calendar.clear(); calendar.set(Calendar.YEAR, dfpDateTime.getDate().getYear()); calendar.set(Calendar.MONTH, dfpDateTime.getDate().getMonth() - 1); calendar.set(Calendar.DAY_OF_MONTH, dfpDateTime.getDate().getDay()); //calendar.set(Calendar.HOUR, dfpDateTime.getHour()); //calendar.set(Calendar.MINUTE, dfpDateTime.getMinute()); //calendar.set(Calendar.SECOND, dfpDateTime.getSecond()); //calendar.setTimeZone(TimeZone.getTimeZone(dfpDateTime // .getTimeZoneID())); java.util.Date customDate = calendar.getTime(); customDateStr = DateUtil.getFormatedDate(customDate, "yyyy-MM-dd"); }else{ customDateStr="NULL"; } return customDateStr; } public PublisherPropertiesObj copyObject(PublisherPropertiesObj sourceObj){ PublisherPropertiesObj destinationObj=new PublisherPropertiesObj(sourceObj.getChannelName(), sourceObj.getName(), sourceObj.geteCPM(), sourceObj.getImpressionsDelivered(), sourceObj.getClicks(),sourceObj.getTotalImpressionsDeliveredBySiteName(), sourceObj.getPayout(), sourceObj.getStateName(), sourceObj.getSite(), sourceObj.getDFPPayout()); destinationObj.setDataSource(sourceObj.getDataSource()); destinationObj.setTotalImpressionsDeliveredByChannelName(sourceObj.getTotalImpressionsDeliveredByChannelName()); destinationObj.setLatitude(sourceObj.getLatitude()); destinationObj.setLongitude(sourceObj.getLongitude()); destinationObj.setClicks(sourceObj.getClicks()); return destinationObj; } public Map<String,List<AdvertiserPerformerDTO>> loadCampainTotalDataPublisherViewList(String lowerDate,String upperDate,String publisherName,String advertiser, String agency, String properties) { Map<String,List<AdvertiserPerformerDTO>> campainTotalDataPublisherMap = new HashMap<String,List<AdvertiserPerformerDTO>>(); Map<String,AdvertiserPerformerDTO> calculatedLineItemMap = new HashMap<String,AdvertiserPerformerDTO>(); //Map<String,AdvertiserPerformerDTO> nonDFPObjectMap = new HashMap<String,AdvertiserPerformerDTO>(); List<AdvertiserPerformerDTO> list = new ArrayList<AdvertiserPerformerDTO>(); List<AdvertiserPerformerDTO> lineItemCalculatedList = new ArrayList<AdvertiserPerformerDTO>(); //AdvertiserDAO advDAO=new AdvertiserDAO(); String replaceStr = "\\\\'"; if(advertiser != null && !advertiser.trim().equalsIgnoreCase("")) { advertiser = advertiser.replaceAll("'", replaceStr); }else { advertiser = ""; } if(agency != null && !agency.trim().equalsIgnoreCase("")) { agency = agency.replaceAll("'", replaceStr); }else { agency = ""; } if(lowerDate == null && upperDate== null) { String monthToDateEnd=DateUtil.getCurrentTimeStamp("yyyy-MM-dd"); String[] dayArray=monthToDateEnd.split("-"); int year=Integer.parseInt(dayArray[0]); int month=Integer.parseInt(dayArray[1])-1; // subtract 1 from day String as day starts from 0 to 11 in Calender class String monthToDateStart=DateUtil.getDateByYearMonthDays(year,month,1,"yyyy-MM-dd"); lowerDate = monthToDateStart; upperDate = monthToDateEnd; } //list = advDAO.loadAdvertiserTotalDataList(lowerDate, upperDate, publisherName,advertiser,agency,properties); list = MemcacheUtil.getPublisherCampaignTotalDataList(lowerDate, upperDate, publisherName,advertiser,agency,properties); if(list == null || list.size() <= 0) { try { LinMobileDAO pubDAO=new LinMobileDAO(); list = pubDAO.loadCampainTotalDataPublisherViewList(lowerDate, upperDate, publisherName,advertiser,agency,properties); MemcacheUtil.setPublisherCampaignTotalDataList(lineItemCalculatedList,lowerDate, upperDate, publisherName,advertiser,agency,properties); }catch (Exception e) { log.severe("DataServiceException :"+e.getMessage()); } }else{ log.info("Advertiser Total Data found from memcache:"); } try{ if(list!=null && list.size()>0){ campainTotalDataPublisherMap.put("campainTotal",list); for (AdvertiserPerformerDTO advertiserPerformerDTO : list) { if(!calculatedLineItemMap.containsKey(advertiserPerformerDTO.getCampaignLineItem())){ advertiserPerformerDTO.setLineItemCountFlag(1); calculatedLineItemMap.put(advertiserPerformerDTO.getCampaignLineItem(), advertiserPerformerDTO); }else{ long impressions = 0; long clicks = 0; long bookedImpressions = 0; double ctr = 0.0; int lineItemCountFlag = 0; double deliveryIndicator = 0.0; double revenue = 0.0; AdvertiserPerformerDTO advertiserObj = copyObject(calculatedLineItemMap.get(advertiserPerformerDTO.getCampaignLineItem())); lineItemCountFlag = advertiserObj.getLineItemCountFlag() + 1; if(lineItemCountFlag!=0){ deliveryIndicator = (advertiserPerformerDTO.getDeliveryIndicator()+advertiserObj.getDeliveryIndicator())/lineItemCountFlag; } advertiserObj.setLineItemCountFlag(lineItemCountFlag); impressions = advertiserPerformerDTO.getImpressionDelivered() + advertiserObj.getImpressionDelivered(); clicks = advertiserPerformerDTO.getClicks() + advertiserObj.getClicks(); bookedImpressions = advertiserPerformerDTO.getBookedImpressions() + advertiserObj.getBookedImpressions(); if(impressions!=0){ ctr = Double.valueOf(clicks*100)/impressions; } revenue = advertiserPerformerDTO.getRevenueDeliverd()+ advertiserObj.getRevenueDeliverd(); advertiserObj.setImpressionDelivered(impressions); advertiserObj.setClicks(clicks); advertiserObj.setCTR(ctr); advertiserObj.setBookedImpressions(bookedImpressions); advertiserObj.setDeliveryIndicator(deliveryIndicator); advertiserObj.setRevenueDeliverd(revenue); calculatedLineItemMap.put(advertiserObj.getCampaignLineItem(), advertiserObj); } } } Iterator iterator = calculatedLineItemMap.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry mapEntry = (Map.Entry) iterator.next(); lineItemCalculatedList.add((AdvertiserPerformerDTO) mapEntry.getValue()); } campainTotalDataPublisherMap.put("lineItemCalculated",lineItemCalculatedList); }catch(Exception e){ } return campainTotalDataPublisherMap; } public List<AdvertiserPerformerDTO> loadCampainPerformanceDeliveryIndicatorData(String lowerDate,String upperDate,String publisherName,String advertiser, String agency, String properties) { List<AdvertiserPerformerDTO> list = new ArrayList<AdvertiserPerformerDTO>(); String replaceStr = "\\\\'"; if(advertiser != null && !advertiser.trim().equalsIgnoreCase("")) { advertiser = advertiser.replaceAll("'", replaceStr); }else { advertiser = ""; } if(agency != null && !agency.trim().equalsIgnoreCase("")) { agency = agency.replaceAll("'", replaceStr); }else { agency = ""; } //list = advDAO.loadDeliveryIndicatorData(lowerDate, upperDate, publisherName, advertiser, agency, properties); //list = MemcacheUtil.getDeliveryIndicatorData(lowerDate, upperDate, publisherName, advertiser, agency, properties); if(list == null || list.size() <= 0) { try { LinMobileDAO pubDAO=new LinMobileDAO(); list = pubDAO.loadCampainPerformanceDeliveryIndicatorData(lowerDate, upperDate, publisherName, advertiser, agency, properties); //MemcacheUtil.setDeliveryIndicatorData(list,lowerDate, upperDate, publisherName,advertiser,agency,properties); }catch (Exception e) { log.severe("DataServiceException :"+e.getMessage()); } }else{ log.info("Delivery Indicator Data found from memcache:"); } return list; } public AdvertiserPerformerDTO copyObject(AdvertiserPerformerDTO sourceObj){ AdvertiserPerformerDTO destinationObj=new AdvertiserPerformerDTO(sourceObj.getCampaignIO(), sourceObj.getLineItemId(), sourceObj.getCampaignLineItem(), sourceObj.getImpressionDelivered(), sourceObj.getClicks(),sourceObj.getCTR(),sourceObj.getRevenueDeliverd(),sourceObj.getAgency(), sourceObj.getAdvertiser(), sourceObj.getCreativeType(), sourceObj.getMarket(), sourceObj.getDeliveryIndicator(),sourceObj.getSite(),sourceObj.getBookedImpressions(),sourceObj.getBudget(),sourceObj.getPublisherName(),sourceObj.getSiteName(),""); destinationObj.setCampaignLineItem(sourceObj.getCampaignLineItem()); destinationObj.setImpressionDelivered(sourceObj.getImpressionDelivered()); destinationObj.setClicks(sourceObj.getClicks()); destinationObj.setCTR(sourceObj.getCTR()); destinationObj.setBookedImpressions(sourceObj.getBookedImpressions()); destinationObj.setLineItemCountFlag(sourceObj.getLineItemCountFlag()); destinationObj.setRevenueDeliverd((sourceObj.getRevenueDeliverd())); return destinationObj; } @Override public PublisherReportHeaderDTO getHeaderData(String allChannelName, List<PublisherSummaryObj> currentDateSummaryList, List<PublisherSummaryObj> compareDateSummaryList) { int maxSite = 0; double totalECPM = 0.0; long totalEmpDelivered = 0; long totalClicks = 0; double totalCTR = 0.0; double totalRPM = 0.0; double totalPayouts = 0.0; long totalRequests = 0; long houseImpression = 0; int newFlag = 0; double fillPercentage = 0.0; long allChannelsTotalEmpDelivered = 0; PublisherReportHeaderDTO publisherReportHeaderDTO = new PublisherReportHeaderDTO(); try { IUserService service = (IUserService) BusinessServiceLocator.locate(IUserService.class); List<String> channelList = service.CommaSeperatedStringToList(allChannelName); if(channelList != null && channelList.size() > 0 && currentDateSummaryList != null && compareDateSummaryList != null) { List<String> totalEmpDeliveredCheckList = new ArrayList<String>(); for (PublisherSummaryObj dtoObject : currentDateSummaryList) { newFlag++; if(channelList.contains(dtoObject.getChannelName().trim())) { if(dtoObject.getChannelName().equals("House")) { houseImpression = dtoObject.getImpressionsDelivered(); } if(dtoObject.getSite() > maxSite) { maxSite = dtoObject.getSite(); } totalEmpDelivered = totalEmpDelivered + dtoObject.getImpressionsDelivered(); totalClicks = totalClicks + dtoObject.getClicks(); totalPayouts = totalPayouts + dtoObject.getPayOuts(); totalRequests = totalRequests + dtoObject.getRequests(); } if(!totalEmpDeliveredCheckList.contains(dtoObject.getChannelName().trim())){ totalEmpDeliveredCheckList.add(dtoObject.getChannelName().trim()); allChannelsTotalEmpDelivered = allChannelsTotalEmpDelivered + dtoObject.getImpressionsDelivered(); } } totalCTR = ((double)totalClicks / totalEmpDelivered) * 100; totalECPM = (totalPayouts / totalEmpDelivered) * 1000; if(totalRequests != 0) { totalRPM = (totalPayouts / totalRequests) * 1000; } fillPercentage = ((double)((totalEmpDelivered - houseImpression)* 100) / allChannelsTotalEmpDelivered); if(newFlag > 0) { maxSite = 23; } publisherReportHeaderDTO.setSite(maxSite); publisherReportHeaderDTO.setImpressionsDelivered(totalEmpDelivered); publisherReportHeaderDTO.setClicks(totalClicks); publisherReportHeaderDTO.setCtrPercentage(totalCTR/100); publisherReportHeaderDTO.setEcpm(totalECPM); publisherReportHeaderDTO.setRpm(totalRPM); publisherReportHeaderDTO.setPayouts(totalPayouts); publisherReportHeaderDTO.setFillPercentage(fillPercentage/100); } }catch (Exception e) { log.severe("Exception in getHeaderData of LinMobileService : "+e.getMessage()); } return publisherReportHeaderDTO; } @Override public Map getChannelPerformanceData(String allChannelName, List<PublisherSummaryObj> currentDateSummaryList, List<PublisherSummaryObj> compareDateSummaryList) { double totalECPMLast = 0.0; double totalPayoutsLast = 0.0; long totalEmpDeliveredLast = 0; double totalECPM = 0.0; long totalEmpDelivered = 0; long totalClicks = 0; double totalCTR = 0.0; double totalPayouts = 0.0; double totalChange = 0.0; double totalChangePercentage = 0.0; //int flg = 0; Map channelperformanceMap = new HashMap(); List<PublisherReportChannelPerformanceDTO> pubReportChannelPerformanceDTOList = new ArrayList<PublisherReportChannelPerformanceDTO>(); List<PublisherReportComputedValuesDTO> publisherReportComputedValuesDTOList = new ArrayList<PublisherReportComputedValuesDTO>(); try { IUserService service = (IUserService) BusinessServiceLocator.locate(IUserService.class); List<String> channelList = service.CommaSeperatedStringToList(allChannelName); if(channelList != null && channelList.size() > 0 && currentDateSummaryList != null && currentDateSummaryList.size() > 0) { for(PublisherSummaryObj dtoObjectCurrent : currentDateSummaryList) { if(channelList.contains(dtoObjectCurrent.getChannelName().trim())) { int matchflag = 0; if(compareDateSummaryList.size() > 0) { int compareDateSummaryLength = compareDateSummaryList.size(); int compareCount = 0; for (PublisherSummaryObj dtoObjectCompare : compareDateSummaryList) { if(channelList.contains(dtoObjectCompare.getChannelName().trim())) { PublisherReportChannelPerformanceDTO publisherReportChannelPerformanceDTO = new PublisherReportChannelPerformanceDTO(); if(dtoObjectCurrent.getChannelName().equals(dtoObjectCompare.getChannelName())) { //flg ++; double CHG = 0; double percentageCHG = 0.0; matchflag = 1; CHG = dtoObjectCurrent.geteCPM() - dtoObjectCompare.geteCPM(); if(dtoObjectCompare.geteCPM() == 0) { percentageCHG = 0.0; } else { percentageCHG = (CHG / dtoObjectCompare.geteCPM()) * 100; } publisherReportChannelPerformanceDTO.setSalesChannel(dtoObjectCurrent.getChannelName()); publisherReportChannelPerformanceDTO.setEcpm(dtoObjectCurrent.geteCPM()); publisherReportChannelPerformanceDTO.setChange(CHG); publisherReportChannelPerformanceDTO.setChangePercentage(percentageCHG/100); publisherReportChannelPerformanceDTO.setImpressionsDelivered(dtoObjectCurrent.getImpressionsDelivered()); publisherReportChannelPerformanceDTO.setClicks(dtoObjectCurrent.getClicks()); publisherReportChannelPerformanceDTO.setCtrPercentage(dtoObjectCurrent.getCTR()/100); publisherReportChannelPerformanceDTO.setPayouts(dtoObjectCurrent.getPayOuts()); totalPayoutsLast = totalPayoutsLast + dtoObjectCompare.getPayOuts(); totalEmpDeliveredLast = totalEmpDeliveredLast + dtoObjectCompare.getImpressionsDelivered(); totalEmpDelivered = totalEmpDelivered + dtoObjectCurrent.getImpressionsDelivered(); totalClicks = totalClicks + dtoObjectCurrent.getClicks(); totalPayouts = totalPayouts + dtoObjectCurrent.getPayOuts(); pubReportChannelPerformanceDTOList.add(publisherReportChannelPerformanceDTO); }else if(compareDateSummaryLength-1 == compareCount && matchflag == 0) { //flg ++; double CHG = 0; double percentageCHG = 0.0; matchflag = 1; CHG = dtoObjectCurrent.geteCPM(); percentageCHG = 0.0; publisherReportChannelPerformanceDTO.setSalesChannel(dtoObjectCurrent.getChannelName()); publisherReportChannelPerformanceDTO.setEcpm(dtoObjectCurrent.geteCPM()); publisherReportChannelPerformanceDTO.setChange(CHG); publisherReportChannelPerformanceDTO.setChangePercentage(percentageCHG/100); publisherReportChannelPerformanceDTO.setImpressionsDelivered(dtoObjectCurrent.getImpressionsDelivered()); publisherReportChannelPerformanceDTO.setClicks(dtoObjectCurrent.getClicks()); publisherReportChannelPerformanceDTO.setCtrPercentage(dtoObjectCurrent.getCTR()/100); publisherReportChannelPerformanceDTO.setPayouts(dtoObjectCurrent.getPayOuts()); totalEmpDelivered = totalEmpDelivered + dtoObjectCurrent.getImpressionsDelivered(); totalClicks = totalClicks + dtoObjectCurrent.getClicks(); totalPayouts = totalPayouts + dtoObjectCurrent.getPayOuts(); pubReportChannelPerformanceDTOList.add(publisherReportChannelPerformanceDTO); } compareCount++; } } }else { PublisherReportChannelPerformanceDTO publisherReportChannelPerformanceDTO = new PublisherReportChannelPerformanceDTO(); //flg ++; double CHG = 0; double percentageCHG = 0.0; matchflag = 1; CHG = dtoObjectCurrent.geteCPM(); percentageCHG = 0.0; publisherReportChannelPerformanceDTO.setSalesChannel(dtoObjectCurrent.getChannelName()); publisherReportChannelPerformanceDTO.setEcpm(dtoObjectCurrent.geteCPM()); publisherReportChannelPerformanceDTO.setChange(CHG); publisherReportChannelPerformanceDTO.setChangePercentage(percentageCHG/100); publisherReportChannelPerformanceDTO.setImpressionsDelivered(dtoObjectCurrent.getImpressionsDelivered()); publisherReportChannelPerformanceDTO.setClicks(dtoObjectCurrent.getClicks()); publisherReportChannelPerformanceDTO.setCtrPercentage(dtoObjectCurrent.getCTR()/100); publisherReportChannelPerformanceDTO.setPayouts(dtoObjectCurrent.getPayOuts()); pubReportChannelPerformanceDTOList.add(publisherReportChannelPerformanceDTO); totalEmpDelivered = totalEmpDelivered + dtoObjectCurrent.getImpressionsDelivered(); totalClicks = totalClicks + dtoObjectCurrent.getClicks(); totalPayouts = totalPayouts + dtoObjectCurrent.getPayOuts(); } } } totalCTR = (totalClicks / totalEmpDelivered) * 100; totalECPM = (totalPayouts / totalEmpDelivered) * 1000; totalECPMLast = (totalPayoutsLast / totalEmpDeliveredLast) * 1000; totalChange = totalECPM - totalECPMLast; totalChangePercentage = (totalChange / totalECPMLast) * 100; PublisherReportComputedValuesDTO publisherReportComputedValuesDTO = new PublisherReportComputedValuesDTO(); publisherReportComputedValuesDTO.setChange(totalChange); publisherReportComputedValuesDTO.setChangePercentage(totalChangePercentage/100); publisherReportComputedValuesDTOList.add(publisherReportComputedValuesDTO); for(PublisherReportChannelPerformanceDTO publisherReportChannelPerformanceDTO : pubReportChannelPerformanceDTOList) { publisherReportChannelPerformanceDTO.setFillRate((double)publisherReportChannelPerformanceDTO.getImpressionsDelivered()/totalEmpDelivered); } } }catch (Exception e) { log.severe("Exception in getChannelPerformanceDate of LinMobileService : "+e.getMessage()); } channelperformanceMap.put("PublisherReportChannelPerformanceDTO", pubReportChannelPerformanceDTOList); channelperformanceMap.put("PublisherReportComputedValuesDTO", publisherReportComputedValuesDTOList); return channelperformanceMap; } public Map getPerformanceByPropertyData(String channelName, List<PublisherPropertiesObj> performanceByPropertyCurrentDataBySiteName, List<PublisherPropertiesObj> performanceByPropertyCompareDataBySiteName) { double payoutsTotalCompare = 0.0; double impDeliveredTotalCompare = 0.0; double clicksTotalCurrent = 0; double payoutsTotalCurrent = 0.0; double impDeliveredTotalCurrent = 0.0; double eCPMTotalCompare = 0.0; double eCPMTotalCurrent = 0.0; double changeTotal = 0.0; double percentageCHGTotal = 0.0; double imprs =0.0; long payout = 0; int flg = 0; Map performanceByPropertyMap = new HashMap(); List<PublisherReportPerformanceByPropertyDTO> publisherReportPerformanceByPropertyDTOList = new ArrayList<PublisherReportPerformanceByPropertyDTO>(); List<PublisherReportComputedValuesDTO> publisherReportComputedValuesDTOList = new ArrayList<PublisherReportComputedValuesDTO>(); try { if(performanceByPropertyCurrentDataBySiteName != null && performanceByPropertyCurrentDataBySiteName.size() > 0) { for(PublisherPropertiesObj objectCurrent : performanceByPropertyCurrentDataBySiteName) { int matchflag = 0; if(performanceByPropertyCompareDataBySiteName != null && performanceByPropertyCompareDataBySiteName.size() > 0) { int compareCount = 0; for(PublisherPropertiesObj objectCompare : performanceByPropertyCompareDataBySiteName) { PublisherReportPerformanceByPropertyDTO publisherReportPerformanceByPropertyDTO = new PublisherReportPerformanceByPropertyDTO(); if(objectCurrent.getSite() != null && objectCompare.getSite() != null && objectCurrent.getSite().equals(objectCompare.getSite()) && objectCurrent.getChannelName().equals(objectCompare.getChannelName())) { imprs = 0; long clks = objectCurrent.getClicks(); imprs = objectCurrent.getImpressionsDelivered(); double ctr = (clks / imprs) * 100; flg++; matchflag = 1; double eCPM = objectCurrent.geteCPM(); double CHG = 0.0; double percentageCHG = 0.0; if(objectCompare.geteCPM() == 0.0) { CHG = objectCurrent.geteCPM(); percentageCHG = 0.0; } else { CHG = objectCurrent.geteCPM() - objectCompare.geteCPM(); percentageCHG = (CHG / objectCompare.geteCPM()) * 100; } publisherReportPerformanceByPropertyDTO.setProperty(objectCurrent.getName()); publisherReportPerformanceByPropertyDTO.setEcpm(objectCurrent.geteCPM()); publisherReportPerformanceByPropertyDTO.setChange(CHG); publisherReportPerformanceByPropertyDTO.setChangePercentage(percentageCHG/100); publisherReportPerformanceByPropertyDTO.setImpressionsDelivered(Math.round(objectCurrent.getImpressionsDelivered())); publisherReportPerformanceByPropertyDTO.setClicks(objectCurrent.getClicks()); publisherReportPerformanceByPropertyDTO.setPayouts(objectCurrent.getPayout()); publisherReportPerformanceByPropertyDTOList.add(publisherReportPerformanceByPropertyDTO); payoutsTotalCompare = payoutsTotalCompare + objectCompare.getPayout(); impDeliveredTotalCompare = impDeliveredTotalCompare + objectCompare.getImpressionsDelivered(); clicksTotalCurrent = clicksTotalCurrent + objectCurrent.getClicks(); payoutsTotalCurrent = payoutsTotalCurrent + objectCurrent.getPayout(); impDeliveredTotalCurrent = impDeliveredTotalCurrent + Math.round(objectCurrent.getImpressionsDelivered()); } else if(performanceByPropertyCompareDataBySiteName.size()-1 == compareCount && matchflag == 0 ) { imprs = 0; long clks = objectCurrent.getClicks(); imprs = objectCurrent.getImpressionsDelivered(); double ctr = (clks / imprs) * 100; flg++; matchflag = 1; double eCPM = objectCurrent.geteCPM(); double CHG = 0.0; double percentageCHG = 0.0; CHG = objectCurrent.geteCPM(); percentageCHG = 0.0; publisherReportPerformanceByPropertyDTO.setProperty(objectCurrent.getName()); publisherReportPerformanceByPropertyDTO.setEcpm(objectCurrent.geteCPM()); publisherReportPerformanceByPropertyDTO.setChange(CHG); publisherReportPerformanceByPropertyDTO.setChangePercentage(percentageCHG/100); publisherReportPerformanceByPropertyDTO.setImpressionsDelivered(Math.round(objectCurrent.getImpressionsDelivered())); publisherReportPerformanceByPropertyDTO.setClicks(objectCurrent.getClicks()); publisherReportPerformanceByPropertyDTO.setPayouts(objectCurrent.getPayout()); publisherReportPerformanceByPropertyDTOList.add(publisherReportPerformanceByPropertyDTO); clicksTotalCurrent = clicksTotalCurrent + objectCurrent.getClicks(); payoutsTotalCurrent = payoutsTotalCurrent + objectCurrent.getPayout(); impDeliveredTotalCurrent = impDeliveredTotalCurrent + Math.round(objectCurrent.getImpressionsDelivered()); } compareCount++; } } else { PublisherReportPerformanceByPropertyDTO publisherReportPerformanceByPropertyDTO = new PublisherReportPerformanceByPropertyDTO(); imprs = 0; long clks = objectCurrent.getClicks(); imprs = objectCurrent.getImpressionsDelivered(); double ctr = (clks / imprs) * 100; flg++; matchflag = 1; double eCPM = objectCurrent.geteCPM(); double CHG = 0.0; double percentageCHG = 0.0; CHG = objectCurrent.geteCPM(); percentageCHG = 0.0; publisherReportPerformanceByPropertyDTO.setProperty(objectCurrent.getName()); publisherReportPerformanceByPropertyDTO.setEcpm(objectCurrent.geteCPM()); publisherReportPerformanceByPropertyDTO.setChange(CHG); publisherReportPerformanceByPropertyDTO.setChangePercentage(percentageCHG/100); publisherReportPerformanceByPropertyDTO.setImpressionsDelivered(Math.round(objectCurrent.getImpressionsDelivered())); publisherReportPerformanceByPropertyDTO.setClicks(objectCurrent.getClicks()); publisherReportPerformanceByPropertyDTO.setPayouts(objectCurrent.getPayout()); publisherReportPerformanceByPropertyDTOList.add(publisherReportPerformanceByPropertyDTO); clicksTotalCurrent = clicksTotalCurrent + objectCurrent.getClicks(); payoutsTotalCurrent = payoutsTotalCurrent + objectCurrent.getPayout(); impDeliveredTotalCurrent = impDeliveredTotalCurrent + Math.round(objectCurrent.getImpressionsDelivered()); } } if(flg > 0) { eCPMTotalCurrent = (payoutsTotalCurrent / impDeliveredTotalCurrent) * 1000; eCPMTotalCompare = (payoutsTotalCompare / impDeliveredTotalCompare) * 1000; changeTotal = (eCPMTotalCurrent - eCPMTotalCompare); percentageCHGTotal = (changeTotal / eCPMTotalCompare) * 100; } PublisherReportComputedValuesDTO publisherReportComputedValuesDTO = new PublisherReportComputedValuesDTO(); publisherReportComputedValuesDTO.setChange(changeTotal); publisherReportComputedValuesDTO.setChangePercentage(percentageCHGTotal/100); publisherReportComputedValuesDTOList.add(publisherReportComputedValuesDTO); } }catch (Exception e) { log.severe("Exception in getPerformanceByPropertyData of LinMobileService : "+e.getMessage()); } performanceByPropertyMap.put("PublisherReportPerformanceByPropertyDTO", publisherReportPerformanceByPropertyDTOList); performanceByPropertyMap.put("PublisherReportPerformanceComputedValuesDTO", publisherReportComputedValuesDTOList); return performanceByPropertyMap; } /* * This method will create json string for line chart */ @SuppressWarnings("unused") private String createJsonResponseForLineChart(Map<String, Object> dateMap, Map<String, Object> channelMap,Map<String, Object> perfDataMap,String chartType) throws TypeMismatchException{ DataTable linechartTable = new DataTable(); List<com.google.visualization.datasource.datatable.TableRow> rows; ColumnDescription col0 = new ColumnDescription("date", ValueType.DATE, "Date"); //ColumnDescription col0 = new ColumnDescription("date", ValueType.TEXT, "Date"); linechartTable.addColumn(col0); for (Entry<String, Object> channel : channelMap.entrySet()) { String channelName = channel.getKey(); ColumnDescription channelcol = new ColumnDescription(channelName, ValueType.NUMBER, channelName); linechartTable.addColumn(channelcol); } rows = Lists.newArrayList(); int year, month, day = 0; for (Entry<String, Object> dates : dateMap.entrySet()) { String date = dates.getKey(); String [] dtArray=date.split("-"); com.google.visualization.datasource.datatable.TableRow row = new com.google.visualization.datasource.datatable.TableRow(); year = Integer.parseInt(dtArray[0]); month = Integer.parseInt(dtArray[1])-1; day = Integer.parseInt(dtArray[2]); DateValue dateValue= new DateValue(year,month,day); row.addCell(new com.google.visualization.datasource.datatable.TableCell(dateValue)); //row.addCell(new com.google.visualization.datasource.datatable.TableCell(date)); for (Entry<String, Object> channel : channelMap.entrySet()) { String channelName = channel.getKey(); String key=date+"_"+channelName; LineChartDTO perData = (LineChartDTO) perfDataMap.get(key); if ( perData != null){ //row.addCell(new com.google.visualization.datasource.datatable.TableCell(perData.getCtr()).); if(chartType.equalsIgnoreCase("CTR")){ Double ctr=StringUtil.getDoubleValue(perData.getCtr(), 4); row.addCell(new NumberValue(new Double(ctr))); }else if(chartType.equalsIgnoreCase("Clicks")){ row.addCell(new NumberValue(new Long(perData.getClicks()))); }else if(chartType.equalsIgnoreCase("Impressions")){ row.addCell(new NumberValue(new Long(perData.getImpressions()))); }else if(chartType.equalsIgnoreCase("Revenue")){ Double revenue = StringUtil.getDoubleValue(perData.getRevenue(), 4); row.addCell(new NumberValue(new Double(revenue))); }else if(chartType.equalsIgnoreCase("Ecpm")){ Double ecpm=StringUtil.getDoubleValue(perData.geteCPM(), 4); row.addCell(new NumberValue(new Double(ecpm))); }else if(chartType.equalsIgnoreCase("FillRate")){ Double fillRate=StringUtil.getDoubleValue(perData.getFillRate(), 4); row.addCell(new NumberValue(new Double(fillRate))); } }else{ row.addCell(new com.google.visualization.datasource.datatable.TableCell(0)); } } rows.add(row); } linechartTable.addRows(rows); java.lang.CharSequence jsonStr = JsonRenderer.renderDataTable(linechartTable, true, false); //System.out.println("LineChart Table JSON Data::" + jsonStr.toString()); return jsonStr.toString(); } public Map<String,String> processPublisherLineChartData(String lowerDate,String upperDate,String publisherName,String channelName){ List<PublisherChannelObj> actualPublisherList=null; Map<String, Object> dateMap = new LinkedHashMap<String, Object>(); Map<String, Object> perfDataMap = new LinkedHashMap<String, Object>(); Map<String, Object> channelMap = new LinkedHashMap<String, Object>(); ILinMobileDAO linDAO=new LinMobileDAO(); Map<String,String> jsonChartMap = null; try { String channelId = getChannelsBQId(channelName); String publisherId = getPublisherBQId(publisherName); jsonChartMap = MemcacheUtil.getLineChartMapFromCachePublisher(lowerDate, upperDate, publisherId, channelId); if(jsonChartMap ==null || jsonChartMap.size()==0){ jsonChartMap = new LinkedHashMap<String,String>(); actualPublisherList = MemcacheUtil.getTrendsAnalysisActualDataPublisher(lowerDate, upperDate, publisherName, channelName); if(actualPublisherList==null || actualPublisherList.size()<=0){ String replaceStr = "\\\\'"; if(channelName!=null){ channelName = channelName.replaceAll("'", replaceStr); channelName = channelName.replaceAll(",", "','"); }else{ channelName = ""; } QueryDTO queryDTO = getQueryDTO(publisherId, lowerDate, upperDate, LinMobileConstants.BQ_CORE_PERFORMANCE); if(queryDTO != null && queryDTO.getQueryData() != null && queryDTO.getQueryData().length() > 0) { actualPublisherList=linDAO.loadActualDataForPublisher(lowerDate,upperDate,channelId, queryDTO); MemcacheUtil.setTrendsAnalysisActualDataPublisher(lowerDate, upperDate, publisherId, channelId, actualPublisherList); } for (PublisherChannelObj publisherChannelObj : actualPublisherList) { String date = publisherChannelObj.getDate(); String channelNamekey = publisherChannelObj.getChannelName(); String revenue = publisherChannelObj.getRevenue()+""; String impressions = publisherChannelObj.getImpressionsDelivered()+""; String clicks = publisherChannelObj.getClicks()+""; String ctr = publisherChannelObj.getCTR()+""; String fillRate = publisherChannelObj.getFillRate()+""; String ecpm = publisherChannelObj.geteCPM()+""; LineChartDTO lineChartDTO = new LineChartDTO(impressions, clicks, ctr, date, fillRate, ecpm, revenue); dateMap.put(date, null); channelMap.put(channelNamekey, null); String key=date+"_"+channelNamekey; perfDataMap.put(key, lineChartDTO); } String ctrLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, "CTR"); jsonChartMap.put("CTR", ctrLineChartJson); String clicksLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, "Clicks"); jsonChartMap.put("Clicks", clicksLineChartJson); String impressionsLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, "Impressions"); jsonChartMap.put("Impressions", impressionsLineChartJson); String revenueLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, "Revenue"); jsonChartMap.put("Revenue", revenueLineChartJson); String ecpmLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, "Ecpm"); jsonChartMap.put("Ecpm", ecpmLineChartJson); String fillRateLineChartJson=createJsonResponseForLineChart(dateMap, channelMap, perfDataMap, "FillRate"); jsonChartMap.put("FillRate", fillRateLineChartJson); MemcacheUtil.setLineChartMapInCachePublisher(jsonChartMap, lowerDate, upperDate, publisherId, channelId); } }else{ log.info("Found line chart data in memcache..size:"+jsonChartMap.size()); } }catch (Exception e) { log.severe("Exception :"+e.getMessage()); return null; } return jsonChartMap; } }
{'content_hash': 'fb76939f45babb395ff3d29532f356c3', 'timestamp': '', 'source': 'github', 'line_count': 3428, 'max_line_length': 351, 'avg_line_length': 44.25904317386231, 'alnum_prop': 0.7198391774321118, 'repo_name': 'nareshPokhriyal86/testing', 'id': '4785070b45e19bddec85c0fa1b9cf813329059bd', 'size': '151720', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/lin/web/service/impl/LinMobileBusinessService.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '1241396'}, {'name': 'HTML', 'bytes': '56004'}, {'name': 'Java', 'bytes': '6601853'}, {'name': 'JavaScript', 'bytes': '3910511'}]}
'use strict'; angular.module('mean.users') .controller('AuthCtrl', ['$scope', '$rootScope', '$http', '$location', 'Global', function ($scope, $rootScope, $http, $location, Global) { // This object will contain list of available social buttons to authorize $scope.socialButtonsCounter = 0; $scope.global = Global; $http.get('/get-config') .success(function (config) { $scope.socialButtons = config; }); } ]) .controller('LoginCtrl', ['$scope', '$rootScope', '$http', '$location', 'Global', function ($scope, $rootScope, $http, $location, Global) { // This object will be filled by the form $scope.user = {}; $scope.global = Global; $scope.global.registerForm = false; $scope.input = { type: 'password', placeholder: 'Password', confirmPlaceholder: 'Repeat Password', iconClass: '', tooltipText: 'Show password' }; $scope.togglePasswordVisible = function () { $scope.input.type = $scope.input.type === 'text' ? 'password' : 'text'; $scope.input.placeholder = $scope.input.placeholder === 'Password' ? 'Visible Password' : 'Password'; $scope.input.iconClass = $scope.input.iconClass === 'icon_hide_password' ? '' : 'icon_hide_password'; $scope.input.tooltipText = $scope.input.tooltipText === 'Show password' ? 'Hide password' : 'Show password'; }; // Register the login() function $scope.login = function () { $http.post('/login', { email: $scope.user.email, password: $scope.user.password }) .success(function (response) { // authentication OK $scope.loginError = 0; $rootScope.user = response.user; $rootScope.$emit('loggedin'); if (response.redirect) { if (window.location.href === response.redirect) { //This is so an admin user will get full admin page window.location.reload(); } else { window.location = response.redirect; } } else { $location.url('/'); } }) .error(function () { $scope.loginerror = 'Authentication failed.'; }); }; } ]) .controller('RegisterCtrl', ['$scope', '$rootScope', '$http', '$location', 'Global', function ($scope, $rootScope, $http, $location, Global) { $scope.user = {}; $scope.global = Global; $scope.global.registerForm = true; $scope.input = { type: 'password', placeholder: 'Password', placeholderConfirmPass: 'Repeat Password', iconClassConfirmPass: '', tooltipText: 'Show password', tooltipTextConfirmPass: 'Show password' }; $scope.togglePasswordVisible = function () { $scope.input.type = $scope.input.type === 'text' ? 'password' : 'text'; $scope.input.placeholder = $scope.input.placeholder === 'Password' ? 'Visible Password' : 'Password'; $scope.input.iconClass = $scope.input.iconClass === 'icon_hide_password' ? '' : 'icon_hide_password'; $scope.input.tooltipText = $scope.input.tooltipText === 'Show password' ? 'Hide password' : 'Show password'; }; $scope.togglePasswordConfirmVisible = function () { $scope.input.type = $scope.input.type === 'text' ? 'password' : 'text'; $scope.input.placeholderConfirmPass = $scope.input.placeholderConfirmPass === 'Repeat Password' ? 'Visible Password' : 'Repeat Password'; $scope.input.iconClassConfirmPass = $scope.input.iconClassConfirmPass === 'icon_hide_password' ? '' : 'icon_hide_password'; $scope.input.tooltipTextConfirmPass = $scope.input.tooltipTextConfirmPass === 'Show password' ? 'Hide password' : 'Show password'; }; $scope.register = function () { $scope.usernameError = null; $scope.registerError = null; $http.post('/register', { email: $scope.user.email, password: $scope.user.password, confirmPassword: $scope.user.confirmPassword, username: $scope.user.username, name: $scope.user.name }) .success(function () { // authentication OK $scope.registerError = 0; $rootScope.user = $scope.user; Global.user = $rootScope.user; Global.authenticated = !!$rootScope.user; $rootScope.$emit('loggedin'); $location.url('/'); }) .error(function (error) { // Error: authentication failed if (error === 'Username already taken') { $scope.usernameError = error; } else if (error === 'Email already taken') { $scope.emailError = error; } else $scope.registerError = error; }); }; } ]) .controller('ForgotPasswordCtrl', ['$scope', '$rootScope', '$http', '$location', 'Global', function ($scope, $rootScope, $http, $location, Global) { $scope.user = {}; $scope.global = Global; $scope.global.registerForm = false; $scope.forgotpassword = function () { $http.post('/forgot-password', { text: $scope.user.email }) .success(function (response) { $scope.response = response; }) .error(function (error) { $scope.response = error; }); }; } ]) .controller('ResetPasswordCtrl', ['$scope', '$rootScope', '$http', '$location', '$stateParams', 'Global', function ($scope, $rootScope, $http, $location, $stateParams, Global) { $scope.user = {}; $scope.global = Global; $scope.global.registerForm = false; $scope.resetpassword = function () { $http.post('/reset/' + $stateParams.tokenId, { password: $scope.user.password, confirmPassword: $scope.user.confirmPassword }) .success(function (response) { $rootScope.user = response.user; $rootScope.$emit('loggedin'); if (response.redirect) { if (window.location.href === response.redirect) { //This is so an admin user will get full admin page window.location.reload(); } else { window.location = response.redirect; } } else { $location.url('/'); } }) .error(function (error) { if (error.msg === 'Token invalid or expired') $scope.resetpassworderror = 'Could not update password as token is invalid or may have expired'; else $scope.validationError = error; }); }; } ]);
{'content_hash': '72a14eaae858f78d1b127ccc6cd16843', 'timestamp': '', 'source': 'github', 'line_count': 173, 'max_line_length': 157, 'avg_line_length': 52.31791907514451, 'alnum_prop': 0.41708098552646117, 'repo_name': 'iakomus/infographics', 'id': 'bec46778f35935c6d7795e3d6d9a7771ddb67607', 'size': '9051', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'packages/users/public/controllers/meanUser.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '81771'}, {'name': 'HTML', 'bytes': '79432'}, {'name': 'JavaScript', 'bytes': '266790'}]}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (version 1.7.0_80) on Thu Oct 15 19:27:36 UTC 2015 --> <title>BootstrapActions.Daemon (AWS SDK for Java - 1.10.27)</title> <meta name="date" content="2015-10-15"> <link rel="stylesheet" type="text/css" href="../../../../../JavaDoc.css" title="Style"> </head> <body> <script type="text/javascript"><!-- if (location.href.indexOf('is-external=true') == -1) { parent.document.title="BootstrapActions.Daemon (AWS SDK for Java - 1.10.27)"; } //--> </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar_top"> <!-- --> </a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em> <!-- Scripts for Syntax Highlighter START--> <script id="syntaxhighlight_script_core" type="text/javascript" src = "http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/resources/syntaxhighlight/scripts/shCore.js"> </script> <script id="syntaxhighlight_script_java" type="text/javascript" src = "http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/resources/syntaxhighlight/scripts/shBrushJava.js"> </script> <link id="syntaxhighlight_css_core" rel="stylesheet" type="text/css" href = "http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/resources/syntaxhighlight/styles/shCoreDefault.css"/> <link id="syntaxhighlight_css_theme" rel="stylesheet" type="text/css" href = "http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/resources/syntaxhighlight/styles/shThemeDefault.css"/> <!-- Scripts for Syntax Highlighter END--> <div> <!-- BEGIN-SECTION --> <div id="divsearch" style="float:left;"> <span id="lblsearch" for="searchQuery"> <label>Search</label> </span> <form id="nav-search-form" target="_parent" method="get" action="http://docs.aws.amazon.com/search/doc-search.html#facet_doc_guide=API+Reference&facet_doc_product=AWS+SDK+for+Java"> <div id="nav-searchfield-outer" class="nav-sprite"> <div class="nav-searchfield-inner nav-sprite"> <div id="nav-searchfield-width"> <input id="nav-searchfield" name="searchQuery"> </div> </div> </div> <div id="nav-search-button" class="nav-sprite"> <input alt="" id="nav-search-button-inner" type="image"> </div> <input name="searchPath" type="hidden" value="documentation-guide" /> <input name="this_doc_product" type="hidden" value="AWS SDK for Java" /> <input name="this_doc_guide" type="hidden" value="API Reference" /> <input name="doc_locale" type="hidden" value="en_us" /> </form> </div> <!-- END-SECTION --> <!-- BEGIN-FEEDBACK-SECTION --> <div id="feedback-section"> <h3>Did this page help you?</h3> <div id="feedback-link-sectioin"> <a id="feedback_yes" target="_blank" style="display:inline;">Yes</a>&nbsp;&nbsp; <a id="feedback_no" target="_blank" style="display:inline;">No</a>&nbsp;&nbsp; <a id="go_cti" target="_blank" style="display:inline;">Tell us about it...</a> </div> </div> <script type="text/javascript"> window.onload = function(){ /* Dynamically add feedback links */ var javadoc_root_name = "/javadoc/"; var javadoc_path = location.href.substring(0, location.href.lastIndexOf(javadoc_root_name) + javadoc_root_name.length); var file_path = location.href.substring(location.href.lastIndexOf(javadoc_root_name) + javadoc_root_name.length); var feedback_yes_url = javadoc_path + "javadoc-resources/feedbackyes.html?topic_id="; var feedback_no_url = javadoc_path + "javadoc-resources/feedbackno.html?topic_id="; var feedback_tellmore_url = "https://aws-portal.amazon.com/gp/aws/html-forms-controller/documentation/aws_doc_feedback_04?service_name=Java-Ref&file_name="; if(file_path != "overview-frame.html") { var file_name = file_path.replace(/[/.]/g, '_'); document.getElementById("feedback_yes").setAttribute("href", feedback_yes_url + file_name); document.getElementById("feedback_no").setAttribute("href", feedback_no_url + file_name); document.getElementById("go_cti").setAttribute("href", feedback_tellmore_url + file_name); } else { // hide the search box and the feeback links in overview-frame page, // show "AWS SDK for Java" instead. document.getElementById("feedback-section").outerHTML = "AWS SDK for Java"; document.getElementById("divsearch").outerHTML = ""; } }; </script> <!-- END-FEEDBACK-SECTION --> </div> </em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.ConfigureHadoop.html" title="class in com.amazonaws.services.elasticmapreduce.util"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/ResizeJobFlowStep.html" title="class in com.amazonaws.services.elasticmapreduce.util"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" target="_top">Frames</a></li> <li><a href="BootstrapActions.Daemon.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#enum_constant_summary">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#enum_constant_detail">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&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">com.amazonaws.services.elasticmapreduce.util</div> <h2 title="Enum BootstrapActions.Daemon" class="title">Enum BootstrapActions.Daemon</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li>java.lang.Object</li> <li> <ul class="inheritance"> <li>java.lang.Enum&lt;<a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a>&gt;</li> <li> <ul class="inheritance"> <li>com.amazonaws.services.elasticmapreduce.util.BootstrapActions.Daemon</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd>java.io.Serializable, java.lang.Comparable&lt;<a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a>&gt;</dd> </dl> <dl> <dt>Enclosing class:</dt> <dd><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.html" title="class in com.amazonaws.services.elasticmapreduce.util">BootstrapActions</a></dd> </dl> <hr> <br> <pre>public static enum <span class="strong">BootstrapActions.Daemon</span> extends java.lang.Enum&lt;<a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a>&gt;</pre> <div class="block">List of Hadoop daemons which can be configured.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== ENUM CONSTANT SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="enum_constant_summary"> <!-- --> </a> <h3>Enum Constant Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Constant Summary table, listing enum constants, and an explanation"> <caption><span>Enum Constants</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colOne" scope="col">Enum Constant and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html#Client">Client</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><code><strong><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html#DataNode">DataNode</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html#JobTracker">JobTracker</a></strong></code>&nbsp;</td> </tr> <tr class="rowColor"> <td class="colOne"><code><strong><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html#NameNode">NameNode</a></strong></code>&nbsp;</td> </tr> <tr class="altColor"> <td class="colOne"><code><strong><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html#TaskTracker">TaskTracker</a></strong></code>&nbsp;</td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method_summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>static <a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a></code></td> <td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html#valueOf(java.lang.String)">valueOf</a></strong>(java.lang.String&nbsp;name)</code> <div class="block">Returns the enum constant of this type with the specified name.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>static <a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a>[]</code></td> <td class="colLast"><code><strong><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html#values()">values</a></strong>()</code> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Enum"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Enum</h3> <code>compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf</code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods_inherited_from_class_java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class&nbsp;java.lang.Object</h3> <code>getClass, notify, notifyAll, wait, wait, wait</code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ ENUM CONSTANT DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="enum_constant_detail"> <!-- --> </a> <h3>Enum Constant Detail</h3> <a name="NameNode"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>NameNode</h4> <pre>public static final&nbsp;<a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a> NameNode</pre> </li> </ul> <a name="DataNode"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>DataNode</h4> <pre>public static final&nbsp;<a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a> DataNode</pre> </li> </ul> <a name="JobTracker"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>JobTracker</h4> <pre>public static final&nbsp;<a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a> JobTracker</pre> </li> </ul> <a name="TaskTracker"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>TaskTracker</h4> <pre>public static final&nbsp;<a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a> TaskTracker</pre> </li> </ul> <a name="Client"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>Client</h4> <pre>public static final&nbsp;<a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a> Client</pre> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method_detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="values()"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>values</h4> <pre>public static&nbsp;<a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a>[]&nbsp;values()</pre> <div class="block">Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows: <pre> for (BootstrapActions.Daemon c : BootstrapActions.Daemon.values()) &nbsp; System.out.println(c); </pre></div> <dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the constants of this enum type, in the order they are declared</dd></dl> </li> </ul> <a name="valueOf(java.lang.String)"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>valueOf</h4> <pre>public static&nbsp;<a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" title="enum in com.amazonaws.services.elasticmapreduce.util">BootstrapActions.Daemon</a>&nbsp;valueOf(java.lang.String&nbsp;name)</pre> <div class="block">Returns the enum constant of this type with the specified name. The string must match <i>exactly</i> an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)</div> <dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the enum constant to be returned.</dd> <dt><span class="strong">Returns:</span></dt><dd>the enum constant with the specified name</dd> <dt><span class="strong">Throws:</span></dt> <dd><code>java.lang.IllegalArgumentException</code> - if this enum type has no constant with the specified name</dd> <dd><code>java.lang.NullPointerException</code> - if the argument is null</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><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="../../../../../index-all.html">Index</a></li> <li><a href="../../../../../help-doc.html">Help</a></li> </ul> <div class="aboutLanguage"><em> <div> <!-- Script for Syntax Highlighter START --> <script type="text/javascript"> SyntaxHighlighter.all() </script> <!-- Script for Syntax Highlighter END --> </div> <script src="http://a0.awsstatic.com/chrome/js/1.0.46/jquery.1.9.js" type="text/javascript"></script> <script>jQuery.noConflict();</script> <script> jQuery(function ($) { $("div.header").prepend('<!--REGION_DISCLAIMER_DO_NOT_REMOVE-->'); }); </script> <!-- BEGIN-URCHIN-TRACKER --> <script src="http://l0.awsstatic.com/js/urchin.js" type="text/javascript"></script> <script type="text/javascript">urchinTracker();</script> <!-- END-URCHIN-TRACKER --> <!-- SiteCatalyst code version: H.25.2. Copyright 1996-2012 Adobe, Inc. All Rights Reserved. More info available at http://www.omniture.com --> <script language="JavaScript" type="text/javascript" src="https://media.amazonwebservices.com/js/sitecatalyst/s_code.min.js (view-source:https://media.amazonwebservices.com/js/sitecatalyst/s_code.min.js)" /> <script language="JavaScript" type="text/javascript"> <!-- // Documentation Service Name s.prop66='AWS SDK for Java'; s.eVar66='D=c66'; // Documentation Guide Name s.prop65='API Reference'; s.eVar65='D=c65'; var s_code=s.t();if(s_code)document.write(s_code) //--> </script> <script language="JavaScript" type="text/javascript"> <!--if(navigator.appVersion.indexOf('MSIE')>=0)document.write(unescape('%3C')+'\!-'+'-') //--> </script> <noscript> <img src="http://amazonwebservices.d2.sc.omtrdc.net/b/ss/awsamazondev/1/H.25.2--NS/0" height="1" width="1" border="0" alt="" /> </noscript> <!--/DO NOT REMOVE/--> <!-- End SiteCatalyst code version: H.25.2. --> </em></div> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/BootstrapActions.ConfigureHadoop.html" title="class in com.amazonaws.services.elasticmapreduce.util"><span class="strong">Prev Class</span></a></li> <li><a href="../../../../../com/amazonaws/services/elasticmapreduce/util/ResizeJobFlowStep.html" title="class in com.amazonaws.services.elasticmapreduce.util"><span class="strong">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../../../index.html?com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html" target="_top">Frames</a></li> <li><a href="BootstrapActions.Daemon.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary:&nbsp;</li> <li>Nested&nbsp;|&nbsp;</li> <li><a href="#enum_constant_summary">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&nbsp;|&nbsp;</li> <li><a href="#method_summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail:&nbsp;</li> <li><a href="#enum_constant_detail">Enum Constants</a>&nbsp;|&nbsp;</li> <li>Field&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> Copyright &#169; 2013 Amazon Web Services, Inc. All Rights Reserved. </small></p> </body> </html>
{'content_hash': '7771a05981295d4a5f57f8343f877a45', 'timestamp': '', 'source': 'github', 'line_count': 478, 'max_line_length': 258, 'avg_line_length': 45.49163179916318, 'alnum_prop': 0.6346286502644286, 'repo_name': 'TomNong/Project2-Intel-Edison', 'id': '0656aebc3178bf9b4c70ffb4909ba8625e364e83', 'size': '21745', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'documentation/javadoc/com/amazonaws/services/elasticmapreduce/util/BootstrapActions.Daemon.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '5522'}]}
.. Auto-generated by help-rst from "mirtk open-scalars -h" output .. |open-scalars-brief-description| replace:: Opens scalar data of an input point set by perfoming an erosion followed by the same number of dilations. When the input data array has more than one component, each component is processed separately.
{'content_hash': '9ff0b21dd2ef010183259e1d462f97e3', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 71, 'avg_line_length': 46.285714285714285, 'alnum_prop': 0.7623456790123457, 'repo_name': 'schuhschuh/MIRTK', 'id': '3d4ecdd5cf5c24114e4c0abb51bf746ef14626d1', 'size': '324', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'Documentation/commands/_summaries/open-scalars.rst', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '1226'}, {'name': 'C', 'bytes': '22955'}, {'name': 'C++', 'bytes': '14908108'}, {'name': 'CMake', 'bytes': '1262915'}, {'name': 'Dockerfile', 'bytes': '7098'}, {'name': 'Python', 'bytes': '232475'}, {'name': 'Shell', 'bytes': '24544'}]}
<input name='button' ='' value="detect me">
{'content_hash': 'c95dc94753f75e301c4a9e37517d25a2', 'timestamp': '', 'source': 'github', 'line_count': 1, 'max_line_length': 43, 'avg_line_length': 43.0, 'alnum_prop': 0.6511627906976745, 'repo_name': 'HtmlUnit/htmlunit-neko', 'id': 'ac368d5aba6e965e409e1c52454245d44f285f88', 'size': '43', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/test/resources/error-handling/test-broken-attribute1.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '51224'}, {'name': 'Java', 'bytes': '2509522'}]}
package com.goodworkalan.spawn; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PipedInputStream; import java.io.PipedOutputStream; /** * Used when an output stream needs to be translated into an input stream to be * read by code expecting an input stream of a pipline output. This is * implemented using <code>PipedInputStream</code> and * <code>PipedOutputStream</code> so the reader needs to be in a separate thread * from the writer. * * @author Alan Gutierrez * */ class MissingProcess extends AbstractProgram { /** The piped input stream. */ private final PipedInputStream in; /** The piped output stream. */ private final PipedOutputStream out; /** Create a missing process. */ public MissingProcess() { try { this.in = new PipedInputStream(); this.out = new PipedOutputStream(this.in); } catch (IOException e) { throw new RuntimeException(e); } } /** * Get the piped input stream. * * @return The piped input stream. */ public InputStream getInputStream() { return in; } /** * Get the piped output stream. * * @return The piped output stream. */ public OutputStream getOutputStream() { return out; } }
{'content_hash': 'ca0e717a62e33d0318e6efd97dafa9bb', 'timestamp': '', 'source': 'github', 'line_count': 53, 'max_line_length': 80, 'avg_line_length': 25.67924528301887, 'alnum_prop': 0.639235855988244, 'repo_name': 'defunct/spawn', 'id': 'b02f1c6859f667ad65ce5a10f8a579725821156b', 'size': '1361', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/com/goodworkalan/spawn/MissingProcess.java', 'mode': '33188', 'license': 'mit', 'language': []}
ACCEPTED #### According to Index Fungorum #### Published in Opredelitel' trutovykh gribov Belorussii 89 (1964) #### Original name Tyromyces albellus f. aurantiacus Komarova ### Remarks null
{'content_hash': '530afb0b88698eb71c5665de97b5a9e3', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 50, 'avg_line_length': 14.846153846153847, 'alnum_prop': 0.7512953367875648, 'repo_name': 'mdoering/backbone', 'id': '8f298b6de8a621d2a4b1c1a2bcbbecf008a8de37', 'size': '258', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Fungi/Basidiomycota/Agaricomycetes/Polyporales/Polyporaceae/Tyromyces/Tyromyces aurantiacus/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
@interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @end
{'content_hash': '7eedcf6e8f0e819a6b2bb672179025b8', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 60, 'avg_line_length': 16.857142857142858, 'alnum_prop': 0.7796610169491526, 'repo_name': 'gzios/SystemLearn', 'id': '42f55ead6bf34b296569f5d0a6304745051f6205', 'size': '264', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Block/Block/AppDelegate.h', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'C', 'bytes': '2017844'}, {'name': 'Go', 'bytes': '1235'}, {'name': 'HTML', 'bytes': '1929'}, {'name': 'M4', 'bytes': '33730'}, {'name': 'Makefile', 'bytes': '13860'}, {'name': 'Objective-C', 'bytes': '851901'}, {'name': 'Python', 'bytes': '7805'}, {'name': 'Roff', 'bytes': '28115'}, {'name': 'Ruby', 'bytes': '2090'}, {'name': 'Shell', 'bytes': '11957'}, {'name': 'Swift', 'bytes': '72870'}]}
<?xml version="1.0" encoding="UTF-8"?> <GeocodeResponse> <status>OK</status> <result> <type>locality</type> <type>political</type> <formatted_address>8756 Sankt Georgen ob Judenburg, Austria</formatted_address> <address_component> <long_name>Sankt Georgen ob Judenburg</long_name> <short_name>Sankt Georgen ob Judenburg</short_name> <type>locality</type> <type>political</type> </address_component> <address_component> <long_name>Gemeinde Sankt Georgen ob Judenburg</long_name> <short_name>Gemeinde St. Georgen ob Judenburg</short_name> <type>administrative_area_level_3</type> <type>political</type> </address_component> <address_component> <long_name>Judenburg</long_name> <short_name>Judenburg</short_name> <type>administrative_area_level_2</type> <type>political</type> </address_component> <address_component> <long_name>Styria</long_name> <short_name>Styria</short_name> <type>administrative_area_level_1</type> <type>political</type> </address_component> <address_component> <long_name>Austria</long_name> <short_name>AT</short_name> <type>country</type> <type>political</type> </address_component> <address_component> <long_name>8756</long_name> <short_name>8756</short_name> <type>postal_code</type> </address_component> <geometry> <location> <lat>47.2060000</lat> <lng>14.4984000</lng> </location> <location_type>APPROXIMATE</location_type> <viewport> <southwest> <lat>47.1984191</lat> <lng>14.4823926</lng> </southwest> <northeast> <lat>47.2135798</lat> <lng>14.5144074</lng> </northeast> </viewport> </geometry> <place_id>ChIJd4BzHt8HNhQREVGoPRATeNI</place_id> </result> </GeocodeResponse>
{'content_hash': 'fc7e36391f215323f33f41cef45d43f3', 'timestamp': '', 'source': 'github', 'line_count': 62, 'max_line_length': 81, 'avg_line_length': 28.532258064516128, 'alnum_prop': 0.6823063877897118, 'repo_name': 'linkeddatalab/statspace', 'id': '65c587cdda1be64e019e1206a64b6fcddcaf130a', 'size': '1769', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'data/datasources/ogd.ifs.tuwien.ac.at_sparql/areas/62000_62026.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '24977'}, {'name': 'HTML', 'bytes': '245851'}, {'name': 'Java', 'bytes': '1177495'}]}
define(["three"], function(THREE) { var renderer = new THREE.WebGLRenderer({ clearColor: 0x000000, antialiasing: true }); renderer.setSize(1920, 1080); document.body.appendChild(renderer.domElement); return renderer; });
{'content_hash': '1e62d3fee23ee871857b2c6fc6d04f76', 'timestamp': '', 'source': 'github', 'line_count': 10, 'max_line_length': 51, 'avg_line_length': 25.8, 'alnum_prop': 0.6511627906976745, 'repo_name': 'IndigoDemo/IndiWorks', 'id': '6a3f381294bfa0b4c0a03e8dc70cbbc8bde4c364', 'size': '258', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'js/app/renderer.js', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '145'}, {'name': 'GLSL', 'bytes': '452'}, {'name': 'HTML', 'bytes': '326'}, {'name': 'JavaScript', 'bytes': '62756'}, {'name': 'Python', 'bytes': '606'}]}
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Sentience.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Sentience.Tests")] [assembly: AssemblyCopyright("Copyright © Andreas Håkansson 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("901858e5-0f30-49a4-9e70-4bb78c3460f0")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{'content_hash': '060e58611e6bd8c36fdb2f51383a9f70', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 84, 'avg_line_length': 40.44444444444444, 'alnum_prop': 0.7287087912087912, 'repo_name': 'thecodejunkie/sentience', 'id': 'c1439255bd1db35b473347b737e466b0529efccd', 'size': '1460', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Sentience.Tests/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '21278'}]}
<?php if(!defined('KIRBY')) exit ?> title: Section Cover pages: false files: true fields: title: label: Title type: text coversubtitle: label: Cover Subtitle type: textarea coverbtn: label: Cover Button Text type: text coverbtnlink: label: Cover Button Link type: text coverpic: label: Cover Picture type: select options: images
{'content_hash': '535cc4913681210cefea12b96307de20', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 35, 'avg_line_length': 17.454545454545453, 'alnum_prop': 0.6588541666666666, 'repo_name': 'dioptre/diym', 'id': 'c32d53cf246b979290f0befc77e15f6c37d8fdc7', 'size': '384', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'site/blueprints/sectioncover.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '1254'}, {'name': 'CSS', 'bytes': '1651345'}, {'name': 'HTML', 'bytes': '432116'}, {'name': 'JavaScript', 'bytes': '5635658'}, {'name': 'PHP', 'bytes': '1039710'}, {'name': 'Ruby', 'bytes': '6736'}]}
/** * This file/module contains all configuration for the build process. */ module.exports = { /** * The `build_dir` folder is where our projects are compiled during * development and the `compile_dir` folder is where our app resides once it's * completely built. */ build_dir: 'build', compile_dir: 'dist', mopidy_package_dir: 'mopidy_mopify', /** * This is a collection of file patterns that refer to our app code (the * stuff in `src/`). These file paths are used in the configuration of * build tasks. `js` is all project javascript, less tests. `ctpl` contains * our reusable components' (`src/common`) template HTML files, while * `atpl` contains the same, but for our app's code. `html` is just our * main HTML file, `less` is our main stylesheet, and `unit` contains our * app's unit tests. */ app_files: { js: [ 'src/app/**/*.js' ], css: [ 'src/css/**/*.css' ], atpl: [ 'src/app/**/*.tmpl.html' ], html: [ 'src/index.html' ] }, /** * This is the same as `app_files`, except it contains patterns that * reference vendor code (`vendor/`) that we need to place into the build * process somewhere. While the `app_files` property ensures all * standardized files are collected for compilation, it is the user's job * to ensure non-standardized (i.e. vendor-related) files are handled * appropriately in `vendor_files.js`. * * The `vendor_files.js` property holds files to be automatically * concatenated and minified with our project source files. * * The `vendor_files.css` property holds any CSS files to be automatically * included in our app. * * The `vendor_files.assets` property holds any assets to be copied along * with our app's assets. This structure is flattened, so it is not * recommended that you use wildcards. */ vendor_files: { js: [ 'src/vendor/mopidy/mopidy.js', 'src/vendor/angular/angular.js', 'src/vendor/angular-route/angular-route.js', 'src/vendor/angular-local-storage/dist/angular-local-storage.js', 'src/vendor/angular-echonest/src/angular-echonest.js', 'src/vendor/angular-loading-bar/src/loading-bar.js', 'src/vendor/angular-sanitize/angular-sanitize.js', 'src/vendor/ng-context-menu/dist/ng-context-menu.js', 'src/vendor/angular-animate/angular-animate.min.js', 'src/vendor/angular-notifier/dist/angular-notifier.min.js', 'src/vendor/angular-spotify/src/angular-spotify.js', 'src/vendor/underscore/underscore-min.js', 'src/vendor/ngInfiniteScroll/build/ng-infinite-scroll.min.js', 'src/vendor/angular-bootstrap/ui-bootstrap-tpls.min.js', 'src/vendor/angular-prompt/dist/angular-prompt.js', 'src/vendor/angular-toggle-switch/angular-toggle-switch.min.js', 'src/vendor/hammerjs/hammer.js', 'src/vendor/ryanmullins-angular-hammer/angular.hammer.js', 'src/vendor/angular-hotkeys/build/hotkeys.js' ], css: [ 'src/vendor/html5-boilerplate/css/normalize.css', 'src/vendor/html5-boilerplate/css/main.css', 'src/vendor/angular-loading-bar/src/loading-bar.css', 'src/vendor/angular-notifier/dist/angular-notifier.css', 'src/vendor/angular-toggle-switch/angular-toggle-switch.css', 'src/vendor/angular-hotkeys/build/hotkeys.css' ], assets: [ ], fonts: [ 'src/assets/webfonts/ss-standard.*' ] }, };
{'content_hash': 'b0afda5bf0da721c28cad4cd49dd6463', 'timestamp': '', 'source': 'github', 'line_count': 87, 'max_line_length': 82, 'avg_line_length': 43.08045977011494, 'alnum_prop': 0.6189967982924226, 'repo_name': 'dbrgn/mopidy-mopify', 'id': '9838bb744df4795cefa87b6159685ab33b3fca67', 'size': '3748', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'build.config.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '199559'}, {'name': 'HTML', 'bytes': '310154'}, {'name': 'JavaScript', 'bytes': '537300'}, {'name': 'Python', 'bytes': '14635'}]}
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("03. JSON Parse")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("03. JSON Parse")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("41bc9e5c-4ff9-4d12-b4fb-51aa67a7aa7e")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
{'content_hash': '0663c74d1871d9a1b874915d95c4a833', 'timestamp': '', 'source': 'github', 'line_count': 36, 'max_line_length': 84, 'avg_line_length': 38.77777777777778, 'alnum_prop': 0.744269340974212, 'repo_name': 'spiderbait90/Step-By-Step-In-Coding', 'id': '80f29b828a69457f383332ef08d73d15c7991817', 'size': '1399', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Programming Fundamentals/Strings and Text/03. JSON Parse/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '106'}, {'name': 'C#', 'bytes': '1601570'}, {'name': 'CSS', 'bytes': '513'}, {'name': 'HTML', 'bytes': '5127'}, {'name': 'JavaScript', 'bytes': '10918'}, {'name': 'Smalltalk', 'bytes': '1516'}]}
SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest help: @echo "Please use \`make <target>' where <target> is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/matplotlib2tikz.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/matplotlib2tikz.qhc" latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ "run these through (pdf)latex." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt."
{'content_hash': 'b25b423f73d44f3bbaf83eac91c62fc3', 'timestamp': '', 'source': 'github', 'line_count': 85, 'max_line_length': 91, 'avg_line_length': 35.90588235294118, 'alnum_prop': 0.7031454783748362, 'repo_name': 'danielhkl/matplotlib2tikz', 'id': 'cb99cd76fec39cc09c6d6684161dd5c73e172331', 'size': '3144', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'doc/Makefile', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Makefile', 'bytes': '654'}, {'name': 'Python', 'bytes': '150161'}]}
<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (C) 2010 - 2014 JBoss by Red Hat 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 --> <features name="fabric-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.0.0"> <feature name="fabric8" version="${project.version}" resolver="(obr)"> <feature>curator</feature> <feature>gravia</feature> <bundle>mvn:io.fabric8.poc/fabric8-api/${project.version}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-container-karaf-attributes/${project.version}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-container-karaf-managed/${project.version}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-container-tomcat-managed/${project.version}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-container-wildfly-connector/${project.version}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-container-wildfly-managed/${project.version}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-core/${project.version}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-domain-agent/${project.version}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-git/${project.version}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-spi/${project.version}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-jolokia/${project.version}</bundle> </feature> <feature name="curator" version="${project.version}" resolver="(obr)"> <bundle dependency="true">mvn:com.google.guava/guava/${version.guava}</bundle> <bundle>mvn:io.fabric8.poc/fabric8-zookeeper/${project.version}</bundle> <bundle>mvn:org.apache.curator/curator-client/${version.apache.curator}</bundle> <bundle>mvn:org.apache.curator/curator-framework/${version.apache.curator}</bundle> <bundle>mvn:org.apache.curator/curator-recipes/${version.apache.curator}</bundle> </feature> <feature name="gravia" version="${project.version}" resolver="(obr)"> <bundle dependency="true">mvn:org.apache.commons/commons-compress/${version.apache.commons.compress}</bundle> <bundle dependency="true">mvn:org.apache.felix/org.apache.felix.eventadmin/${version.apache.felix.eventadmin}</bundle> <bundle dependency="true">mvn:org.apache.felix/org.apache.felix.scr/${version.apache.felix.scr}</bundle> <bundle dependency="true">mvn:org.apache.felix/org.apache.felix.metatype/${version.apache.felix.metatype}</bundle> <bundle dependency="true">mvn:org.apache.felix/org.apache.felix.http.bundle/${version.apache.felix.http}</bundle> <bundle>mvn:org.jboss.gravia/gravia-provision/${version.jboss.gravia}</bundle> <bundle>mvn:org.jboss.gravia/gravia-resolver/${version.jboss.gravia}</bundle> <bundle>mvn:org.jboss.gravia/gravia-resource/${version.jboss.gravia}</bundle> <bundle>mvn:org.jboss.gravia/gravia-repository/${version.jboss.gravia}</bundle> <bundle>mvn:org.jboss.gravia/gravia-runtime-api/${version.jboss.gravia}</bundle> <bundle>mvn:org.jboss.gravia/gravia-runtime-osgi/${version.jboss.gravia}</bundle> </feature> </features>
{'content_hash': '0d52142c6e626ee29fac797b1f0157da', 'timestamp': '', 'source': 'github', 'line_count': 57, 'max_line_length': 126, 'avg_line_length': 62.89473684210526, 'alnum_prop': 0.7087866108786611, 'repo_name': 'tdiesler/fabric8poc', 'id': '59042bf61973022bdac1d54bf5c1f2c41a608952', 'size': '3585', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'container/karaf/features/src/main/resources/features.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '1142765'}, {'name': 'Shell', 'bytes': '2680'}]}
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{'content_hash': 'c468265b44720a7d4f166720f87da78f', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': 'f02ba78b1a3e0f7f3657152fe359c0cd0e58d05e', 'size': '179', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Saxifragales/Saxifragaceae/Micranthes/Micranthes sachalinensis/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
<idea-plugin version="2"> <id>com.behindthewires.intellij.fitnesse</id> <name>Fitnesse Plugin</name> <version>1.0</version> <description><![CDATA[ Enter short description for your plugin here.<br> <em>most HTML tags may be used</em> ]]></description> <change-notes><![CDATA[ Add change notes here.<br> <em>most HTML tags may be used</em> ]]> </change-notes> <!-- please see http://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description --> <idea-version since-build="131"/> <!-- please see http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products on how to target different products --> <!-- uncomment to enable plugin in all products <depends>com.intellij.modules.lang</depends> --> <extensions defaultExtensionNs="com.intellij"> <!-- Add your extensions here --> <fileTypeFactory implementation="com.behindthewires.intellij.fitnesse.lang.FitnesseFileTypeFactory"/> </extensions> <application-components> <!-- Add your application components here --> </application-components> <project-components> <!-- Add your project components here --> </project-components> <actions> <!-- Add your actions here --> </actions> </idea-plugin>
{'content_hash': '25be5e00abd00ea7d2bc2dc30eaf6f49', 'timestamp': '', 'source': 'github', 'line_count': 43, 'max_line_length': 118, 'avg_line_length': 30.348837209302324, 'alnum_prop': 0.6865900383141762, 'repo_name': 'chrisjgell/intj-fitnesse', 'id': '7109c4efa7c555629f8f3b26c8f304295c1c1ea9', 'size': '1305', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'META-INF/plugin.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '2784'}]}
__version__=''' $Id$ ''' __doc__="""Experimental class to generate Tables of Contents easily This module defines a single TableOfContents() class that can be used to create automatically a table of tontents for Platypus documents like this: story = [] toc = TableOfContents() story.append(toc) # some heading paragraphs here... doc = MyTemplate(path) doc.multiBuild(story) The data needed to create the table is a list of (level, text, pageNum) triplets, plus some paragraph styles for each level of the table itself. The triplets will usually be created in a document template's method like afterFlowable(), making notification calls using the notify() method with appropriate data like this: (level, text, pageNum) = ... self.notify('TOCEntry', (level, text, pageNum)) Optionally the list can contain four items in which case the last item is a destination key which the entry should point to. A bookmark with this key needs to be created first like this: key = 'ch%s' % self.seq.nextf('chapter') self.canv.bookmarkPage(key) self.notify('TOCEntry', (level, text, pageNum, key)) As the table of contents need at least two passes over the Platypus story which is why the moultiBuild0() method must be called. The level<NUMBER>ParaStyle variables are the paragraph styles used to format the entries in the table of contents. Their indentation is calculated like this: each entry starts at a multiple of some constant named delta. If one entry spans more than one line, all lines after the first are indented by the same constant named epsilon. """ from reportlab.lib import enums from reportlab.lib.units import cm from reportlab.lib.utils import commasplit, escapeOnce, encode_label, decode_label, strTypes from reportlab.lib.styles import ParagraphStyle, _baseFontName from reportlab.platypus.paragraph import Paragraph from reportlab.platypus.doctemplate import IndexingFlowable from reportlab.platypus.tables import TableStyle, Table from reportlab.platypus.flowables import Spacer, Flowable from reportlab.pdfbase.pdfmetrics import stringWidth from reportlab.pdfgen import canvas def unquote(txt): from xml.sax.saxutils import unescape return unescape(txt, {"&apos;": "'", "&quot;": '"'}) try: set except: class set(list): def add(self,x): if x not in self: list.append(self,x) def drawPageNumbers(canvas, style, pages, availWidth, availHeight, dot=' . '): ''' Draws pagestr on the canvas using the given style. If dot is None, pagestr is drawn at the current position in the canvas. If dot is a string, pagestr is drawn right-aligned. If the string is not empty, the gap is filled with it. ''' pages.sort() pagestr = ', '.join([str(p) for p, _ in pages]) x, y = canvas._curr_tx_info['cur_x'], canvas._curr_tx_info['cur_y'] fontSize = style.fontSize pagestrw = stringWidth(pagestr, style.fontName, fontSize) #if it's too long to fit, we need to shrink to fit in 10% increments. #it would be very hard to output multiline entries. #however, we impose a minimum size of 1 point as we don't want an #infinite loop. Ultimately we should allow a TOC entry to spill #over onto a second line if needed. freeWidth = availWidth-x while pagestrw > freeWidth and fontSize >= 1.0: fontSize = 0.9 * fontSize pagestrw = stringWidth(pagestr, style.fontName, fontSize) if isinstance(dot, strTypes): if dot: dotw = stringWidth(dot, style.fontName, fontSize) dotsn = int((availWidth-x-pagestrw)/dotw) else: dotsn = dotw = 0 text = '%s%s' % (dotsn * dot, pagestr) newx = availWidth - dotsn*dotw - pagestrw pagex = availWidth - pagestrw elif dot is None: text = ', ' + pagestr newx = x pagex = newx else: raise TypeError('Argument dot should either be None or an instance of basestring.') tx = canvas.beginText(newx, y) tx.setFont(style.fontName, fontSize) tx.setFillColor(style.textColor) tx.textLine(text) canvas.drawText(tx) commaw = stringWidth(', ', style.fontName, fontSize) for p, key in pages: if not key: continue w = stringWidth(str(p), style.fontName, fontSize) canvas.linkRect('', key, (pagex, y, pagex+w, y+style.leading), relative=1) pagex += w + commaw # Default paragraph styles for tables of contents. # (This could also be generated automatically or even # on-demand if it is not known how many levels the # TOC will finally need to display...) delta = 1*cm epsilon = 0.5*cm defaultLevelStyles = [ ParagraphStyle( name='Level 0', fontName=_baseFontName, fontSize=10, leading=11, firstLineIndent = 0, leftIndent = epsilon)] defaultTableStyle = \ TableStyle([ ('VALIGN', (0,0), (-1,-1), 'TOP'), ('RIGHTPADDING', (0,0), (-1,-1), 0), ('LEFTPADDING', (0,0), (-1,-1), 0), ]) class TableOfContents(IndexingFlowable): """This creates a formatted table of contents. It presumes a correct block of data is passed in. The data block contains a list of (level, text, pageNumber) triplets. You can supply a paragraph style for each level (starting at zero). Set dotsMinLevel to determine from which level on a line of dots should be drawn between the text and the page number. If dotsMinLevel is set to a negative value, no dotted lines are drawn. """ def __init__(self): self.rightColumnWidth = 72 self.levelStyles = defaultLevelStyles self.tableStyle = defaultTableStyle self.dotsMinLevel = 1 self._table = None self._entries = [] self._lastEntries = [] def beforeBuild(self): # keep track of the last run self._lastEntries = self._entries[:] self.clearEntries() def isIndexing(self): return 1 def isSatisfied(self): return (self._entries == self._lastEntries) def notify(self, kind, stuff): """The notification hook called to register all kinds of events. Here we are interested in 'TOCEntry' events only. """ if kind == 'TOCEntry': self.addEntry(*stuff) def clearEntries(self): self._entries = [] def getLevelStyle(self, n): '''Returns the style for level n, generating and caching styles on demand if not present.''' try: return self.levelStyles[n] except IndexError: prevstyle = self.getLevelStyle(n-1) self.levelStyles.append(ParagraphStyle( name='%s-%d-indented' % (prevstyle.name, n), parent=prevstyle, firstLineIndent = prevstyle.firstLineIndent+delta, leftIndent = prevstyle.leftIndent+delta)) return self.levelStyles[n] def addEntry(self, level, text, pageNum, key=None): """Adds one entry to the table of contents. This allows incremental buildup by a doctemplate. Requires that enough styles are defined.""" assert type(level) == type(1), "Level must be an integer" self._entries.append((level, text, pageNum, key)) def addEntries(self, listOfEntries): """Bulk creation of entries in the table of contents. If you knew the titles but not the page numbers, you could supply them to get sensible output on the first run.""" for entryargs in listOfEntries: self.addEntry(*entryargs) def wrap(self, availWidth, availHeight): "All table properties should be known by now." # makes an internal table which does all the work. # we draw the LAST RUN's entries! If there are # none, we make some dummy data to keep the table # from complaining if len(self._lastEntries) == 0: _tempEntries = [(0,'Placeholder for table of contents',0,None)] else: _tempEntries = self._lastEntries def drawTOCEntryEnd(canvas, kind, label): '''Callback to draw dots and page numbers after each entry.''' label = label.split(',') page, level, key = int(label[0]), int(label[1]), eval(label[2],{}) style = self.getLevelStyle(level) if self.dotsMinLevel >= 0 and level >= self.dotsMinLevel: dot = ' . ' else: dot = '' drawPageNumbers(canvas, style, [(page, key)], availWidth, availHeight, dot) self.canv.drawTOCEntryEnd = drawTOCEntryEnd tableData = [] for (level, text, pageNum, key) in _tempEntries: style = self.getLevelStyle(level) if key: text = '<a href="#%s">%s</a>' % (key, text) keyVal = repr(key).replace(',','\\x2c').replace('"','\\x2c') else: keyVal = None para = Paragraph('%s<onDraw name="drawTOCEntryEnd" label="%d,%d,%s"/>' % (text, pageNum, level, keyVal), style) if style.spaceBefore: tableData.append([Spacer(1, style.spaceBefore),]) tableData.append([para,]) self._table = Table(tableData, colWidths=(availWidth,), style=self.tableStyle) self.width, self.height = self._table.wrapOn(self.canv,availWidth, availHeight) return (self.width, self.height) def split(self, availWidth, availHeight): """At this stage we do not care about splitting the entries, we will just return a list of platypus tables. Presumably the calling app has a pointer to the original TableOfContents object; Platypus just sees tables. """ return self._table.splitOn(self.canv,availWidth, availHeight) def drawOn(self, canvas, x, y, _sW=0): """Don't do this at home! The standard calls for implementing draw(); we are hooking this in order to delegate ALL the drawing work to the embedded table object. """ self._table.drawOn(canvas, x, y, _sW) def makeTuple(x): if hasattr(x, '__iter__'): return tuple(x) return (x,) class SimpleIndex(IndexingFlowable): """Creates multi level indexes. The styling can be cutomized and alphabetic headers turned on and off. """ def __init__(self, **kwargs): """ Constructor of SimpleIndex. Accepts the same arguments as the setup method. """ #keep stuff in a dictionary while building self._entries = {} self._lastEntries = {} self._flowable = None self.setup(**kwargs) def getFormatFunc(self,format): try: D = {} exec('from reportlab.lib.sequencer import _format_%s as formatFunc' % format, D) return D['formatFunc'] except ImportError: raise ValueError('Unknown format %r' % format) def setup(self, style=None, dot=None, tableStyle=None, headers=True, name=None, format='123', offset=0): """ This method makes it possible to change styling and other parameters on an existing object. style is the paragraph style to use for index entries. dot can either be None or a string. If it's None, entries are immediatly followed by their corresponding page numbers. If it's a string, page numbers are aligned on the right side of the document and the gap filled with a repeating sequence of the string. tableStyle is the style used by the table which the index uses to draw itself. Use this to change properties like spacing between elements. headers is a boolean. If it is True, alphabetic headers are displayed in the Index when the first letter changes. If False, we just output some extra space before the next item name makes it possible to use several indexes in one document. If you want this use this parameter to give each index a unique name. You can then index a term by refering to the name of the index which it should appear in: <index item="term" name="myindex" /> format can be 'I', 'i', '123', 'ABC', 'abc' """ if style is None: style = ParagraphStyle(name='index', fontName=_baseFontName, fontSize=11) self.textStyle = style self.tableStyle = tableStyle or defaultTableStyle self.dot = dot self.headers = headers if name is None: from reportlab.platypus.paraparser import DEFAULT_INDEX_NAME as name self.name = name self.formatFunc = self.getFormatFunc(format) self.offset = offset def __call__(self,canv,kind,label): try: terms, format, offset = decode_label(label) except: terms = label format = offset = None if format is None: formatFunc = self.formatFunc else: formatFunc = self.getFormatFunc(format) if offset is None: offset = self.offset terms = commasplit(terms) pns = formatFunc(canv.getPageNumber()-offset) key = 'ix_%s_%s_p_%s' % (self.name, label, pns) info = canv._curr_tx_info canv.bookmarkHorizontal(key, info['cur_x'], info['cur_y'] + info['leading']) self.addEntry(terms, pns, key) def getCanvasMaker(self, canvasmaker=canvas.Canvas): def newcanvasmaker(*args, **kwargs): from reportlab.pdfgen import canvas c = canvasmaker(*args, **kwargs) setattr(c,self.name,self) return c return newcanvasmaker def isIndexing(self): return 1 def isSatisfied(self): return (self._entries == self._lastEntries) def beforeBuild(self): # keep track of the last run self._lastEntries = self._entries.copy() self.clearEntries() def clearEntries(self): self._entries = {} def notify(self, kind, stuff): """The notification hook called to register all kinds of events. Here we are interested in 'IndexEntry' events only. """ if kind == 'IndexEntry': (text, pageNum) = stuff self.addEntry(text, pageNum) def addEntry(self, text, pageNum, key=None): """Allows incremental buildup""" self._entries.setdefault(makeTuple(text),set([])).add((pageNum, key)) def split(self, availWidth, availHeight): """At this stage we do not care about splitting the entries, we will just return a list of platypus tables. Presumably the calling app has a pointer to the original TableOfContents object; Platypus just sees tables. """ return self._flowable.splitOn(self.canv,availWidth, availHeight) def _getlastEntries(self, dummy=[(['Placeholder for index'],enumerate((None,)*3))]): '''Return the last run's entries! If there are none, returns dummy.''' if not self._lastEntries: if self._entries: return list(self._entries.items()) return dummy return list(self._lastEntries.items()) def _build(self,availWidth,availHeight): _tempEntries = self._getlastEntries() def getkey(seq): return [x.upper() for x in seq[0]] _tempEntries.sort(key=getkey) leveloffset = self.headers and 1 or 0 def drawIndexEntryEnd(canvas, kind, label): '''Callback to draw dots and page numbers after each entry.''' style = self.getLevelStyle(leveloffset) pages = decode_label(label) drawPageNumbers(canvas, style, pages, availWidth, availHeight, self.dot) self.canv.drawIndexEntryEnd = drawIndexEntryEnd alpha = '' tableData = [] lastTexts = [] alphaStyle = self.getLevelStyle(0) for texts, pageNumbers in _tempEntries: texts = list(texts) #track when the first character changes; either output some extra #space, or the first letter on a row of its own. We cannot do #widow/orphan control, sadly. nalpha = texts[0][0].upper() if alpha != nalpha: alpha = nalpha if self.headers: header = alpha else: header = ' ' tableData.append([Spacer(1, alphaStyle.spaceBefore),]) tableData.append([Paragraph(header, alphaStyle),]) tableData.append([Spacer(1, alphaStyle.spaceAfter),]) i, diff = listdiff(lastTexts, texts) if diff: lastTexts = texts texts = texts[i:] label = encode_label(list(pageNumbers)) texts[-1] = '%s<onDraw name="drawIndexEntryEnd" label="%s"/>' % (texts[-1], label) for text in texts: #Platypus and RML differ on how parsed XML attributes are escaped. #e.g. <index item="M&S"/>. The only place this seems to bite us is in #the index entries so work around it here. text = escapeOnce(text) style = self.getLevelStyle(i+leveloffset) para = Paragraph(text, style) if style.spaceBefore: tableData.append([Spacer(1, style.spaceBefore),]) tableData.append([para,]) i += 1 self._flowable = Table(tableData, colWidths=[availWidth], style=self.tableStyle) def wrap(self, availWidth, availHeight): "All table properties should be known by now." self._build(availWidth,availHeight) self.width, self.height = self._flowable.wrapOn(self.canv,availWidth, availHeight) return self.width, self.height def drawOn(self, canvas, x, y, _sW=0): """Don't do this at home! The standard calls for implementing draw(); we are hooking this in order to delegate ALL the drawing work to the embedded table object. """ self._flowable.drawOn(canvas, x, y, _sW) def draw(self): t = self._flowable ocanv = getattr(t,'canv',None) if not ocanv: t.canv = self.canv try: t.draw() finally: if not ocanv: del t.canv def getLevelStyle(self, n): '''Returns the style for level n, generating and caching styles on demand if not present.''' if not hasattr(self.textStyle, '__iter__'): self.textStyle = [self.textStyle] try: return self.textStyle[n] except IndexError: self.textStyle = list(self.textStyle) prevstyle = self.getLevelStyle(n-1) self.textStyle.append(ParagraphStyle( name='%s-%d-indented' % (prevstyle.name, n), parent=prevstyle, firstLineIndent = prevstyle.firstLineIndent+.2*cm, leftIndent = prevstyle.leftIndent+.2*cm)) return self.textStyle[n] AlphabeticIndex = SimpleIndex def listdiff(l1, l2): m = min(len(l1), len(l2)) for i in range(m): if l1[i] != l2[i]: return i, l2[i:] return m, l2[m:] class ReferenceText(IndexingFlowable): """Fakery to illustrate how a reference would work if we could put it in a paragraph.""" def __init__(self, textPattern, targetKey): self.textPattern = textPattern self.target = targetKey self.paraStyle = ParagraphStyle('tmp') self._lastPageNum = None self._pageNum = -999 self._para = None def beforeBuild(self): self._lastPageNum = self._pageNum def notify(self, kind, stuff): if kind == 'Target': (key, pageNum) = stuff if key == self.target: self._pageNum = pageNum def wrap(self, availWidth, availHeight): text = self.textPattern % self._lastPageNum self._para = Paragraph(text, self.paraStyle) return self._para.wrap(availWidth, availHeight) def drawOn(self, canvas, x, y, _sW=0): self._para.drawOn(canvas, x, y, _sW)
{'content_hash': '1b5c2577f7858da7217ad117dad184a3', 'timestamp': '', 'source': 'github', 'line_count': 551, 'max_line_length': 123, 'avg_line_length': 37.201451905626136, 'alnum_prop': 0.6104985852278271, 'repo_name': 'kitanata/resume', 'id': 'd3f685368eb460f5302713072e6071a83a97cfb9', 'size': '20696', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'env/lib/python2.7/site-packages/reportlab/platypus/tableofcontents.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '4224'}, {'name': 'CoffeeScript', 'bytes': '385'}, {'name': 'JavaScript', 'bytes': '37733'}]}
/*global TimelineUrl*/ 'use strict'; class TimelineUrlPane { constructor() { this.paneTitle = 'Generate Timeline URL'; this.createSidebar(); } createSidebar() { chrome.devtools.panels.sources.createSidebarPane(this.paneTitle, function (sidebar) { sidebar.setPage('sidebar.html'); sidebar.onShown.addListener(this.bindEvents.bind(this)); }.bind(this)); } bindEvents(win) { win.generateBtn.addEventListener('click', function () { new TimelineUrl(win); }); } } // kick it off. var tlpane = new TimelineUrlPane();
{'content_hash': '742917a9f15df828f84d35166ad1da43', 'timestamp': '', 'source': 'github', 'line_count': 25, 'max_line_length': 87, 'avg_line_length': 21.64, 'alnum_prop': 0.7024029574861368, 'repo_name': 'ChromeDevTools/timeline-url', 'id': '6187d7a7006350e1d6f4c09cba98279a1c60047d', 'size': '541', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'app/scripts/panel.js', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '2082'}, {'name': 'JavaScript', 'bytes': '7945'}, {'name': 'Shell', 'bytes': '649'}]}
<?php /** * @namespace */ namespace Yandex\Market\Partner; use Psr\Http\Message\UriInterface; use Yandex\Common\AbstractServiceClient; use GuzzleHttp\Psr7\Response; use GuzzleHttp\Exception\ClientException; use Yandex\Common\Exception\ForbiddenException; use Yandex\Common\Exception\UnauthorizedException; use Yandex\Market\Partner\Exception\PartnerRequestException; use Yandex\Market\Partner\Models; /** * Class PartnerClient * * @category Yandex * @package Market * * @author Alexander Khaylo <[email protected]> * @created 04.11.13 12:48 */ class PartnerClient extends AbstractServiceClient { /** * Order is being processed */ const ORDER_STATUS_PROCESSING = 'PROCESSING'; /** * Order submitted to the delivery */ const ORDER_STATUS_DELIVERY = 'DELIVERY'; /** * Order delivered to the point of self-delivery */ const ORDER_STATUS_PICKUP = 'PICKUP'; /** * The order is received by the buyer */ const ORDER_STATUS_DELIVERED = 'DELIVERED'; /** * Order canceled. */ const ORDER_STATUS_CANCELLED = 'CANCELLED'; //Sub-statuses for status CANCELLED // - the buyer is not finalized the reserved order on time const ORDER_SUBSTATUS_RESERVATION_EXPIRED = 'RESERVATION_EXPIRED'; // - the buyer did not pay for the order ( for the type of payment PREPAID) const ORDER_SUBSTATUS_USER_NOT_PAID = 'USER_NOT_PAID'; // - failed to communicate with the buyer const ORDER_SUBSTATUS_USER_UNREACHABLE = 'USER_UNREACHABLE'; // - buyer canceled the order for cause const ORDER_SUBSTATUS_USER_CHANGED_MIND = 'USER_CHANGED_MIND'; // - the buyer is not satisfied with the terms of delivery const ORDER_SUBSTATUS_USER_REFUSED_DELIVERY = 'USER_REFUSED_DELIVERY'; // - the buyer did not fit the goods const ORDER_SUBSTATUS_USER_REFUSED_PRODUCT = 'USER_REFUSED_PRODUCT'; // - shop can not fulfill the order const ORDER_SUBSTATUS_SHOP_FAILED = 'SHOP_FAILED'; // - the buyer is not satisfied with the quality of the goods const ORDER_SUBSTATUS_USER_REFUSED_QUALITY = 'USER_REFUSED_QUALITY'; // - buyer changes the composition of the order const ORDER_SUBSTATUS_REPLACING_ORDER = 'REPLACING_ORDER'; //- store does not process orders on time const ORDER_SUBSTATUS_PROCESSING_EXPIRED = 'PROCESSING_EXPIRED'; //Способ оплаты заказа //предоплата через Яндекс; const PAYMENT_METHOD_YANDEX = 'YANDEX'; //предоплата напрямую магазину, //не принимающему предоплату через Яндекс. const PAYMENT_METHOD_SHOP_PREPAID = 'SHOP_PREPAID'; // наличный расчет при получении заказа; const PAYMENT_METHOD_CASH_ON_DELIVERY = 'CASH_ON_DELIVERY'; // оплата банковской картой при получении заказа. const PAYMENT_METHOD_CARD_ON_DELIVERY = 'CARD_ON_DELIVERY'; //Типы доставки //курьерская доставка const DELIVERY_TYPE_DELIVERY = 'DELIVERY'; //самовывоз const DELIVERY_TYPE_PICKUP = 'PICKUP'; //почта const DELIVERY_TYPE_POST = 'POST'; const ORDER_DECLINE_REASON_OUT_OF_DATE= 'OUT_OF_DATE'; /** * Requested version of API * @var string */ private $version = 'v2'; /** * Application id * * @var string */ protected $clientId; /** * User login * * @var string */ protected $login; /** * Campaign Id * * @var string */ protected $campaignId; /** * API domain * * @var string */ protected $serviceDomain = 'api.partner.market.yandex.ru'; /** * Get url to service resource with parameters * * @param string $resource * @see http://api.yandex.ru/market/partner/doc/dg/concepts/method-call.xml * @return string */ public function getServiceUrl($resource = '') { return $this->serviceScheme . '://' . $this->serviceDomain . '/' . $this->version . '/' . $resource; } /** * @param string $token access token */ public function __construct($token = '') { $this->setAccessToken($token); } /** * @param string $clientId */ public function setClientId($clientId) { $this->clientId = $clientId; } /** * @param string $login */ public function setLogin($login) { $this->login = $login; } /** * @param string $campaignId */ public function setCampaignId($campaignId) { $this->campaignId = $campaignId; } /** * @return string */ public function getClientId() { return $this->clientId; } /** * @return string */ public function getLogin() { return $this->login; } /** * Sends a request * * @param string $method HTTP method * @param string|UriInterface $uri URI object or string. * @param array $options Request options to apply. * * @return Response * * @throws ForbiddenException * @throws UnauthorizedException * @throws PartnerRequestException */ protected function sendRequest($method, $uri, array $options = []) { try { $response = $this->getClient()->request($method, $uri, $options); } catch (ClientException $ex) { $result = $ex->getResponse(); $code = $result->getStatusCode(); $message = $result->getReasonPhrase(); $body = $result->getBody(); if ($body) { $jsonBody = json_decode($body); if ($jsonBody && isset($jsonBody->error) && isset($jsonBody->error->message)) { $message = $jsonBody->error->message; } } if ($code === 403) { throw new ForbiddenException($message); } if ($code === 401) { throw new UnauthorizedException($message); } throw new PartnerRequestException( 'Service responded with error code: "' . $code . '" and message: "' . $message . '"', $code ); } return $response; } /** * Get OAuth data for header request * * @see http://api.yandex.ru/market/partner/doc/dg/concepts/authorization.xml * * @return string */ public function getAccessToken() { return 'oauth_token=' . parent::getAccessToken() . ', oauth_client_id=' . $this->getClientId() . ', oauth_login=' . $this->getLogin(); } /** * Get User Campaigns * * Returns the user to the list of campaigns Yandex.market. * The list coincides with the list of campaigns * that are displayed in the partner interface Yandex.Market on page "My shops." * * @see http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns.xml * * @return Models\Campaigns */ public function getCampaigns() { $resource = 'campaigns.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getCampaignsResponse = new Models\GetCampaignsResponse($decodedResponseBody); return $getCampaignsResponse->getCampaigns(); } /** * Get information about orders by campaign id * * @param array $params * * Returns information on the requested orders. * Available filtering by date ordering and order status. * The maximum range of dates in a single request for a resource - 30 days. * * @see http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-orders.xml * * @return Models\GetOrdersResponse */ public function getOrdersResponse($params = []) { $resource = 'campaigns/' . $this->campaignId . '/orders.json'; $resource .= '?' . http_build_query($params); $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); return new Models\GetOrdersResponse($decodedResponseBody); } /** * Get only orders data without pagination * * @param array $params * @return null|Models\Orders */ public function getOrders($params = []) { return $this->getOrdersResponse($params)->getOrders(); } /** * Get order info * * @param int $orderId * @return Models\Order * * @link http://api.yandex.ru/market/partner/doc/dg/reference/get-campaigns-id-orders-id.xml */ public function getOrder($orderId) { $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '.json'; $response = $this->sendRequest('GET', $this->getServiceUrl($resource)); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $getOrderResponse = new Models\GetOrderResponse($decodedResponseBody); return $getOrderResponse->getOrder(); } /** * Send changed status to Yandex.Market * * @param int $orderId * @param string $status * @param null|string $subStatus * @return Models\Order * * @link http://api.yandex.ru/market/partner/doc/dg/reference/put-campaigns-id-orders-id-status.xml */ public function setOrderStatus($orderId, $status, $subStatus = null) { $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '/status.json'; $data = [ "order" => [ "status" => $status ] ]; if ($subStatus) { $data['order']['substatus'] = $subStatus; } $response = $this->sendRequest( 'PUT', $this->getServiceUrl($resource), [ 'json' => $data ] ); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $updateOrderStatusResponse = new Models\UpdateOrderStatusResponse($decodedResponseBody); return $updateOrderStatusResponse->getOrder(); } /** * Update changed delivery parameters * * @param int $orderId * @param Models\Delivery $delivery * @return Models\Order * * Example: * PUT /v2/campaigns/10003/order/12345/delivery.json HTTP/1.1 * * @link http://api.yandex.ru/market/partner/doc/dg/reference/put-campaigns-id-orders-id-delivery.xml */ public function updateDelivery($orderId, Models\Delivery $delivery) { $resource = 'campaigns/' . $this->campaignId . '/orders/' . $orderId . '/delivery.json'; $response = $this->sendRequest( 'PUT', $this->getServiceUrl($resource), [ 'json' => $delivery->toArray() ] ); $decodedResponseBody = $this->getDecodedBody($response->getBody()); $updateOrderDeliveryResponse = new Models\UpdateOrderDeliveryResponse($decodedResponseBody); return $updateOrderDeliveryResponse->getOrder(); } }
{'content_hash': '4ceff4bb2d824d316d860707f4961306', 'timestamp': '', 'source': 'github', 'line_count': 404, 'max_line_length': 105, 'avg_line_length': 27.70049504950495, 'alnum_prop': 0.5951210794388347, 'repo_name': 'zbarinov/yandex-php-library', 'id': '4d23b3d0fa84b9ced63215d540995f4a205b7969', 'size': '11532', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Yandex/Market/Partner/PartnerClient.php', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Nginx', 'bytes': '715'}, {'name': 'PHP', 'bytes': '1149782'}, {'name': 'Shell', 'bytes': '4433'}]}
require 'spec_helper' require 'devise-links/links/registration' require 'devise-links/links/labels' describe Devise::Links::Registration do extend_view_with Devise::Links::Registration extend_view_with Devise::Links::Labels describe '#new_registration_link' do it "should create a registration link" do view_engine do |e, view| label = 'new registration' path = 'new/reg/path' # view.stubs(:user_reg_path).with(:new, :admin).returns path view.stubs(:new_registration_path).returns path output_label = view.new_registration_label view.stubs(:link_to).returns output_label res = e.run_template do %{<%= new_registration_link(:role => :admin) %> } end res.should match /#{output_label}/ end end end end
{'content_hash': 'de7c41818d2c5919b9bb8ae9e29f71d2', 'timestamp': '', 'source': 'github', 'line_count': 31, 'max_line_length': 68, 'avg_line_length': 27.677419354838708, 'alnum_prop': 0.6177156177156177, 'repo_name': 'kristianmandrup/devise-links', 'id': 'a49f5e2681fe23a30f98992f262ee298d4f093eb', 'size': '858', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/devise-links/registration-links_spec.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Ruby', 'bytes': '10567'}]}
package android.support.log4j2.slf4j; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.spi.AbstractLoggerAdapter; import org.apache.logging.log4j.spi.LoggerContext; import org.apache.logging.slf4j.Log4jLogger; import org.slf4j.ILoggerFactory; import org.slf4j.Logger; /** * Log4jLoggerFactory */ public class Log4jLoggerFactory extends AbstractLoggerAdapter<Logger> implements ILoggerFactory { @Override protected Logger newLogger(final String name, final LoggerContext context) { final String key = Logger.ROOT_LOGGER_NAME.equals(name) ? LogManager.ROOT_LOGGER_NAME : name; return new Log4jLogger(context.getLogger(key), name); } @Override protected LoggerContext getContext() { return LogManager.getContext(false); } }
{'content_hash': '30ecddd07332e8e153d734ede4bb6409', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 101, 'avg_line_length': 29.77777777777778, 'alnum_prop': 0.7611940298507462, 'repo_name': 'fine1021/Log4JAndroid', 'id': '783ab0dc661cf1d7b6b15a97dc7d54f04e361dad', 'size': '804', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'log4j2-android/src/main/java/android/support/log4j2/slf4j/Log4jLoggerFactory.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Java', 'bytes': '142518'}]}
<?php use yii\widgets\ListView; /* @var $this yii\web\View */ /* @var $searchModel app\models\form\Content */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = $breadcrum; $this->params['breadcrumbs'][] = $this->title; ?> <div class="content-index"> <?=ListView::widget([ 'dataProvider' => $dataProvider, 'itemView' => '/content/listItem', 'layout' => "{items}\n{pager}", ]);?> </div>
{'content_hash': 'e3a665720ae77a0d5393b311aae3978f', 'timestamp': '', 'source': 'github', 'line_count': 19, 'max_line_length': 52, 'avg_line_length': 21.63157894736842, 'alnum_prop': 0.6423357664233577, 'repo_name': 'froyot/dandan', 'id': '4af02620b7a0482e6beaef0c7179e5a7dedb9098', 'size': '411', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'fronted/views/post/index.php', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '515'}, {'name': 'CSS', 'bytes': '491122'}, {'name': 'HTML', 'bytes': '87733'}, {'name': 'JavaScript', 'bytes': '1879144'}, {'name': 'PHP', 'bytes': '335320'}]}
local_path=$(dirname $0) source $local_path/Common func_check_xwalkservice if [[ $? -eq 1 ]]; then func_xwalkservice if [[ $? -eq 1 ]]; then echo "set xwalk service failure" exit 1 fi fi pkgcmd -i -t wgt -p $local_path/../source/manifest_app_mainsource_tests.wgt -q a=`sqlite3 /home/app/.applications/dbspace/.app_info.db "select package from app_info;" | grep mainsource` if [[ $a =~ 'mainsource' ]]; then echo "Use run as service install successfully" else echo "Use run as service mode install failure" exit 1 fi if [[ $a =~ 'mainsource' ]]; then echo "Use run as service install app and the DB correctly" pkgcmd -u -n mainsource -q exit 0 else echo "Use run as service install app and the DB incorrectly" pkgcmd -u -n mainsource -q exit 1 fi
{'content_hash': 'de93ce27f338800de3710a18462304f2', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 106, 'avg_line_length': 34.1, 'alnum_prop': 0.5219941348973607, 'repo_name': 'yugang/crosswalk-test-suite', 'id': '54c0b08cb3d270907554aa10b7327052f000be70', 'size': '2539', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'wrt/wrt-rtbin-tizen-tests/rtbinauto/Crosswalk_Run_As_Service_CheckDB.sh', 'mode': '33261', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '3495'}, {'name': 'CSS', 'bytes': '1694855'}, {'name': 'Erlang', 'bytes': '2850'}, {'name': 'Java', 'bytes': '155590'}, {'name': 'JavaScript', 'bytes': '32256550'}, {'name': 'PHP', 'bytes': '43783'}, {'name': 'Perl', 'bytes': '1696'}, {'name': 'Python', 'bytes': '4215706'}, {'name': 'Shell', 'bytes': '638387'}, {'name': 'XSLT', 'bytes': '2143471'}]}
export * from "./trafficChart.component"; export * from "./trafficChart.service";
{'content_hash': '06019fa48b660eb111ab948d000baf9f', 'timestamp': '', 'source': 'github', 'line_count': 2, 'max_line_length': 41, 'avg_line_length': 41.0, 'alnum_prop': 0.7317073170731707, 'repo_name': 'huazai128/angular2-admin', 'id': '05964f32312de63dbc63db611f5331f4f1420667', 'size': '82', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/app/pages/dashboard/trafficChart/index.ts', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '76849'}, {'name': 'HTML', 'bytes': '20295'}, {'name': 'JavaScript', 'bytes': '38780'}, {'name': 'Shell', 'bytes': '153'}, {'name': 'TypeScript', 'bytes': '125804'}]}
package nz.co.doltech.gwtjui.demo.client.application.interactions.selectable; import com.google.gwt.core.client.Scheduler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.ui.FocusPanel; import com.google.gwt.user.client.ui.SimplePanel; import com.google.gwt.user.client.ui.Widget; import com.gwtplatform.mvp.client.ViewWithUiHandlers; import nz.co.doltech.gwtjui.interactions.client.ui.Selectable; import org.gwtbootstrap3.client.ui.html.OrderedList; import javax.inject.Inject; public class SelectableView extends ViewWithUiHandlers<SelectableUiHandlers> implements SelectablePresenter.MyView { interface Binder extends UiBinder<Widget, SelectableView> { } @UiField OrderedList list; @UiField FocusPanel focus; private Selectable selectable; @Inject SelectableView(Binder uiBinder) { initWidget(uiBinder.createAndBindUi(this)); selectable = new Selectable(list); } @Override protected void onAttach() { super.onAttach(); Scheduler.get().scheduleDeferred(new Command() { @Override public void execute() { focus.setFocus(true); focus.setFocus(false); } }); } }
{'content_hash': '0bc1b6f9eb0da8c0a3e8fd7d83c096c5', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 116, 'avg_line_length': 29.91111111111111, 'alnum_prop': 0.7184249628528975, 'repo_name': 'BenDol/gwt-jui-demo', 'id': '03841050047850066da53d8d784441569f8e416d', 'size': '1945', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/main/java/nz/co/doltech/gwtjui/demo/client/application/interactions/selectable/SelectableView.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '2462'}, {'name': 'HTML', 'bytes': '1602'}, {'name': 'Java', 'bytes': '68504'}, {'name': 'Shell', 'bytes': '1342'}]}
<div> I parametri consentono di richiedere agli utenti uno o più input che saranno forniti a una compilazione. Ad esempio, si potrebbe avere un progetto che esegue test su richiesta consentendo agli utenti di caricare un file ZIP contenente i binari da testare. Si potrebbe ottenere tale risultato aggiungendo qui un <i>Parametro file</i> . <br /> Oppure si potrebbe avere un progetto che rilascia del software e si desidera che gli utenti immettano delle note di rilascio che saranno caricate insieme al software. Si potrebbe ottenere tale risultato aggiungendo qui un <i>Parametro stringa multiriga</i> . <p> Ogni parametro ha un <i>Nome</i> e qualche tipo di <i>Valore</i> che dipende dal tipo del parametro. Queste coppie nome-valore saranno esportate come variabili d'ambiente all'avvio della compilazione, consentendo ai passaggi successivi della configurazione della compilazione (come le istruzioni di compilazione) di accedere a tali valori, ad esempio utilizzando la sintassi <code>${NOME_PARAMETRO}</code> (o <code>%NOME_PARAMETRO%</code> su Windows). <br /> Ciò implica anche che ogni parametro definito qui debba avere un <i>Nome</i> univoco. </p> <p> Quando un progetto è parametrizzato, il collegamento <i>Compila ora</i> usuale sarà sostituito da un collegamento <i>Compila con parametri</i> dove agli utenti verrà chiesto di specificare i valori per ognuno dei parametri definiti. Se questi scelgono di non immettere nulla, la compilazione verrà avviata con il valore predefinito per ogni parametro. </p> <p> Se una compilazione è avviata automaticamente, ad esempio se è avviata da un trigger del sistema di gestione del codice sorgente, saranno utilizzati i valori predefiniti per ogni parametro. </p> <p> Quando una compilazione parametrizzata è in coda, i tentativi di avvio di un'altra compilazione dello stesso progetto avranno successo solo se i valori dei parametri sono diversi, o se l'opzione <i>Esegui compilazioni concorrenti se necessario</i> è abilitata. </p> <p> Si veda la <a href="https://www.jenkins.io/redirect/parameterized-builds" rel="noopener noreferrer" target="_blank" > documentazione sulle compilazioni parametrizzate </a> per ulteriori informazioni su questa funzionalità. </p> </div>
{'content_hash': '749fbff80f64cb8457b3a335c0efba01', 'timestamp': '', 'source': 'github', 'line_count': 70, 'max_line_length': 80, 'avg_line_length': 35.02857142857143, 'alnum_prop': 0.7222675367047309, 'repo_name': 'damianszczepanik/jenkins', 'id': 'f738e6f2852b08ccac8beaa3e7c30d54ecf978f0', 'size': '2463', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'core/src/main/resources/hudson/model/ParametersDefinitionProperty/help_it.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ANTLR', 'bytes': '4633'}, {'name': 'Batchfile', 'bytes': '1023'}, {'name': 'C', 'bytes': '2091'}, {'name': 'CSS', 'bytes': '215757'}, {'name': 'Dockerfile', 'bytes': '163'}, {'name': 'Groovy', 'bytes': '75812'}, {'name': 'HTML', 'bytes': '938754'}, {'name': 'Handlebars', 'bytes': '15221'}, {'name': 'Java', 'bytes': '11624679'}, {'name': 'JavaScript', 'bytes': '392682'}, {'name': 'Less', 'bytes': '193265'}, {'name': 'Perl', 'bytes': '16145'}, {'name': 'Python', 'bytes': '4709'}, {'name': 'Ruby', 'bytes': '17290'}, {'name': 'Shell', 'bytes': '2354'}]}
{-# LANGUAGE GADTs #-} {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-| Low-level file storage engine -} module Hevents.Eff.Store.FileOps where import Control.Concurrent.Async import Control.Concurrent.STM import Control.Exception (Exception, IOException, bracket, catch) import Control.Monad (forever) import Control.Monad.Trans (liftIO) import qualified Data.Binary.Get as Bin import Data.ByteString (hGet, hPut) import Data.ByteString.Lazy (fromStrict) import Data.Either import Data.Functor (void) import Data.Monoid ((<>)) import Data.Serialize import Data.Typeable import Hevents.Eff.Store import Prelude hiding (length, read) import System.IO -- |Internal definition of the storage to use for operations data FileStorage = FileStorage { storeName :: String , storeVersion :: Version , storeHandle :: Maybe Handle -- ^Handle to the underlying OS stream for storing events , storeTid :: TMVar (Async ()) -- ^The store's thread id, if store is open and running , storeTQueue :: TBQueue QueuedOperation } -- | Options for opening storage data StorageOptions = StorageOptions { storageFilePath :: FilePath -- ^The file path to store data , storageVersion :: Version -- ^Events version. Note this version represents the point of view of the consumer -- of this storage which may contain events with different versions. The implementation -- of `Versionable` should be able to handle any version, up to `storageVersion` , storageQueueSize :: Int -- ^Upper bound on the number of store operations that can be queued. The exact value -- is dependent on the number of clients this storage is consumed by and the operations -- throughput. Requests for operations will block when queue is full. } defaultOptions :: StorageOptions defaultOptions = StorageOptions "store.data" (Version 1) 100 data QueuedOperation where QueuedOperation :: forall s . { operation :: StoreOperation IO s, opResult :: TMVar (StorageResult s) } -> QueuedOperation data StorageException = CannotDeserialize String deriving (Show, Typeable) instance Exception StorageException openFileStorage :: StorageOptions -> IO FileStorage openFileStorage StorageOptions{..} = do tidvar <- atomically newEmptyTMVar tq <- newTBQueueIO storageQueueSize h <- openFile storageFilePath ReadWriteMode hSetBuffering h NoBuffering let s@FileStorage{..} = FileStorage storageFilePath storageVersion (Just h) tidvar tq tid <- async (runStorage s) atomically $ putTMVar storeTid tid return s openHandleStorage :: Handle -> IO FileStorage openHandleStorage hdl = do tidvar <- atomically newEmptyTMVar tq <- newTBQueueIO 100 hSetBuffering hdl NoBuffering let s@FileStorage{..} = FileStorage "<handle>" (Version 1) (Just hdl) tidvar tq tid <- async (runStorage s) atomically $ putTMVar storeTid tid return s closeFileStorage :: FileStorage -> IO FileStorage closeFileStorage s@(FileStorage _ _ h ltid _) = do t <- liftIO $ atomically $ tryTakeTMVar ltid case t of Just tid -> liftIO $ cancel tid Nothing -> return () void $ hClose `traverse` h return s -- | Run some computation requiring a `FileStorage`, automatically opening and closing required -- file. withStorage :: StorageOptions -> (FileStorage -> IO a) -> IO a withStorage opts = bracket (openFileStorage opts) closeFileStorage runStorage :: FileStorage -> IO () runStorage FileStorage{..} = do forever $ do QueuedOperation op res <- atomically $ readTBQueue storeTQueue let ?currentVersion = storeVersion atomically . putTMVar res =<< runOp op storeHandle runOp :: (?currentVersion::Version) => StoreOperation IO s -> Maybe Handle -> IO (StorageResult s) runOp _ Nothing = return NoOp runOp (OpStore pre post) (Just h) = do p <- pre case p of Right ev -> do let s = doStore ev opres <- (hSeek h SeekFromEnd 0 >> hPut h s >> hFlush h >> return (WriteSucceed ev)) `catch` \ (ex :: IOException) -> return (OpFailed $ "exception " <> show ex <> " while storing event") WriteSucceed <$> (post $ Right opres) Left l -> WriteFailed <$> post (Left l) runOp OpLoad (Just h) = do pos <- hTell h hSeek h SeekFromEnd 0 sz <- hTell h hSeek h AbsoluteSeek 0 opres <- (LoadSucceed <$> readAll h sz) `catch` \ (ex :: IOException) -> return (OpFailed $ "exception " <> show ex <> " while loading events") hSeek h AbsoluteSeek pos return opres where readAll :: (?currentVersion :: Version, Versionable s) => Handle -> Integer -> IO [s] readAll hdl sz = if sz > 0 then do (loaded,ln) <- doLoad hdl case loaded of Right e -> do es <- readAll hdl (sz - ln) return $ e : es Left err -> fail err else return [] runOp OpReset (Just handle) = do w <- hIsWritable handle opres <- case w of False -> return $ OpFailed "File handle not writeable while resetting event store" True -> do emptyEvents `catch` \ (ex :: IOException) -> return (OpFailed $ "exception" <> (show ex) <> " while resetting event store") where emptyEvents = do (hSetFileSize handle 0) return ResetSucceed return opres -- |Read a single event from file store, returning also the number of bytes read -- -- This is not symetric to doStore as we need first to read the length of the message, then -- to read only the necessary amount of bytes from storage doLoad :: Versionable s => Handle -> IO (Either String s, Integer) doLoad h = do lw <- hGet h 4 let l = fromIntegral $ Bin.runGet Bin.getWord32be $ fromStrict lw bs <- hGet h l let msg = do v <- getWord8 _ <- getWord32be pay <- getByteString (l - 5) either fail return $ read (fromIntegral v) pay content = runGet msg bs return $ (content, fromIntegral $ l + 4) push :: StoreOperation IO s -> FileStorage -> IO (StorageResult s) push op FileStorage{..} = do v <- atomically $ do tmv <- newEmptyTMVar writeTBQueue storeTQueue (QueuedOperation op tmv) return tmv atomically $ takeTMVar v writeStore :: (Versionable e) => FileStorage -> IO (Either a e) -> (Either a (StorageResult e) -> IO r) -> IO (StorageResult r) writeStore s pre post = push (OpStore pre post) s readStore :: (Versionable s) => FileStorage -> IO (StorageResult s) readStore = push OpLoad resetStore :: FileStorage -> IO (StorageResult ()) resetStore = push OpReset instance Store IO FileStorage where close = closeFileStorage store = writeStore load = readStore reset = resetStore
{'content_hash': '3cf2667ec75bc3e2633189cfd8358724', 'timestamp': '', 'source': 'github', 'line_count': 194, 'max_line_length': 131, 'avg_line_length': 40.53092783505155, 'alnum_prop': 0.5906142693628386, 'repo_name': 'abailly/hevents', 'id': 'c5d2c04e26ee988a97ce21361e8a6d9308627593', 'size': '7863', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Hevents/Eff/Store/FileOps.hs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Haskell', 'bytes': '63862'}]}
ACCEPTED #### According to International Plant Names Index #### Published in null #### Original name null ### Remarks null
{'content_hash': '454c8928366a8c3cb959cff93d58d0d7', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 31, 'avg_line_length': 9.692307692307692, 'alnum_prop': 0.7063492063492064, 'repo_name': 'mdoering/backbone', 'id': 'c269b288701ac087aff2a42d2da6202c0d06493a', 'size': '178', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Caryophyllaceae/Silene/Silene kungessana/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
import os import sys import subprocess def ReadKddsToBeCalculated(fname): """ self explanatory """ listKdds=[] with open(fname,'r') as f: for line in f: listKdds.append(line.rstrip('\n')) return listKdds gcr = "us.gcr.io" project = "direct-disk-101619" docker = "egs-rc-4039" Kdds = ReadKddsToBeCalculated(sys.argv[1]) docker2run = os.path.join(gcr, project, docker) # full path to docker for kdd in Kdds: cmd = "docker run {0} python main.py {1}".format(docker2run, kdd) #print(cmd) rc = subprocess.call(cmd, shell=True) #print(rc)
{'content_hash': 'b2652ab7dc9508985a77a6633fe20a50', 'timestamp': '', 'source': 'github', 'line_count': 30, 'max_line_length': 69, 'avg_line_length': 20.3, 'alnum_prop': 0.6338259441707718, 'repo_name': 'Iwan-Zotow/runEGS', 'id': '7f3bc8523aa7d240a3651756be534e9575f4fa09', 'size': '628', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'run_local.py', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'Jupyter Notebook', 'bytes': '12348489'}, {'name': 'Python', 'bytes': '205708'}]}
module Features module AuthenticationHelpers unless ActionController::Base.new.respond_to?(:authenticate_participant!) ActionController::Base.class_eval do define_method(:authenticate_participant!) { true } end end end end
{'content_hash': 'ac5c7f2af57b176a12fc5a5e8cbe16f5', 'timestamp': '', 'source': 'github', 'line_count': 9, 'max_line_length': 77, 'avg_line_length': 28.333333333333332, 'alnum_prop': 0.7215686274509804, 'repo_name': 'cbitstech/social_networking', 'id': 'dcce54b98f116267846b95ad566013a4f47d9d3c', 'size': '285', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'spec/support/feature_helpers.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '2598'}, {'name': 'HTML', 'bytes': '41438'}, {'name': 'JavaScript', 'bytes': '261548'}, {'name': 'Ruby', 'bytes': '179142'}]}
module Status class Plugin # Plugin for Rubygems class Rubygems < self # Return url # # @return [String] # # @api private # def url "https://rubygems.org/gems/#{project_short_name}" end memoize :url # Return image source # # @return [String] # # @api private # def image_src "https://badge.fury.io/rb/#{project_short_name}.png" end memoize :image_src end end end
{'content_hash': '6be245db1b55add428a105e925b23ddd', 'timestamp': '', 'source': 'github', 'line_count': 28, 'max_line_length': 60, 'avg_line_length': 18.0, 'alnum_prop': 0.5099206349206349, 'repo_name': 'zaidan/rom-status', 'id': '955de0f07464467ab906a36877869f511f389571', 'size': '504', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'lib/status/plugin/rubygems.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CoffeeScript', 'bytes': '454'}, {'name': 'Ruby', 'bytes': '35123'}]}
package java8; import com.sandwich.koan.Koan; import java.util.Base64; import java.io.UnsupportedEncodingException; import static com.sandwich.koan.constant.KoanConstants.__; import static com.sandwich.util.Assert.assertEquals; public class AboutBase64 { private final String plainText = "lorem ipsum"; private final String encodedText = "bG9yZW0gaXBzdW0="; @Koan public void base64Encoding() { try { // Encode the plainText // This uses the basic Base64 encoding scheme but there are corresponding // getMimeEncoder and getUrlEncoder methods available if you require a // different format/Base64 Alphabet assertEquals(encodedText, Base64.getEncoder().encodeToString(__.getBytes("utf-8"))); } catch (UnsupportedEncodingException ex) {} } @Koan public void base64Decoding() { // Decode the Base64 encodedText // This uses the basic Base64 decoding scheme but there are corresponding // getMimeDecoder and getUrlDecoder methods available if you require a // different format/Base64 Alphabet byte[] decodedBytes = Base64.getDecoder().decode(__); try { String decodedText = new String(decodedBytes, "utf-8"); assertEquals(plainText, decodedText); } catch (UnsupportedEncodingException ex) {} } }
{'content_hash': 'd3d275755f4ea8e1a70e2cd58f75497e', 'timestamp': '', 'source': 'github', 'line_count': 40, 'max_line_length': 96, 'avg_line_length': 34.725, 'alnum_prop': 0.6781857451403888, 'repo_name': 'DavidWhitlock/java-koans', 'id': 'ed1235e89d727bf38b8e9dd949b89be65f349468', 'size': '1389', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'koans/src/java8/AboutBase64.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Dockerfile', 'bytes': '1055'}, {'name': 'Java', 'bytes': '288280'}, {'name': 'Ruby', 'bytes': '751'}]}
namespace System.Drawing.API { public interface IApiTiming { float DeltaTime { get; } } }
{'content_hash': '91d4dff71faa5ec2c87c920185edf7ae', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 32, 'avg_line_length': 15.857142857142858, 'alnum_prop': 0.6036036036036037, 'repo_name': 'Meragon/Unity-WinForms', 'id': 'da15ce9d0a24a9f8df4638cd14c424768a40381c', 'size': '113', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Core/API/IApiTiming.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '1082017'}, {'name': 'ShaderLab', 'bytes': '2030'}]}
class CefCallbackCToCpp : public CefCToCppRefCounted<CefCallbackCToCpp, CefCallback, cef_callback_t> { public: CefCallbackCToCpp(); // CefCallback methods. void Continue() OVERRIDE; void Cancel() OVERRIDE; }; #endif // CEF_LIBCEF_DLL_CTOCPP_CALLBACK_CTOCPP_H_
{'content_hash': '42fa596748e6040fa083ef8bb9b12bc8', 'timestamp': '', 'source': 'github', 'line_count': 12, 'max_line_length': 64, 'avg_line_length': 23.666666666666668, 'alnum_prop': 0.7183098591549296, 'repo_name': 'arkenthera/cef3d', 'id': '892d6e7ab624a835410c22c2b17948cef555c2c5', 'size': '1247', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Cef/libcef_dll/ctocpp/callback_ctocpp.h', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C', 'bytes': '1028782'}, {'name': 'C++', 'bytes': '2887899'}, {'name': 'CMake', 'bytes': '118535'}, {'name': 'HLSL', 'bytes': '821'}, {'name': 'Python', 'bytes': '82527'}]}
package org.gradle.api.internal.tasks.testing.results; import org.gradle.api.internal.tasks.testing.TestCompleteEvent; import org.gradle.api.internal.tasks.testing.TestDescriptorInternal; import org.gradle.api.internal.tasks.testing.TestResultProcessor; import org.gradle.api.internal.tasks.testing.TestStartEvent; import org.gradle.api.tasks.testing.TestFailure; import org.gradle.api.tasks.testing.TestOutputEvent; public class AttachParentTestResultProcessor implements TestResultProcessor { private Object rootId; private final TestResultProcessor processor; public AttachParentTestResultProcessor(TestResultProcessor processor) { this.processor = processor; } @Override public void started(TestDescriptorInternal test, TestStartEvent event) { if (rootId == null) { assert test.isComposite(); rootId = test.getId(); } else if (event.getParentId() == null) { event = event.withParentId(rootId); } processor.started(test, event); } @Override public void failure(Object testId, TestFailure result) { processor.failure(testId, result); } @Override public void output(Object testId, TestOutputEvent event) { processor.output(testId, event); } @Override public void completed(Object testId, TestCompleteEvent event) { if (testId.equals(rootId)) { rootId = null; } processor.completed(testId, event); } }
{'content_hash': 'b0efecf7bbafa41abe21164804d9d76a', 'timestamp': '', 'source': 'github', 'line_count': 48, 'max_line_length': 77, 'avg_line_length': 31.3125, 'alnum_prop': 0.7012641383898869, 'repo_name': 'gradle/gradle', 'id': 'd58225d4ece0ee44db8d19478afc7298230c2ac9', 'size': '2118', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'subprojects/testing-base/src/main/java/org/gradle/api/internal/tasks/testing/results/AttachParentTestResultProcessor.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Assembly', 'bytes': '277'}, {'name': 'Brainfuck', 'bytes': '54'}, {'name': 'C', 'bytes': '123600'}, {'name': 'C++', 'bytes': '1781062'}, {'name': 'CSS', 'bytes': '151435'}, {'name': 'GAP', 'bytes': '424'}, {'name': 'Gherkin', 'bytes': '191'}, {'name': 'Groovy', 'bytes': '30897043'}, {'name': 'HTML', 'bytes': '54458'}, {'name': 'Java', 'bytes': '28750090'}, {'name': 'JavaScript', 'bytes': '78583'}, {'name': 'Kotlin', 'bytes': '4154213'}, {'name': 'Objective-C', 'bytes': '652'}, {'name': 'Objective-C++', 'bytes': '441'}, {'name': 'Python', 'bytes': '57'}, {'name': 'Ruby', 'bytes': '16'}, {'name': 'Scala', 'bytes': '10840'}, {'name': 'Shell', 'bytes': '12148'}, {'name': 'Swift', 'bytes': '2040'}, {'name': 'XSLT', 'bytes': '42693'}]}
<?xml version="1.0" ?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"> <parameters> <parameter key="simplethings.entityaudit.audited_entities" type="collection" /> <parameter key="simplethings.entityaudit.global_ignore_columns" type="collection" /> <parameter key="simplethings.entityaudit.table_prefix" type="string" /> <parameter key="simplethings.entityaudit.table_suffix" type="string" /> <parameter key="simplethings.entityaudit.revision_field_name" type="string" /> <parameter key="simplethings.entityaudit.revision_type_field_name" type="string" /> <parameter key="simplethings.entityaudit.revision_table_name" type="string" /> <parameter key="simplethings.entityaudit.revision_id_field_type" type="string" /> </parameters> <services> <service id="simplethings_entityaudit.manager" class="SimpleThings\EntityAudit\AuditManager"> <argument id="simplethings_entityaudit.config" type="service" /> </service> <service id="simplethings_entityaudit.reader" class="SimpleThings\EntityAudit\AuditReader" factory-service="simplethings_entityaudit.manager" factory-method="createAuditReader"> <argument type="service" id="doctrine.orm.default_entity_manager" /> </service> <service id="simplethings_entityaudit.log_revisions_listener" class="SimpleThings\EntityAudit\EventListener\LogRevisionsListener"> <argument id="simplethings_entityaudit.manager" type="service" /> <tag name="doctrine.event_subscriber" connection="default" /> </service> <service id="simplethings_entityaudit.create_schema_listener" class="SimpleThings\EntityAudit\EventListener\CreateSchemaListener"> <argument id="simplethings_entityaudit.manager" type="service" /> <tag name="doctrine.event_subscriber" connection="default" /> </service> <service id="simplethings_entityaudit.config" class="SimpleThings\EntityAudit\AuditConfiguration"> <call method="setAuditedEntityClasses"> <argument>%simplethings.entityaudit.audited_entities%</argument> </call> <call method="setGlobalIgnoreColumns"> <argument>%simplethings.entityaudit.global_ignore_columns%</argument> </call> <call method="setTablePrefix"> <argument>%simplethings.entityaudit.table_prefix%</argument> </call> <call method="setTableSuffix"> <argument>%simplethings.entityaudit.table_suffix%</argument> </call> <call method="setRevisionFieldName"> <argument>%simplethings.entityaudit.revision_field_name%</argument> </call> <call method="setRevisionTypeFieldName"> <argument>%simplethings.entityaudit.revision_type_field_name%</argument> </call> <call method="setRevisionTableName"> <argument>%simplethings.entityaudit.revision_table_name%</argument> </call> <call method="setRevisionIdFieldType"> <argument>%simplethings.entityaudit.revision_id_field_type%</argument> </call> </service> </services> </container>
{'content_hash': '0ffc8483ff062ac6c31e4218921a088b', 'timestamp': '', 'source': 'github', 'line_count': 65, 'max_line_length': 185, 'avg_line_length': 53.69230769230769, 'alnum_prop': 0.6644699140401146, 'repo_name': 'kinkinweb/lhvb', 'id': '598d325a3987f0d5a5a35d62f7242fdaf65c22b6', 'size': '3490', 'binary': False, 'copies': '8', 'ref': 'refs/heads/master', 'path': 'vendor/simplethings/entity-audit-bundle/src/SimpleThings/EntityAudit/Resources/config/auditable.xml', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ApacheConf', 'bytes': '163'}, {'name': 'Batchfile', 'bytes': '376'}, {'name': 'CSS', 'bytes': '370932'}, {'name': 'Cucumber', 'bytes': '184496'}, {'name': 'HTML', 'bytes': '100628'}, {'name': 'JavaScript', 'bytes': '93972'}, {'name': 'Makefile', 'bytes': '1847'}, {'name': 'PHP', 'bytes': '544345'}, {'name': 'Ruby', 'bytes': '1112'}, {'name': 'Shell', 'bytes': '9898'}, {'name': 'Smarty', 'bytes': '721'}]}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.11"/> <title>V8 API Reference Guide for node.js v6.10.2: Member List</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/searchdata.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { init_search(); }); </script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td id="projectalign" style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for node.js v6.10.2 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.11 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class&#160;List</span></a></li> <li><a href="classes.html"><span>Class&#160;Index</span></a></li> <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li> <li><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> </div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="namespacev8.html">v8</a></li><li class="navelem"><a class="el" href="classv8_1_1Exception.html">Exception</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">v8::Exception Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="classv8_1_1Exception.html">v8::Exception</a>, including all inherited members.</p> <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1Exception.html#a8d575a721cf0fd5b325afb8b586c0d1e">CreateMessage</a>(Isolate *isolate, Local&lt; Value &gt; exception)</td><td class="entry"><a class="el" href="classv8_1_1Exception.html">v8::Exception</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Error</b>(Local&lt; String &gt; message) (defined in <a class="el" href="classv8_1_1Exception.html">v8::Exception</a>)</td><td class="entry"><a class="el" href="classv8_1_1Exception.html">v8::Exception</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1Exception.html#a81d1fd3c8d729e9a8d830bc2830bfe77">GetStackTrace</a>(Local&lt; Value &gt; exception)</td><td class="entry"><a class="el" href="classv8_1_1Exception.html">v8::Exception</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>RangeError</b>(Local&lt; String &gt; message) (defined in <a class="el" href="classv8_1_1Exception.html">v8::Exception</a>)</td><td class="entry"><a class="el" href="classv8_1_1Exception.html">v8::Exception</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ReferenceError</b>(Local&lt; String &gt; message) (defined in <a class="el" href="classv8_1_1Exception.html">v8::Exception</a>)</td><td class="entry"><a class="el" href="classv8_1_1Exception.html">v8::Exception</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>SyntaxError</b>(Local&lt; String &gt; message) (defined in <a class="el" href="classv8_1_1Exception.html">v8::Exception</a>)</td><td class="entry"><a class="el" href="classv8_1_1Exception.html">v8::Exception</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>TypeError</b>(Local&lt; String &gt; message) (defined in <a class="el" href="classv8_1_1Exception.html">v8::Exception</a>)</td><td class="entry"><a class="el" href="classv8_1_1Exception.html">v8::Exception</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>V8_DEPRECATED</b>(&quot;Use version with an Isolate*&quot;, static Local&lt; Message &gt; CreateMessage(Local&lt; Value &gt; exception)) (defined in <a class="el" href="classv8_1_1Exception.html">v8::Exception</a>)</td><td class="entry"><a class="el" href="classv8_1_1Exception.html">v8::Exception</a></td><td class="entry"></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.11 </small></address> </body> </html>
{'content_hash': '72c2aa55f8e7f71c0f1c7d00dae8be0f', 'timestamp': '', 'source': 'github', 'line_count': 114, 'max_line_length': 379, 'avg_line_length': 61.98245614035088, 'alnum_prop': 0.661052929521653, 'repo_name': 'v8-dox/v8-dox.github.io', 'id': '7ce4edb063f4e8a0eb6fbace8b3f9ddd673225ab', 'size': '7066', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': '1ff512c/html/classv8_1_1Exception-members.html', 'mode': '33188', 'license': 'mit', 'language': []}
<HTML><HEAD> <TITLE>Review for Vertigo (1958)</TITLE> <LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css"> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1 ALIGN="CENTER" CLASS="title"><A HREF="/Title?0052357">Vertigo (1958)</A></H1><H3 ALIGN=CENTER>reviewed by<BR><A HREF="/ReviewsBy?Ian+Low">Ian Low</A></H3><HR WIDTH="40%" SIZE="4"> <PRE>VERTIGO Fragments Of An Obsession</PRE> <P>In the pantheon of film making, there are undoubtable classics that stand out as monumental artifacts of this art form. Some of these remain the standards where new films are measured against and even imitated upon. Citizen Kane, Casablanca and Lawrence of Arabia are such examples of a great tradition of movie making that have been widely praised, liked and even analyzed upon in countless books and articles. Yet, legendary as these films are, there is one motion picture that has reached the heights of such similar classic status, but still remains as one of the least conspicuous among its more illustrious peers. I am referring to Alfred Hitchcock's Vertigo.</P> <P>Released to muted reviews and disappointing box office receipts, Vertigo has since gained much respect and admiration from all aspects of the film community. Ranging from film historians to the casual fan, Vertigo has now deservedly taken its place among Hitchcock's other classic films as one of the most intriguing of all thriller movies. And certainly, one of the most personal films ever to have emerged from arguably, the best director in this business. Beginning with this movie, Hitchcock managed to create a trilogy of films in successive years that is perhaps, the most remarkable ever attempted by any director. North By Northwest, Psycho and Vertigo feature frequently among critics' best of lists and represents the culmination of Hitchcock's prowess, as well as showcasing his brilliant skills as a film-maker and his extensive knowledge of the language of the cinema.</P> <P>Part of the mystique of the movie stems from the fact that it is misleading the viewer right from the beginning, the plot seemingly about how James Stewart's character, Scottie Ferguson tries to prevent "Madeline", played by Kim Novak, from succumbing to a supernatural force that threatens to possess and ultimately, overwhelms her. This deception is carried on brilliantly by both the performances and the usually taut direction that Hitchcock imposes on the entire picture. It is not until the middle third of the movie, that Hitchcock surprisingly reveals the mystery in a fashion that completely catches the viewer off guard. From there on, the film shifts to a more personal tone of undesirable and questionable obsession on Scottie's part to transform Judy back into his dream woman that was "Madeline". Yet, the "Madeline" that he seeks never existed at all. It is this irony that provides this film with its unique, almost surrealistic tone and among Hitchcock's works, this is the film that is at once darkly depressing as it is revealingly autobiographical.</P> <P>Jimmy Stewart has always been known to play the charming and effervescent American ordinary everyday guy, a role that is similarly typified by Tom Hanks today. His winsome smile garnered him with his only Academy award in The Philadelphia Story and his even more famous turn as George Bailey in Capra's It's A Wonderful Life cemented Stewart as the quintessential American hero. A face and a style that any American and even non-American can identify with. But since he began to work with Hitchcock, Jimmy Stewart began a series of roles that played him against type and character.</P> <P>In Rear Window, Stewart's L.B. Jefferies's character begins the film as a restless voyeuristic photographer. But by the end of the movie, one tends to forget this questionable aspect of his character as he manages to solve a murder mystery in the process. In Vertigo, however, Stewart plays a character that displays even more flaws then the Jefferies character could ever have. At the beginning, he faces seemingly increasing difficulty in overcoming his fear of heights that was triggered off by his guilt towards causing the death of a fellow police officer. Hitchcock then pulls off an incredible delusion to the audience by deliberately misleading us into thinking that Scottie Ferguson will conquer his fear by falling in love and by resolving the mystery that surrounds "Madeline".</P> <P>For all his reputation for suspense and thriller films, Hitchcock's ultimate masterpiece does not focus on those two aspects as he does on the personal aspects of his two main characters in the picture. We are allowed a glimpse into the director's mindset and dare I say it, his emotions as he molded Scottie and "Madeline" into human beings that seem at once, frightfully true to life and yet, almost dreamlike in pure visual terms. As the audience, we can certainly identify with Scottie's pursuit of his perfect woman as at one time or another, each one of us had probably wanted to find that same person who can fulfill our ultimate fantasies. The difference is, Scottie manages to come close.</P> <P>Only close, because his fantasy woman is after all, a masquerade fabricated by his longtime friend Gavin Elster to deliberately lead Scottie into his murderous scheme as an unknowing accomplice and also, as a convenient scapegoat and alibi. Judy, the woman who plays the role of "Madeline" is nothing like the "Madeline" that Scottie envisions. The real Judy is a more earthly woman that seems at once materialistic and bubbly, which contrasts strikingly with the icy cold blonde that is "Madeline", who simply emanates with stylish sophistication. But Scottie is never let into this revelation as early as the audience, so from the moment the truth is made known to the viewer, we are made to observe and follow his emotional trauma in losing "Madeline" and then the joy of rediscovering her in the form of Judy.</P> <P>The beauty of the picture lies not in watching it for the first time, but from subsequent viewings, when the audience has the intimate knowledge of what has happened. The first half of the movie then takes on multiple layers of meanings and and it becomes a responsibility for the viewer to understand how difficult it is for Kim Novak to play Judy who herself is playing "Madeline". Her movements and gestures are even more impressive with the realization that she herself is putting up an act of deception and deceit. Yet, from the moment Scottie fishes her out of the waters of the Golden Gate bridge, the audience can almost identify with the extreme restraint that is evident in Judy's eyes and that keeps her from revealing herself to Scottie.</P> <P>Later in Scottie's apartment, we are already well aware of the ruse that Judy is putting up for him. It is convincing to the point that the first time viewer is totally taken in by the deception. You could believe that she was suffering from amnesia, seemingly possessed by a "supernatural spirit" that guides her through the various locations of San Francisco. But seeing it the second time, notice how Novak manages to "act" surprised and shocked in waking up naked in Scottie's room. But for all intents and purposes, she "lets" him bring her there and even "lets" him undresses her in a deliberate attempt to delude him. Throughout the whole charade, Scottie is completely oblivious to the fact that she "knows". It is this idea of irony and deceptive role-play that gives this film an unusual aural of mystery and surrealistic romantiscm.</P> <P>This is a romance that is unlikely, yet when it does finally occur, at the cliffs where Judy almost overacts her part, we are already under the impression that Scottie is in love with her. Simultaneously, we are equally convinced that Judy, masquerading as "Madeline" is also falling for him. The Hitchcockian touch at resolving this romance is sheer genius as it breaks new ground in the way it treat film lovers on screen. Electing not to provide an avenue for the doomed lovers to escape from, he decides to end the picture almost abruptly at the infamous bell tower scene. It is the same exact spot where earlier on, Scottie first witnesses the "suicidal" fall of Elster's real wife. The same exact scene where Scottie relives his guilt at being unable to prevent a certain death due to his vertigo.</P> <P>A guilt which is unfairly burdened upon him the second time round as he is only playing a pawn in the midst of a greater murderous scheme. A scheme that involves Judy as "Madeline", a common girl hired by Elster because her looks probably resemble that of Elster's wife. A guilt which would be further complicated by the realization that Judy would herself find herself falling hopelessly for him. At the end of the picture, Hitchcock has to submit Scottie to one last trauma at the bell tower. Right at the moment when Scottie is faced with the most difficult decision of his life, of whether or not to bring Judy to justice or simply carry on the deception and let the past slip by. The appearance of the nun at the top of the bell tower is an inspired decision, a decision apparently made by Samuel Taylor, the main scriptwriter for the film.</P> <P>A nun represents God, and if the ending is abrupt, the resolvement of Judy's involvement in the murder of the actual "Madeline" is to symbolize the cliched notion that criminals may escape the hands of the law, but not from the hand of God. Her apparent accidental fall may be even more symbolic in the sense that she is re-enacting what she was asked to do by Elster, to pretend to fall to her death to mask the death and murder of his actual wife. The terrific irony here again is she is not acting, but really "doing" it this time. Falling to her own death, which is as real as Elster's wife death was. With that, the film concludes with the everlasting image of Stewart's Scottie standing at the bell tower, looking down on the lifeless body of his de-mystified obsession, a woman who never existed for him. A woman who was manufactured for the purpose of a diabolical crime, and a woman was in turn, re-manufactured by the very same man she was supposed to deceive.</P> <P>The re-fashioning of Judy into "Madeline" is itself, worthy of much discussion. The main focal point becomes that of Judy being willing to subject herself to a second of time of role-playing. But whereas the first was due to financial and material benefits, possibly from Elster himself, the second was unquestionably due to the purpose of pleasing Scottie. For by the time she was "rediscovered", the audience can sense her love for him. This is most clearly demonstrated in her reluctance to leave him a goodbye note explaining the whole crime, and willing to play a second round of charade with Scottie. And even after voicing her objections to being remodeled, she eventually subjects herself to Scottie's almost unhealthy desire to see and possess "Madeline" back in the form of another woman who "happens" to look like her. This possession obsession at one time becomes almost surreal. Look at the scene when she finally emerges from the bathroom as the completed "product".</P> <P>Roger Ebert calls this the single best shot or sequence that Hitchcock has ever done, and I am very inclined to agree. The ghostlike green glow serves as a haunting, almost hallucinating background to Novak's "Madeline" as she proceeds with almost torturous pace towards Scottie. Their eyes locked in almost twin emotions of elation and pain. Elation because both have ultimately satisfied each other's desires. She, because she believes he will finally accept her, and he, because the woman he thought he had "lost" so dramatically and tragically has finally returned. In a scene where there is no background or ambient noise, just images and Bernard Herrmann's stirring and hauntingly romantic score, it is the ultimate piece of pure cinema anyone has since or will ever conjure up. The moment the two tragic lovers lock and embrace, the camera circles around the both of them, and as it does so, images of San Juan Batista emerge from behind them, as if to indicate that the past has caught up with the present, and later will engulf them to a powerfully emotional and tragic end. Yet, Scottie clings on to her as if he never has lost her, and he is at once willing to believe that she is the same "Madeline" that he has fallen for during the first part of the film. He hesitates only for a brief moment, but once he is convinced that she is "genuine", he embraces her with the utmost of passion that has yet been captured on celluloid.</P> <P>Perhaps, the optimist would have hoped the film should have ended there. But then, there is always the moral issue of not letting characters getting away with blatant crime, especially when it involves murder. For us, for Hitchcock, the resolution of this film represents one of the best climatic endings to a motion picture. Dark, emotional, tense and frightful, these are the emotions that one goes through together with the two leads as they ascend the steps of the bell tower. Of course, the innovative "Vertigo" shot heightens the tension and gives us a visual simulation of what Scottie is feeling as he looks down towards the depths of the stairs. As Scottie unravels the truth, a truth where Novak's character and the audience are already well aware of, we see his expression of anger and of passion at the same time. Emotions which would have been overplayed by any other actor, Jimmy Stewart manages to convince us equally of his confusion, his guilt, his hurt and his ultimate love for a fabled "woman" from which there is no turning back from. As he reaches the top, he is ultimately faced with his own strong belief of upholding the law, and his equally passionate feelings for a woman who has deceived him and yet, now offer the only real hope of redemption and his only compromised opportunity for a perfect love. And as he contemplates his decision for either justice or love, he is cruelly robbed of that decision as Judy accidentally plunges towards her own demise, a justice meted out by perhaps, in equally "supernatural" manner.</P> <P>As a motion picture, Vertigo possesses all the necessary technical credentials for a 1958 film. George Tomasini's taut editing, Robert Burks's elegant cinematography, Saul Bass's innovative and hypnotic title designs and of course, Herrmann's score. The importance of how music affects a film has never been understated. Yet somehow, Herrmann's musical soundtrack manages to bring images that Burk's camera could not even capture. The haunting title theme elicits both terror and romance simultaneously, and it is this musical picture that gives the audience a glance into the movie's contents right at the beginning of the credits. Coupled this with the eerie logos supplied creatively by Bass and extreme close-ups of the woman's lips and eye, Vertigo manages to evoke the entire atmosphere of the film in the first few minutes. Herrmann's score is never catchy or tuneful, just long stretches of mesmerizing moods and ambience that complements both story and performances to perfection. At times overbearing, at times tender, this is music that lives up to the high expectations of the director and his actors. Pure cinema such as this could not have been created without the musical strains of Bernard Herrmann and the striking photography of Burk and Hitchcock.</P> <P>Artistically, films like Citizen Kane and A Birth Of A Nation may have displayed much more cinematic invention in terms of camera techniques and other technical innovations. Vertigo however, propels the film medium further by taking the established cinematic approaches and transcends them by exploring the human emotion on celluloid. To accomplish this requires a director of immense knowledge and skill, and a touch of brilliance. Further, a set of actors who are able to translate the written script into film and then expand on it by giving their own unique touch of humanity and expression. Alfred Hitchcock, James Stewart and Kim Novak together with Samuel Taylor and the crew of Vertigo created a cinematic milestone in 1958 and like the aforementioned film classics, it ranks as a motion picture masterpiece worthy of the highest accolades. In generations to come, Vertigo will only serve as a reminder to the art of the motion picture . or in Hitchcock's preference, the art of pure cinema.</P> <PRE>Ian Low 9th September 1999</PRE> <HR><P CLASS=flush><SMALL>The review above was posted to the <A HREF="news:rec.arts.movies.reviews">rec.arts.movies.reviews</A> newsgroup (<A HREF="news:de.rec.film.kritiken">de.rec.film.kritiken</A> for German reviews).<BR> The Internet Movie Database accepts no responsibility for the contents of the review and has no editorial control. Unless stated otherwise, the copyright belongs to the author.<BR> Please direct comments/criticisms of the review to relevant newsgroups.<BR> Broken URLs inthe reviews are the responsibility of the author.<BR> The formatting of the review is likely to differ from the original due to ASCII to HTML conversion. </SMALL></P> <P ALIGN=CENTER>Related links: <A HREF="/Reviews/">index of all rec.arts.movies.reviews reviews</A></P> </P></BODY></HTML>
{'content_hash': 'ddd14c15060e04afeb89437786a89612', 'timestamp': '', 'source': 'github', 'line_count': 248, 'max_line_length': 183, 'avg_line_length': 70.70564516129032, 'alnum_prop': 0.7886512688907898, 'repo_name': 'xianjunzhengbackup/code', 'id': '772be949543761d3b78600de0a05c0aa240ab764', 'size': '17535', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'data science/machine_learning_for_the_web/chapter_4/movie/20449.html', 'mode': '33261', 'license': 'mit', 'language': [{'name': 'BitBake', 'bytes': '113'}, {'name': 'BlitzBasic', 'bytes': '256'}, {'name': 'CSS', 'bytes': '49827'}, {'name': 'HTML', 'bytes': '157006325'}, {'name': 'JavaScript', 'bytes': '14029'}, {'name': 'Jupyter Notebook', 'bytes': '4875399'}, {'name': 'Mako', 'bytes': '2060'}, {'name': 'Perl', 'bytes': '716'}, {'name': 'Python', 'bytes': '874414'}, {'name': 'R', 'bytes': '454'}, {'name': 'Shell', 'bytes': '3984'}]}
import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [] #extensions = ['sphinxcontrib.youtube'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = 'BIOF509' copyright = '2016, Jonathan Street' author = 'Jonathan Street' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '1.0' # The full version, including alpha/beta/rc tags. release = '1.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # "<project> v<release> documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr' #html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # Now only 'ja' uses this config value #html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration directory) that # implements a search results scorer. If empty, the default will be used. #html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. htmlhelp_basename = 'BIOF509doc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', # Latex figure (float) alignment #'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'BIOF509.tex', 'BIOF509 Documentation', 'Jonathan Street', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'biof509', 'BIOF509 Documentation', [author], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'BIOF509', 'BIOF509 Documentation', author, 'BIOF509', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False
{'content_hash': '99b4608177ebb59a505cceefb3261d0f', 'timestamp': '', 'source': 'github', 'line_count': 270, 'max_line_length': 79, 'avg_line_length': 32.53703703703704, 'alnum_prop': 0.7044963005122368, 'repo_name': 'streety/biof509', 'id': '035fd3c4a20ba52f00ba085655bce7183bffbf1f', 'size': '9228', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'docs/conf.py', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Jupyter Notebook', 'bytes': '44062'}]}
<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <title>StaticWeb - Admin</title> <meta name="viewport" content="width=device-width" /> <meta name="generator" content="StaticWeb" /> <link rel="apple-touch-icon" sizes="180x180" href="favicons/apple-touch-icon.png"> <link rel="icon" type="image/png" href="favicons/favicon-32x32_neg.png" sizes="32x32"> <link rel="icon" type="image/png" href="favicons/favicon-16x16_neg.png" sizes="16x16"> <link rel="manifest" href="favicons/manifest.json"> <link rel="mask-icon" href="favicons/safari-pinned-tab.svg" color="#3A5C78"> <link rel="shortcut icon" href="favicons/favicon_neg.ico"> <meta name="msapplication-config" content="favicons/browserconfig.xml"> <meta name="theme-color" content="#3A5C78"> </head> <body> <p> <a id="staticweb-login-link" href="https://brfskagagard-inloggning.azurewebsites.net?state=stateKeyToVerifyToken&appName=admin-dev">Login</a> </p> <script async="async" src="js/swchecker.js"></script> </body> </html>
{'content_hash': 'ac83f918cd75abfd284a6566b40cc06f', 'timestamp': '', 'source': 'github', 'line_count': 26, 'max_line_length': 149, 'avg_line_length': 42.34615384615385, 'alnum_prop': 0.6802906448683016, 'repo_name': 'StefanWallin/core', 'id': '9a82a71660a135465ca88eb02f96f4a2bebf16c6', 'size': '1101', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'admin/index.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '7575'}, {'name': 'HTML', 'bytes': '5078'}, {'name': 'JavaScript', 'bytes': '63433'}]}
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>io.quarkus</groupId> <artifactId>quarkus-bootstrap-parent</artifactId> <version>999-SNAPSHOT</version> </parent> <artifactId>quarkus-bootstrap-bom-test</artifactId> <name>Quarkus - Bootstrap - Test BOM</name> <description>This BOM contains only test scoped dependencies for the bootstrap project's testsuite</description> <packaging>pom</packaging> <dependencyManagement> <dependencies> <dependency> <groupId>io.quarkus</groupId> <artifactId>quarkus-bootstrap-core</artifactId> <version>${project.version}</version> <type>test-jar</type> <scope>test</scope> </dependency> <dependency> <groupId>org.assertj</groupId> <artifactId>assertj-core</artifactId> <version>${assertj.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter</artifactId> <version>${junit.jupiter.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap</groupId> <artifactId>shrinkwrap-depchain</artifactId> <type>pom</type> <scope>test</scope> <version>${shrinkwrap-depchain.version}</version> </dependency> <dependency> <groupId>org.apache.maven.plugin-testing</groupId> <artifactId>maven-plugin-testing-harness</artifactId> <version>3.3.0</version> <scope>test</scope> <exclusions> <!-- let's prefer the plexus-utils pulled by maven-resolver-provider --> <exclusion> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> </exclusion> <exclusion> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> </exclusion> </exclusions> </dependency> <dependency> <!-- maven compat is needed because the maven testing harness still uses maven 2 APIs --> <groupId>org.apache.maven</groupId> <artifactId>maven-compat</artifactId> <version>${maven.version}</version> <scope>test</scope> </dependency> </dependencies> </dependencyManagement> </project>
{'content_hash': 'c9418a76b313d06708619abcc46f9877', 'timestamp': '', 'source': 'github', 'line_count': 68, 'max_line_length': 116, 'avg_line_length': 44.220588235294116, 'alnum_prop': 0.5407382773528434, 'repo_name': 'quarkusio/quarkus', 'id': '75ceb03f4c8062c316cc971e138670e8599826b4', 'size': '3007', 'binary': False, 'copies': '1', 'ref': 'refs/heads/main', 'path': 'independent-projects/bootstrap/bom-test/pom.xml', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'ANTLR', 'bytes': '23342'}, {'name': 'Batchfile', 'bytes': '13096'}, {'name': 'CSS', 'bytes': '6685'}, {'name': 'Dockerfile', 'bytes': '459'}, {'name': 'FreeMarker', 'bytes': '8106'}, {'name': 'Groovy', 'bytes': '16133'}, {'name': 'HTML', 'bytes': '1418749'}, {'name': 'Java', 'bytes': '38584810'}, {'name': 'JavaScript', 'bytes': '90960'}, {'name': 'Kotlin', 'bytes': '704351'}, {'name': 'Mustache', 'bytes': '13191'}, {'name': 'Scala', 'bytes': '9756'}, {'name': 'Shell', 'bytes': '71729'}]}
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>metacoq-checker: Not compatible 👼</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.css" rel="stylesheet"> <link href="../../../../../bootstrap-custom.css" rel="stylesheet"> <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet"> <script src="../../../../../moment.min.js"></script> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> <body> <div class="container"> <div class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="../../../../.."><i class="fa fa-lg fa-flag-checkered"></i> Coq bench</a> </div> <div id="navbar" class="collapse navbar-collapse"> <ul class="nav navbar-nav"> <li><a href="../..">clean / released</a></li> <li class="active"><a href="">8.9.1 / metacoq-checker - 1.0~alpha1+8.8</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../..">« Up</a> <h1> metacoq-checker <small> 1.0~alpha1+8.8 <span class="label label-info">Not compatible 👼</span> </small> </h1> <p>📅 <em><script>document.write(moment("2022-04-18 10:02:02 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script> (2022-04-18 10:02:02 UTC)</em><p> <h2>Context</h2> <pre># Packages matching: installed # Name # Installed # Synopsis base-bigarray base base-threads base base-unix base camlp5 7.14 Preprocessor-pretty-printer of OCaml conf-findutils 1 Virtual package relying on findutils conf-perl 2 Virtual package relying on perl coq 8.9.1 Formal proof management system num 1.4 The legacy Num library for arbitrary-precision integer and rational arithmetic ocaml 4.09.1 The OCaml compiler (virtual package) ocaml-base-compiler 4.09.1 Official release 4.09.1 ocaml-config 1 OCaml Switch Configuration ocamlfind 1.9.3 A library manager for OCaml # opam file: opam-version: &quot;2.0&quot; maintainer: &quot;[email protected]&quot; homepage: &quot;https://metacoq.github.io/metacoq&quot; dev-repo: &quot;git+https://github.com/MetaCoq/metacoq.git#coq-8.8&quot; bug-reports: &quot;https://github.com/MetaCoq/metacoq/issues&quot; authors: [&quot;Abhishek Anand &lt;[email protected]&gt;&quot; &quot;Simon Boulier &lt;[email protected]&gt;&quot; &quot;Cyril Cohen &lt;[email protected]&gt;&quot; &quot;Yannick Forster &lt;[email protected]&gt;&quot; &quot;Fabian Kunze &lt;[email protected]&gt;&quot; &quot;Gregory Malecha &lt;[email protected]&gt;&quot; &quot;Matthieu Sozeau &lt;[email protected]&gt;&quot; &quot;Nicolas Tabareau &lt;[email protected]&gt;&quot; &quot;Théo Winterhalter &lt;[email protected]&gt;&quot; ] license: &quot;MIT&quot; build: [ [&quot;sh&quot; &quot;./configure.sh&quot;] [make &quot;-j%{jobs}%&quot; &quot;checker&quot;] ] install: [ [make &quot;-C&quot; &quot;checker&quot; &quot;install&quot;] ] depends: [ &quot;ocaml&quot; {&gt; &quot;4.02.3&quot;} &quot;coq&quot; {&gt;= &quot;8.8&quot; &amp; &lt; &quot;8.9~&quot;} &quot;coq-metacoq-template&quot; {= version} ] synopsis: &quot;Specification of Coq&#39;s type theory and reference checker implementation&quot; description: &quot;&quot;&quot; MetaCoq is a meta-programming framework for Coq. The Checker module provides a complete specification of Coq&#39;s typing and conversion relation along with a reference type-checker that is extracted to a pluging. This provides a command: `MetaCoq Check [global_reference]` that can be used to typecheck a Coq definition using the verified type-checker. &quot;&quot;&quot; url { src: &quot;https://github.com/MetaCoq/metacoq/archive/1.0-alpha+8.8.tar.gz&quot; checksum: &quot;sha256=c2fe122ad30849e99c1e5c100af5490cef0e94246f8eb83f6df3f2ccf9edfc04&quot; }</pre> <h2>Lint</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Dry install 🏜️</h2> <p>Dry install with the current Coq version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam install -y --show-action coq-metacoq-checker.1.0~alpha1+8.8 coq.8.9.1</code></dd> <dt>Return code</dt> <dd>5120</dd> <dt>Output</dt> <dd><pre>[NOTE] Package coq is already installed (current version is 8.9.1). The following dependencies couldn&#39;t be met: - coq-metacoq-checker -&gt; coq &lt; 8.9~ -&gt; ocaml &lt; 4.06.0 base of this switch (use `--unlock-base&#39; to force) Your request can&#39;t be satisfied: - No available version of coq satisfies the constraints No solution found, exiting </pre></dd> </dl> <p>Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:</p> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>opam remove -y coq; opam install -y --show-action --unlock-base coq-metacoq-checker.1.0~alpha1+8.8</code></dd> <dt>Return code</dt> <dd>0</dd> </dl> <h2>Install dependencies</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Install 🚀</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Duration</dt> <dd>0 s</dd> </dl> <h2>Installation size</h2> <p>No files were installed.</p> <h2>Uninstall 🧹</h2> <dl class="dl-horizontal"> <dt>Command</dt> <dd><code>true</code></dd> <dt>Return code</dt> <dd>0</dd> <dt>Missing removes</dt> <dd> none </dd> <dt>Wrong removes</dt> <dd> none </dd> </dl> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> Sources are on <a href="https://github.com/coq-bench">GitHub</a> © Guillaume Claret 🐣 </p> </div> </div> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../../../../../bootstrap.min.js"></script> </body> </html>
{'content_hash': '6b1349436f877e0115a633dbdca30445', 'timestamp': '', 'source': 'github', 'line_count': 181, 'max_line_length': 159, 'avg_line_length': 43.08839779005525, 'alnum_prop': 0.559174253109373, 'repo_name': 'coq-bench/coq-bench.github.io', 'id': 'a9febdc2e0e2ddb10fc355a7692ffff8131a4e4a', 'size': '7825', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'clean/Linux-x86_64-4.09.1-2.0.6/released/8.9.1/metacoq-checker/1.0~alpha1+8.8.html', 'mode': '33188', 'license': 'mit', 'language': []}
function B = normalizecols(A); % % B = normalizecols(A); % % Normalizes the columns of a matrix, so each is a unit vector. B = A./repmat(sqrt(sum(A.^2)), size(A,1), 1);
{'content_hash': 'd6b8bdd6ca4a20ec270b7a63d70b1af7', 'timestamp': '', 'source': 'github', 'line_count': 7, 'max_line_length': 64, 'avg_line_length': 24.428571428571427, 'alnum_prop': 0.6432748538011696, 'repo_name': 'wilsonCernWq/GLMspiketools', 'id': 'a7c2416b430b63cf6fb5d7483289133ca85eabc4', 'size': '171', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'glmtools_misc/normalizecols.m', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'Matlab', 'bytes': '92330'}]}
package levar package object util { import java.net.{ URL, MalformedURLException } /** Regex match for valid organization names */ def validOrgName(name: String): Boolean = name.matches("""[-\w\.]+""") /** Check for valid URL */ def validURL(url: String): Boolean = { try { new URL(url) true } catch { case _: MalformedURLException => false } } def eitherAsAny(eith: Either[_, _]): Any = eith.fold(identity, identity) }
{'content_hash': 'ae986af11dc3f1b5bd9152d2bddad889', 'timestamp': '', 'source': 'github', 'line_count': 21, 'max_line_length': 74, 'avg_line_length': 22.333333333333332, 'alnum_prop': 0.6183368869936035, 'repo_name': 'peoplepattern/LeVar', 'id': '725e86f6b6b915da6e28845565628fcc1a308ee5', 'size': '469', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'levar-core/src/main/scala/levar/util.scala', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '23179'}, {'name': 'HTML', 'bytes': '3753'}, {'name': 'PLSQL', 'bytes': '9220'}, {'name': 'Scala', 'bytes': '189690'}]}
using System; namespace NLibuv { public interface IUvHandle { /// <summary> /// Gets the type of the current handle. /// </summary> UvHandleType HandleType { get; } /// <summary> /// Gets the loop object, on which the handle was initialized. /// </summary> UvLoop Loop { get; } /// <summary> /// Properly closes the handle and ensures that current object will be disposed correctly. /// </summary> void Close(); } }
{'content_hash': '8972f53f255369db21775d8483c08709', 'timestamp': '', 'source': 'github', 'line_count': 22, 'max_line_length': 92, 'avg_line_length': 21.227272727272727, 'alnum_prop': 0.6167023554603854, 'repo_name': 'neris/NLibuv', 'id': '3583d62ec5ca1105abd95da03c3e9e8c69014a61', 'size': '469', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/NLibuv/IUvHandle.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '79809'}]}
<?php /* * <auto-generated> * This code was generated by a Codezu. * * Changes to this file may cause incorrect behavior and will be lost if * the code is regenerated. * </auto-generated> */ namespace Mozu\Api\Contracts\CommerceRuntime\Carts; /** * Collection of messages logged or created each time the cart was modifed. */ class CartChangeMessageCollection { /** *Total number of objects in am item collection. Total counts are calculated for numerous objects in Mozu, including location inventory, products, options, product types, product reservations, categories, addresses, carriers, tax rates, time zones, and much more. */ public $totalCount; /** *Collection list of items. All returned data is provided in an items array. For a failed request, the returned response may be success with an empty item collection. Items are used throughout APIs for carts, wish lists, documents, payments, returns, properties, and more. */ public $items; } ?>
{'content_hash': 'bf5792f514496012e229c9505031e79b', 'timestamp': '', 'source': 'github', 'line_count': 34, 'max_line_length': 272, 'avg_line_length': 28.941176470588236, 'alnum_prop': 0.7408536585365854, 'repo_name': 'sanjaymandadi/mozu-php-sdk', 'id': '5c69c53aef07762b72c5830d2fc28467628b3084', 'size': '984', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/Contracts/CommerceRuntime/Carts/CartChangeMessageCollection.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'PHP', 'bytes': '2811166'}]}
// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // 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. // ---------------------------------------------------------------------------------- using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Xunit; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Commands.Management.Storage.Test")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Commands.Management.Storage.Test")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("779954d6-2751-45ba-ad0f-0e30d384c099")] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: [assembly: AssemblyVersion("1.1.3")] [assembly: AssemblyFileVersion("1.1.3")] [assembly: CollectionBehavior(DisableTestParallelization = true)]
{'content_hash': '228176e83ab9e9b9319cf295d220df90', 'timestamp': '', 'source': 'github', 'line_count': 52, 'max_line_length': 86, 'avg_line_length': 42.86538461538461, 'alnum_prop': 0.699416778824585, 'repo_name': 'shuagarw/azure-powershell', 'id': 'f97be4ccddb16319ec5c949c3f88f6291931f2a7', 'size': '2232', 'binary': False, 'copies': '3', 'ref': 'refs/heads/dev', 'path': 'src/ResourceManager/Storage/Commands.Management.Storage.Test/Properties/AssemblyInfo.cs', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '16509'}, {'name': 'C#', 'bytes': '30266509'}, {'name': 'HTML', 'bytes': '209'}, {'name': 'JavaScript', 'bytes': '4979'}, {'name': 'PHP', 'bytes': '41'}, {'name': 'PowerShell', 'bytes': '3266272'}, {'name': 'Shell', 'bytes': '50'}, {'name': 'XSLT', 'bytes': '6114'}]}
package org.apache.activemq.artemis.core.config.impl; import java.io.File; import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.config.ha.LiveOnlyPolicyConfiguration; import org.apache.activemq.artemis.core.journal.impl.JournalConstants; import org.apache.activemq.artemis.core.server.JournalType; import org.apache.activemq.artemis.tests.util.ActiveMQTestBase; import org.apache.activemq.artemis.tests.util.RandomUtil; import org.junit.Assert; import org.junit.Before; import org.junit.Test; public class ConfigurationImplTest extends ActiveMQTestBase { protected Configuration conf; @Test public void testDefaults() { Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultScheduledThreadPoolMaxSize(), conf.getScheduledThreadPoolMaxSize()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultSecurityInvalidationInterval(), conf.getSecurityInvalidationInterval()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultSecurityEnabled(), conf.isSecurityEnabled()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultBindingsDirectory(), conf.getBindingsDirectory()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultCreateBindingsDir(), conf.isCreateBindingsDir()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalDir(), conf.getJournalDirectory()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultCreateJournalDir(), conf.isCreateJournalDir()); Assert.assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_TYPE, conf.getJournalType()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultJournalSyncTransactional(), conf.isJournalSyncTransactional()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultJournalSyncNonTransactional(), conf.isJournalSyncNonTransactional()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalFileSize(), conf.getJournalFileSize()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalMinFiles(), conf.getJournalMinFiles()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalMaxIoAio(), conf.getJournalMaxIO_AIO()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalMaxIoNio(), conf.getJournalMaxIO_NIO()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultWildcardRoutingEnabled(), conf.isWildcardRoutingEnabled()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultTransactionTimeout(), conf.getTransactionTimeout()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageExpiryScanPeriod(), conf.getMessageExpiryScanPeriod()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageExpiryThreadPriority(), conf.getMessageExpiryThreadPriority()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultTransactionTimeoutScanPeriod(), conf.getTransactionTimeoutScanPeriod()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultManagementAddress(), conf.getManagementAddress()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultManagementNotificationAddress(), conf.getManagementNotificationAddress()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultClusterUser(), conf.getClusterUser()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultClusterPassword(), conf.getClusterPassword()); // OK Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultPersistenceEnabled(), conf.isPersistenceEnabled()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultPersistDeliveryCountBeforeDelivery(), conf.isPersistDeliveryCountBeforeDelivery()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultFileDeployerScanPeriod(), conf.getFileDeployerScanPeriod()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultThreadPoolMaxSize(), conf.getThreadPoolMaxSize()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultJmxManagementEnabled(), conf.isJMXManagementEnabled()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultConnectionTtlOverride(), conf.getConnectionTTLOverride()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultAsyncConnectionExecutionEnabled(), conf.isAsyncConnectionExecutionEnabled()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultPagingDir(), conf.getPagingDirectory()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultLargeMessagesDir(), conf.getLargeMessagesDirectory()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalCompactPercentage(), conf.getJournalCompactPercentage()); Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_AIO, conf.getJournalBufferTimeout_AIO()); Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_TIMEOUT_NIO, conf.getJournalBufferTimeout_NIO()); Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_AIO, conf.getJournalBufferSize_AIO()); Assert.assertEquals(JournalConstants.DEFAULT_JOURNAL_BUFFER_SIZE_NIO, conf.getJournalBufferSize_NIO()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultJournalLogWriteRate(), conf.isLogJournalWriteRate()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultJournalPerfBlastPages(), conf.getJournalPerfBlastPages()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultMessageCounterEnabled(), conf.isMessageCounterEnabled()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageCounterMaxDayHistory(), conf.getMessageCounterMaxDayHistory()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMessageCounterSamplePeriod(), conf.getMessageCounterSamplePeriod()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultIdCacheSize(), conf.getIDCacheSize()); Assert.assertEquals(ActiveMQDefaultConfiguration.isDefaultPersistIdCache(), conf.isPersistIDCache()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultServerDumpInterval(), conf.getServerDumpInterval()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMemoryWarningThreshold(), conf.getMemoryWarningThreshold()); Assert.assertEquals(ActiveMQDefaultConfiguration.getDefaultMemoryMeasureInterval(), conf.getMemoryMeasureInterval()); } @Test public void testSetGetAttributes() throws Exception { for (int j = 0; j < 100; j++) { int i = RandomUtil.randomInt(); conf.setScheduledThreadPoolMaxSize(i); Assert.assertEquals(i, conf.getScheduledThreadPoolMaxSize()); long l = RandomUtil.randomLong(); conf.setSecurityInvalidationInterval(l); Assert.assertEquals(l, conf.getSecurityInvalidationInterval()); boolean b = RandomUtil.randomBoolean(); conf.setSecurityEnabled(b); Assert.assertEquals(b, conf.isSecurityEnabled()); String s = RandomUtil.randomString(); conf.setBindingsDirectory(s); Assert.assertEquals(s, conf.getBindingsDirectory()); b = RandomUtil.randomBoolean(); conf.setCreateBindingsDir(b); Assert.assertEquals(b, conf.isCreateBindingsDir()); s = RandomUtil.randomString(); conf.setJournalDirectory(s); Assert.assertEquals(s, conf.getJournalDirectory()); b = RandomUtil.randomBoolean(); conf.setCreateJournalDir(b); Assert.assertEquals(b, conf.isCreateJournalDir()); i = RandomUtil.randomInt() % 2; JournalType journal = i == 0 ? JournalType.ASYNCIO : JournalType.NIO; conf.setJournalType(journal); Assert.assertEquals(journal, conf.getJournalType()); b = RandomUtil.randomBoolean(); conf.setJournalSyncTransactional(b); Assert.assertEquals(b, conf.isJournalSyncTransactional()); b = RandomUtil.randomBoolean(); conf.setJournalSyncNonTransactional(b); Assert.assertEquals(b, conf.isJournalSyncNonTransactional()); i = RandomUtil.randomInt(); conf.setJournalFileSize(i); Assert.assertEquals(i, conf.getJournalFileSize()); i = RandomUtil.randomInt(); conf.setJournalMinFiles(i); Assert.assertEquals(i, conf.getJournalMinFiles()); i = RandomUtil.randomInt(); conf.setJournalMaxIO_AIO(i); Assert.assertEquals(i, conf.getJournalMaxIO_AIO()); i = RandomUtil.randomInt(); conf.setJournalMaxIO_NIO(i); Assert.assertEquals(i, conf.getJournalMaxIO_NIO()); s = RandomUtil.randomString(); conf.setManagementAddress(new SimpleString(s)); Assert.assertEquals(s, conf.getManagementAddress().toString()); i = RandomUtil.randomInt(); conf.setMessageExpiryThreadPriority(i); Assert.assertEquals(i, conf.getMessageExpiryThreadPriority()); l = RandomUtil.randomLong(); conf.setMessageExpiryScanPeriod(l); Assert.assertEquals(l, conf.getMessageExpiryScanPeriod()); b = RandomUtil.randomBoolean(); conf.setPersistDeliveryCountBeforeDelivery(b); Assert.assertEquals(b, conf.isPersistDeliveryCountBeforeDelivery()); b = RandomUtil.randomBoolean(); conf.setEnabledAsyncConnectionExecution(b); Assert.assertEquals(b, conf.isAsyncConnectionExecutionEnabled()); b = RandomUtil.randomBoolean(); conf.setPersistenceEnabled(b); Assert.assertEquals(b, conf.isPersistenceEnabled()); b = RandomUtil.randomBoolean(); conf.setJMXManagementEnabled(b); Assert.assertEquals(b, conf.isJMXManagementEnabled()); l = RandomUtil.randomLong(); conf.setFileDeployerScanPeriod(l); Assert.assertEquals(l, conf.getFileDeployerScanPeriod()); l = RandomUtil.randomLong(); conf.setConnectionTTLOverride(l); Assert.assertEquals(l, conf.getConnectionTTLOverride()); i = RandomUtil.randomInt(); conf.setThreadPoolMaxSize(i); Assert.assertEquals(i, conf.getThreadPoolMaxSize()); SimpleString ss = RandomUtil.randomSimpleString(); conf.setManagementNotificationAddress(ss); Assert.assertEquals(ss, conf.getManagementNotificationAddress()); s = RandomUtil.randomString(); conf.setClusterUser(s); Assert.assertEquals(s, conf.getClusterUser()); i = RandomUtil.randomInt(); conf.setIDCacheSize(i); Assert.assertEquals(i, conf.getIDCacheSize()); b = RandomUtil.randomBoolean(); conf.setPersistIDCache(b); Assert.assertEquals(b, conf.isPersistIDCache()); i = RandomUtil.randomInt(); conf.setJournalCompactMinFiles(i); Assert.assertEquals(i, conf.getJournalCompactMinFiles()); i = RandomUtil.randomInt(); conf.setJournalCompactPercentage(i); Assert.assertEquals(i, conf.getJournalCompactPercentage()); i = RandomUtil.randomInt(); conf.setJournalBufferSize_AIO(i); Assert.assertEquals(i, conf.getJournalBufferSize_AIO()); i = RandomUtil.randomInt(); conf.setJournalBufferTimeout_AIO(i); Assert.assertEquals(i, conf.getJournalBufferTimeout_AIO()); i = RandomUtil.randomInt(); conf.setJournalBufferSize_NIO(i); Assert.assertEquals(i, conf.getJournalBufferSize_NIO()); i = RandomUtil.randomInt(); conf.setJournalBufferTimeout_NIO(i); Assert.assertEquals(i, conf.getJournalBufferTimeout_NIO()); b = RandomUtil.randomBoolean(); conf.setLogJournalWriteRate(b); Assert.assertEquals(b, conf.isLogJournalWriteRate()); i = RandomUtil.randomInt(); conf.setJournalPerfBlastPages(i); Assert.assertEquals(i, conf.getJournalPerfBlastPages()); l = RandomUtil.randomLong(); conf.setServerDumpInterval(l); Assert.assertEquals(l, conf.getServerDumpInterval()); s = RandomUtil.randomString(); conf.setPagingDirectory(s); Assert.assertEquals(s, conf.getPagingDirectory()); s = RandomUtil.randomString(); conf.setLargeMessagesDirectory(s); Assert.assertEquals(s, conf.getLargeMessagesDirectory()); b = RandomUtil.randomBoolean(); conf.setWildcardRoutingEnabled(b); Assert.assertEquals(b, conf.isWildcardRoutingEnabled()); l = RandomUtil.randomLong(); conf.setTransactionTimeout(l); Assert.assertEquals(l, conf.getTransactionTimeout()); b = RandomUtil.randomBoolean(); conf.setMessageCounterEnabled(b); Assert.assertEquals(b, conf.isMessageCounterEnabled()); l = RandomUtil.randomPositiveLong(); conf.setMessageCounterSamplePeriod(l); Assert.assertEquals(l, conf.getMessageCounterSamplePeriod()); i = RandomUtil.randomInt(); conf.setMessageCounterMaxDayHistory(i); Assert.assertEquals(i, conf.getMessageCounterMaxDayHistory()); l = RandomUtil.randomLong(); conf.setTransactionTimeoutScanPeriod(l); Assert.assertEquals(l, conf.getTransactionTimeoutScanPeriod()); s = RandomUtil.randomString(); conf.setClusterPassword(s); Assert.assertEquals(s, conf.getClusterPassword()); } } @Test public void testGetSetInterceptors() { final String name1 = "uqwyuqywuy"; final String name2 = "yugyugyguyg"; conf.getIncomingInterceptorClassNames().add(name1); conf.getIncomingInterceptorClassNames().add(name2); Assert.assertTrue(conf.getIncomingInterceptorClassNames().contains(name1)); Assert.assertTrue(conf.getIncomingInterceptorClassNames().contains(name2)); Assert.assertFalse(conf.getIncomingInterceptorClassNames().contains("iijij")); } @Test public void testSerialize() throws Exception { boolean b = RandomUtil.randomBoolean(); conf.setHAPolicyConfiguration(new LiveOnlyPolicyConfiguration()); int i = RandomUtil.randomInt(); conf.setScheduledThreadPoolMaxSize(i); Assert.assertEquals(i, conf.getScheduledThreadPoolMaxSize()); long l = RandomUtil.randomLong(); conf.setSecurityInvalidationInterval(l); Assert.assertEquals(l, conf.getSecurityInvalidationInterval()); b = RandomUtil.randomBoolean(); conf.setSecurityEnabled(b); Assert.assertEquals(b, conf.isSecurityEnabled()); String s = RandomUtil.randomString(); conf.setBindingsDirectory(s); Assert.assertEquals(s, conf.getBindingsDirectory()); b = RandomUtil.randomBoolean(); conf.setCreateBindingsDir(b); Assert.assertEquals(b, conf.isCreateBindingsDir()); s = RandomUtil.randomString(); conf.setJournalDirectory(s); Assert.assertEquals(s, conf.getJournalDirectory()); b = RandomUtil.randomBoolean(); conf.setCreateJournalDir(b); Assert.assertEquals(b, conf.isCreateJournalDir()); i = RandomUtil.randomInt() % 2; JournalType journal = i == 0 ? JournalType.ASYNCIO : JournalType.NIO; conf.setJournalType(journal); Assert.assertEquals(journal, conf.getJournalType()); b = RandomUtil.randomBoolean(); conf.setJournalSyncTransactional(b); Assert.assertEquals(b, conf.isJournalSyncTransactional()); b = RandomUtil.randomBoolean(); conf.setJournalSyncNonTransactional(b); Assert.assertEquals(b, conf.isJournalSyncNonTransactional()); i = RandomUtil.randomInt(); conf.setJournalFileSize(i); Assert.assertEquals(i, conf.getJournalFileSize()); i = RandomUtil.randomInt(); conf.setJournalMinFiles(i); Assert.assertEquals(i, conf.getJournalMinFiles()); i = RandomUtil.randomInt(); conf.setJournalMaxIO_AIO(i); Assert.assertEquals(i, conf.getJournalMaxIO_AIO()); i = RandomUtil.randomInt(); conf.setJournalMaxIO_NIO(i); Assert.assertEquals(i, conf.getJournalMaxIO_NIO()); s = RandomUtil.randomString(); conf.setManagementAddress(new SimpleString(s)); Assert.assertEquals(s, conf.getManagementAddress().toString()); i = RandomUtil.randomInt(); conf.setMessageExpiryThreadPriority(i); Assert.assertEquals(i, conf.getMessageExpiryThreadPriority()); l = RandomUtil.randomLong(); conf.setMessageExpiryScanPeriod(l); Assert.assertEquals(l, conf.getMessageExpiryScanPeriod()); b = RandomUtil.randomBoolean(); conf.setPersistDeliveryCountBeforeDelivery(b); Assert.assertEquals(b, conf.isPersistDeliveryCountBeforeDelivery()); b = RandomUtil.randomBoolean(); conf.setEnabledAsyncConnectionExecution(b); Assert.assertEquals(b, conf.isAsyncConnectionExecutionEnabled()); b = RandomUtil.randomBoolean(); conf.setPersistenceEnabled(b); Assert.assertEquals(b, conf.isPersistenceEnabled()); b = RandomUtil.randomBoolean(); conf.setJMXManagementEnabled(b); Assert.assertEquals(b, conf.isJMXManagementEnabled()); l = RandomUtil.randomLong(); conf.setFileDeployerScanPeriod(l); Assert.assertEquals(l, conf.getFileDeployerScanPeriod()); l = RandomUtil.randomLong(); conf.setConnectionTTLOverride(l); Assert.assertEquals(l, conf.getConnectionTTLOverride()); i = RandomUtil.randomInt(); conf.setThreadPoolMaxSize(i); Assert.assertEquals(i, conf.getThreadPoolMaxSize()); SimpleString ss = RandomUtil.randomSimpleString(); conf.setManagementNotificationAddress(ss); Assert.assertEquals(ss, conf.getManagementNotificationAddress()); s = RandomUtil.randomString(); conf.setClusterUser(s); Assert.assertEquals(s, conf.getClusterUser()); i = RandomUtil.randomInt(); conf.setIDCacheSize(i); Assert.assertEquals(i, conf.getIDCacheSize()); b = RandomUtil.randomBoolean(); conf.setPersistIDCache(b); Assert.assertEquals(b, conf.isPersistIDCache()); i = RandomUtil.randomInt(); conf.setJournalCompactMinFiles(i); Assert.assertEquals(i, conf.getJournalCompactMinFiles()); i = RandomUtil.randomInt(); conf.setJournalCompactPercentage(i); Assert.assertEquals(i, conf.getJournalCompactPercentage()); i = RandomUtil.randomInt(); conf.setJournalBufferSize_AIO(i); Assert.assertEquals(i, conf.getJournalBufferSize_AIO()); i = RandomUtil.randomInt(); conf.setJournalBufferTimeout_AIO(i); Assert.assertEquals(i, conf.getJournalBufferTimeout_AIO()); i = RandomUtil.randomInt(); conf.setJournalBufferSize_NIO(i); Assert.assertEquals(i, conf.getJournalBufferSize_NIO()); i = RandomUtil.randomInt(); conf.setJournalBufferTimeout_NIO(i); Assert.assertEquals(i, conf.getJournalBufferTimeout_NIO()); b = RandomUtil.randomBoolean(); conf.setLogJournalWriteRate(b); Assert.assertEquals(b, conf.isLogJournalWriteRate()); i = RandomUtil.randomInt(); conf.setJournalPerfBlastPages(i); Assert.assertEquals(i, conf.getJournalPerfBlastPages()); l = RandomUtil.randomLong(); conf.setServerDumpInterval(l); Assert.assertEquals(l, conf.getServerDumpInterval()); s = RandomUtil.randomString(); conf.setPagingDirectory(s); Assert.assertEquals(s, conf.getPagingDirectory()); s = RandomUtil.randomString(); conf.setLargeMessagesDirectory(s); Assert.assertEquals(s, conf.getLargeMessagesDirectory()); b = RandomUtil.randomBoolean(); conf.setWildcardRoutingEnabled(b); Assert.assertEquals(b, conf.isWildcardRoutingEnabled()); l = RandomUtil.randomLong(); conf.setTransactionTimeout(l); Assert.assertEquals(l, conf.getTransactionTimeout()); b = RandomUtil.randomBoolean(); conf.setMessageCounterEnabled(b); Assert.assertEquals(b, conf.isMessageCounterEnabled()); l = RandomUtil.randomPositiveLong(); conf.setMessageCounterSamplePeriod(l); Assert.assertEquals(l, conf.getMessageCounterSamplePeriod()); i = RandomUtil.randomInt(); conf.setMessageCounterMaxDayHistory(i); Assert.assertEquals(i, conf.getMessageCounterMaxDayHistory()); l = RandomUtil.randomLong(); conf.setTransactionTimeoutScanPeriod(l); Assert.assertEquals(l, conf.getTransactionTimeoutScanPeriod()); s = RandomUtil.randomString(); conf.setClusterPassword(s); Assert.assertEquals(s, conf.getClusterPassword()); // This will use serialization to perform a deep copy of the object Configuration conf2 = conf.copy(); Assert.assertTrue(conf.equals(conf2)); } @Test public void testResolvePath() throws Throwable { // Validate that the resolve method will work even with artemis.instance doesn't exist String oldProperty = System.getProperty("artemis.instance"); try { System.setProperty("artemis.instance", "/tmp/" + RandomUtil.randomString()); ConfigurationImpl configuration = new ConfigurationImpl(); configuration.setJournalDirectory("./data-journal"); File journalLocation = configuration.getJournalLocation(); Assert.assertFalse("This path shouldn't resolve to a real folder", journalLocation.exists()); } finally { if (oldProperty == null) { System.clearProperty("artemis.instance"); } else { System.setProperty("artemis.instance", oldProperty); } } } @Test public void testAbsolutePath() throws Throwable { // Validate that the resolve method will work even with artemis.instance doesn't exist String oldProperty = System.getProperty("artemis.instance"); File tempFolder = null; try { System.setProperty("artemis.instance", "/tmp/" + RandomUtil.randomString()); tempFolder = File.createTempFile("journal-folder", ""); tempFolder.delete(); tempFolder = new File(tempFolder.getAbsolutePath()); tempFolder.mkdirs(); System.out.println("TempFolder = " + tempFolder.getAbsolutePath()); ConfigurationImpl configuration = new ConfigurationImpl(); configuration.setJournalDirectory(tempFolder.getAbsolutePath()); File journalLocation = configuration.getJournalLocation(); Assert.assertTrue(journalLocation.exists()); } finally { if (oldProperty == null) { System.clearProperty("artemis.instance"); } else { System.setProperty("artemis.instance", oldProperty); } if (tempFolder != null) { tempFolder.delete(); } } } @Override @Before public void setUp() throws Exception { super.setUp(); conf = createConfiguration(); } protected Configuration createConfiguration() throws Exception { return new ConfigurationImpl(); } }
{'content_hash': '234dc968e36131531af8b5c60b1588ee', 'timestamp': '', 'source': 'github', 'line_count': 546, 'max_line_length': 147, 'avg_line_length': 42.663003663003664, 'alnum_prop': 0.7165364471537735, 'repo_name': 'waysact/activemq-artemis', 'id': '447d51bb9bfabc36bcbee452805b663354e9af63', 'size': '24093', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/ConfigurationImplTest.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '5879'}, {'name': 'C', 'bytes': '23262'}, {'name': 'C++', 'bytes': '1032'}, {'name': 'CMake', 'bytes': '4260'}, {'name': 'CSS', 'bytes': '11732'}, {'name': 'HTML', 'bytes': '19113'}, {'name': 'Java', 'bytes': '22819589'}, {'name': 'Shell', 'bytes': '11911'}]}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="zh"> <head> <!-- Generated by javadoc (1.8.0_171) on Mon Apr 22 17:36:00 CST 2019 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>D - 索引 (android API)</title> <meta name="date" content="2019-04-22"> <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="D - \u7D22\u5F15 (android API)"; } } catch(err) { } //--> </script> <noscript> <div>您的浏览器已禁用 JavaScript。</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="跳过导航链接">跳过导航链接</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../overview-summary.html">概览</a></li> <li>程序包</li> <li>类</li> <li><a href="../overview-tree.html">树</a></li> <li><a href="../deprecated-list.html">已过时</a></li> <li class="navBarCell1Rev">索引</li> <li><a href="../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="index-3.html">上一个字母</a></li> <li><a href="index-5.html">下一个字母</a></li> </ul> <ul class="navList"> <li><a href="../index.html?index-files/index-4.html" target="_top">框架</a></li> <li><a href="index-4.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <div class="contentContainer"><a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">H</a>&nbsp;<a href="index-9.html">I</a>&nbsp;<a href="index-10.html">J</a>&nbsp;<a href="index-11.html">L</a>&nbsp;<a href="index-12.html">M</a>&nbsp;<a href="index-13.html">N</a>&nbsp;<a href="index-14.html">O</a>&nbsp;<a href="index-15.html">P</a>&nbsp;<a href="index-16.html">R</a>&nbsp;<a href="index-17.html">S</a>&nbsp;<a href="index-18.html">T</a>&nbsp;<a href="index-19.html">U</a>&nbsp;<a href="index-20.html">V</a>&nbsp;<a href="index-21.html">W</a>&nbsp;<a name="I:D"> <!-- --> </a> <h2 class="title">D</h2> <dl> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/ContactManager.html#declineInvitation-java.lang.String-java.lang.String-java.lang.String-cn.jpush.im.api.BasicCallback-">declineInvitation(String, String, String, BasicCallback)</a></span> - 类 中的静态方法cn.jpush.im.android.api.<a href="../cn/jpush/im/android/api/ContactManager.html" title="cn.jpush.im.android.api中的类">ContactManager</a></dt> <dd> <div class="block">拒绝对方的好友请求</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/ChatRoomManager.html#delChatRoomAdmin-long-java.util.List-cn.jpush.im.api.BasicCallback-">delChatRoomAdmin(long, List&lt;UserInfo&gt;, BasicCallback)</a></span> - 类 中的静态方法cn.jpush.im.android.api.<a href="../cn/jpush/im/android/api/ChatRoomManager.html" title="cn.jpush.im.android.api中的类">ChatRoomManager</a></dt> <dd> <div class="block">取消指定用户的聊天室房管身份,只有房主有此权限</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/ChatRoomManager.html#delChatRoomBlacklist-long-java.util.List-cn.jpush.im.api.BasicCallback-">delChatRoomBlacklist(long, List&lt;UserInfo&gt;, BasicCallback)</a></span> - 类 中的静态方法cn.jpush.im.android.api.<a href="../cn/jpush/im/android/api/ChatRoomManager.html" title="cn.jpush.im.android.api中的类">ChatRoomManager</a></dt> <dd> <div class="block">将用户从聊天室黑名单中移除,只有聊天室的房主和房管有此权限</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/ChatRoomManager.html#delChatRoomSilence-long-java.util.Collection-cn.jpush.im.api.BasicCallback-">delChatRoomSilence(long, Collection&lt;UserInfo&gt;, BasicCallback)</a></span> - 类 中的静态方法cn.jpush.im.android.api.<a href="../cn/jpush/im/android/api/ChatRoomManager.html" title="cn.jpush.im.android.api中的类">ChatRoomManager</a></dt> <dd> <div class="block">将指定用户从聊天室禁言列表中移除(批量设置一次最多500个) 只有房主和管理员可设置,取消成功聊天室成员会收到<a href="../cn/jpush/im/android/api/event/ChatRoomNotificationEvent.html" title="cn.jpush.im.android.api.event中的类"><code>ChatRoomNotificationEvent</code></a></div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/model/Conversation.html#deleteAllMessage--">deleteAllMessage()</a></span> - 类 中的方法cn.jpush.im.android.api.model.<a href="../cn/jpush/im/android/api/model/Conversation.html" title="cn.jpush.im.android.api.model中的类">Conversation</a></dt> <dd> <div class="block">删除会话中的所有消息,但不会删除会话本身。</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/JMessageClient.html#deleteChatRoomConversation-long-">deleteChatRoomConversation(long)</a></span> - 类 中的静态方法cn.jpush.im.android.api.<a href="../cn/jpush/im/android/api/JMessageClient.html" title="cn.jpush.im.android.api中的类">JMessageClient</a></dt> <dd> <div class="block">删除聊天室会话,同时删除掉本地相关缓存文件</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/JMessageClient.html#deleteGroupConversation-long-">deleteGroupConversation(long)</a></span> - 类 中的静态方法cn.jpush.im.android.api.<a href="../cn/jpush/im/android/api/JMessageClient.html" title="cn.jpush.im.android.api中的类">JMessageClient</a></dt> <dd> <div class="block">删除群聊的会话,同时删除掉本地聊天记录</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/model/Conversation.html#deleteMessage-int-">deleteMessage(int)</a></span> - 类 中的方法cn.jpush.im.android.api.model.<a href="../cn/jpush/im/android/api/model/Conversation.html" title="cn.jpush.im.android.api.model中的类">Conversation</a></dt> <dd> <div class="block">删除会话中指定messageId的消息 由于聊天室类型会话中所有消息都不会保存到本地,调用此接口将固定返回false</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/JMessageClient.html#deleteSingleConversation-java.lang.String-">deleteSingleConversation(String)</a></span> - 类 中的静态方法cn.jpush.im.android.api.<a href="../cn/jpush/im/android/api/JMessageClient.html" title="cn.jpush.im.android.api中的类">JMessageClient</a></dt> <dd> <div class="block">删除单聊的会话,同时删除掉本地聊天记录。</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/JMessageClient.html#deleteSingleConversation-java.lang.String-java.lang.String-">deleteSingleConversation(String, String)</a></span> - 类 中的静态方法cn.jpush.im.android.api.<a href="../cn/jpush/im/android/api/JMessageClient.html" title="cn.jpush.im.android.api中的类">JMessageClient</a></dt> <dd> <div class="block">删除与指定appkey下username的单聊的会话,同时删除掉本地聊天记录。</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/model/GroupInfo.html#delGroupAnnouncement-int-cn.jpush.im.api.BasicCallback-">delGroupAnnouncement(int, BasicCallback)</a></span> - 类 中的方法cn.jpush.im.android.api.model.<a href="../cn/jpush/im/android/api/model/GroupInfo.html" title="cn.jpush.im.android.api.model中的类">GroupInfo</a></dt> <dd> <div class="block">删除群内指定id的公告,只有群主和管理员有权限删除<br/> 删除群公告成功时群内所有成员会收到<a href="../cn/jpush/im/android/api/event/GroupAnnouncementChangedEvent.html" title="cn.jpush.im.android.api.event中的类"><code>GroupAnnouncementChangedEvent</code></a></div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/model/GroupInfo.html#delGroupBlacklist-java.util.List-cn.jpush.im.api.BasicCallback-">delGroupBlacklist(List&lt;UserInfo&gt;, BasicCallback)</a></span> - 类 中的方法cn.jpush.im.android.api.model.<a href="../cn/jpush/im/android/api/model/GroupInfo.html" title="cn.jpush.im.android.api.model中的类">GroupInfo</a></dt> <dd> <div class="block">将用户从群组黑名单中移除,只有群主和管理员有此权限.</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/model/GroupInfo.html#delGroupSilence-java.util.Collection-cn.jpush.im.api.BasicCallback-">delGroupSilence(Collection&lt;UserInfo&gt;, BasicCallback)</a></span> - 类 中的方法cn.jpush.im.android.api.model.<a href="../cn/jpush/im/android/api/model/GroupInfo.html" title="cn.jpush.im.android.api.model中的类">GroupInfo</a></dt> <dd> <div class="block">取消群成员禁言(批量设置一次最多500个),取消禁言成功后会以系统消息形式通知群内成员</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/JMessageClient.html#delUsersFromBlacklist-java.util.List-cn.jpush.im.api.BasicCallback-">delUsersFromBlacklist(List&lt;String&gt;, BasicCallback)</a></span> - 类 中的静态方法cn.jpush.im.android.api.<a href="../cn/jpush/im/android/api/JMessageClient.html" title="cn.jpush.im.android.api中的类">JMessageClient</a></dt> <dd> <div class="block">将用户移出黑名单。</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/JMessageClient.html#delUsersFromBlacklist-java.util.List-java.lang.String-cn.jpush.im.api.BasicCallback-">delUsersFromBlacklist(List&lt;String&gt;, String, BasicCallback)</a></span> - 类 中的静态方法cn.jpush.im.android.api.<a href="../cn/jpush/im/android/api/JMessageClient.html" title="cn.jpush.im.android.api中的类">JMessageClient</a></dt> <dd> <div class="block">将用户移出黑名单,通过指定appKey可以实现跨应用将用户移出黑名单</div> </dd> <dt><a href="../cn/jpush/im/android/api/model/DeviceInfo.html" title="cn.jpush.im.android.api.model中的类"><span class="typeNameLink">DeviceInfo</span></a> - <a href="../cn/jpush/im/android/api/model/package-summary.html">cn.jpush.im.android.api.model</a>中的类</dt> <dd> <div class="block">设备状态信息,使用<a href="../cn/jpush/im/android/api/JMessageClient.html#login-java.lang.String-java.lang.String-cn.jpush.im.android.api.callback.RequestCallback-"><code>JMessageClient.login(String, String, RequestCallback)</code></a>可以返回账号所登陆过的设备信息。</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/model/DeviceInfo.html#DeviceInfo-long-cn.jpush.im.android.api.enums.PlatformType-int-int-boolean-int-">DeviceInfo(long, PlatformType, int, int, boolean, int)</a></span> - 类 的构造器cn.jpush.im.android.api.model.<a href="../cn/jpush/im/android/api/model/DeviceInfo.html" title="cn.jpush.im.android.api.model中的类">DeviceInfo</a></dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/jmrtc/JMRTCInternalUse.html#doCompleteCallBackToUser-cn.jpush.im.api.BasicCallback-int-java.lang.String-java.lang.Object...-">doCompleteCallBackToUser(BasicCallback, int, String, Object...)</a></span> - 类 中的静态方法cn.jpush.im.android.api.jmrtc.<a href="../cn/jpush/im/android/api/jmrtc/JMRTCInternalUse.html" title="cn.jpush.im.android.api.jmrtc中的类">JMRTCInternalUse</a></dt> <dd>&nbsp;</dd> <dt><a href="../cn/jpush/im/android/api/callback/DownloadAvatarCallback.html" title="cn.jpush.im.android.api.callback中的类"><span class="typeNameLink">DownloadAvatarCallback</span></a> - <a href="../cn/jpush/im/android/api/callback/package-summary.html">cn.jpush.im.android.api.callback</a>中的类</dt> <dd>&nbsp;</dd> <dt><a href="../cn/jpush/im/android/api/callback/DownloadCompletionCallback.html" title="cn.jpush.im.android.api.callback中的类"><span class="typeNameLink">DownloadCompletionCallback</span></a> - <a href="../cn/jpush/im/android/api/callback/package-summary.html">cn.jpush.im.android.api.callback</a>中的类</dt> <dd>&nbsp;</dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/content/FileContent.html#downloadFile-cn.jpush.im.android.api.model.Message-cn.jpush.im.android.api.callback.DownloadCompletionCallback-">downloadFile(Message, DownloadCompletionCallback)</a></span> - 类 中的方法cn.jpush.im.android.api.content.<a href="../cn/jpush/im/android/api/content/FileContent.html" title="cn.jpush.im.android.api.content中的类">FileContent</a></dt> <dd> <div class="block">下载消息中文件。</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/content/ImageContent.html#downloadOriginImage-cn.jpush.im.android.api.model.Message-cn.jpush.im.android.api.callback.DownloadCompletionCallback-">downloadOriginImage(Message, DownloadCompletionCallback)</a></span> - 类 中的方法cn.jpush.im.android.api.content.<a href="../cn/jpush/im/android/api/content/ImageContent.html" title="cn.jpush.im.android.api.content中的类">ImageContent</a></dt> <dd> <div class="block">下载图片消息中的原图,下载过程中想要取消的话调用<a href="../cn/jpush/im/android/api/content/ImageContent.html#cancelDownload-cn.jpush.im.android.api.model.Message-"><code>ImageContent.cancelDownload(Message)</code></a>。</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/content/VideoContent.html#downloadThumbImage-cn.jpush.im.android.api.model.Message-cn.jpush.im.android.api.callback.DownloadCompletionCallback-">downloadThumbImage(Message, DownloadCompletionCallback)</a></span> - 类 中的方法cn.jpush.im.android.api.content.<a href="../cn/jpush/im/android/api/content/VideoContent.html" title="cn.jpush.im.android.api.content中的类">VideoContent</a></dt> <dd> <div class="block">下载视频消息的缩略图(如果视频消息发送者有指定的话) 对于用户在线期间收到的视频消息:sdk会在接收到视频消息时自动下载缩略图文件。</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/content/ImageContent.html#downloadThumbnailImage-cn.jpush.im.android.api.model.Message-cn.jpush.im.android.api.callback.DownloadCompletionCallback-">downloadThumbnailImage(Message, DownloadCompletionCallback)</a></span> - 类 中的方法cn.jpush.im.android.api.content.<a href="../cn/jpush/im/android/api/content/ImageContent.html" title="cn.jpush.im.android.api.content中的类">ImageContent</a></dt> <dd> <div class="block">下载图片消息中原图对应的缩略图 对于用户在线期间收到的图片消息:sdk会在接收到图片消息时自动下载缩略图。</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/content/VideoContent.html#downloadVideoFile-cn.jpush.im.android.api.model.Message-cn.jpush.im.android.api.callback.DownloadCompletionCallback-">downloadVideoFile(Message, DownloadCompletionCallback)</a></span> - 类 中的方法cn.jpush.im.android.api.content.<a href="../cn/jpush/im/android/api/content/VideoContent.html" title="cn.jpush.im.android.api.content中的类">VideoContent</a></dt> <dd> <div class="block">下载视频消息中的视频文件,下载过程中如果想取消调用<a href="../cn/jpush/im/android/api/content/VideoContent.html#cancelDownload-cn.jpush.im.android.api.model.Message-"><code>VideoContent.cancelDownload(Message)</code></a> 注意:sdk收到文件消息后,不会自动下载视频文件附件,需要用户主动调用此接口完成下载。</div> </dd> <dt><span class="memberNameLink"><a href="../cn/jpush/im/android/api/content/VoiceContent.html#downloadVoiceFile-cn.jpush.im.android.api.model.Message-cn.jpush.im.android.api.callback.DownloadCompletionCallback-">downloadVoiceFile(Message, DownloadCompletionCallback)</a></span> - 类 中的方法cn.jpush.im.android.api.content.<a href="../cn/jpush/im/android/api/content/VoiceContent.html" title="cn.jpush.im.android.api.content中的类">VoiceContent</a></dt> <dd> <div class="block">下载语音消息中的语音文件。</div> </dd> </dl> <a href="index-1.html">A</a>&nbsp;<a href="index-2.html">B</a>&nbsp;<a href="index-3.html">C</a>&nbsp;<a href="index-4.html">D</a>&nbsp;<a href="index-5.html">E</a>&nbsp;<a href="index-6.html">F</a>&nbsp;<a href="index-7.html">G</a>&nbsp;<a href="index-8.html">H</a>&nbsp;<a href="index-9.html">I</a>&nbsp;<a href="index-10.html">J</a>&nbsp;<a href="index-11.html">L</a>&nbsp;<a href="index-12.html">M</a>&nbsp;<a href="index-13.html">N</a>&nbsp;<a href="index-14.html">O</a>&nbsp;<a href="index-15.html">P</a>&nbsp;<a href="index-16.html">R</a>&nbsp;<a href="index-17.html">S</a>&nbsp;<a href="index-18.html">T</a>&nbsp;<a href="index-19.html">U</a>&nbsp;<a href="index-20.html">V</a>&nbsp;<a href="index-21.html">W</a>&nbsp;</div> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="跳过导航链接">跳过导航链接</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="导航"> <li><a href="../overview-summary.html">概览</a></li> <li>程序包</li> <li>类</li> <li><a href="../overview-tree.html">树</a></li> <li><a href="../deprecated-list.html">已过时</a></li> <li class="navBarCell1Rev">索引</li> <li><a href="../help-doc.html">帮助</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="index-3.html">上一个字母</a></li> <li><a href="index-5.html">下一个字母</a></li> </ul> <ul class="navList"> <li><a href="../index.html?index-files/index-4.html" target="_top">框架</a></li> <li><a href="index-4.html" target="_top">无框架</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../allclasses-noframe.html">所有类</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> </body> </html>
{'content_hash': '36e7cc4973dd70aa81446e393ec0d201', 'timestamp': '', 'source': 'github', 'line_count': 232, 'max_line_length': 770, 'avg_line_length': 74.23706896551724, 'alnum_prop': 0.7189804331417291, 'repo_name': 'Aoyunyun/jpush-docs', 'id': 'e5b2bbf466a87e9d736d91aff40835a1fdc491ff', 'size': '19169', 'binary': False, 'copies': '3', 'ref': 'refs/heads/master', 'path': 'zh/jmessage/client/im_android_api_docs/index-files/index-4.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '143254'}, {'name': 'HTML', 'bytes': '7277764'}, {'name': 'JavaScript', 'bytes': '195949'}, {'name': 'Python', 'bytes': '4590'}, {'name': 'Shell', 'bytes': '2945'}]}
#include <arch_helpers.h> #include <assert.h> #include <bakery_lock.h> #include <bl_common.h> #include <context.h> #include <context_mgmt.h> #include <debug.h> #include <denver.h> #include <gic_v2.h> #include <interrupt_mgmt.h> #include <platform.h> #include <tegra_def.h> #include <tegra_private.h> DEFINE_BAKERY_LOCK(tegra_fiq_lock); /******************************************************************************* * Static variables ******************************************************************************/ static uint64_t ns_fiq_handler_addr; static unsigned int fiq_handler_active; static pcpu_fiq_state_t fiq_state[PLATFORM_CORE_COUNT]; /******************************************************************************* * Handler for FIQ interrupts ******************************************************************************/ static uint64_t tegra_fiq_interrupt_handler(uint32_t id, uint32_t flags, void *handle, void *cookie) { cpu_context_t *ctx = cm_get_context(NON_SECURE); el3_state_t *el3state_ctx = get_el3state_ctx(ctx); int cpu = plat_my_core_pos(); uint32_t irq; bakery_lock_get(&tegra_fiq_lock); /* * The FIQ was generated when the execution was in the non-secure * world. Save the context registers to start with. */ cm_el1_sysregs_context_save(NON_SECURE); /* * Save elr_el3 and spsr_el3 from the saved context, and overwrite * the context with the NS fiq_handler_addr and SPSR value. */ fiq_state[cpu].elr_el3 = read_ctx_reg(el3state_ctx, CTX_ELR_EL3); fiq_state[cpu].spsr_el3 = read_ctx_reg(el3state_ctx, CTX_SPSR_EL3); /* * Set the new ELR to continue execution in the NS world using the * FIQ handler registered earlier. */ assert(ns_fiq_handler_addr); write_ctx_reg(el3state_ctx, CTX_ELR_EL3, ns_fiq_handler_addr); /* * Mark this interrupt as complete to avoid a FIQ storm. */ irq = plat_ic_acknowledge_interrupt(); if (irq < 1022) plat_ic_end_of_interrupt(irq); bakery_lock_release(&tegra_fiq_lock); return 0; } /******************************************************************************* * Setup handler for FIQ interrupts ******************************************************************************/ void tegra_fiq_handler_setup(void) { uint64_t flags; int rc; /* return if already registered */ if (fiq_handler_active) return; /* * Register an interrupt handler for FIQ interrupts generated for * NS interrupt sources */ flags = 0; set_interrupt_rm_flag(flags, NON_SECURE); rc = register_interrupt_type_handler(INTR_TYPE_EL3, tegra_fiq_interrupt_handler, flags); if (rc) panic(); /* handler is now active */ fiq_handler_active = 1; } /******************************************************************************* * Validate and store NS world's entrypoint for FIQ interrupts ******************************************************************************/ void tegra_fiq_set_ns_entrypoint(uint64_t entrypoint) { ns_fiq_handler_addr = entrypoint; } /******************************************************************************* * Handler to return the NS EL1/EL0 CPU context ******************************************************************************/ int tegra_fiq_get_intr_context(void) { cpu_context_t *ctx = cm_get_context(NON_SECURE); gp_regs_t *gpregs_ctx = get_gpregs_ctx(ctx); el1_sys_regs_t *el1state_ctx = get_sysregs_ctx(ctx); int cpu = plat_my_core_pos(); uint64_t val; /* * We store the ELR_EL3, SPSR_EL3, SP_EL0 and SP_EL1 registers so * that el3_exit() sends these values back to the NS world. */ write_ctx_reg(gpregs_ctx, CTX_GPREG_X0, fiq_state[cpu].elr_el3); write_ctx_reg(gpregs_ctx, CTX_GPREG_X1, fiq_state[cpu].spsr_el3); val = read_ctx_reg(gpregs_ctx, CTX_GPREG_SP_EL0); write_ctx_reg(gpregs_ctx, CTX_GPREG_X2, val); val = read_ctx_reg(el1state_ctx, CTX_SP_EL1); write_ctx_reg(gpregs_ctx, CTX_GPREG_X3, val); return 0; }
{'content_hash': '018b19a27ee8c559c10cac6c56424a38', 'timestamp': '', 'source': 'github', 'line_count': 134, 'max_line_length': 80, 'avg_line_length': 29.350746268656717, 'alnum_prop': 0.5542842613780828, 'repo_name': 'sbranden/arm-trusted-firmware', 'id': '7fcc114c0624c9f7498ed9d6b6008613845a9209', 'size': '5489', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'plat/nvidia/tegra/common/tegra_fiq_glue.c', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Assembly', 'bytes': '583601'}, {'name': 'C', 'bytes': '3262969'}, {'name': 'C++', 'bytes': '67409'}, {'name': 'Makefile', 'bytes': '188703'}, {'name': 'Objective-C', 'bytes': '2286'}]}
Plugin.define "Sendcard" do author "Brendan Coles <[email protected]>" # 2011-03-15 version "0.1" description "Sendcard is a multi-database (It currently supports 9 different databases!) ecards script or virtual postcard program written in PHP. Suitable for large or small sites, it is very easy to setup, and comes with an installation wizard." website "http://www.sendcard.org/" # Google results as at 2011-03-15 # # 255 for scscsc320 # 141 for "Powered by sendcard - an advanced PHP e-card program" -dork # Dorks # dorks [ '"scscsc320"', '"Powered by sendcard - an advanced PHP e-card program" -dork' ] # Matches # matches [ # Powered by logo link { :regexp=>/<a href="http:\/\/(sendcard.sf.net|www.sendcard.org)\/"( title="download your own PHP e-card script")?><img src="poweredbysendcard102x47.gif"[^>]+alt="Powered by sendcard - an advanced PHP e-card program"[^>]*><\/a>/ }, # Powered by logo { :certainty=>25, :regexp=>/<img src="poweredbysendcard102x47.gif"[^>]+alt="Powered by sendcard - an advanced PHP e-card program">/ }, # HTML Comment { :text=>"<!-- The following line should allow me to search on google and find sendcard installations -->" }, # "scscsc320" string provided for Google hackers as per HTML comment: # <!-- The following line should allow me to search on google and find sendcard installations --> { :text=>'<div style="display: none; color: White;">scscsc320</div>' }, ] end
{'content_hash': 'a35083c153883f03f780719ff531005d', 'timestamp': '', 'source': 'github', 'line_count': 39, 'max_line_length': 247, 'avg_line_length': 36.38461538461539, 'alnum_prop': 0.7110641296687809, 'repo_name': 'Yukinoshita47/Yuki-Chan-The-Auto-Pentest', 'id': '77dc8022f9eecbfb14770b54a2738d79d0ed511c', 'size': '1664', 'binary': False, 'copies': '4', 'ref': 'refs/heads/master', 'path': 'Module/WhatWeb/plugins/sendcard.rb', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'HTML', 'bytes': '36211'}, {'name': 'JavaScript', 'bytes': '3038'}, {'name': 'Makefile', 'bytes': '1360'}, {'name': 'Perl', 'bytes': '108876'}, {'name': 'Python', 'bytes': '3034585'}, {'name': 'Roff', 'bytes': '6738'}, {'name': 'Ruby', 'bytes': '2693582'}, {'name': 'Shell', 'bytes': '53755'}, {'name': 'XSLT', 'bytes': '5475'}]}
using namespace boost::python; using namespace GafferUIBindings; using namespace GafferUI; struct NodeGadgetCreator { NodeGadgetCreator( object fn ) : m_fn( fn ) { } NodeGadgetPtr operator()( Gaffer::NodePtr node ) { IECorePython::ScopedGILLock gilLock; NodeGadgetPtr result = extract<NodeGadgetPtr>( m_fn( node ) ); return result; } private : object m_fn; }; static void registerNodeGadget( IECore::TypeId nodeType, object creator ) { NodeGadget::registerNodeGadget( nodeType, NodeGadgetCreator( creator ) ); } static Gaffer::NodePtr node( NodeGadget &nodeGadget ) { return nodeGadget.node(); } void GafferUIBindings::bindNodeGadget() { typedef NodeGadgetWrapper<NodeGadget> Wrapper; IE_CORE_DECLAREPTR( Wrapper ); NodeGadgetClass<NodeGadget, WrapperPtr>() .def( "node", &node ) .def( "create", &NodeGadget::create ).staticmethod( "create" ) .def( "registerNodeGadget", &registerNodeGadget ).staticmethod( "registerNodeGadget" ) ; }
{'content_hash': 'b03efdedcd10c91e68db05ee4b2a9ce2', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 88, 'avg_line_length': 21.666666666666668, 'alnum_prop': 0.7323076923076923, 'repo_name': 'davidsminor/gaffer', 'id': 'a5bc00d968cbfbe477a92edc7d487d2655f1afda', 'size': '3104', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'src/GafferUIBindings/NodeGadgetBinding.cpp', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '9286'}, {'name': 'C++', 'bytes': '3358250'}, {'name': 'COBOL', 'bytes': '64449'}, {'name': 'CSS', 'bytes': '28027'}, {'name': 'Python', 'bytes': '3267354'}, {'name': 'Shell', 'bytes': '7055'}, {'name': 'Slash', 'bytes': '35200'}]}
SYNONYM #### According to The Catalogue of Life, 3rd January 2011 #### Published in null #### Original name null ### Remarks null
{'content_hash': '4a36ae6a2cb1fdfc88bba833ad633512', 'timestamp': '', 'source': 'github', 'line_count': 13, 'max_line_length': 39, 'avg_line_length': 10.23076923076923, 'alnum_prop': 0.6917293233082706, 'repo_name': 'mdoering/backbone', 'id': '5f083f0131bb95cb5adce1dd72d19debc17ef419', 'size': '186', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'life/Plantae/Magnoliophyta/Liliopsida/Poales/Cyperaceae/Carex/Carex austroalpina/ Syn. Carex sempervirens tenax/README.md', 'mode': '33188', 'license': 'apache-2.0', 'language': []}
package com.lfk.justwetools.View.NewPaint; import android.app.Application; import java.util.ArrayList; /** * Created by liufengkai on 15/8/25. */ public class PathNode extends Application{ public class Node{ public Node() {} public float x; public float y; public int PenColor; public int TouchEvent; public int PenWidth; public boolean IsPaint; public long time; public int EraserWidth; } private ArrayList<Node> PathList; public ArrayList<Node> getPathList() { return PathList; } public void addNode(Node node){ PathList.add(node); } public Node NewAnode(){ return new Node(); } public void clearList(){ PathList.clear(); } @Override public void onCreate() { super.onCreate(); PathList = new ArrayList<Node>(); } public void setPathList(ArrayList<Node> pathList) { PathList = pathList; } public Node getTheLastNote(){ return PathList.get(PathList.size()-1); } public void deleteTheLastNote(){ PathList.remove(PathList.size()-1); } public PathNode() { PathList = new ArrayList<Node>(); } }
{'content_hash': '068a025dc9c566f5ebea5e91fdc4b62a', 'timestamp': '', 'source': 'github', 'line_count': 64, 'max_line_length': 55, 'avg_line_length': 19.5, 'alnum_prop': 0.5985576923076923, 'repo_name': 'xxzj990/Reader', 'id': 'c61ac53384e81f8b78f2c7a16495fba5202238e3', 'size': '1248', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'app/src/main/java/com/lfk/justwetools/View/NewPaint/PathNode.java', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '30096'}, {'name': 'HTML', 'bytes': '962'}, {'name': 'Java', 'bytes': '267523'}, {'name': 'JavaScript', 'bytes': '24085'}]}
<head> <!-- Plotly.js --> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> </head> <!-- Plots go in blank <div> elements. You can size them in the plot layout, or give the div a size as shown here. --> <div id="myDiv" style="width:90%;height:550px;"></div> <script> Plotly.d3.csv('https://data.sfgov.org/resource/tvq9-ec9w.csv', function(err, rows){ function unpack(rows, key) { return rows.map(function(row) { if (row["case_disposition"] == "Confirmed"){ return row[key]; }; }); } casesDict = {} deathDict = {} var i; for (i = 0; i < rows.length; i++) { if (rows[i]["case_disposition"] == "Confirmed"){ currDate = rows[i]["date"] currCases = parseInt(rows[i]["case_count"]) if (currDate in casesDict) { casesDict[currDate] += currCases } else { casesDict[currDate] = currCases } } if (rows[i]["case_disposition"] == "Death"){ currDate = rows[i]["date"] currCases = parseInt(rows[i]["case_count"]) if (currDate in deathDict) { deathDict[currDate] += currCases } else { deathDict[currDate] = currCases } } } var casesData = { type: "scatter", mode: "lines", name: 'New cases per day', x: Object.keys(casesDict), y: Object.values(casesDict), line: {color: '#1279ED'} } var deathData = { type: "bar", mode: "lines", name: 'New deaths per day', x: Object.keys(deathDict), y: Object.values(deathDict), line: {color: '#B5DD02'} } //data = [casesData] data = [casesData, deathData] var layout = { title: 'SF COVID-19 Confirmed New Cases By Day', xaxis: { type: 'date', title: { automargin: true, text: "Date" } }, yaxis: { title: { automargin: true, text: "New cases" } }, }; Plotly.plot(myDiv, data, layout); }) </script> <p> Data from - <a href="https://data.sfgov.org/stories/s/fjki-2fab">San Francisco COVID-19 Data Tracker</a> <br> Powered by their <a href="https://data.sfgov.org/COVID-19/COVID-19-Cases-Summarized-by-Date-Transmission-and/tvq9-ec9w"> API</a> </p>
{'content_hash': 'fea9ad793f6e7ffc8feac5c90eca7972', 'timestamp': '', 'source': 'github', 'line_count': 101, 'max_line_length': 132, 'avg_line_length': 21.019801980198018, 'alnum_prop': 0.5925577013659915, 'repo_name': 'richieM/richieM.github.io', 'id': 'f16de43944991bedf7cbe4a76e400e96f9ce33db', 'size': '2123', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'SF-COVID/index.html', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'CSS', 'bytes': '222889'}, {'name': 'HTML', 'bytes': '5423416'}, {'name': 'JavaScript', 'bytes': '13239197'}, {'name': 'SCSS', 'bytes': '58835'}]}
<?php /** * Модуль для работы с сессиями пользователей */ /** * @return array настройки шардов хранения сессий пользователя */ function session_config() { return [ [ 'host' => 'cachesession1', ], [ 'host' => 'cachesession2', ], ]; } /** * @return mixed соединение с пулом кешей хранения сессий пользователя */ function session_getconnection() { $connection = null; $config = session_config(); foreach($config as $v) { if (is_null($connection)) { $connection = memcache_connect($v['host']); } else { memcache_add_server($connection, $v['host']); } } return $connection; } /** * Функция получения данных сессии * @param string $sessionId идентификатор сессии * @return mixed данные и сессии */ function session_get($sessionId) { $connection = session_getconnection(); return memcache_get($connection, $sessionId); }
{'content_hash': '285d4004f32f53d750a7ad0c9521d6ab', 'timestamp': '', 'source': 'github', 'line_count': 45, 'max_line_length': 70, 'avg_line_length': 21.6, 'alnum_prop': 0.588477366255144, 'repo_name': 'alxmslwork/order', 'id': '551690cbabddd35aba6898f0f739a64d571d5f5e', 'size': '1157', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'source/ordr/session/session.php', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'HTML', 'bytes': '11281'}, {'name': 'Nginx', 'bytes': '51'}, {'name': 'PHP', 'bytes': '80832'}, {'name': 'Shell', 'bytes': '4738'}]}
<?php error_reporting(E_STRICT | E_ALL); // You can set the include path to src directory or reference // DfpUser.php directly via require_once. // $path = '/path/to/dfp_api_php_lib/src'; $path = dirname(__FILE__) . '/../../../../src'; set_include_path(get_include_path() . PATH_SEPARATOR . $path); require_once 'Google/Api/Ads/Dfp/Lib/DfpUser.php'; require_once dirname(__FILE__) . '/../../../Common/ExampleUtils.php'; try { // Get DfpUser from credentials in "../auth.ini" // relative to the DfpUser.php file's directory. $user = new DfpUser(); // Log SOAP XML request and response. $user->LogDefaults(); // Get the TeamService. $teamService = $user->GetService('TeamService', 'v201502'); // Create an array to store local team objects. $teams = array(); for ($i = 0; $i < 5; $i++) { $team = new Team(); $team->name = 'Team #' . uniqid(); $team->hasAllCompanies = false; $team->hasAllInventory = false; $teams[] = $team; } // Create the teams on the server. $teams = $teamService->createTeams($teams); // Display results. if (isset($teams)) { foreach ($teams as $team) { print 'A team with ID "' . $team->id . '" and name "'. $team->name . '" was created."' . "\n"; } } else { print "No teams created.\n"; } } catch (OAuth2Exception $e) { ExampleUtils::CheckForOAuth2Errors($e); } catch (ValidationException $e) { ExampleUtils::CheckForOAuth2Errors($e); } catch (Exception $e) { print $e->getMessage() . "\n"; }
{'content_hash': 'fd625e16de48a27d137bbf9ac82132c4', 'timestamp': '', 'source': 'github', 'line_count': 56, 'max_line_length': 69, 'avg_line_length': 27.196428571428573, 'alnum_prop': 0.6080105055810899, 'repo_name': 'Adslive/googleads-php-lib', 'id': 'c9d76efb943be05bb090688f27fdb130b7e3934e', 'size': '2558', 'binary': False, 'copies': '5', 'ref': 'refs/heads/master', 'path': 'examples/Dfp/v201502/TeamService/CreateTeams.php', 'mode': '33261', 'license': 'apache-2.0', 'language': [{'name': 'PHP', 'bytes': '45961097'}, {'name': 'XSLT', 'bytes': '17842'}]}
extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. project = u'django-cruds-adminlte' copyright = u'2017, Óscar M. Lage' author = u'Óscar M. Lage' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = u'0.0.3' # The full version, including alpha/beta/rc tags. release = u'0.0.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # # html_theme_options = {} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. htmlhelp_basename = 'django-cruds-adminltedoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'django-cruds-adminlte.tex', u'django-cruds-adminlte Documentation', u'Óscar M. Lage', 'manual'), ] # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'django-cruds-adminlte', u'django-cruds-adminlte Documentation', [author], 1) ] # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'django-cruds-adminlte', u'django-cruds-adminlte Documentation', author, 'django-cruds-adminlte', 'One line description of project.', 'Miscellaneous'), ]
{'content_hash': '5535439e650c68c140006eabd35e66d3', 'timestamp': '', 'source': 'github', 'line_count': 124, 'max_line_length': 78, 'avg_line_length': 30.588709677419356, 'alnum_prop': 0.6659636171895598, 'repo_name': 'luisza/django-cruds-adminlte', 'id': '719ef65b9b562727198456bdb6e17ae819513028', 'size': '4862', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/conf.py', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'CSS', 'bytes': '246689'}, {'name': 'HTML', 'bytes': '75891'}, {'name': 'JavaScript', 'bytes': '246595'}, {'name': 'Python', 'bytes': '57039'}]}
using System; using System.Linq; using System.Linq.Expressions; using System.Reflection; namespace Naxis.Core.Extensions { /// <summary> /// Type扩展 /// </summary> public static class TypeExtensions { /// <summary> /// 返回类型的实例 /// </summary> /// <param name="type"></param> /// <param name="args"></param> /// <returns></returns> public static object CreateInstance(this Type type, params object[] args) { return Activator.CreateInstance(type, args); } /// <summary> /// 返回泛型的实例 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="type"></param> /// <param name="args"></param> /// <returns></returns> public static T CreateInstance<T>(this Type type, params object[] args) { return (T)type.CreateInstance(args); } /// <summary> /// 获取属性信息 /// </summary> /// <param name="expression"></param> /// <returns></returns> public static MemberInfo GetMemberInfo(this Expression expression) { var lambda = (LambdaExpression)expression; MemberExpression memberExpression; var body = lambda.Body as UnaryExpression; if (body != null) { var unaryExpression = body; memberExpression = (MemberExpression)unaryExpression.Operand; } else { memberExpression = (MemberExpression)lambda.Body; } return memberExpression.Member; } /// <summary> /// 类型是否有指定特性 /// </summary> /// <param name="type"></param> /// <param name="attributeType"></param> /// <returns></returns> public static bool HasAttribute(this Type type, Type attributeType) { return type.GetCustomAttributes(attributeType, false).Length > 0; } /// <summary> /// 方法是否有指定特性 /// </summary> /// <param name="type"></param> /// <param name="attributeType"></param> /// <returns></returns> public static bool HasMethodsWithAttribute(this Type type, Type attributeType) { return type.GetMethods().Any(methodInfo => methodInfo.GetCustomAttributes(attributeType, false).Length > 0); } /// <summary> /// 属性是否有指定特性 /// </summary> /// <param name="methodInfo"></param> /// <param name="attributeType"></param> /// <returns></returns> public static bool HasAttribute(this MethodInfo methodInfo, Type attributeType) { return methodInfo.GetCustomAttributes(attributeType, false).Length > 0; } /// <summary> /// 是否能转换到另一个类型 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="type"></param> /// <returns></returns> public static bool CanBeCastTo<T>(this Type type) { if (type == null) { return false; } var destinationType = typeof(T); return CanBeCastTo(type, destinationType); } /// <summary> /// 是否能转换到另一个类型 /// </summary> /// <param name="type"></param> /// <param name="destinationType"></param> /// <returns></returns> public static bool CanBeCastTo(this Type type, Type destinationType) { if (type == null) { return false; } return type == destinationType || destinationType.IsAssignableFrom(type); } /// <summary> /// 是否对象实例 /// </summary> /// <param name="type"></param> /// <returns></returns> public static bool IsConcrete(this Type type) { if (type == null) { return false; } return !type.IsAbstract && !type.IsInterface; } /// <summary> /// 非对象实例(接口/抽象类) /// </summary> /// <param name="type"></param> /// <returns></returns> public static bool IsNotConcrete(this Type type) { return !type.IsConcrete(); } } }
{'content_hash': '1f0bb5e0d76dfb38c38809bbb5f05b84', 'timestamp': '', 'source': 'github', 'line_count': 154, 'max_line_length': 120, 'avg_line_length': 28.42207792207792, 'alnum_prop': 0.5058259081562714, 'repo_name': 'swpudp/Naxis', 'id': 'dbcd299964c6dd269767ada0ffd079b670dc2cb3', 'size': '4553', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'Naxis.Common/Extensions/TypeExtensions.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'ASP', 'bytes': '96'}, {'name': 'C#', 'bytes': '994969'}, {'name': 'CSS', 'bytes': '842932'}, {'name': 'HTML', 'bytes': '167343'}, {'name': 'JavaScript', 'bytes': '610860'}, {'name': 'TypeScript', 'bytes': '394'}]}
// // (C) Jan de Vaan 2007-2010, all rights reserved. See the accompanying "License.txt" for licensed use. // #ifndef JLS_INTERFACE #define JLS_INTERFACE #include "pubtypes.h" #include "dcmtk/ofstd/ofstd.h" /* for size_t */ #include "dcmtk/ofstd/ofdefine.h" /* for DCMTK_DECL_EXPORT */ #ifdef charls_EXPORTS #define DCMTK_CHARLS_EXPORT DCMTK_DECL_EXPORT #else #define DCMTK_CHARLS_EXPORT DCMTK_DECL_IMPORT #endif #ifndef CHARLS_IMEXPORT #define CHARLS_IMEXPORT(returntype) DCMTK_CHARLS_EXPORT returntype #endif #ifdef __cplusplus extern "C" { #endif CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsEncode(void* compressedData, size_t compressedLength, size_t* pcbyteWritten, const void* uncompressedData, size_t uncompressedLength, struct JlsParameters* pparams); CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsDecode(void* uncompressedData, size_t uncompressedLength, const void* compressedData, size_t compressedLength, struct JlsParameters* info); CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsDecodeRect(void* uncompressedData, size_t uncompressedLength, const void* compressedData, size_t compressedLength, struct JlsRect rect, struct JlsParameters* info); CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsReadHeader(const void* uncompressedData, size_t uncompressedLength, struct JlsParameters* pparams); CHARLS_IMEXPORT(enum JLS_ERROR) JpegLsVerifyEncode(const void* uncompressedData, size_t uncompressedLength, const void* compressedData, size_t compressedLength); #ifdef __cplusplus } #endif #endif
{'content_hash': 'd1ccf9eaad720240f7bd9c719eccb932', 'timestamp': '', 'source': 'github', 'line_count': 51, 'max_line_length': 116, 'avg_line_length': 29.705882352941178, 'alnum_prop': 0.7768976897689769, 'repo_name': 'NCIP/annotation-and-image-markup', 'id': '1a7bd4b9259183c2270e10dd26578801ee7ae0d1', 'size': '1515', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'AIMToolkit_v4.1.0_rv44/source/dcmtk-3.6.1_20121102/dcmjpls/libcharls/intrface.h', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'C', 'bytes': '31363450'}, {'name': 'C#', 'bytes': '5152916'}, {'name': 'C++', 'bytes': '148605530'}, {'name': 'CSS', 'bytes': '85406'}, {'name': 'Java', 'bytes': '2039090'}, {'name': 'Objective-C', 'bytes': '381107'}, {'name': 'Perl', 'bytes': '502054'}, {'name': 'Shell', 'bytes': '11832'}, {'name': 'Tcl', 'bytes': '30867'}]}
'use strict'; // global events var EVENTS = require('../events'); var ViewModel = require('./models/getFeatureInfo'); var View = require('./views/getFeatureInfo'); var UI_Panel = require('./panel'); var Controller = function(options) { // initialize VM, and that's all a controller should EVER do, everything // else is handled by the vm and model this.vm = new ViewModel(options); }; var GetFeatureInfo = function(options) { this.options = { // initial module options }; // override and extend default options for (var opt in options) { if (options.hasOwnProperty(opt)) { this.options[opt] = options[opt]; } } this.init(); return { controller: this.controller, view: this.view }; }; GetFeatureInfo.prototype = { init: function() { var gfi_controller = new Controller(this.options); var gfi_view = View; var panel = new UI_Panel(this.options, { title: 'Rezultati', component: {controller: gfi_controller, view: gfi_view}, width: '200px', top: '56px', right: '10px' }); this.controller = panel.controller; this.view = panel.view; EVENTS.on('getFeatureInfo.results', function(options) { gfi_controller.vm.set(options.features); }); gfi_controller.vm.events.on('results.show', function(options) { panel.controller.vm.show(); }); gfi_controller.vm.events.on('results.hide', function(options) { panel.controller.vm.hide(); }); gfi_controller.vm.events.on('result.click', function(options) { EVENTS.emit('getFeatureInfo.result.clicked', options); }); panel.controller.vm.events.on('panel.closed', function () { EVENTS.emit('getFeatureInfo.results.closed'); }); EVENTS.on('getFeatureInfo.tool.deactivate', function () { panel.controller.vm.hide(); }); } }; module.exports = GetFeatureInfo;
{'content_hash': '93412c864f5f8d7c266ca53c0bb1a596', 'timestamp': '', 'source': 'github', 'line_count': 80, 'max_line_length': 76, 'avg_line_length': 26.025, 'alnum_prop': 0.5840537944284342, 'repo_name': 'candela-it/sunlumo', 'id': 'c849c6d2067692610e72c2863f156a0621516057', 'size': '2082', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'django_project/lib_js/lib/ui/getFeatureInfo.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '394728'}, {'name': 'HTML', 'bytes': '2964'}, {'name': 'JavaScript', 'bytes': '364730'}, {'name': 'Python', 'bytes': '99692'}, {'name': 'Ruby', 'bytes': '900'}, {'name': 'Shell', 'bytes': '446'}]}
<!doctype html> <html> <title>npm-init</title> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="../../static/style.css"> <link rel="canonical" href="https://www.npmjs.org/doc/cli/npm-init.html"> <script async=true src="../../static/toc.js"></script> <body> <div id="wrapper"> <h1><a href="../cli/npm-init.html">npm-init</a></h1> <p>create a package.json file</p> <h2 id="synopsis">SYNOPSIS</h2> <pre><code>npm init [--force|-f|--yes|-y|--scope] npm init &lt;@scope&gt; (same as `npx &lt;@scope&gt;/create`) npm init [&lt;@scope&gt;/]&lt;name&gt; (same as `npx [&lt;@scope&gt;/]create-&lt;name&gt;`)</code></pre><h2 id="examples">EXAMPLES</h2> <p>Create a new React-based project using <a href="https://npm.im/create-react-app"><code>create-react-app</code></a>:</p> <pre><code>$ npm init react-app ./my-react-app</code></pre><p>Create a new <code>esm</code>-compatible package using <a href="https://npm.im/create-esm"><code>create-esm</code></a>:</p> <pre><code>$ mkdir my-esm-lib &amp;&amp; cd my-esm-lib $ npm init esm --yes</code></pre><p>Generate a plain old package.json using legacy init:</p> <pre><code>$ mkdir my-npm-pkg &amp;&amp; cd my-npm-pkg $ git init $ npm init</code></pre><p>Generate it without having it ask any questions:</p> <pre><code>$ npm init -y</code></pre><h2 id="description">DESCRIPTION</h2> <p><code>npm init &lt;initializer&gt;</code> can be used to set up a new or existing npm package.</p> <p><code>initializer</code> in this case is an npm package named <code>create-&lt;initializer&gt;</code>, which will be installed by <a href="https://npm.im/npx"><code><a href="../cli/npx.html">npx(1)</a></code></a>, and then have its main bin executed -- presumably creating or updating <code>package.json</code> and running any other initialization-related operations.</p> <p>The init command is transformed to a corresponding <code>npx</code> operation as follows:</p> <ul> <li><code>npm init foo</code> -&gt; <code>npx create-foo</code></li> <li><code>npm init @usr/foo</code> -&gt; <code>npx @usr/create-foo</code></li> <li><code>npm init @usr</code> -&gt; <code>npx @usr/create</code></li> </ul> <p>Any additional options will be passed directly to the command, so <code>npm init foo --hello</code> will map to <code>npx create-foo --hello</code>.</p> <p>If the initializer is omitted (by just calling <code>npm init</code>), init will fall back to legacy init behavior. It will ask you a bunch of questions, and then write a package.json for you. It will attempt to make reasonable guesses based on existing fields, dependencies, and options selected. It is strictly additive, so it will keep any fields and values that were already set. You can also use <code>-y</code>/<code>--yes</code> to skip the questionnaire altogether. If you pass <code>--scope</code>, it will create a scoped package.</p> <h2 id="see-also">SEE ALSO</h2> <ul> <li><a href="https://github.com/isaacs/init-package-json">https://github.com/isaacs/init-package-json</a></li> <li><a href="../files/package.json.html">package.json(5)</a></li> <li><a href="../cli/npm-version.html">npm-version(1)</a></li> <li><a href="../misc/npm-scope.html">npm-scope(7)</a></li> </ul> </div> <table border=0 cellspacing=0 cellpadding=0 id=npmlogo> <tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18>&nbsp;</td></tr> <tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td colspan=6 style="width:60px;height:10px;background:#fff">&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td></tr> <tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2>&nbsp;</td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td></tr> <tr><td style="width:10px;height:10px;background:#fff" rowspan=2>&nbsp;</td></tr> <tr><td style="width:10px;height:10px;background:#fff">&nbsp;</td></tr> <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr> <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr> </table> <p id="footer">npm-init &mdash; [email protected]</p>
{'content_hash': 'b814ace278ccc8d889d4d84a040e636a', 'timestamp': '', 'source': 'github', 'line_count': 65, 'max_line_length': 807, 'avg_line_length': 82.63076923076923, 'alnum_prop': 0.7013591509960901, 'repo_name': 'joegesualdo/dotfiles', 'id': 'af9d321cf10c183d2fbc88d707f9c2a8e834ab02', 'size': '5371', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'npm-global/lib/node_modules/npm/html/doc/cli/npm-init.html', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '712'}, {'name': 'CoffeeScript', 'bytes': '386'}, {'name': 'Elm', 'bytes': '332785'}, {'name': 'JavaScript', 'bytes': '115864'}, {'name': 'Ruby', 'bytes': '5718'}, {'name': 'Shell', 'bytes': '24929'}, {'name': 'Vim script', 'bytes': '90842'}]}
.. aiohttp documentation master file, created by sphinx-quickstart on Wed Mar 5 12:35:35 2014. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. aiohttp ======= HTTP client/server for :term:`asyncio` (:pep:`3156`). .. _GitHub: https://github.com/KeepSafe/aiohttp .. _Freenode: http://freenode.net Features -------- - Supports both :ref:`aiohttp-client` and :ref:`HTTP Server <aiohttp-web>`. - Supports both :ref:`Server WebSockets <aiohttp-web-websockets>` and :ref:`Client WebSockets <aiohttp-client-websockets>` out-of-the-box. - Web-server has :ref:`aiohttp-web-middlewares`, :ref:`aiohttp-web-signals` and pluggable routing. Library Installation -------------------- :: $ pip install aiohttp You may want to install *optional* :term:`cchardet` library as faster replacement for :term:`chardet`:: $ pip install cchardet Getting Started --------------- Client example:: import asyncio import aiohttp async def fetch_page(session, url): with aiohttp.Timeout(10): async with session.get(url) as response: assert response.status == 200 return await response.read() loop = asyncio.get_event_loop() with aiohttp.ClientSession(loop=loop) as session: content = loop.run_until_complete( fetch_page(session, 'http://python.org')) print(content) Server example:: from aiohttp import web async def handle(request): name = request.match_info.get('name', "Anonymous") text = "Hello, " + name return web.Response(body=text.encode('utf-8')) app = web.Application() app.router.add_route('GET', '/{name}', handle) web.run_app(app) .. note:: Throughout this documentation, examples utilize the `async/await` syntax introduced by :pep:`492` that is only valid for Python 3.5+. If you are using Python 3.4, please replace ``await`` with ``yield from`` and ``async def`` with a ``@coroutine`` decorator. For example, this:: async def coro(...): ret = await f() should be replaced by:: @asyncio.coroutine def coro(...): ret = yield from f() Source code ----------- The project is hosted on GitHub_ Please feel free to file an issue on the `bug tracker <https://github.com/KeepSafe/aiohttp/issues>`_ if you have found a bug or have some suggestion in order to improve the library. The library uses `Travis <https://travis-ci.org/KeepSafe/aiohttp>`_ for Continuous Integration. Dependencies ------------ - Python Python 3.4.1+ - *chardet* library - *Optional* :term:`cchardet` library as faster replacement for :term:`chardet`. Install it explicitly via:: $ pip install cchardet Discussion list --------------- *aio-libs* google group: https://groups.google.com/forum/#!forum/aio-libs Feel free to post your questions and ideas here. Contributing ------------ Please read the :ref:`instructions for contributors<aiohttp-contributing>` before making a Pull Request. Authors and License ------------------- The ``aiohttp`` package is written mostly by Nikolay Kim and Andrew Svetlov. It's *Apache 2* licensed and freely available. Feel free to improve this package and send a pull request to GitHub_. Contents -------- .. toctree:: client client_reference web web_reference server multidict multipart api logging gunicorn faq new_router contributing changes glossary Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` .. disqus::
{'content_hash': 'ec27cce6b36b5d6bed4a4728df978ac9', 'timestamp': '', 'source': 'github', 'line_count': 167, 'max_line_length': 76, 'avg_line_length': 21.802395209580837, 'alnum_prop': 0.6550398242241142, 'repo_name': 'decentfox/aiohttp', 'id': '3117ab2550044523d559d9c759cc6fd0df4bbdd4', 'size': '3641', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'docs/index.rst', 'mode': '33188', 'license': 'apache-2.0', 'language': [{'name': 'Batchfile', 'bytes': '838'}, {'name': 'CSS', 'bytes': '112'}, {'name': 'HTML', 'bytes': '1060'}, {'name': 'Makefile', 'bytes': '2272'}, {'name': 'PLpgSQL', 'bytes': '765'}, {'name': 'Python', 'bytes': '995177'}, {'name': 'Shell', 'bytes': '550'}]}
var mraa = require('mraa'); function Womprat(config){ if(!this.config) this.config = config; }; Womprat.prototype.constructor = womprat; /* contrains a value to a minimum and maximum range * @param {Number} value * @param {Number} min * @param {Number} max * @return {Number} */ Womprat.prototype.constrain = function (value, min, max){ if(value < min) return min; else if (value > max) return max; else return value; }; /* maps a value from an old range to a new range * @param {Number} x * @param {Number} in_min * @param {Number} in_max * @param {Number} out_min * @param {Number} out_max * @return {Number} */ Womprat.prototype.map = function (x, in_min, in_max, out_min, out_max){ return(x-in_min)*(out_max - out_min)/(in_max - in_min)+out_min; }; module.exports = Womprat;
{'content_hash': 'dee5935dadf0f3eaeb1797f0a0e722ab', 'timestamp': '', 'source': 'github', 'line_count': 32, 'max_line_length': 71, 'avg_line_length': 25.46875, 'alnum_prop': 0.6539877300613497, 'repo_name': 'Foxman13/womprat', 'id': 'ac42f1303778fa3d2500bd72ba797fb8bc697915', 'size': '815', 'binary': False, 'copies': '2', 'ref': 'refs/heads/master', 'path': 'js/index.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'JavaScript', 'bytes': '947'}]}
(function() { 'use strict'; var root = this; root.define([ 'views/edit/contact', 'models/contact' ], function( EditContact, Contact ) { describe('EditContact Itemview', function () { it('should be an instance of EditContact Itemview', function () { var contact = new Contact({ firstName: 'Foo', lastName: 'Bar', phoneNumber: '0000000000' }); var editContact = new EditContact({ model: contact }); expect( editContact ).to.be.an.instanceOf( EditContact ); }); }); }); }).call( this );
{'content_hash': 'b1ffeeee9d0edf70edb0aad56c7ed211', 'timestamp': '', 'source': 'github', 'line_count': 27, 'max_line_length': 81, 'avg_line_length': 29.62962962962963, 'alnum_prop': 0.41625, 'repo_name': 'shaine/marionette-gentle-introduction-requirejs', 'id': '3a5e4e557fff20804e438aefef1e38654e4a5870', 'size': '800', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'test/spec/views/edit/contact.js', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'CSS', 'bytes': '181878'}, {'name': 'JavaScript', 'bytes': '63052'}]}
using System; using System.Linq; using Microsoft.VisualStudio.Language.StandardClassification; namespace ILSupport { public static partial class ILParser { private class Span { public Span ( string @class, string start, string end, string escape = null ) { Class = @class; Start = start; End = end; Escape = escape; } public readonly string Class; public readonly string Start; public readonly string End; public readonly string Escape; } private static Span IdentifySpan ( string text, int position ) { var part = text.Substring ( position, Math.Min ( spanStartMaxLength, text.Length - position ) ); foreach ( var span in spans ) if ( part.StartsWith ( span.Start ) ) return span; return null; } private static readonly Span [ ] spans = { new Span ( PredefinedClassificationTypeNames.Comment, "/*", "*/", null ), new Span ( PredefinedClassificationTypeNames.Comment, "//", "\n", null ), new Span ( PredefinedClassificationTypeNames.String, "@\"", "\"", "\"\"" ), new Span ( PredefinedClassificationTypeNames.String, "\"", "\"", "\\\"" ), new Span ( PredefinedClassificationTypeNames.Character, "'", "'", "\\\'" ) }; private static readonly int spanStartMaxLength = spans.Max ( s => s.Start.Length ); } }
{'content_hash': '0261a301cd077685a561dacb9d79d96d', 'timestamp': '', 'source': 'github', 'line_count': 44, 'max_line_length': 131, 'avg_line_length': 40.43181818181818, 'alnum_prop': 0.4867903316469927, 'repo_name': 'ins0mniaque/ILSupport', 'id': 'a9ccc0edcb3c15d2def5443d56d8238348fbead3', 'size': '1779', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'IL Support/Parser/Parser.span.cs', 'mode': '33188', 'license': 'mit', 'language': [{'name': 'C#', 'bytes': '47122'}, {'name': 'F#', 'bytes': '1132'}, {'name': 'Visual Basic .NET', 'bytes': '16886'}]}
namespace CefSharp { /// <summary> /// The manner in which a link click should be opened. /// </summary> public enum WindowOpenDisposition { /// <summary> /// An enum constant representing the unknown option. /// </summary> Unknown, /// <summary> /// An enum constant representing the current tab option. /// </summary> CurrentTab, /// <summary> /// Indicates that only one tab with the url should exist in the same window /// </summary> SingletonTab, /// <summary> /// An enum constant representing the new foreground tab option. /// </summary> NewForegroundTab, /// <summary> /// An enum constant representing the new background tab option. /// </summary> NewBackgroundTab, /// <summary> /// An enum constant representing the new popup option. /// </summary> NewPopup, /// <summary> /// An enum constant representing the new window option. /// </summary> NewWindow, /// <summary> /// An enum constant representing the save to disk option. /// </summary> SaveToDisk, /// <summary> /// An enum constant representing the off the record option. /// </summary> OffTheRecord, /// <summary> /// An enum constant representing the ignore action option. /// </summary> IgnoreAction } }
{'content_hash': '61dbebd8c86f0b05e34583980201e383', 'timestamp': '', 'source': 'github', 'line_count': 49, 'max_line_length': 84, 'avg_line_length': 31.06122448979592, 'alnum_prop': 0.5440210249671484, 'repo_name': 'Livit/CefSharp', 'id': 'c2722845bd36a635ad5939606fa575f56a0c392a', 'size': '1691', 'binary': False, 'copies': '1', 'ref': 'refs/heads/master', 'path': 'CefSharp/Enums/WindowOpenDisposition.cs', 'mode': '33188', 'license': 'bsd-3-clause', 'language': [{'name': 'Batchfile', 'bytes': '335'}, {'name': 'C#', 'bytes': '919437'}, {'name': 'C++', 'bytes': '468798'}, {'name': 'CSS', 'bytes': '92244'}, {'name': 'HTML', 'bytes': '85258'}, {'name': 'JavaScript', 'bytes': '2653'}, {'name': 'PowerShell', 'bytes': '9677'}]}