code
stringlengths
3
1.05M
repo_name
stringlengths
4
116
path
stringlengths
3
942
language
stringclasses
30 values
license
stringclasses
15 values
size
int32
3
1.05M
<html> <head> <title> We will not be silenced </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <?php include "../../legacy-includes/Script.htmlf" ?> </head> <body bgcolor="#FFFFCC" text="000000" link="990000" vlink="660000" alink="003366" leftmargin="0" topmargin="0"> <table width="744" cellspacing="0" cellpadding="0" border="0"> <tr><td width="474"><a name="Top"></a><?php include "../../legacy-includes/TopLogo.htmlf" ?></td> <td width="270"><?php include "../../legacy-includes/TopAd.htmlf" ?> </td></tr></table> <table width="744" cellspacing="0" cellpadding="0" border="0"> <tr><td width="18" bgcolor="FFCC66"></td> <td width="108" bgcolor="FFCC66" valign=top><?php include "../../legacy-includes/LeftButtons.htmlf" ?></td> <td width="18"></td> <td width="480" valign="top"> <?php include "../../legacy-includes/BodyInsert.htmlf" ?> <font face="Arial, Helvetica, sans-serif" size="2"><b>VIEWS AND VOICES</b></font><br> <font face="Times New Roman, Times, serif" size="4">Left-wing writing purged from Kent State newspaper</font><br> <font face="Times New Roman, Times, serif" size="5"><b>We will not be silenced</b></font><p> <font face="Arial, Helvetica, sans-serif" size="2">April 14, 2006 | Page 4</font><p> <font face="Times New Roman, Times, serif" size="3">ALL COLLEGE students think the campus newspaper is the worst around, but students at Kent State University have a firm foundation for that belief. <p> Last semester, letters to the editor from progressive students submitted to the <i>Daily Kent Stater</i> were edited to death, or not printed at all. The editorial board strictly followed conservative ideology. Very few of the left-minded columnists wrote anything remotely political. Much of this right-wing governance continues. Moreover, the <i>Stater</i> has shown a reluctance to employ progressives and a tendency to censor those it does hire. <p> From August to December of last year, I wrote for the <i>Stater</i>. During that time, I wrote a weekly column and never missed a deadline. I covered issues such as abortion, immigration and Kent State student Dave Airhart's right to free expression from the viewpoint of an activist and revolutionary. <p> In mid-December, I reapplied for the job for the spring semester. I turned in my application without samples of my writing. After all, the editor already had the 15 columns I had written during the fall semester. Because I didn't print from the <i>Stater</i> Web site some of the columns I'd written and attach them to my application, it was rejected. <p> But judging by the content of the Forum page, the paper was, and still is, in dire need of columnists. Since the spring semester began in late January, the <i>Stater</i> has run multiple U-Wire columns from other colleges and universities on its Forum page, at least one day almost every week.<p> So on February 22, I spoke with Ryan Loew, editor of the <i>Stater</i>. I handed him another application, this time with the stories I'd written for a local professional newspaper. He took the writing samples, but said he still had my original application and would use that to judge whether I was qualified for the job. He also said he was hoping to look at the applications that weekend. <p> I e-mailed him three weeks later to see if he'd made a decision. He never responded. <p> Then on March 23, I went to the <i>Stater</i> production office to talk to Loew, and he said the paper wasn't looking for more columnists because it was doing better in terms of running columns written by Kent State students. <p> This isn't exactly true, however. During the first two weeks of March alone, the <i>Stater</i> twice printed multiple U-Wire columns on the same day. <p> The issue is not whether the paper needs columnists, because it obviously does. The issue is whether the editor will hire columnists who challenge right-wing thinking. <p> <i>Stater</i> editors have proven their unwillingness to hire progressives in the past. Greg Schwartz worked as a columnist for the <i>Stater</i> in the spring of 2005. He wrote concise, politically relevant columns, but he, too, took a progressive stance in his columns. When he reapplied to write during the fall semester of 2005, he included samples of his writing, but still his application was rejected.<p> International Socialist Organization (ISO) member Chris Kok currently works for the <i>Stater</i>. He writes one half of the Point-Counterpoint, which pits a conservative bigot against the one real progressive the paper will hire. <p> Recently, Kok wrote a column about abortion in which he said, "If you think Democrats are going to save abortion rights, you better start collecting coat hangers now." What actually came out in the paper was "[i]f you think Democrats are going to save abortion rights, don't hold your breath." This may seem like a small change, but it is just one of many ways in which conservatives on campus are trying to silence progressives.<p> This week, the Kent ISO will kick off a "Take Back the <i>Stater</i>" campaign. Action against the <i>Stater</i> is long overdue. We cannot allow the tyranny to continue any longer. We must take back the <i>Stater </i>for Kent State students.<br> <b>Allen Hines,</b> Kent, Ohio<p> <?php include "../../legacy-includes/BottomNavLinks.htmlf" ?> <td width="12"></td> <td width="108" valign="top"> <?php include "../../legacy-includes/RightAdFolder.htmlf" ?> </td> </tr> </table> </body> </html>
ISO-tech/sw-d8
web/2006-1/584/584_04_Kent.php
PHP
mit
5,493
// ST32LD_GUIDlg.cpp : implementation file // #include "stdafx.h" #include "ST32LD_GUI.h" #include "ST32LD_GUIDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif CST32LD_GUIDlg *pDlg; ///////////////////////////////////////////////////////////////////////////// // CAboutDlg dialog used for App About class CAboutDlg : public CDialog { public: CAboutDlg(); // Dialog Data //{{AFX_DATA(CAboutDlg) enum { IDD = IDD_ABOUTBOX }; //}}AFX_DATA // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CAboutDlg) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: //{{AFX_MSG(CAboutDlg) //}}AFX_MSG DECLARE_MESSAGE_MAP() }; CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) { //{{AFX_DATA_INIT(CAboutDlg) //}}AFX_DATA_INIT } void CAboutDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CAboutDlg) //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) //{{AFX_MSG_MAP(CAboutDlg) // No message handlers //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CST32LD_GUIDlg dialog CST32LD_GUIDlg::CST32LD_GUIDlg(CWnd* pParent /*=NULL*/) : CDialog(CST32LD_GUIDlg::IDD, pParent) { //{{AFX_DATA_INIT(CST32LD_GUIDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); } void CST32LD_GUIDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CST32LD_GUIDlg) DDX_Control(pDX, IDC_COMBO_BOARD, m_ctrlBoard); DDX_Control(pDX, IDC_COMBO_COMPORT, m_comboCOM); DDX_Control(pDX, IDC_LIST_DEBUG, m_listLog); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CST32LD_GUIDlg, CDialog) //{{AFX_MSG_MAP(CST32LD_GUIDlg) ON_WM_SYSCOMMAND() ON_WM_PAINT() ON_WM_QUERYDRAGICON() ON_BN_CLICKED(IDC_BUTTON_OPEN, OnButtonOpen) ON_WM_DESTROY() ON_BN_CLICKED(IDC_BUTTON_DOWN_BOOT, OnButtonDownBoot) ON_BN_CLICKED(IDC_BUTTON_DOWN_FIRM, OnButtonDownFirm) ON_BN_CLICKED(IDC_BUTTON_UPDATE, OnButtonUpdate) ON_BN_CLICKED(IDC_BUTTON_WRITE_UNPROTECT, OnButtonWriteUnprotect) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CST32LD_GUIDlg message handlers BOOL CST32LD_GUIDlg::OnInitDialog() { CDialog::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { CString strAboutMenu; strAboutMenu.LoadString(IDS_ABOUTBOX); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } // Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here Print_LogTitle(); fp = NULL; UART_Opened = FALSE; FILE_Opened = FALSE; m_ctrlBoard.SetCurSel(1); //m_comboCOM.GetCurSel(); pDlg = this; ((CButton *)GetDlgItem(IDC_CHECK_AUTO_BOOT))->SetCheck(FALSE); return TRUE; // return TRUE unless you set the focus to a control } void CST32LD_GUIDlg::OnSysCommand(UINT nID, LPARAM lParam) { if ((nID & 0xFFF0) == IDM_ABOUTBOX) { CAboutDlg dlgAbout; dlgAbout.DoModal(); } else { CDialog::OnSysCommand(nID, lParam); } } // If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework. void CST32LD_GUIDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); // Center icon in client rectangle int cxIcon = GetSystemMetrics(SM_CXICON); int cyIcon = GetSystemMetrics(SM_CYICON); CRect rect; GetClientRect(&rect); int x = (rect.Width() - cxIcon + 1) / 2; int y = (rect.Height() - cyIcon + 1) / 2; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { CDialog::OnPaint(); } } // The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CST32LD_GUIDlg::OnQueryDragIcon() { return (HCURSOR) m_hIcon; } BOOL CST32LD_GUIDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_ESCAPE)) { return TRUE; } return CDialog::PreTranslateMessage(pMsg); } void CST32LD_GUIDlg::Print_LogTitle(void) { m_listLog.DeleteAllItems(); m_listLog.InsertColumn( 0,"Log", 0,1000 ); } void CST32LD_GUIDlg::Print_Log(CString str) { int last_index = m_listLog.GetItemCount(); m_listLog.InsertItem( last_index, str ); m_listLog.EnsureVisible(m_listLog.GetItemCount()-1, FALSE); } void CST32LD_GUIDlg::OnButtonOpen() { // TODO: Add your control notification handler code here } void CST32LD_GUIDlg::OnDestroy() { CDialog::OnDestroy(); // TODO: Add your message handler code here if( fp != NULL ) { fclose(fp); } } u32 CST32LD_GUIDlg::writeh_read_data( u8 *dst, u32 len ) { size_t readbytes = 0; if( !feof( pDlg->fp ) ) readbytes = fread( dst, 1, len, pDlg->fp ); return ( u32 )readbytes; } // Progress function void CST32LD_GUIDlg::writeh_progress( u32 wrote ) { unsigned pwrite = ( wrote * 100 ) / pDlg->fpsize; if( pwrite >= pDlg->expected_next ) { pDlg->dbg_printf( "%d%% ", pDlg->expected_next ); pDlg->expected_next += 10; } } void CST32LD_GUIDlg::COM_Update( void ) { char port_name[100]; int i; int list_cnt = 0; ser_handler hPort; CString str; stm32_close(); //-- COM ¸®½ºÆ® Clear list_cnt = m_comboCOM.GetCount(); for( i=0; i<list_cnt; i++ ) { m_comboCOM.DeleteString(0); } UART_Opened = FALSE; list_cnt = 0; for( i=1; i<=32; i++ ) { sprintf( port_name, "COM%d", i ); hPort = ser_open( port_name ); if( hPort == WIN_ERROR ) { //-- COM Æ÷Æ®°¡ ¾øÀ¸¸é ´ÙÀ½ Æ÷Æ®·Î À̵¿ continue; } else { //-- COM Æ÷Æ®°¡ ÀÖÀ¸¸é ¸®½ºÆ®¿¡ Ãß°¡ m_comboCOM.AddString(port_name); m_comboCOM.SetCurSel(0); dbg_printf("%s Found ", port_name); ser_close(hPort); list_cnt++; } } if( list_cnt > 0 ) { UART_Opened = TRUE; } } void CST32LD_GUIDlg::dbg_printf( char *format, ... ) { char Str[200]; va_list ap; CString str; va_start( ap, format ); vsprintf( Str, format, ap ); va_end(ap); str.Format("%s", Str); Print_Log(str); } void CST32LD_GUIDlg::Button_Status( BOOL Mode ) { if( Mode == TRUE ) { ((CButton *)GetDlgItem(IDC_BUTTON_DOWN_BOOT))->EnableWindow(TRUE); ((CButton *)GetDlgItem(IDC_BUTTON_DOWN_FIRM))->EnableWindow(TRUE); ((CButton *)GetDlgItem(IDC_BUTTON_WRITE_UNPROTECT))->EnableWindow(TRUE); } else { ((CButton *)GetDlgItem(IDC_BUTTON_DOWN_BOOT))->EnableWindow(FALSE); ((CButton *)GetDlgItem(IDC_BUTTON_DOWN_FIRM))->EnableWindow(FALSE); ((CButton *)GetDlgItem(IDC_BUTTON_WRITE_UNPROTECT))->EnableWindow(FALSE); } } BOOL CST32LD_GUIDlg::GetFileName( void ) { BOOL Ret = FALSE; OPENFILENAME OFN; char str[300]; char lpstrFile[MAX_PATH]=""; memset(&OFN, 0, sizeof(OPENFILENAME)); OFN.lStructSize = sizeof(OPENFILENAME); OFN.hwndOwner= this->GetSafeHwnd(); OFN.lpstrFilter="BIN File(*.bin)\0*.bin\0BIN File\0*.bin;*.bin\0"; OFN.lpstrFile=lpstrFile; OFN.nMaxFile=256; OFN.lpstrInitialDir="c:\\"; CString filename; if( GetOpenFileName(&OFN) != 0 ) { strcpy(file_str, OFN.lpstrFile ); Ret = TRUE; } return Ret; } void CST32LD_GUIDlg::Download_Exe() { u8 not_flashing = 0; u8 send_go_command = 0; u8 boot_mode = 0; u8 load_bin = 1; u8 minor, major; u16 version; long baud = 115200; char com_str[1024]; CString str; int ErrCode; dbg_printf("stm32ld ver 1.0.1\n"); if( UART_Opened != TRUE ) { dbg_printf("ERROR : COM Port is not selected\n"); MessageBox("Please Update COM and Select COM Port"); return; } dbg_printf(" "); if( Download_Mode == BOOT_DOWNLOAD ) { send_go_command = 1; dbg_printf("--- Bootloader Download Mode --- "); } else if( Download_Mode == FIRM_DOWNLOAD ) { boot_mode = 1; send_go_command = 1; dbg_printf("--- Firmware Download Mode --- "); } else { load_bin = 0; boot_mode = 0; send_go_command = 0; dbg_printf("--- Write Unprotect Mode --- "); } if( load_bin == 1 ) { //-- Bin ÆÄÀÏ À̸§ Àбâ // if( GetFileName() == FALSE ) { dbg_printf("ERROR : GetFileName Failed"); } else { dbg_printf("Download File : %s",file_str); } //-- Bin ÆÄÀÏ Open // if( fp != NULL ) { fclose(fp); } if( ( fp = fopen( file_str, "rb" ) ) == NULL ) { dbg_printf( "Unable to open %s\n", file_str ); return; } else { fseek( fp, 0, SEEK_END ); fpsize = ftell( fp ); fseek( fp, 0, SEEK_SET ); } dbg_printf( "File Size : %d KB\n", fpsize/1024 ); } //-- Connect to bootloader // stm32_close(); m_comboCOM.GetWindowText(str); sscanf( str, "%s", com_str ); //dbg_printf("port : %s\n", com_str); if( ((CButton *)GetDlgItem(IDC_CHECK_AUTO_BOOT))->GetCheck() == TRUE ) { dbg_printf( "Go to bootloader\n" ); //-- ºÎÆ®·Î´õ ½ÇÇà // stm32_go_boot( com_str, baud ); } if( stm32_init( com_str, baud ) != STM32_OK ) { dbg_printf( "ERROR :Unable to connect to bootloader\n" ); if( load_bin == 1 ) { fclose(fp); } return; } if( boot_mode == 1 ) { if( stm32_boot_command() != STM32_OK ) { dbg_printf( "ERROR : not baram bootloader\n" ); return; } } // Get version if( stm32_get_version( &major, &minor ) != STM32_OK ) { dbg_printf( "ERROR :Unable to get bootloader version\n" ); return; } else { if( boot_mode == 1) { dbg_printf( "Found baram bootloader version: %d.%d\n", major, minor ); } else { dbg_printf( "Found bootloader version: %d.%d\n", major, minor ); } if( BL_MKVER( major, minor ) < BL_MINVERSION ) { dbg_printf( "ERROR : Unsupported bootloader version" ); return; } } // Get chip ID if( stm32_get_chip_id( &version ) != STM32_OK ) { dbg_printf( "ERROR : Unable to get chip ID\n" ); return; } else { dbg_printf( "Chip ID: %04X\n", version ); if( version != CHIP_ID && version != CHIP_ID_ALT && version != 0x410 ) { dbg_printf( "ERROR : Unsupported chip ID" ); return; } } // Write unprotect // if( Download_Mode == WRITE_UNPROTECT ) { if( stm32_write_unprotect() != STM32_OK ) { dbg_printf( "Unable to execute write unprotect\n" ); return; } else { dbg_printf( "Cleared write protection.\n" ); dbg_printf( "Reset and Run BootLoader.\n" ); } return; } // Erase flash // if( major == 3 ) { dbg_printf( "Starting Extended Erase of FLASH memory. This will take some time ... Please be patient ...\n" ); if( stm32_extended_erase_flash() != STM32_OK ) { dbg_printf( "ERROR : Unable to extended erase chip\n" ); return; } else dbg_printf( "Extended Erased FLASH memory.\n" ); } else { ErrCode = stm32_erase_flash(); if( ErrCode != STM32_OK ) { str.Format("ERROR :Unable to erase chip : %d\n", ErrCode ); dbg_printf((char *)str.GetBuffer(0)); return; } else dbg_printf( "Erased FLASH memory.\n" ); } // Program flash // //setbuf( stdout, NULL ); expected_next = 10; dbg_printf( "Programming flash ... "); if( stm32_write_flash( writeh_read_data, writeh_progress ) != STM32_OK ) { dbg_printf( "ERROR : Unable to program FLASH memory.\n" ); return; } else dbg_printf( "\nDone.\n" ); //-- Go // if( send_go_command == 1 ) { // Run GO dbg_printf( "Sending Go command ... \n" ); if( stm32_go_command( ) != STM32_OK ) { dbg_printf( "ERROR : Unable to run Go command.\n" ); return; } } Print_Log("´Ù¿î·Îµå ¼º°ø"); } void CST32LD_GUIDlg::Download_Exe_OpenCM() { u8 not_flashing = 0; u8 send_go_command = 0; u8 boot_mode = 0; u8 load_bin = 1; u8 minor, major; u16 version; u16 i; int Ret; char RecvStr[100]; long baud = 115200; char com_str[1024]; CString str; int ErrCode; dbg_printf("stm32ld ver 1.0.1 for CupDrone\n"); if( UART_Opened != TRUE ) { dbg_printf("ERROR : COM Port is not selected\n"); MessageBox("Please Update COM and Select COM Port"); return; } dbg_printf(" "); if( Download_Mode == FIRM_DOWNLOAD ) { boot_mode = 1; send_go_command = 1; dbg_printf("--- CupDrone Firmware Download Mode --- "); } else { load_bin = 0; boot_mode = 0; send_go_command = 0; dbg_printf("--- Mode Error --- "); return; } if( load_bin == 1 ) { //-- Bin ÆÄÀÏ À̸§ Àбâ // if( GetFileName() == FALSE ) { dbg_printf("ERROR : GetFileName Failed"); } else { dbg_printf("Download File : %s",file_str); } //-- Bin ÆÄÀÏ Open // if( fp != NULL ) { fclose(fp); } if( ( fp = fopen( file_str, "rb" ) ) == NULL ) { dbg_printf( "Unable to open %s\n", file_str ); return; } else { fseek( fp, 0, SEEK_END ); fpsize = ftell( fp ); fseek( fp, 0, SEEK_SET ); } dbg_printf( "File Size : %d KB\n", fpsize/1024 ); } //-- Connect to bootloader // stm32_close(); m_comboCOM.GetWindowText(str); sscanf( str, "%s", com_str ); dbg_printf("port : %s\n", com_str); Ret = OpenCM_Cmd_Init( com_str, baud ); if( Ret != STM32_OK ) { str.Format("ERROR :Unable to connect to bootloader : %d\n", Ret ); dbg_printf( str.GetBuffer(0) ); if( load_bin == 1 ) { fclose(fp); } return; } dbg_printf( "CupDrone_Cmd_Init : OK\n" ); for( i=0; i<5; i++ ) { if( OpenCM_Cmd_SendCmdRecvResponse("AT&LD", RecvStr, 5000 ) == TRUE ) { dbg_printf("Ready To download \n"); OpenCM_Wait_ms(5); if( OpenCM_WriteFlash( writeh_read_data, writeh_progress ) != TRUE ) { fprintf( stderr, "Unable to program FLASH memory.\n" ); exit( 1 ); } else { //printf("\nFlash OK\n"); OpenCM_Wait_ms(50); RecvStr[0] = 0; OpenCM_Cmd_ReadResponse( RecvStr, 500 ); dbg_printf("CheckSum : %s\n", RecvStr); if( strncmp(RecvStr, "Success", 7) == 0 ) { if( send_go_command == 1 ) { OpenCM_Wait_ms(200); dbg_printf("Go Application\n"); OpenCM_Cmd_SendCommand("AT&GO"); } break; } else { OpenCM_Wait_ms(200); fseek( fp, 0, SEEK_SET ); expected_next = 10; } } } else { fprintf( stderr, "Fail to be ready.\n" ); break; } } if( load_bin == 1 ) { fclose(fp); } Print_Log("´Ù¿î·Îµå ¼º°ø"); } UINT CST32LD_GUIDlg::Download_Thread(LPVOID pParam) { CST32LD_GUIDlg *Dlg = (CST32LD_GUIDlg*)pParam; Dlg->Download_Exe(); stm32_close(); Dlg->Button_Status(TRUE); return 0; } UINT CST32LD_GUIDlg::Download_Thread_OpenCM(LPVOID pParam) { CST32LD_GUIDlg *Dlg = (CST32LD_GUIDlg*)pParam; Dlg->Download_Exe_OpenCM(); Dlg->Button_Status(TRUE); return 0; } void CST32LD_GUIDlg::OnButtonDownBoot() { // TODO: Add your control notification handler code here Download_Mode = BOOT_DOWNLOAD; Button_Status(FALSE); AfxBeginThread(Download_Thread,this); } void CST32LD_GUIDlg::OnButtonDownFirm() { // TODO: Add your control notification handler code here Download_Mode = FIRM_DOWNLOAD; Button_Status(FALSE); if( Get_BoardType() == BOARD_SKYROVER ) { AfxBeginThread(Download_Thread,this); } else if( Get_BoardType() == BOARD_CUPDRONE ) { AfxBeginThread(Download_Thread_OpenCM,this); } else { MessageBox("Wrong BoardType"); } } void CST32LD_GUIDlg::OnButtonUpdate() { // TODO: Add your control notification handler code here COM_Update(); } void CST32LD_GUIDlg::OnButtonWriteUnprotect() { // TODO: Add your control notification handler code here Download_Mode = WRITE_UNPROTECT; Button_Status(FALSE); AfxBeginThread(Download_Thread,this); } u32 CST32LD_GUIDlg::Get_BoardType() { int BoardType; CString str; BoardType = m_ctrlBoard.GetCurSel(); //str.Format("%d", BoardType ); //MessageBox( str ); if( BoardType > 1 ) BoardType = 0; return BoardType; }
chcbaram/stm32ld_gui
STM32LD_GUI/ST32LD_GUIDlg.cpp
C++
mit
16,731
// // ViewController.h // SULoggerDemo // // Created by KevinSu on 16/3/5. // Copyright © 2016年 KevinSu. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end
DaMingShen/SULogger
SULoggerDemo/ViewController.h
C
mit
215
/* * This file is part of LuckPerms, licensed under the MIT License. * * Copyright (c) lucko (Luck) <[email protected]> * Copyright (c) contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ package me.lucko.luckperms.bukkit.inject.permissible; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import me.lucko.luckperms.bukkit.LPBukkitPlugin; import me.lucko.luckperms.bukkit.calculator.OpProcessor; import me.lucko.luckperms.bukkit.calculator.PermissionMapProcessor; import me.lucko.luckperms.common.cacheddata.result.TristateResult; import me.lucko.luckperms.common.config.ConfigKeys; import me.lucko.luckperms.common.context.manager.QueryOptionsCache; import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.verbose.event.CheckOrigin; import net.luckperms.api.query.QueryOptions; import net.luckperms.api.util.Tristate; import org.bukkit.entity.Player; import org.bukkit.permissions.PermissibleBase; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.Plugin; import org.checkerframework.checker.nullness.qual.NonNull; import java.lang.reflect.Field; import java.util.Collection; import java.util.Iterator; import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicBoolean; /** * PermissibleBase for LuckPerms. * * This class overrides all methods defined in PermissibleBase, and provides custom handling * from LuckPerms. * * This means that all permission checks made for a player are handled directly by the plugin. * Method behaviour is retained, but alternate implementation is used. * * "Hot" method calls, (namely #hasPermission) are significantly faster than the base implementation. * * This class is **thread safe**. This means that when LuckPerms is installed on the server, * is is safe to call Player#hasPermission asynchronously. */ public class LuckPermsPermissible extends PermissibleBase { private static final Field ATTACHMENTS_FIELD; static { try { ATTACHMENTS_FIELD = PermissibleBase.class.getDeclaredField("attachments"); ATTACHMENTS_FIELD.setAccessible(true); } catch (NoSuchFieldException e) { throw new ExceptionInInitializerError(e); } } // the LuckPerms user this permissible references. private final User user; // the player this permissible is injected into. private final Player player; // the luckperms plugin instance private final LPBukkitPlugin plugin; // caches context lookups for the player private final QueryOptionsCache<Player> queryOptionsSupplier; // the players previous permissible. (the one they had before this one was injected) private PermissibleBase oldPermissible = null; // if the permissible is currently active. private final AtomicBoolean active = new AtomicBoolean(false); // the attachments hooked onto the permissible. // this collection is only modified by the attachments themselves final Set<LuckPermsPermissionAttachment> hookedAttachments = ConcurrentHashMap.newKeySet(); public LuckPermsPermissible(Player player, User user, LPBukkitPlugin plugin) { super(player); this.user = Objects.requireNonNull(user, "user"); this.player = Objects.requireNonNull(player, "player"); this.plugin = Objects.requireNonNull(plugin, "plugin"); this.queryOptionsSupplier = plugin.getContextManager().getCacheFor(player); injectFakeAttachmentsList(); } /** * Injects a fake 'attachments' list into the superclass, for dumb plugins * which for some reason decided to add attachments via reflection. * * The fake list proxies (some) calls back to the proper methods on this permissible. */ private void injectFakeAttachmentsList() { FakeAttachmentList fakeList = new FakeAttachmentList(); try { // the field we need to modify is in the superclass - it has private // and final modifiers so we have to use reflection to modify it. ATTACHMENTS_FIELD.set(this, fakeList); } catch (Exception e) { e.printStackTrace(); } } @Override public boolean isPermissionSet(@NonNull String permission) { if (permission == null) { throw new NullPointerException("permission"); } QueryOptions queryOptions = this.queryOptionsSupplier.getQueryOptions(); TristateResult result = this.user.getCachedData().getPermissionData(queryOptions).checkPermission(permission, CheckOrigin.PLATFORM_API_HAS_PERMISSION_SET); if (result.result() == Tristate.UNDEFINED) { return false; } // ignore matches made from looking up in the permission map (replicate bukkit behaviour) if (result.processorClass() == PermissionMapProcessor.class) { return false; } // ignore the op processor return result.processorClass() != OpProcessor.class; } @Override public boolean isPermissionSet(@NonNull Permission permission) { if (permission == null) { throw new NullPointerException("permission"); } return isPermissionSet(permission.getName()); } @Override public boolean hasPermission(@NonNull String permission) { if (permission == null) { throw new NullPointerException("permission"); } QueryOptions queryOptions = this.queryOptionsSupplier.getQueryOptions(); return this.user.getCachedData().getPermissionData(queryOptions).checkPermission(permission, CheckOrigin.PLATFORM_API_HAS_PERMISSION).result().asBoolean(); } @Override public boolean hasPermission(@NonNull Permission permission) { if (permission == null) { throw new NullPointerException("permission"); } QueryOptions queryOptions = this.queryOptionsSupplier.getQueryOptions(); TristateResult result = this.user.getCachedData().getPermissionData(queryOptions).checkPermission(permission.getName(), CheckOrigin.PLATFORM_API_HAS_PERMISSION); // override default op handling using the Permission class we have if (result.processorClass() == OpProcessor.class && this.plugin.getConfiguration().get(ConfigKeys.APPLY_BUKKIT_DEFAULT_PERMISSIONS)) { // 'op == true' is implied by the presence of the OpProcessor class return permission.getDefault().getValue(true); } return result.result().asBoolean(); } /** * Adds attachments to this permissible. * * @param attachments the attachments to add */ void convertAndAddAttachments(Collection<PermissionAttachment> attachments) { for (PermissionAttachment attachment : attachments) { new LuckPermsPermissionAttachment(this, attachment).hook(); } } @Override public void setOp(boolean value) { this.player.setOp(value); } @Override public @NonNull Set<PermissionAttachmentInfo> getEffectivePermissions() { Map<String, Boolean> permissionMap = this.user.getCachedData().getPermissionData(this.queryOptionsSupplier.getQueryOptions()).getPermissionMap(); ImmutableSet.Builder<PermissionAttachmentInfo> builder = ImmutableSet.builder(); permissionMap.forEach((key, value) -> builder.add(new PermissionAttachmentInfo(this.player, key, null, value))); return builder.build(); } @Override public @NonNull LuckPermsPermissionAttachment addAttachment(@NonNull Plugin plugin) { Objects.requireNonNull(plugin, "plugin"); LuckPermsPermissionAttachment attachment = new LuckPermsPermissionAttachment(this, plugin); attachment.hook(); return attachment; } @Override public @NonNull PermissionAttachment addAttachment(@NonNull Plugin plugin, @NonNull String permission, boolean value) { Objects.requireNonNull(plugin, "plugin"); Objects.requireNonNull(permission, "permission"); PermissionAttachment attachment = addAttachment(plugin); attachment.setPermission(permission, value); return attachment; } @Override public LuckPermsPermissionAttachment addAttachment(@NonNull Plugin plugin, int ticks) { Objects.requireNonNull(plugin, "plugin"); if (!plugin.isEnabled()) { throw new IllegalArgumentException("Plugin " + plugin.getDescription().getFullName() + " is not enabled"); } LuckPermsPermissionAttachment attachment = addAttachment(plugin); if (getPlugin().getBootstrap().getServer().getScheduler().scheduleSyncDelayedTask(plugin, attachment::remove, ticks) == -1) { attachment.remove(); throw new RuntimeException("Could not add PermissionAttachment to " + this.player + " for plugin " + plugin.getDescription().getFullName() + ": Scheduler returned -1"); } return attachment; } @Override public LuckPermsPermissionAttachment addAttachment(@NonNull Plugin plugin, @NonNull String permission, boolean value, int ticks) { Objects.requireNonNull(plugin, "plugin"); Objects.requireNonNull(permission, "permission"); LuckPermsPermissionAttachment attachment = addAttachment(plugin, ticks); attachment.setPermission(permission, value); return attachment; } @Override public void removeAttachment(@NonNull PermissionAttachment attachment) { Objects.requireNonNull(attachment, "attachment"); LuckPermsPermissionAttachment luckPermsAttachment; if (!(attachment instanceof LuckPermsPermissionAttachment)) { // try to find a match LuckPermsPermissionAttachment match = this.hookedAttachments.stream().filter(at -> at.getSource() == attachment).findFirst().orElse(null); if (match != null) { luckPermsAttachment = match; } else { throw new IllegalArgumentException("Given attachment is not a LPPermissionAttachment."); } } else { luckPermsAttachment = (LuckPermsPermissionAttachment) attachment; } if (luckPermsAttachment.getPermissible() != this) { throw new IllegalArgumentException("Attachment does not belong to this permissible."); } luckPermsAttachment.remove(); } @Override public void recalculatePermissions() { // this method is called (among other times) when op status is updated. // because we encapsulate op status within QueryOptions, we need to invalidate // the query options cache when op status changes. // (#invalidate is a fast call) if (this.queryOptionsSupplier != null) { // this method is called by the super class constructor, before this class has fully initialised this.queryOptionsSupplier.invalidate(); } // but we don't need to do anything else in this method, unlike the CB impl. } @Override public void clearPermissions() { this.hookedAttachments.forEach(LuckPermsPermissionAttachment::remove); } public User getUser() { return this.user; } public Player getPlayer() { return this.player; } public LPBukkitPlugin getPlugin() { return this.plugin; } PermissibleBase getOldPermissible() { return this.oldPermissible; } AtomicBoolean getActive() { return this.active; } void setOldPermissible(PermissibleBase oldPermissible) { this.oldPermissible = oldPermissible; } /** * A fake list to be injected into the superclass. This implementation simply * proxies calls back to this permissible instance. * * Some (clever/dumb??) plugins attempt to add/remove/query attachments using reflection. * * An instance of this map is injected into the super instance so these plugins continue * to work with LuckPerms. */ private final class FakeAttachmentList implements List<PermissionAttachment> { @Override public boolean add(PermissionAttachment attachment) { if (LuckPermsPermissible.this.hookedAttachments.stream().anyMatch(at -> at.getSource() == attachment)) { return false; } new LuckPermsPermissionAttachment(LuckPermsPermissible.this, attachment).hook(); return true; } @Override public boolean remove(Object o) { removeAttachment((PermissionAttachment) o); return true; } @Override public void clear() { clearPermissions(); } @Override public boolean addAll(@NonNull Collection<? extends PermissionAttachment> c) { boolean modified = false; for (PermissionAttachment e : c) { if (add(e)) { modified = true; } } return modified; } @Override public boolean contains(Object o) { PermissionAttachment attachment = (PermissionAttachment) o; return LuckPermsPermissible.this.hookedAttachments.stream().anyMatch(at -> at.getSource() == attachment); } @Override public Iterator<PermissionAttachment> iterator() { return ImmutableList.<PermissionAttachment>copyOf(LuckPermsPermissible.this.hookedAttachments).iterator(); } @Override public ListIterator<PermissionAttachment> listIterator() { return ImmutableList.<PermissionAttachment>copyOf(LuckPermsPermissible.this.hookedAttachments).listIterator(); } @Override public @NonNull Object[] toArray() { return ImmutableList.<PermissionAttachment>copyOf(LuckPermsPermissible.this.hookedAttachments).toArray(); } @Override public <T> @NonNull T[] toArray(@NonNull T[] a) { return ImmutableList.<PermissionAttachment>copyOf(LuckPermsPermissible.this.hookedAttachments).toArray(a); } @Override public int size() { throw new UnsupportedOperationException(); } @Override public boolean isEmpty() { throw new UnsupportedOperationException(); } @Override public boolean containsAll(@NonNull Collection<?> c) { throw new UnsupportedOperationException(); } @Override public boolean addAll(int index, @NonNull Collection<? extends PermissionAttachment> c) { throw new UnsupportedOperationException(); } @Override public boolean removeAll(@NonNull Collection<?> c) { throw new UnsupportedOperationException(); } @Override public boolean retainAll(@NonNull Collection<?> c) { throw new UnsupportedOperationException(); } @Override public PermissionAttachment get(int index) { throw new UnsupportedOperationException(); } @Override public PermissionAttachment set(int index, PermissionAttachment element) { throw new UnsupportedOperationException(); } @Override public void add(int index, PermissionAttachment element) { throw new UnsupportedOperationException(); } @Override public PermissionAttachment remove(int index) { throw new UnsupportedOperationException(); } @Override public int indexOf(Object o) { throw new UnsupportedOperationException(); } @Override public int lastIndexOf(Object o) { throw new UnsupportedOperationException(); } @Override public @NonNull ListIterator<PermissionAttachment> listIterator(int index) { throw new UnsupportedOperationException(); } @Override public @NonNull List<PermissionAttachment> subList(int fromIndex, int toIndex) { throw new UnsupportedOperationException(); } } }
lucko/LuckPerms
bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/permissible/LuckPermsPermissible.java
Java
mit
17,120
/** * afterloe <[email protected]> (https://github.com/afterloe) - standard_ascs/distributed/slave.js * * Copyright(c) afterloe <[email protected]> (https://github.com/afterloe). * MIT Licensed * * Authors: * afterloe <[email protected]> (https://github.com/afterloe) <[email protected]> (https://github.com/afterloe/standard) * Date: * 2017-4-7 11:37:37 */ "use strict"; const [ {createServer}, {resolve}, ] = [ require("http"), require("path") ]; const servers = resolve(__dirname, "..", "servers"); const registry = require(resolve(servers, "registry")); const server = createServer(registry.callback()); let workerServer; process.on("message", (msg, handler) => { const {act} = msg; if ("start-up" === act) { workerServer = handler; workerServer.on("connection", socket => server.emit("connection", socket)); console.log(`${new Date().toLocaleString()} : slave ${process.pid} is running`); } }); process.on("systemError", (err, ctx) => { console.log("%s process catch err! %s", new Date().toLocaleDateString(), err); console.dir(ctx); }); process.on("uncaughtException", err => { process.send({act: "suicide"}); console.error(err); workerServer.close(() => { process.exit(1); }); process.nextTick(() => process.exit(1)); });
afterloe/standard
distributed/slave.js
JavaScript
mit
1,312
package android.support.v8.renderscript; public class Float2 { public float f27x; public float f28y; public Float2(float initX, float initY) { this.f27x = initX; this.f28y = initY; } }
morisha/theIncredibleYouth
android/support/v8/renderscript/Float2.java
Java
mit
219
\hypertarget{dir_aa51c61d653410d475ad94cff28fd53a}{}\section{filter Directory Reference} \label{dir_aa51c61d653410d475ad94cff28fd53a}\index{filter Directory Reference@{filter Directory Reference}} Directory dependency graph for filter\+: \nopagebreak \begin{figure}[H] \begin{center} \leavevmode \includegraphics[width=134pt]{dir_aa51c61d653410d475ad94cff28fd53a_dep} \end{center} \end{figure} \subsection*{Files} \begin{DoxyCompactItemize} \item file \hyperlink{filter_8cpp}{filter.\+cpp} \item file \hyperlink{mf-hw-ip_8cpp}{mf-\/hw-\/ip.\+cpp} \item file \hyperlink{mf-sw_8cpp}{mf-\/sw.\+cpp} \end{DoxyCompactItemize}
wafgo/rt-depth-map
latex/dir_aa51c61d653410d475ad94cff28fd53a.tex
TeX
mit
624
from enum import Enum import numpy as np import acpc_python_client as acpc from cfr.main import Cfr from tools.walk_trees import walk_trees from tools.io_util import read_strategy_from_file from tools.game_utils import copy_strategy from tools.game_tree.builder import GameTreeBuilder from tools.game_tree.node_provider import StrategyTreeNodeProvider class TiltType(Enum): ADD = 1, MULTIPLY = 2, def create_agent_strategy( game_file_path, tilt_action, tilt_type, tilt_probability, cfr_iterations=2000, cfr_weight_delay=700, show_progress=True): game = acpc.read_game_file(game_file_path) cfr = Cfr(game, show_progress=show_progress) cfr.train(cfr_iterations, cfr_weight_delay) return create_agent_strategy_from_trained_strategy( game_file_path, cfr.game_tree, tilt_action, tilt_type, tilt_probability, True) def create_agent_strategy_from_strategy_file( game_file_path, strategy_path, tilt_action, tilt_type, tilt_probability): strategy_tree, _ = read_strategy_from_file(game_file_path, strategy_path) return create_agent_strategy_from_trained_strategy( game_file_path, strategy_tree, tilt_action, tilt_type, tilt_probability, True) def create_agent_strategy_from_trained_strategy( game_file_path, strategy_tree, tilt_action, tilt_type, tilt_probability, in_place=False): tilt_action_index = tilt_action.value def on_node(node): if tilt_action_index in node.children: original_tilt_action_probability = node.strategy[tilt_action_index] new_tilt_action_probability = None if tilt_type == TiltType.ADD: new_tilt_action_probability = np.clip(original_tilt_action_probability + tilt_probability, 0, 1) elif tilt_type == TiltType.MULTIPLY: new_tilt_action_probability = np.clip( original_tilt_action_probability + original_tilt_action_probability * tilt_probability, 0, 1) node.strategy[tilt_action_index] = new_tilt_action_probability diff = new_tilt_action_probability - original_tilt_action_probability other_actions_probability = 1 - original_tilt_action_probability if diff != 0 and other_actions_probability == 0: other_action_probability_diff = diff / (len(node.children) - 1) for a in filter(lambda a: a != tilt_action_index, node.children): node.strategy[a] -= other_action_probability_diff elif diff != 0: for a in filter(lambda a: a != tilt_action_index, node.children): node.strategy[a] -= diff * (node.strategy[a] / other_actions_probability) result_strategy = None if in_place: result_strategy = strategy_tree else: game = acpc.read_game_file(game_file_path) result_strategy = GameTreeBuilder(game, StrategyTreeNodeProvider()).build_tree() copy_strategy(result_strategy, strategy_tree) walk_trees(on_node, result_strategy) return result_strategy
JakubPetriska/poker-cfr
weak_agents/action_tilted_agent.py
Python
mit
3,260
------------------------------------------------------------- -- -- 篩系 -- -- Module : MyModule.Sieve -- Coding : Little Schemer -- ------------------------------------------------------------- module MyModule.Sieve where import qualified Data.Vector as V import qualified Data.Vector.Mutable as VM import qualified Data.Vector.Unboxed as U import qualified Data.Vector.Unboxed.Mutable as UM import Control.Monad.ST import Control.Monad import Data.List -- -- エラトステネスの篩による素数リスト -- -- + ex : primeList 20 => [2,3,5,7,11,13,17,19] -- primeList :: Int -> [Int] primeList n = 2 : (map indexToValue $ U.toList $ U.elemIndices True $ sieve) where indexToValue i = 2 * i + 3 valueToIndex v = div (v - 3) 2 lastIndex = valueToIndex n sieve = runST $ do mVec <- UM.replicate (lastIndex + 1) True forM_ [0 .. valueToIndex (floor $ sqrt $ fromIntegral n)] $ \i -> do v <- UM.unsafeRead mVec i when v $ do let (s, d) = (2 * i * (i + 3) + 3, indexToValue i) forM_ [s, s + d .. lastIndex] $ \j -> do UM.unsafeWrite mVec j False U.unsafeFreeze mVec -- -- 1 〜 n までの約数のリスト -- -- + ex : divisorsList 5 => [[1],[1,2],[1,3],[1,2,4],[1,5]] -- divisorsList :: Int -> [[Int]] divisorsList n = tail $ V.toList $ sieve where sieve = runST $ do mVec <- VM.replicate (n + 1) [] forM_ [n, n - 1 .. 1] $ \i -> do forM_ [i, i + i .. n] $ \j -> do lst <- VM.unsafeRead mVec j VM.unsafeWrite mVec j (i : lst) V.unsafeFreeze mVec -- -- 1 〜 n までの素因数分解のリスト -- -- ex : factorsList' 5 => [[],[2],[3],[2,2],[5]] -- ex : factorsList 5 => [[],[(2,1)],[(3,1)],[(2,2)],[(5,1)]] -- factorsList :: Int -> [[(Int, Int)]] factorsList n = map f $ factorsList' n where f xs = [(p, length ps) | ps@(p : _) <- group xs] factorsList' :: Int -> [[Int]] factorsList' n = tail $ map reverse $ V.toList $ sieve where sieve = runST $ do vec <- VM.replicate (n + 1) [] forM_ [2 .. n] $ \i -> do v <- VM.unsafeRead vec i when (null v) $ do forM_ (takeWhile (<= n) $ iterate (* i) i) $ \j -> do forM_ [j, 2 * j .. n] $ \k -> do ps <- VM.unsafeRead vec k VM.unsafeWrite vec k (i : ps) V.unsafeFreeze vec -- -- 1 〜 n までのオイラーのφ関数のリスト -- -- ex : phiList 10 => [1,1,2,2,4,2,6,4,6,4] -- phiList :: Int -> [Int] phiList n = map f $ factorsList n where f xs = product [p^(i - 1) * (p - 1) | (p, i) <- xs]
little-schemer/MyModule
Sieve.hs
Haskell
mit
2,644
require File.dirname(__FILE__) + '/../../spec_helper' include PoolParty::Resources describe "Remote file" do describe "instances" do before(:each) do @file = remotefile({:name => "/etc/apache2/puppetmaster.conf"}) end it "should turn the one hash instance into a string" do @file.to_string.should =~ /"\/etc\/apache2\/puppetmaster\.conf":/ end it "should turn the two hash instance into a string" do @file = file do name "/etc/init.d/puppetmaster" owner "redsmith" end @file.to_string.should =~ /"\/etc\/init\.d\/puppetmaster":/ end describe "as included" do before(:each) do @file = remotefile({:rent => "low"}) do name "/www/conf/httpd.conf" end end it "should have the source set to puppet" do @file.source.should == "puppet:///files/httpd.conf" end it "should use default values" do @file.name.should == "/www/conf/httpd.conf" end it "should keep the default values for the file" do @file.mode.should == 644 end it "should also set options through a hash" do @file.rent.should == "low" end end end end
benburkert/poolparty
spec/poolparty/pool/resources/remote_file_spec.rb
Ruby
mit
1,220
--- layout: page title: safari category: blog description: date: 2018-09-27 --- # Preface # clear passwd option: 先删除:keychain access 中的passwords # forget login keychain password If you don't know your old password, the solution is to create a new login keychain. 1. 从“钥匙串访问”菜单中,选取“偏好设置”,然后在“偏好设置”窗口中点按“还原我的默认钥匙串”按钮。输入新密码后,“钥匙串访问”将创建无密码的空登录钥匙串。点按“好”以确认。 2. create empty "login" keychain with no password. please change via "edit - change password for keychain" If you know your old password, use that password to update your existing login keychain: Open the Keychain Access app From the Edit menu, choose “Change Password for Keychain 'login.'” Enter the old password of your user account in the Current Password field. This is the password you were using before the password was reset. Enter the new password of your user account in the New Password field. This is the password you're now using to log in to your Mac. Enter the same password in the Verify field. Click OK when done, then quit Keychain Access.
hilojack/hilojack.github.io
post/mac/safari.md
Markdown
mit
1,202
'use strict'; const assert = require('assert'); const sinon = require('sinon'); const uuid = require('uuid'); const logger = require('../../lib/logger'); const requestLogger = require('../../middleware/requestLogger'); describe('requestLogger', () => { const sandbox = sinon.sandbox.create(); let context; let childLogger; beforeEach(() => { childLogger = { debug: sandbox.stub() }; sandbox.stub(uuid, 'v4').returns('a-uuid'); sandbox.stub(logger, 'child').returns(childLogger); context = new Map(); requestLogger.call(context, 'a-request'); }); afterEach(() => { sandbox.restore(); }); it('creates a child logger using a UUID', () => { assert.deepEqual(logger.child.args, [[{ uuid: 'a-uuid' }]]); }); it('appends the child logger to the middleware context', () => { assert.equal(context.get('logger'), childLogger); }); it('appends the UUID to the middleware context', () => { assert.equal(context.get('uuid'), 'a-uuid'); }); it('logs the incoming request', () => { assert.deepEqual(childLogger.debug.args, [[{ req: 'a-request' }, 'Incoming request.']]); }); });
qubyte/szalinski
test/middleware/requestLogger.tests.js
JavaScript
mit
1,156
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="ApiGen 2.8.0" /> <meta name="robots" content="noindex" /> <title>File Merchenta/Exceptions/MerchentaException.php | Merchenta Php Documentation</title> <script type="text/javascript" src="resources/combined.js?1748829536"></script> <script type="text/javascript" src="elementlist.js?330520236"></script> <link rel="stylesheet" type="text/css" media="all" href="resources/style.css?3505392360" /> </head> <body> <div id="left"> <div id="menu"> <a href="index.html" title="Overview"><span>Overview</span></a> <div id="groups"> <h3>Namespaces</h3> <ul> <li class="active"><a href="namespace-Merchenta.html">Merchenta<span></span></a> <ul> <li><a href="namespace-Merchenta.Auth.html">Auth</a> </li> <li class="active"><a href="namespace-Merchenta.Exceptions.html">Exceptions</a> </li> <li><a href="namespace-Merchenta.Services.html">Services</a> </li> <li><a href="namespace-Merchenta.Util.html">Util</a> </li> </ul></li> <li><a href="namespace-PHP.html">PHP</a> </li> </ul> </div> <hr /> <div id="elements"> <h3>Exceptions</h3> <ul> <li><a href="class-Merchenta.Exceptions.AuthException.html">AuthException</a></li> <li><a href="class-Merchenta.Exceptions.IllegalArgumentException.html">IllegalArgumentException</a></li> <li class="active"><a href="class-Merchenta.Exceptions.MerchentaException.html">MerchentaException</a></li> </ul> </div> </div> </div> <div id="splitter"></div> <div id="right"> <div id="rightInner"> <form id="search"> <input type="hidden" name="cx" value="" /> <input type="hidden" name="ie" value="UTF-8" /> <input type="text" name="q" class="text" /> <input type="submit" value="Search" /> </form> <div id="navigation"> <ul> <li> <a href="index.html" title="Overview"><span>Overview</span></a> </li> <li> <a href="namespace-Merchenta.Exceptions.html" title="Summary of Merchenta\Exceptions"><span>Namespace</span></a> </li> <li> <a href="class-Merchenta.Exceptions.MerchentaException.html" title="Summary of Merchenta\Exceptions\MerchentaException"><span>Class</span></a> </li> </ul> <ul> <li> <a href="tree.html" title="Tree view of classes, interfaces, traits and exceptions"><span>Tree</span></a> </li> </ul> <ul> </ul> </div> <pre><code><span id="1" class="l"><a class="l" href="#1"> 1: </a><span class="xlang">&lt;?php</span> </span><span id="2" class="l"><a class="l" href="#2"> 2: </a><span class="php-keyword1">namespace</span> Merchenta\Exceptions; </span><span id="3" class="l"><a class="l" href="#3"> 3: </a> </span><span id="4" class="l"><a class="l" href="#4"> 4: </a><span class="php-keyword1">use</span> Exception; </span><span id="5" class="l"><a class="l" href="#5"> 5: </a> </span><span id="6" class="l"><a class="l" href="#6"> 6: </a><span class="php-comment">/** </span></span><span id="7" class="l"><a class="l" href="#7"> 7: </a><span class="php-comment"> * General exception </span></span><span id="8" class="l"><a class="l" href="#8"> 8: </a><span class="php-comment"> * </span></span><span id="9" class="l"><a class="l" href="#9"> 9: </a><span class="php-comment"> * @package exceptions </span></span><span id="10" class="l"><a class="l" href="#10">10: </a><span class="php-comment"> * @author Baptiste Pernet </span></span><span id="11" class="l"><a class="l" href="#11">11: </a><span class="php-comment"> */</span> </span><span id="12" class="l"><a class="l" href="#12">12: </a><span class="php-keyword1">class</span> <a id="MerchentaException" href="#MerchentaException">MerchentaException</a> <span class="php-keyword1">extends</span> Exception { </span><span id="13" class="l"><a class="l" href="#13">13: </a> </span><span id="14" class="l"><a class="l" href="#14">14: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$errors" href="#$errors">$errors</a></span>; </span><span id="15" class="l"><a class="l" href="#15">15: </a> <span class="php-keyword1">private</span> <span class="php-var"><a id="$curlInfo" href="#$curlInfo">$curlInfo</a></span>; </span><span id="16" class="l"><a class="l" href="#16">16: </a> </span><span id="17" class="l"><a class="l" href="#17">17: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setErrors" href="#_setErrors">setErrors</a>(<span class="php-keyword1">array</span> <span class="php-var">$errors</span>) { </span><span id="18" class="l"><a class="l" href="#18">18: </a> <span class="php-var">$this</span>-&gt;errors = <span class="php-var">$errors</span>; </span><span id="19" class="l"><a class="l" href="#19">19: </a> } </span><span id="20" class="l"><a class="l" href="#20">20: </a> </span><span id="21" class="l"><a class="l" href="#21">21: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getErrors" href="#_getErrors">getErrors</a>() { </span><span id="22" class="l"><a class="l" href="#22">22: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;errors; </span><span id="23" class="l"><a class="l" href="#23">23: </a> } </span><span id="24" class="l"><a class="l" href="#24">24: </a> </span><span id="25" class="l"><a class="l" href="#25">25: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_setCurlInfo" href="#_setCurlInfo">setCurlInfo</a>(<span class="php-keyword1">array</span> <span class="php-var">$info</span>) { </span><span id="26" class="l"><a class="l" href="#26">26: </a> <span class="php-var">$this</span>-&gt;curlInfo = <span class="php-var">$info</span>; </span><span id="27" class="l"><a class="l" href="#27">27: </a> } </span><span id="28" class="l"><a class="l" href="#28">28: </a> </span><span id="29" class="l"><a class="l" href="#29">29: </a> <span class="php-keyword1">public</span> <span class="php-keyword1">function</span> <a id="_getCurlInfo" href="#_getCurlInfo">getCurlInfo</a>() { </span><span id="30" class="l"><a class="l" href="#30">30: </a> <span class="php-keyword1">return</span> <span class="php-var">$this</span>-&gt;curlInfo; </span><span id="31" class="l"><a class="l" href="#31">31: </a> } </span><span id="32" class="l"><a class="l" href="#32">32: </a>} </span><span id="33" class="l"><a class="l" href="#33">33: </a></span></code></pre> <div id="footer"> Merchenta Php Documentation API documentation generated by <a href="http://apigen.org">ApiGen 2.8.0</a> </div> </div> </div> </body> </html>
sp4ce/merchenta-php
docs/source-class-Merchenta.Exceptions.MerchentaException.html
HTML
mit
6,735
// The MIT License (MIT) // // Copyright (c) Andrew Armstrong/FacticiusVir 2020 // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // This file was automatically generated and should not be edited directly. namespace SharpVk { /// <summary> /// Framebuffer blending factors. /// </summary> public enum BlendFactor { /// <summary> /// /// </summary> Zero = 0, /// <summary> /// /// </summary> One = 1, /// <summary> /// /// </summary> SourceColor = 2, /// <summary> /// /// </summary> OneMinusSourceColor = 3, /// <summary> /// /// </summary> DestinationColor = 4, /// <summary> /// /// </summary> OneMinusDestinationColor = 5, /// <summary> /// /// </summary> SourceAlpha = 6, /// <summary> /// /// </summary> OneMinusSourceAlpha = 7, /// <summary> /// /// </summary> DestinationAlpha = 8, /// <summary> /// /// </summary> OneMinusDestinationAlpha = 9, /// <summary> /// /// </summary> ConstantColor = 10, /// <summary> /// /// </summary> OneMinusConstantColor = 11, /// <summary> /// /// </summary> ConstantAlpha = 12, /// <summary> /// /// </summary> OneMinusConstantAlpha = 13, /// <summary> /// /// </summary> SourceAlphaSaturate = 14, /// <summary> /// /// </summary> Src1Color = 15, /// <summary> /// /// </summary> OneMinusSrc1Color = 16, /// <summary> /// /// </summary> Src1Alpha = 17, /// <summary> /// /// </summary> OneMinusSrc1Alpha = 18, } }
FacticiusVir/SharpVk
src/SharpVk/BlendFactor.gen.cs
C#
mit
3,218
/* An initial-boundary value problem in 1D u_t - u_xx = 2(x^2 - x)(2t - 1) - 4(t^2 - t), x \in (0, 1) -u_x(0, t) + 3u(0, t) = 2(t^2 - t) u_x(1, t) + 5u(1, t) = 2(t^2 - t) u(x, 0) = 0 Exact solution: u(x, t) = 2(t^2 - t)(x^2 - x) */ #include <iostream> #include <vector> #include <cmath> #include <joker-fdm/bvp1d.h> using namespace std; double zero (double x) { return 0; } double exact (double x, double t) { return 2 * (t * t - t) * (x * x - x); } double gfun (double x, double t) { return 2 * (x * x - x) * (2 * t - 1) - 4 * (t * t - t); } int main() { double L0 = 1; double T = 10; int K0 = 10; int tnum = 10; double rms_old; for (int test = 0; test <= 5; ++test) { vector<double> L(1); L[0] = L0; vector<int> K(1); K[0] = K0; Grid1D grid(L, K); Data1D data(1, grid); data.a[0][0] = 1; data.b[0][0] = 3; // data.w[0][0] will be defined later data.b[0][1] = 5; // data.w[0][1] will be defined later data.f[0][0][0] = data.df[0][0][0] = zero; double c = 1; double tau = T / tnum; data.c[0] = c / tau; vector<GridFunction1D> sol(1); sol[0].set_grid(grid); TimeGridFunction1D res(grid, tnum); // initial condition for (int n = 0; n <= K0; ++n) { sol[0](0, n) = 0; res(0, 0, n) = sol[0](0, n); } for (int m = 1; m <= tnum; ++m) { double t = m * tau; data.w[0][0] = data.w[0][1] = 2 * (t * t - t); for (int n = 0; n <= K0; ++n) { data.g[0](0, n) = gfun(grid.coord(0, n), t) + c / tau * sol[0](0, n); } Parameters1D param; param.max_Newton_iterations = 1; SolveBVP1D(data, param, sol); for (int n = 0; n <= K0; ++n) res(m, 0, n) = sol[0](0, n); } double rms = 0; for (int m = 0; m <= tnum; ++m) { for (int n = 0; n <= K0; ++n) rms += pow(res(m, 0, n) - exact(grid.coord(0, n), m * tau), 2); } rms = sqrt(rms / (K0 + 1) / (tnum + 1)); cout << "h = " << grid.h[0] << endl; cout << "tau = " << tau << endl; cout << "rms = " << rms << endl; if (test > 0) cout << "rms_old / rms = " << rms_old / rms << "\n\n"; rms_old = rms; K0 *= 2; tnum *= 4; } return 0; }
grenkin/joker-fdm
examples/bvp1d/ibvp3.cpp
C++
mit
2,443
/* * Smith and Associates package, js api. * * Copyright (c) 2017 N.F. Smith & Associates * * 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. */ /* * This file provides services for Valence Learning Framework API. */ /*jslint browser: true */ /*global D2L, jQuery, $, console, SMI */ (function ($) { "use strict"; window.SMI = { LEVERSION: '1.25', BAVERSION: '1.0', LPVERSION: '1.18', currentContext: {}, init: function (currentContext) { this.currentContext = currentContext; }, getUrls: function (name) { var urls = { user_grade: '/d2l/api/le/' + this.LEVERSION + '/' + this.currentContext.ou + '/grades/' + this.currentContext.gi + '/values/' + this.currentContext.ui, grade: '/d2l/api/le/' + this.LEVERSION + '/' + this.currentContext.ou + '/grades/' + this.currentContext.gi, grade_stats: '/d2l/api/le/' + this.LEVERSION + '/' + this.currentContext.ou + '/grades/' + this.currentContext.gi + '/statistics', associations: '/d2l/api/bas/' + this.BAVERSION + '/orgunits/' + this.currentContext.ou + '/associations/', issue_award: '/d2l/api/bas/' + this.BAVERSION + '/orgunits/' + this.currentContext.ou + '/issued/', who_am_i: '/d2l/api/lp/' + this.LPVERSION + '/users/whoami' }; return urls[name]; }, getAppContext: function () { var a = 'Bocs5Yg-9rEpxK_0L4dGUw', b = 'zEoByoY5l3sWLvBkwXAmcA'; return new D2L.ApplicationContext(a, b); }, getUserContext: function () { var c = 'https://smithweb.brightspace.com', d = '443', e = 'e9RfZgHDTu3vm_gqMPsmfC', f = 'DphdEgK0jpS_8P-ZXaZQWR'; return this.getAppContext().createUserContextWithValues(c, d, e, f); }, preCall: function (cb) { if (this.currentContext.prod) { $.get('/d2l/lp/auth/xsrf-tokens', cb); } else { cb({'hitCodePrefix': '-1315665569', 'referrerToken': 'Znpl0OTAb63pYv88SK92DaKkwZsArud9'}); } }, callAjax: function (m, u, cb, data) { if (typeof cb !== 'function') { cb = function (res, err) { if (res.status !== 200) { console.error(res.statusText, err); } }; } u = this.getUserContext().createUrlForAuthentication(u, m); var preCallback = function (d) { var settings = { type: m, url: u, complete: cb, headers: { 'X-Csrf-Token': d.referrerToken } }; if ('POST' === m.toUpperCase() || 'PUT' === m.toUpperCase()) { settings.dataType = 'json'; settings.contentType = "application/json"; settings.data = JSON.stringify(data); settings.headers.Accept = 'application/json'; settings.headers['Content-Type'] = 'application/json'; } $.ajax(settings); }; return this.preCall(preCallback); }, getAssociations: function (cb) { var url = this.getUrls('associations'); return this.callAjax('GET', url, cb); }, issueAward: function (cb, data) { var url = this.getUrls('issue_award'); return this.callAjax('POST', url, cb, data); }, getGrade: function (cb) { var url = this.getUrls('grade'); return this.callAjax('GET', url, cb); }, getGradeStats: function (cb) { var url = this.getUrls('grade_stats'); return this.callAjax('GET', url, cb); }, getUserGrade: function (cb) { var url = this.getUrls('user_grade'); return this.callAjax('GET', url, cb); }, putUserGrade: function (cb, data) { var url = this.getUrls('user_grade'); return this.callAjax('PUT', url, cb, data); }, generateIssuedAwardCreate: function (c, e) { return { AwardId: this.currentContext.ai, IssuedToUserId: this.currentContext.ui, Criteria: c, Evidence: e }; }, generateIncomingGradeValue: function (score, c, pc) { return { GradeObjectType: 1, PointsNumerator: score, Comments: { Content: c || '', Type: 'Text' }, PrivateComments: { Content: pc || '', Type: 'Text' } }; }, whoAmI: function (cb) { var url = this.getUrls('who_am_i'); return this.callAjax('GET', url, cb); } }; }(jQuery));
oscarchang1226/bsa
js/valence/valence-smith.js
JavaScript
mit
5,658
/* Less CSS Document */ @import "css/normalize.css"; @import "css/main.css"; @import "css/wp-core.css"; /* Theme Name: CSO Research Theme URI: http://csoresearch.com Description: Custom theme for the CSO Research website Author: CSO Research, Inc. Author URI: http://csoresearch.com Version: 1.0 Tags: License: License URI: */ /* Less CSS Document */ /* Will be auto compiled to CSS file on save */ .roboto { font-family: 'Roboto', sans-serif; font-weight: 300; } .condensed { font-family: 'Roboto Condensed', sans-serif; font-weight: 300; } body { font-family: 'Roboto', sans-serif; font-weight: 300; color: #333333; } h1, h2, h3, h4, h5, h6 { font-family: 'Roboto Condensed', sans-serif; font-weight: 300; } .main h2 { font-size: 3em; color: #f7931e; } .main h3 { font-size: 2em; color: #f7931e; } .main h4 { font-size: 1.5em; margin: 0; } svg { fill: #2b85c4; width: 1em; height: 1em; margin-bottom: -0.1em; } a { color: #2b85c4; text-decoration: none; } a:hover, a:active, a:focus { color: #194c70; } .grey { color: #999999; } .grey-link { color: #999999; } .grey-link a { color: #999999; } .grey-link a:hover, .grey-link a:active, .grey-link a:focus { color: #666666; } .white-link { color: #ffffff; } .white-link a { color: #ffffff; } .white-link a:hover, .white-link a:active, .white-link a:focus { color: #ffffff; text-decoration: underline; } .blue-link { color: #2b85c4; } .blue-link a { color: #2b85c4; } .blue-link a:hover, .blue-link a:active, .blue-link a:focus { color: #194c70; } .orange-link { color: #f7931e; } .orange-link a { color: #f7931e; } .orange-link a:hover, .orange-link a:active, .orange-link a:focus { color: #da7908; } .red-link { color: #c1272d; } .red-link a { color: #c1272d; } .red-link a:hover, .red-link a:active, .red-link a:focus { color: #971e23; } .green-link { color: #83bc3c; } .green-link a { color: #83bc3c; } .green-link a:hover, .green-link a:active, .green-link a:focus { color: #689530; } .small { font-size: .8em; } .align-center { text-align: center; } hr.lt-blue { border-color: #f5f5f5; border-width: .2em 0 0; } .indent { margin-left: 2em; } .indent2 { margin-left: 4em; } ol li ol { list-style: none; } ol li ol li:before { content: "- "; margin-left: -0.6em; } li img, li img.alignnone { margin: 0.4em 0 0.4em -0.8em; margin-left: -0.8em; } .jump-top { float: right; height: 5em; margin-left: 1em; } .jump-top svg { width: 1em; height: 1em; fill: #2b85c4; padding-right: .2em; margin-bottom: -0.2em; } @media screen and (max-width: 40em) { .jump-top { float: none; background-color: #f5f5f5; padding: .2em; height: auto; width: 6.5em; margin-left: calc(100% - 7em); } } /*clearfix http://css-tricks.com/snippets/css/clear-fix/ */ .group:after { content: ""; display: table; clear: both; } button { font-family: 'Roboto Condensed', sans-serif; font-weight: 300; } .btn-ease { transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } .button-orange, .button-blue { border-radius: .2em; border: none; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } .button-orange { background-color: #f7931e; color: #ffffff; padding: 0.04em 0.313em 0.08em 0.313em; } .button-orange:hover, .button-orange:active, .button-orange:focus { text-shadow: 0.063em 0.063em 0.063em #784304; } .button-orange a { color: #ffffff; } .button-orange a:hover, .button-orange a:active, .button-orange a:focus { color: #ffffff; } .button-blue { background-color: #2b85c4; color: #ffffff; font-family: 'Roboto Condensed', sans-serif; font-weight: 300; padding: 0.04em 0.5em 0.08em 0.5em; } .button-blue:hover, .button-blue:active, .button-blue:focus { background-color: #22699a; } .button-blue a { color: #ffffff; } .button-blue a:hover, .button-blue a:active, .button-blue a:focus { color: #ffffff; } input[type="submit"] { border-radius: .2em; border: none; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; background-color: #2b85c4; color: #ffffff; font-family: 'Roboto Condensed', sans-serif; font-weight: 300; padding: 0.04em 0.5em 0.08em 0.5em; font-family: 'Roboto', sans-serif; font-weight: 300; padding-bottom: .14em; } input[type="submit"]:hover, input[type="submit"]:active, input[type="submit"]:focus { background-color: #22699a; } input[type="submit"] a { color: #ffffff; } input[type="submit"] a:hover, input[type="submit"] a:active, input[type="submit"] a:focus { color: #ffffff; } #searchform input[type="submit"] { background-image: url(img/icons/search.svg); background-repeat: no-repeat; color: transparent; background-color: transparent; padding: 0px; height: 2em; width: 2em; } #searchform input[type="submit"]:hover { background-image: url(img/icons/search-blue.svg); } .demo { border-radius: .2em; border: none; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; background-color: #f7931e; color: #ffffff; padding: 0.04em 0.313em 0.08em 0.313em; } .demo:hover, .demo:active, .demo:focus { text-shadow: 0.063em 0.063em 0.063em #784304; } .demo a { color: #ffffff; } .demo a:hover, .demo a:active, .demo a:focus { color: #ffffff; } a[href*="screencast"], a[href$=".pdf"], a[href$=".doc"], a[href$=".xls"], a[href$=".csv"] { background-repeat: no-repeat; background-position: right center; background-size: 1em; padding-right: 1.2em; } a[href*="screencast.com"] { background-image: url(img/icons/video-icon.svg); } a[href$=".pdf"] { background-image: url(img/icons/pdf-icon.svg); } a[href$=".doc"] { background-image: url(img/icons/doc-icon.svg); } a[href$=".xls"], a[href$=".csv"] { background-image: url(img/icons/spreadsheet-icon.svg); } circle { fill: #2b85c4; } .cso path { fill: #ffffff; } .research path { fill: #89bfe5; } #header { width: 100%; height: 10em; position: relative; font-size: 1em; z-index: 3; } @media screen and (max-width: 61.5em) { #header { font-size: .8em; } } #header .logo { margin: 1.25em; float: left; } #header .logo svg { width: 7em; height: 7em; } #header nav { font-size: 1.3em; float: left; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; margin-top: calc(6em / 2); } @media screen and (max-width: 50em) { #header nav { display: none; } } #header nav ul { list-style: none; display: inherit; padding: 0; margin: 0; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } #header nav ul ul { visibility: hidden; opacity: 0; position: absolute; padding: 0.3em 0px; background-color: #ffffff; font-size: .8em; border-bottom: 0.125em solid #2b85c4; top: 1.875em; left: 0.3em; } #header nav li { display: inline-block; padding: 0 .5em; position: relative; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } #header nav li.demo { padding-bottom: 0.1em; } #header nav li:hover > ul { visibility: visible; opacity: 1; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } #header nav li li { display: block; white-space: nowrap; padding: .3em .5em; } #header nav li li:hover { background-color: #f5f5f5; } #header nav li:nth-last-child(2) { padding-right: 0.813em; } #header .contact { color: #999999; position: absolute; right: 1.25em; color: #999999; } #header .contact a { color: #999999; } #header .contact a:hover, #header .contact a:active, #header .contact a:focus { color: #666666; } #header .contact p { display: inline-block; padding-right: .3em; } #header .contact svg { height: 1.6em; width: 1.6em; display: inline-block; fill: #2b85c4; margin-bottom: -0.4em; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } #header .contact svg:hover { fill: #22699a; } @media screen and (max-width: 31em) { #header .contact { display: none; } } #header .search, #header .search-icon, #header .nav-icon { float: right; margin-right: 1.25em; } #header .search { margin-top: calc(8.2em / 2); } @media screen and (max-width: 74em) { #header .search { display: none; position: absolute; right: 0; top: 2em; background-color: #f5f5f5; padding: .5em; } #header .search input[type=submit] { border-radius: .2em; border: none; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; background-color: #2b85c4; color: #ffffff; font-family: 'Roboto Condensed', sans-serif; font-weight: 300; padding: 0.04em 0.5em 0.08em 0.5em; font-family: 'Roboto', sans-serif; font-weight: 300; padding-bottom: .14em; background-image: none; width: auto; height: auto; } #header .search input[type=submit]:hover, #header .search input[type=submit]:active, #header .search input[type=submit]:focus { background-color: #22699a; } #header .search input[type=submit] a { color: #ffffff; } #header .search input[type=submit] a:hover, #header .search input[type=submit] a:active, #header .search input[type=submit] a:focus { color: #ffffff; } #header .search input[type=submit]:hover { background-image: none; } } @media screen and (max-width: 50em) { #header .search { font-size: 2em; width: 100%; top: 0; margin-right: 0; text-align: right; box-shadow: 0 0.2em 0.1em rgba(51, 51, 51, 0.1); } #header .search input#s { width: calc(100% - 5.5em); } } #header .search-icon, #header .nav-icon { display: none; margin-top: calc(7.6em / 2); padding: .125em .3em .3em .3em; } @media screen and (max-width: 31em) { #header .search-icon, #header .nav-icon { margin-top: calc(4.9em / 2); } } @media screen and (max-width: 74em) { #header .search-icon { display: block; } } @media screen and (max-width: 50em) { #header .search-icon { margin-right: 0; } } @media screen and (max-width: 50em) { #header .nav-icon { display: block; } } @media screen and (max-width: 31em) { #header .nav-icon { margin-right: 0; } } #header .search-icon svg, #header .nav-icon svg { height: 2em; width: 2em; fill: #999999; } @media screen and (max-width: 50em) { #header .search-icon svg, #header .nav-icon svg { height: 4em; width: 4em; fill: #2b85c4; } } @media screen and (max-width: 31em) { #header .search-icon svg, #header .nav-icon svg { height: 5em; width: 5em; } } #header .active { background-color: #f5f5f5; border: 0.2em solid #f5f5f5; border-radius: .2em; } #header nav.mobile { position: absolute; text-align: right; right: .6em; font-size: 2em; top: 1em; background-color: #f5f5f5; padding: .5em; line-height: 1.8em; box-shadow: -0.2em 0.2em 0.1em 0 rgba(51, 51, 51, 0.1); z-index: 5; } @media screen and (max-width: 31em) { #header nav.mobile { right: 0; } } #header nav.mobile li { display: block; } #header nav.mobile li:nth-last-child(2) { padding-bottom: 0.6em; } #header nav.mobile li:hover > ul { visibility: hidden; opacity: 0; } #content { width: 100%; } #content #title-bar { background-color: #f5f5f5; width: 100%; height: 8em; background-image: url(../img/chains.jpg); background-position: left center; background-repeat: no-repeat; background-size: 40% auto; } @media screen and (max-width: 61.5em) { #content #title-bar { font-size: .8em; } } @media screen and (max-width: 50em) { #content #title-bar { font-size: .6em; } } @media screen and (max-width: 31em) { #content #title-bar { background-image: none !important; } } #content #title-bar .img-gradient { background: linear-gradient(to right, rgba(255, 255, 255, 0), #f5f5f5); height: inherit; position: absolute; left: 5em; width: calc(40% - 5em); float: left; } @media screen and (max-width: 31em) { #content #title-bar .img-gradient { display: none; } } #content #title-bar h1, #content #title-bar h2 { float: right; margin-right: 30px; color: #2b85c4; position: relative; } @media screen and (max-width: 50em) { #content #title-bar h1, #content #title-bar h2 { margin-right: 10px; } } .page:not(.page-child) #content #title-bar h1, .search-results #content #title-bar h1, .page-template-page-client-services-php #content #title-bar h1 { line-height: 1em; vertical-align: middle; margin-top: 0.3em; margin-bottom: 0.3em; font-size: 4.5em; } #content #title-bar h1 { font-size: 4em; margin-top: -0.1em; margin-bottom: .05em; } #content #title-bar h2 { clear: right; font-size: 2em; margin-top: -0.3em; } #content .breadcrumbs { margin-left: 30px; font-size: .8em; color: #999999; color: #999999; margin-bottom: 1.5em; } #content .breadcrumbs a { color: #999999; } #content .breadcrumbs a:hover, #content .breadcrumbs a:active, #content .breadcrumbs a:focus { color: #666666; } @media screen and (max-width: 50em) { #content .breadcrumbs { margin-left: 10px; } } @media screen and (max-width: 31em) { #content .breadcrumbs { display: none; } } #content .sidebar-icon { display: none; margin-left: 10px; padding-top: .5em; width: 100%; color: #999999; font-size: .8em; margin-bottom: 1.5em; clear: both; } #content .sidebar-icon a { color: #999999; } #content .sidebar-icon a:hover, #content .sidebar-icon a:active, #content .sidebar-icon a:focus { color: #666666; } #content .sidebar-icon p { display: inline; } @media screen and (max-width: 31em) { #content .sidebar-icon { display: block; } } #content .sidebar-icon svg { height: 1.5em; width: 1.5em; fill: #dcdcdc; margin-bottom: -0.4em; } #content .sidebar-icon a:hover svg { fill: #666666; } #content .sidebar-icon.bottom { border-bottom: 0.2em dotted #F5F5F5; padding-bottom: .5em; } #content .main { width: calc(100% - 18.3em); margin: 0 30px 0 0; float: right; vertical-align: top; } @media screen and (max-width: 50em) { #content .main { font-size: .8em; width: calc(100% - 17.9em); margin-right: 20px; } } @media screen and (max-width: 31em) { #content .main { float: none; font-size: .8em; width: calc(100% - 21px); margin: 0 10px; } } @media screen and (max-width: 50em) { #content .main h2 { font-size: 2.5em; } } #content .main h2:first-child { margin-top: -0.35em; } #content .main img { max-width: 100%; height: auto; } #content #sidebar { width: 12em; margin: -0.3em 2.25em 0 30px; vertical-align: top; color: #2b85c4; float: left; } #content #sidebar .menus { font-size: 1.2em; } #content #sidebar .widgets { border-top: dotted 0.2em #f5f5f5; margin-top: .7em; padding-top: .7em; } #content #sidebar .widgets h4.widgettitle { font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 1.2em; text-transform: uppercase; margin: .8em 0; } @media screen and (max-width: 50em) { #content #sidebar { font-size: 1em; margin-left: 20px; margin-right: 1.5em; } } @media screen and (max-width: 31em) { #content #sidebar { float: none; margin-left: 20px; margin-right: 20px; width: calc(100% - 40px); } #content #sidebar .menus, #content #sidebar .widgets { display: inline-block; width: calc(50% - .9em); vertical-align: top; border-bottom: none; } #content #sidebar .widgets { margin-left: 1.5em; border-top: none; margin-top: 0; } } @media screen and (max-width: 21em) { #content #sidebar .menus, #content #sidebar .widgets { display: block; width: 100%; margin-left: 0; } #content #sidebar .menus { border-bottom: dotted 0.2em #f5f5f5; } } #content #sidebar ul.menu { font-size: 1.2em; } #content #sidebar ul.menu li ul { list-style: none; padding-left: 1em; } #content #sidebar ul.menu:first-of-type ul { margin-top: 0; } #content #sidebar nav ul, #content #sidebar ul.menu { list-style: none; padding-left: 1em; text-transform: uppercase; } #content #sidebar nav ul:first-child, #content #sidebar ul.menu:first-child { padding-left: 0; } #content #sidebar nav ul li ul, #content #sidebar ul.menu li ul { margin-top: .3em; font-size: .8em; text-transform: none; } #content #sidebar nav ul li ul li.current_page_item:before, #content #sidebar ul.menu li ul li.current_page_item:before { content: "> "; } #content #sidebar nav ul li ul li, #content #sidebar ul.menu li ul li { padding-left: .8em; text-indent: -0.8em; } #content #sidebar nav:first-child ul { margin-top: 0; } @media screen and (min-width: 31em) { .page-template-page-client-services-php #content .main { width: calc(100% - 20.3em); padding-right: 2em; } } .page-template-page-client-services-php.page-id-90 #title { display: none; } .page-template-page-client-services-php #title { width: 23em; float: left; margin-bottom: 2em; height: 7em; line-height: 7em; } .page-template-page-client-services-php #title span { display: inline-block; line-height: 0; vertical-align: middle; width: 15em; } .page-template-page-client-services-php #title span h2, .page-template-page-client-services-php #title span h2:first-child { color: #333333; line-height: 1.1em; margin: 0; } .page-template-page-client-services-php #title svg { width: 6em; height: 6em; fill: #ffffff; border-radius: .3em; float: left; padding: .5em; margin-right: 1em; } @media screen and (max-width: 50em) { .page-template-page-client-services-php #title svg { margin-top: -0.6em; } } @media screen and (max-width: 31em) { .page-template-page-client-services-php #title { float: none; margin-left: auto; margin-right: auto; } } .page-template-page-client-services-php.page-id-91 #title svg, .page-template-page-client-services-php.parent-pageid-91 #title svg { background-color: #2b85c4; } .page-template-page-client-services-php.page-id-93 #title svg, .page-template-page-client-services-php.parent-pageid-93 #title svg, .page-template-page-client-services-php.parent-pageid-94 #title svg { background-color: #f7931e; } .page-template-page-client-services-php.page-id-105 #title svg, .page-template-page-client-services-php.parent-pageid-105 #title svg, .page-template-page-client-services-php.parent-pageid-155 #title svg, .page-template-page-client-services-php.parent-pageid-106 #title svg { background-color: #c1272d; } .page-template-page-client-services-php.page-id-107 #title svg, .page-template-page-client-services-php.parent-pageid-107 #title svg { background-color: #83bc3c; } .page-template-page-client-services-php #content .info { float: right; width: 25em; height: 7em; border: solid 0.2em #f5f5f5; border-radius: 1em; box-sizing: border-box; padding: 0 .5em; display: table; } .page-template-page-client-services-php #content .info .info-box { font-size: .8em; display: table-cell; vertical-align: middle; } .page-template-page-client-services-php #content .info .info-box h3 { font-size: 1.5em; margin: .5em 0; color: #333333; } .page-template-page-client-services-php #content .info .info-box h3 a { color: #2b85c4; } .page-template-page-client-services-php #content .info .info-box h3 a a { color: #2b85c4; } .page-template-page-client-services-php #content .info .info-box h3 a a:hover, .page-template-page-client-services-php #content .info .info-box h3 a a:active, .page-template-page-client-services-php #content .info .info-box h3 a a:focus { color: #194c70; } @media screen and (max-width: 74em) { .page-template-page-client-services-php #content .info { float: none; clear: both; width: calc(100% - 4em); margin: 2em; min-height: 7em; height: auto; padding-bottom: .5em; } } .page-template-page-client-services-php .main .content { clear: both; } .page-template-page-client-services-php .main .content h3 { color: #2b85c4; margin-bottom: 0; } .page-template-page-client-services-php .main .content svg { width: .8em; height: .8em; float: left; padding: .15em; border-radius: .1em; fill: #ffffff; margin-top: .15em; margin-right: .2em; } .page-template-page-client-services-php .main .content .social li { height: 3em; } .page-template-page-client-services-php .main .content .social span { margin-top: .5em; display: inline-block; } .page-template-page-client-services-php .main .content .social svg { background-color: transparent; fill: #2b85c4; width: 2em; height: 2em; } .page-template-page-client-services-php.page-id-91 .main svg, .page-template-page-client-services-php.parent-pageid-91 .main svg { background-color: #2b85c4; } .page-template-page-client-services-php.page-id-93 .main h3, .page-template-page-client-services-php.parent-pageid-93 .main h3, .page-template-page-client-services-php.parent-pageid-94 .main h3 { color: #f7931e; } .page-template-page-client-services-php.page-id-93 .main h3 a, .page-template-page-client-services-php.parent-pageid-93 .main h3 a, .page-template-page-client-services-php.parent-pageid-94 .main h3 a { color: #f7931e; } .page-template-page-client-services-php.page-id-93 .main h3 a:hover, .page-template-page-client-services-php.parent-pageid-93 .main h3 a:hover, .page-template-page-client-services-php.parent-pageid-94 .main h3 a:hover, .page-template-page-client-services-php.page-id-93 .main h3 a:active, .page-template-page-client-services-php.parent-pageid-93 .main h3 a:active, .page-template-page-client-services-php.parent-pageid-94 .main h3 a:active, .page-template-page-client-services-php.page-id-93 .main h3 a:focus, .page-template-page-client-services-php.parent-pageid-93 .main h3 a:focus, .page-template-page-client-services-php.parent-pageid-94 .main h3 a:focus { color: #da7908; } .page-template-page-client-services-php.page-id-93 .main svg, .page-template-page-client-services-php.parent-pageid-93 .main svg, .page-template-page-client-services-php.parent-pageid-94 .main svg { background-color: #f7931e; } .page-template-page-client-services-php.page-id-105 .main h3, .page-template-page-client-services-php.parent-pageid-105 .main h3, .page-template-page-client-services-php.parent-pageid-155 .main h3 { color: #c1272d; } .page-template-page-client-services-php.page-id-105 .main h3 a, .page-template-page-client-services-php.parent-pageid-105 .main h3 a, .page-template-page-client-services-php.parent-pageid-155 .main h3 a { color: #c1272d; } .page-template-page-client-services-php.page-id-105 .main h3 a:hover, .page-template-page-client-services-php.parent-pageid-105 .main h3 a:hover, .page-template-page-client-services-php.parent-pageid-155 .main h3 a:hover, .page-template-page-client-services-php.page-id-105 .main h3 a:active, .page-template-page-client-services-php.parent-pageid-105 .main h3 a:active, .page-template-page-client-services-php.parent-pageid-155 .main h3 a:active, .page-template-page-client-services-php.page-id-105 .main h3 a:focus, .page-template-page-client-services-php.parent-pageid-105 .main h3 a:focus, .page-template-page-client-services-php.parent-pageid-155 .main h3 a:focus { color: #971e23; } .page-template-page-client-services-php.page-id-105 .main svg, .page-template-page-client-services-php.parent-pageid-105 .main svg, .page-template-page-client-services-php.parent-pageid-155 .main svg { background-color: #c1272d; } .page-template-page-client-services-php.page-id-107 .main h3, .page-template-page-client-services-php.parent-pageid-107 .main h3 { color: #83bc3c; } .page-template-page-client-services-php.page-id-107 .main h3 a, .page-template-page-client-services-php.parent-pageid-107 .main h3 a { color: #83bc3c; } .page-template-page-client-services-php.page-id-107 .main h3 a:hover, .page-template-page-client-services-php.parent-pageid-107 .main h3 a:hover, .page-template-page-client-services-php.page-id-107 .main h3 a:active, .page-template-page-client-services-php.parent-pageid-107 .main h3 a:active, .page-template-page-client-services-php.page-id-107 .main h3 a:focus, .page-template-page-client-services-php.parent-pageid-107 .main h3 a:focus { color: #689530; } .page-template-page-client-services-php.page-id-107 .main svg, .page-template-page-client-services-php.parent-pageid-107 .main svg { background-color: #83bc3c; } .page-template-page-client-services-php #quick-support { position: absolute; right: 0; top: 14em; background-color: rgba(247, 147, 30, 0.85); padding: .5em; border-radius: .2em 0 0 .2em; color: #ffffff; font-family: 'Roboto Condensed', sans-serif; font-weight: 300; font-size: 1.2em; z-index: 10; margin-top: 2em; } .page-template-page-client-services-php #quick-support a { color: #ffffff; } .page-template-page-client-services-php #quick-support a:hover, .page-template-page-client-services-php #quick-support a:active, .page-template-page-client-services-php #quick-support a:focus { color: #ffffff; text-decoration: underline; } .page-template-page-client-services-php #quick-support.sticky { position: fixed; top: 0em; } @media screen and (max-width: 31em) { .page-template-page-client-services-php #quick-support.sticky { top: auto; } } .page-template-page-client-services-php #quick-support svg { height: 1.8em; width: 1.8em; fill: #ffffff; display: block; margin: 0 auto; } .page-template-page-client-services-php #quick-support ul { list-style: none; padding: 0; margin: 0; text-align: center; } .page-template-page-client-services-php #quick-support ul li { margin-bottom: .4em; } .page-template-page-client-services-php #quick-support ul li:hover [class^="icon-"], .page-template-page-client-services-php #quick-support ul li:hover [class*=" icon-"] { fill: rgba(255, 255, 255, 0.7); } @media screen and (max-width: 61.5em) { .page-template-page-client-services-php #quick-support { font-size: 1em; } } @media screen and (max-width: 50em) { .page-template-page-client-services-php #quick-support { top: 18em; } } @media screen and (max-width: 31em) { .page-template-page-client-services-php #quick-support { position: fixed; top: auto; bottom: 0; width: 100%; font-size: 1.2em; padding: .3em 0; border-radius: 0; background-color: rgba(247, 147, 30, 0.9); } .page-template-page-client-services-php #quick-support svg { display: none; } .page-template-page-client-services-php #quick-support ul { width: 100%; } .page-template-page-client-services-php #quick-support ul li { display: inline-block; width: 18%; } } .page-template-page-client-services-php #content #sidebar svg { height: 1.1em; width: 1.1em; fill: #ffffff; padding: .15em; vertical-align: middle; border-radius: .2em; margin: 0 .2em .2em 0; background-color: #2b85c4; } .page-template-page-client-services-php #content #sidebar ul.menu { font-size: 1em; } .page-template-page-client-services-php #content #sidebar nav.menu-client-services-container ul li ul li.current_page_item:before { content: ""; } .page-template-page-client-services-php #content #sidebar li { margin-top: 1em; } .page-template-page-client-services-php #content #sidebar li:first-of-type { margin-top: 0; } .page-template-page-client-services-php #content #sidebar li.menu-item-100 svg { background-color: #f7931e; } .page-template-page-client-services-php #content #sidebar li.menu-item-111 div { display: inline-block; width: calc(100% - 1.7em); } .page-template-page-client-services-php #content #sidebar li.menu-item-111 svg { background-color: #c1272d; vertical-align: top; } .page-template-page-client-services-php #content #sidebar li.menu-item-109 svg { background-color: #83bc3c; } .page-template-page-client-services-php #content #sidebar ul ul li, .page-template-page-client-services-php #content #sidebar ul.menu li ul li { margin-top: 0; text-indent: -1.3em; padding-left: 1.3em; } .page-template-page-client-services-php #content #sidebar ul ul li svg, .page-template-page-client-services-php #content #sidebar ul.menu li ul li svg { height: 1em; width: 1em; fill: #2b85c4; padding: 0px 0.3em .2em 0px; vertical-align: middle; background-color: transparent; margin: 0; border-radius: 0; } .page-template-page-client-services-php #content #sidebar ul li.menu-item-100 ul li svg { background-color: transparent; fill: #f7931e; } .page-template-page-client-services-php #content #sidebar ul li.menu-item-111 ul li svg { background-color: transparent; fill: #c1272d; } .page-template-page-client-services-php #content #sidebar ul li.menu-item-109 ul li svg { background-color: transparent; fill: #83bc3c; } .page-template-page-client-services-php #content #sidebar li.menu-item-100 { color: #f7931e; } .page-template-page-client-services-php #content #sidebar li.menu-item-100 a { color: #f7931e; } .page-template-page-client-services-php #content #sidebar li.menu-item-100 a:hover, .page-template-page-client-services-php #content #sidebar li.menu-item-100 a:active, .page-template-page-client-services-php #content #sidebar li.menu-item-100 a:focus { color: #da7908; } .page-template-page-client-services-php #content #sidebar li.menu-item-111 { color: #c1272d; } .page-template-page-client-services-php #content #sidebar li.menu-item-111 a { color: #c1272d; } .page-template-page-client-services-php #content #sidebar li.menu-item-111 a:hover, .page-template-page-client-services-php #content #sidebar li.menu-item-111 a:active, .page-template-page-client-services-php #content #sidebar li.menu-item-111 a:focus { color: #971e23; } .page-template-page-client-services-php #content #sidebar li.menu-item-109 { color: #83bc3c; } .page-template-page-client-services-php #content #sidebar li.menu-item-109 a { color: #83bc3c; } .page-template-page-client-services-php #content #sidebar li.menu-item-109 a:hover, .page-template-page-client-services-php #content #sidebar li.menu-item-109 a:active, .page-template-page-client-services-php #content #sidebar li.menu-item-109 a:focus { color: #689530; } .page-template-page-client-services-php #content #sidebar .menus #searchform { margin-top: 1em; } .page-template-page-client-services-php #content #sidebar .menus #searchform input[type="submit"] { width: 1.5em; height: 1.5em; } .page-template-page-client-services-php #content #sidebar .menus #s { width: calc(100% - 2.1em); } .page-template-page-client-services-php .cs-home { width: calc(100% - 5em); max-width: 50em; margin-left: auto; margin-right: auto; } .page-template-page-client-services-php .cs-home .item { width: 50%; float: left; margin-top: 4em; } @media screen and (max-width: 61.5em) { .page-template-page-client-services-php .cs-home .item { width: 100%; } } .page-template-page-client-services-php .cs-home .item h3 { margin-top: 0; font-size: 1.6em; } .page-template-page-client-services-php .cs-home .item p { font-size: .8em; margin-top: .5em; } .page-template-page-client-services-php .cs-home .item svg { width: 5em; height: 5em; fill: #ffffff; padding: .75em; margin-right: .8em; border-radius: .2em; margin-top: .5em; } @media screen and (max-width: 61.5em) { .page-template-page-client-services-php .cs-home .item svg { margin-top: 0; } } .page-template-page-client-services-php .cs-home .item div { float: left; width: calc(100% - 7.5em); } .page-template-page-client-services-php .cs-home .item.support svg { background-color: #2b85c4; } .page-template-page-client-services-php .cs-home .item.university h3 { color: #f7931e; } .page-template-page-client-services-php .cs-home .item.university h3 a { color: #f7931e; } .page-template-page-client-services-php .cs-home .item.university h3 a:hover, .page-template-page-client-services-php .cs-home .item.university h3 a:active, .page-template-page-client-services-php .cs-home .item.university h3 a:focus { color: #da7908; } .page-template-page-client-services-php .cs-home .item.university svg { background-color: #f7931e; } .page-template-page-client-services-php .cs-home .item.community h3 { color: #c1272d; } .page-template-page-client-services-php .cs-home .item.community h3 a { color: #c1272d; } .page-template-page-client-services-php .cs-home .item.community h3 a:hover, .page-template-page-client-services-php .cs-home .item.community h3 a:active, .page-template-page-client-services-php .cs-home .item.community h3 a:focus { color: #971e23; } .page-template-page-client-services-php .cs-home .item.community svg { background-color: #c1272d; } .page-template-page-client-services-php .cs-home .item.products h3 { color: #83bc3c; } .page-template-page-client-services-php .cs-home .item.products h3 a { color: #83bc3c; } .page-template-page-client-services-php .cs-home .item.products h3 a:hover, .page-template-page-client-services-php .cs-home .item.products h3 a:active, .page-template-page-client-services-php .cs-home .item.products h3 a:focus { color: #689530; } .page-template-page-client-services-php .cs-home .item.products svg { background-color: #83bc3c; } .page-template-page-client-services-php.page-id-94 .webinar-description { margin-top: 2em; } .page-template-page-client-services-php.page-id-94 .webinar-description div:nth-child(even) { display: none; } .page-template-page-client-services-php.page-id-94 .webinar-description h4 { color: #2b85c4; font-size: 1.5em; } .page-template-page-client-services-php.page-id-94 .webinar-description h4 a { color: #2b85c4; } .page-template-page-client-services-php.page-id-94 .webinar-description h4 a:hover, .page-template-page-client-services-php.page-id-94 .webinar-description h4 a:active, .page-template-page-client-services-php.page-id-94 .webinar-description h4 a:focus { color: #194c70; } .page-template-page-client-services-php div.webinar:last-of-type { margin-bottom: 0; } .page-template-page-client-services-php .webinar { margin-bottom: -1em; } .page-template-page-client-services-php .webinar h4 { background-color: #f5f5f5; border-radius: .2em; padding: 0.04em 0.5em 0.08em; font-size: 1.2em; } .page-template-page-client-services-php .webinar h4, .page-template-page-client-services-php .webinar p { display: inline-block; } .page-template-page-client-services-php .webinar p { padding-right: .5em; padding-left: .5em; } .page-template-page-client-services-php .webinar p:first-of-type { border-right: solid 0.1em #4b9dd7; padding-right: .7em; margin-left: .5em; } .page-template-page-client-services-php .webinar p:last-of-type { font-size: 1.2em; margin-left: .5em; margin-top: 0; } @media screen and (max-width: 74em) { .page-template-page-client-services-php .webinar { margin-bottom: 1em; } .page-template-page-client-services-php .webinar h4 { display: block; margin-bottom: -0.2em; } } @media screen and (max-width: 40em) { .page-template-page-client-services-php .webinar { margin-top: 2em; } .page-template-page-client-services-php .webinar p, .page-template-page-client-services-php .webinar p:first-of-type { display: block; margin-left: 1em; margin-top: .5em; margin-bottom: .5em; border: none; padding: 0; } .page-template-page-client-services-php .webinar p:last-of-type, .page-template-page-client-services-php .webinar p:first-of-type:last-of-type { font-size: 1.2em; text-align: center; width: 3.3em; padding: 0.04em 0.5em 0.08em; margin-left: .8em; } } .category .content, .tag .content { margin-left: 3em; } .category .content h3, .tag .content h3 { margin-bottom: .2em; } .category .content .tags span, .tag .content .tags span { background-color: #f5f5f5; margin-right: .5em; padding: .2em .5em .3em; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } .category .content .tags span:hover, .tag .content .tags span:hover { background-color: #dcdcdc; } @media screen and (max-width: 31em) { .category .content, .tag .content { margin-left: 0; } } .category #sidebar li.page-item-126:before, .tag #sidebar li.page-item-126:before { content: "> "; } .enews-nav { font-size: 1.5em; margin-top: 2em; } .enews-nav .right { float: right; } @media screen and (max-width: 31em) { .enews-nav button, .enews-nav button.right { float: none; clear: both; width: 10em; margin-bottom: .5em; display: block; margin-left: auto; margin-right: auto; } } .search #content .main h2, .search #content .main h3 { margin-bottom: 0; } .search .main #searchform { font-size: 1.2em; margin-left: 2em; margin-bottom: 2em; } .search .main #searchform p { margin-bottom: 0; } .search .main #searchform #s { width: 20em; } @media screen and (max-width: 40em) { .search .main #searchform #s { width: calc(100% - 4em); } } .search .post-91 h3, .search .parent-pageid-91 h3 { color: #2b85c4; } .search .post-91 svg, .search .parent-pageid-91 svg { background-color: #2b85c4; } .search .post-93 h3, .search .parent-pageid-93 h3, .search .parent-pageid-94 h3, .search .webinar h3 { color: #f7931e; } .search .post-93 h3 a, .search .parent-pageid-93 h3 a, .search .parent-pageid-94 h3 a, .search .webinar h3 a { color: #f7931e; } .search .post-93 h3 a:hover, .search .parent-pageid-93 h3 a:hover, .search .parent-pageid-94 h3 a:hover, .search .webinar h3 a:hover, .search .post-93 h3 a:active, .search .parent-pageid-93 h3 a:active, .search .parent-pageid-94 h3 a:active, .search .webinar h3 a:active, .search .post-93 h3 a:focus, .search .parent-pageid-93 h3 a:focus, .search .parent-pageid-94 h3 a:focus, .search .webinar h3 a:focus { color: #da7908; } .search .post-93 svg, .search .parent-pageid-93 svg, .search .parent-pageid-94 svg, .search .webinar svg { background-color: #f7931e; } .search .post-105 h3, .search .parent-pageid-105 h3, .search .parent-pageid-155 h3 { color: #c1272d; } .search .post-105 h3 a, .search .parent-pageid-105 h3 a, .search .parent-pageid-155 h3 a { color: #c1272d; } .search .post-105 h3 a:hover, .search .parent-pageid-105 h3 a:hover, .search .parent-pageid-155 h3 a:hover, .search .post-105 h3 a:active, .search .parent-pageid-105 h3 a:active, .search .parent-pageid-155 h3 a:active, .search .post-105 h3 a:focus, .search .parent-pageid-105 h3 a:focus, .search .parent-pageid-155 h3 a:focus { color: #971e23; } .search .post-105 svg, .search .parent-pageid-105 svg, .search .parent-pageid-155 svg { background-color: #c1272d; } .search .post-107 h3, .search .parent-pageid-107 h3 { color: #83bc3c; } .search .post-107 h3 a, .search .parent-pageid-107 h3 a { color: #83bc3c; } .search .post-107 h3 a:hover, .search .parent-pageid-107 h3 a:hover, .search .post-107 h3 a:active, .search .parent-pageid-107 h3 a:active, .search .post-107 h3 a:focus, .search .parent-pageid-107 h3 a:focus { color: #689530; } .search .post-107 svg, .search .parent-pageid-107 svg { background-color: #83bc3c; } iframe.client-map { width: 100%; height: 40em; } @media screen and (max-width: 50em) { iframe.client-map { height: 30em; } } .two-column { width: 100%; } .two-column .left, .two-column .right { width: 50%; float: left; } .two-column .left ul, .two-column .right ul { list-style: none; margin-top: 0; } .two-column .left { max-width: 30em; } .page-id-472 #home .overview { background-color: transparent; } button.enews { width: 100%; font-size: 1.3em; text-align: left; padding-bottom: .2em; margin: 1em 0; } button.enews svg { fill: #ffffff; width: 2em; height: 2em; float: left; padding-right: 0.7em; margin-top: 0.4em; padding-left: .3em; } #cboxContent #cboxLoadedContent { background-color: #f5f5f5; } .tagcloud { line-height: 1em; text-align: center; color: #f7931e; margin-bottom: 2em; } .tagcloud a { color: #f7931e; } .tagcloud a:hover, .tagcloud a:active, .tagcloud a:focus { color: #da7908; } ul.tweets { list-style: none; padding-left: 0; color: #333333; font-size: .8em; } ul.tweets li { margin-bottom: 1em; } ul.tweets li em a { color: #999999; } ul.tweets li em a a { color: #999999; } ul.tweets li em a a:hover, ul.tweets li em a a:active, ul.tweets li em a a:focus { color: #666666; } .mg_filter { margin-top: 1em; } ul.mg_cust_options li { text-indent: -1.5em; padding-left: 1.5em; } ul.mg_cust_options li span { margin-left: -0.2em; } ul.mg_cust_options i { text-indent: 0; } .page-numbers { padding: 0; list-style: none; } .page-numbers li { display: inline; } .page-numbers li a, .page-numbers li span { background-color: #f5f5f5; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; padding: .1em 0.4em .2em; } .page-numbers li:hover a { background-color: #dcdcdc; } .page-numbers li span.current { background-color: #2b85c4; color: #ffffff; display: inline-block; } .collapseomatic.colomat-hover { text-decoration: none; color: #666666; } span.collapseomatic { background: none; padding-left: 0; } span.collapseomatic:before { content: "+ "; } span.colomat-close:before { content: "- \00a0"; } span.expand { font-size: 1.2em; display: block; width: 100%; background-color: #f5f5f5; text-align: center; border-radius: .2em; padding-top: .2em; height: 1.2em; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } span.expand:hover { background-color: #dcdcdc; } .page.page-id-6 .tshowcase, .single.page-id-6 .tshowcase, .archive.page-id-6 .tshowcase { margin-top: -2em; } .page ul#ts-filter-nav li.ts-current-li, .single ul#ts-filter-nav li.ts-current-li, .archive ul#ts-filter-nav li.ts-current-li, .page ul#ts-enhance-filter-nav li.ts-current-li, .single ul#ts-enhance-filter-nav li.ts-current-li, .archive ul#ts-enhance-filter-nav li.ts-current-li, .page ul#ts-filter-nav li:hover, .single ul#ts-filter-nav li:hover, .archive ul#ts-filter-nav li:hover, .page ul#ts-enhance-filter-nav li:hover, .single ul#ts-enhance-filter-nav li:hover, .archive ul#ts-enhance-filter-nav li:hover { background-color: #2b85c4; border-radius: .1em; } .page ul#ts-filter-nav li, .single ul#ts-filter-nav li, .archive ul#ts-filter-nav li, .page ul#ts-enhance-filter-nav li, .single ul#ts-enhance-filter-nav li, .archive ul#ts-enhance-filter-nav li { font-family: 'Roboto Condensed', sans-serif; font-weight: 300; font-size: 1.5em; padding-bottom: .4em; } .page div.tshowcase-box-photo.ts-grayscale, .single div.tshowcase-box-photo.ts-grayscale, .archive div.tshowcase-box-photo.ts-grayscale { filter: none; } .page .tshowcase-box-title, .single .tshowcase-box-title, .archive .tshowcase-box-title { font-size: 1.5em; margin: .5em 0; color: #f7931e; } .page .tshowcase-single-position, .single .tshowcase-single-position, .archive .tshowcase-single-position { font-weight: bold; } .page .tshowcase-single-position, .single .tshowcase-single-position, .archive .tshowcase-single-position, .page .tshowcase-single-location, .single .tshowcase-single-location, .archive .tshowcase-single-location, .page .tshowcase-single-website, .single .tshowcase-single-website, .archive .tshowcase-single-website, .page .tshowcase-single-telephone, .single .tshowcase-single-telephone, .archive .tshowcase-single-telephone { margin: .2em 0; text-indent: -0.75em; padding-left: 1.5em; } .page .tshowcase-single-freehtml, .single .tshowcase-single-freehtml, .archive .tshowcase-single-freehtml { margin-top: 1em; border-top: solid 0.2em #f5f5f5; font-style: italic; padding-top: .5em; } .page i.fa, .single i.fa, .archive i.fa { color: #f7931e; padding-right: .3em; } .page i.fa.fa-graduation-cap, .single i.fa.fa-graduation-cap, .archive i.fa.fa-graduation-cap { padding-right: .2em; margin-left: -0.1em; font-size: 0.9em; } .page tr.ts-align-left td:nth-child(2), .single tr.ts-align-left td:nth-child(2), .archive tr.ts-align-left td:nth-child(2) { font-size: 1.2em; color: #2b85c4; } .page .tshowcase-box-table .ts-square img, .single .tshowcase-box-table .ts-square img, .archive .tshowcase-box-table .ts-square img { margin-top: .2em; margin-bottom: -0.2em; } .page .tshowcase-vcard-right, .single .tshowcase-vcard-right, .archive .tshowcase-vcard-right { margin-left: 10em; } .main .wFormContainer { margin: -1em 0 0 0; } .main .wFormContainer .wForm { padding: 0; margin-top: -1em; } .main .wFormContainer .wFormTitle { margin-top: -0.5em; } .main .wFormContainer .wForm h1, .main .wFormContainer .wForm h2, .main .wFormContainer .wForm h3 { margin: 0 0 .5em 0; font-family: 'Roboto Condensed', sans-serif; font-weight: 300; } .main .wFormContainer .wForm .label.preField { font-family: 'Roboto Condensed', sans-serif; font-weight: 300; font-size: 1.2em; } .main .wFormContainer .supportInfo { padding: .1em; font-size: 1em; } .main .wFormContainer .inputWrapper, .main .wFormContainer input, .main .wFormContainer textarea { max-width: 100%; } @media screen and (max-width: 31em) { .main .wFormContainer .wForm label.label.preField, .main .wFormContainer .inputWrapper { font-size: 1.5em; } } #home { width: 100%; } #home #tagline { width: inherit; text-align: center; position: relative; z-index: 2; background-color: #ffffff; border-bottom: 3em solid #ffffff; margin-bottom: -3em; } #home #tagline svg { width: 800px; height: auto; } #home #tagline svg .tagline-icon { fill: #f7931e; } #home #tagline svg .tagline-text { fill: #2b85c4; font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 3.25em; } @media screen and (max-width: 61.5em) { #home #tagline svg { width: 90%; } } #home .overview { width: calc(100% - 3em); background-color: #f5f5f5; padding: 1.5em; margin-top: 3em; position: relative; z-index: 2; } @media screen and (max-width: 74em) { #home .overview { font-size: .8em; } } #home .overview .overview-item { width: calc((100% - 8em) / 4); text-align: center; float: left; padding: 1em; vertical-align: top; } @media screen and (max-width: 61.5em) { #home .overview .overview-item { width: calc((100% - 4em) / 2); } #home .overview .overview-item:nth-child(3) { clear: left; } } @media screen and (max-width: 31em) { #home .overview .overview-item { width: calc(100% - 2em); float: none; clear: both; } } #home .overview .overview-item svg { width: 12em; height: 12em; border-radius: 50%; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } #home .overview .overview-item svg circle { fill: #2b85c4; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } #home .overview .overview-item svg path { fill: #ffffff; } #home .overview .overview-item svg:hover { box-shadow: 0 0 0.3em 0.1em rgba(153, 153, 153, 0.8); } #home .overview .overview-item svg:hover circle { fill: #2677af; } #home .overview .overview-item h3 { font-size: 1.5em; } #home .overview .overview-item p { font-size: 1.2em; } #home .details-wrapper { width: 100%; background-color: #ffffff; position: relative; z-index: 2; } #home .details { width: calc(100% - 6em); padding: 3em; max-width: 75em; margin: 0 auto; } #home .details .description { float: left; width: calc(68% - 2em); margin-bottom: 3em; } #home .details .description h2 { font-size: 2em; margin-top: 0; } #home .details .description button { float: right; font-size: 1.5em; } #home .details .diagram { float: right; width: calc(32% - 2em); margin-left: 4em; } #home .details .diagram img { width: 100%; height: auto; } #home .details.right .description { float: right; margin-left: 2em; } #home .details.right .diagram { float: left; margin-left: 0; } #home .details .more-icons { margin: 2em auto 0; clear: both; width: 100%; max-width: 60em; } #home .details .more-icons .item { float: left; text-align: center; width: calc((100% - 2em) / 4); } #home .details .more-icons .item svg { fill: #2b85c4; height: 5em; width: 5em; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } #home .details .more-icons .item p { font-size: 1.5em; font-family: 'Roboto Condensed', sans-serif; font-weight: 300; margin: 0; padding-left: .5em; padding-right: .5em; } #home .details .more-icons .item:hover svg { fill: #22699a; } #home .details .more-icons .item:hover a { color: #194c70; } @media screen and (max-width: 61.5em) { #home .details { font-size: .8em; } } @media screen and (max-width: 40em) { #home .details { text-align: center; padding: 1.5em; width: calc(100% - 3em); } #home .details.right .description, #home .details .description, #home .details.right .diagram, #home .details .diagram { float: none; clear: both; width: 100%; margin-left: auto; margin-right: auto; } #home .details.right .description button, #home .details .description button, #home .details.right .diagram button, #home .details .diagram button { margin-bottom: 1em; } #home .details .diagram { max-width: 20em; } #home .details .more-icons { font-size: .8em; } } @media screen and (max-width: 31em) { #home .details .more-icons .item { width: 50%; } #home .details .more-icons .item:nth-child(3) { clear: left; } #home .details .more-icons .item:nth-child(3), #home .details .more-icons .item:nth-child(4) { margin-top: 2em; } } #home .top { float: right; margin-right: 2em; color: #999999; position: relative; z-index: 3; padding: 0.2em .5em .3em; background-color: rgba(255, 255, 255, 0.8); border-bottom-left-radius: .2em; border-bottom-right-radius: .2em; } #home .top a { color: #999999; } #home .top a:hover, #home .top a:active, #home .top a:focus { color: #666666; } #home .top svg { height: 1.5em; width: 1.5em; fill: #999999; margin-bottom: -0.4em; } #home .top p { display: inline; } #home .top:hover svg { fill: #808080; } @media screen and (max-width: 31em) { #home .top { float: none; font-size: 1.2em; margin: 0px auto -3em; text-align: center; width: 8em; } } #home .bg-image { width: 100%; background-repeat: no-repeat; background-attachment: fixed; background-size: cover; text-align: center; } #home .bg-image p { position: fixed; font-size: 4em; top: 25%; margin: auto; left: 0; right: 0; padding: 0 2em; display: none; color: #2b85c4; } #home .bg-image p span { font-style: italic; font-size: 0.6em; line-height: 1em; display: block; margin-top: .5em; } @media screen and (max-width: 74em) { #home .bg-image { font-size: .8em; } #home .bg-image p { padding: 0 .5em; top: 18%; } } @media screen and (max-width: 50em) { #home .bg-image { font-size: .6em; } } @media screen and (max-width: 31em) { #home .bg-image { font-size: .4em; } #home .bg-image p { padding: 0 .2em; } } #home .bg-image.active p { display: block; } #home .bg-image.general { background-image: url(img/bg/pennybacker.jpg); } #home .bg-image.system { background-image: url(img/bg/cso-system.jpg); } #home .bg-image.outcomes { background-image: url(img/bg/outcomes.jpg); } #home .bg-image.connect { background-image: url(img/bg/wysteria.jpg); } #home .bg-image.coach { background-image: url(img/bg/chains.jpg); } #home .contact-go { width: calc(100% - 6em); background-color: #2b85c4; padding: 3em; text-align: center; color: #ffffff; position: relative; margin-bottom: -2em; border-bottom: 2em solid #ffffff; } #home .contact-go h4 { font-family: 'Roboto Condensed', sans-serif; font-weight: 300; font-size: 4em; margin: -0.2em 0 1em; } #home .contact-go .moreinfo { font-size: 2em; float: left; width: 33%; text-align: center; } #home .contact-go .moreinfo svg { width: 5em; height: 5em; fill: #ffffff; } #home .contact-go .moreinfo button { width: 70%; margin: 1em auto 0; display: block; padding: .5em; } @media screen and (max-width: 61.5em) { #home .contact-go { font-size: .8em; } } @media screen and (max-width: 40em) { #home .contact-go { padding: 1em; width: calc(100% - 2em); } #home .contact-go .moreinfo { float: none; width: 100%; margin-bottom: 2em; } #home .contact-go .moreinfo button { width: 50%; } } #footer { width: 100%; clear: both; padding-top: 1.5em; position: relative; } #footer .mid-bar { width: inherit; background-color: #f5f5f5; } #footer .mid-bar nav { width: 61.5em; margin-left: auto; margin-right: auto; padding: .625em .5em 6.8em; color: #999999; } #footer .mid-bar nav a { color: #999999; } #footer .mid-bar nav a:hover, #footer .mid-bar nav a:active, #footer .mid-bar nav a:focus { color: #666666; } #footer .mid-bar nav li.menu-item-56 { display: none; } @media screen and (max-width: 61.5em) { #footer .mid-bar nav { width: 100%; } } @media screen and (max-width: 50em) { #footer .mid-bar nav { font-size: .8em; } } @media screen and (max-width: 40em) { #footer .mid-bar nav { padding-bottom: .9em; } } @media screen and (max-width: 31em) { #footer .mid-bar nav { padding-left: 0; } } #footer .mid-bar nav ul, #footer .mid-bar nav li { display: inline-block; padding: 0; margin: 0; width: 100%; } @media screen and (max-width: 31em) { #footer .mid-bar nav ul { text-align: center; } } #footer .mid-bar nav li { width: calc(50.4em / 5); position: relative; font-family: 'Roboto Condensed', sans-serif; font-weight: 300; font-size: 1.2em; } @media screen and (max-width: 61.5em) { #footer .mid-bar nav li { width: calc(( 100% - 1em ) / 5); } } @media screen and (max-width: 40em) { #footer .mid-bar nav li { text-align: center; } } @media screen and (max-width: 31em) { #footer .mid-bar nav li { width: auto; padding: 0 .5em; } } #footer .mid-bar nav li ul { position: absolute; margin-top: 1.875em; left: 0; } @media screen and (max-width: 40em) { #footer .mid-bar nav li ul { display: none; } } #footer .mid-bar nav li ul li { display: block; width: auto; font-family: 'Roboto', sans-serif; font-weight: 300; font-size: 0.6em; } #footer .bot-bar { width: inherit; height: 6.25em; background-color: #ffffff; font-size: 0.8em; color: #999999; } #footer .bot-bar a { color: #999999; } #footer .bot-bar a:hover, #footer .bot-bar a:active, #footer .bot-bar a:focus { color: #666666; } #footer .bot-bar .left { float: left; margin-left: 20px; } #footer .bot-bar .right { float: right; margin-right: 20px; font-size: 1.2em; } #footer .bot-bar .right p { float: right; } @media screen and (max-width: 31em) { #footer .bot-bar .right p { float: none; } } @media screen and (max-width: 31em) { #footer .bot-bar .left, #footer .bot-bar .right { float: none; margin-left: auto; margin-right: auto; text-align: center; } } #footer .bot-bar svg { height: 1.6em; width: 1.6em; display: inline-block; fill: #2b85c4; margin-bottom: -0.4em; transition: all 0.3s ease; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -o-transition: all 0.3s ease; } #footer .bot-bar svg:hover { fill: #22699a; } /* This beautiful CSS-File has been crafted with LESS (lesscss.org) and compiled by simpLESS (wearekiss.com/simpless) */
rebeccacso/cso-research
style.css
CSS
mit
56,525
module.exports = { validate: false, maxDepth: 0, moduleSystems: ["amd", "cjs", "es6", "tsd"], tsPreCompilationDeps: false, preserveSymlinks: false, combinedDependencies: false, externalModuleResolutionStrategy: "node_modules", exoticRequireStrings: [], };
sverweij/dependency-cruiser
src/main/options/defaults.js
JavaScript
mit
272
class CardsRetriever def initialize(api, mapper) @api = api @mapper = mapper raise "invalid api" unless (@api.respond_to? 'getCards') && (@api.respond_to? 'getCard') raise "invalid mapper" unless (@mapper.respond_to? 'mapCard') end def createCardsFromRemote(params) cards = @api.getCards(params) if(cards && cards[:cards]) return { :cards => cards[:cards].map {|card|@mapper.mapCard @api.getCard(card[:id])}, :total => cards[:found] } end return { :cards => [], :total => 0 } end end
makeus/WPOHT2016
lib/cards_retriever.rb
Ruby
mit
569
--- --- <!doctype html> <html class="default no-js"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Disposable | @uirouter/angular</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="../assets/css/main.css"> </head> <body> <header> <div class="tsd-page-toolbar"> <div class="container"> <div class="table-wrap"> <div class="table-cell" id="tsd-search" data-index="../assets/js/search.js" data-base=".."> <div class="field"> <label for="tsd-search-field" class="tsd-widget search no-caption">Search</label> <input id="tsd-search-field" type="text" /> </div> <ul class="results"> <li class="state loading">Preparing search index...</li> <li class="state failure">The search index is not available</li> </ul> <a href="../index.html" class="title">@uirouter/angular</a> </div> <div class="table-cell" id="tsd-widgets"> <div id="tsd-filter"> <a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a> <div class="tsd-filter-group"> <div class="tsd-select" id="tsd-filter-visibility"> <span class="tsd-select-label">All</span> <ul class="tsd-select-list"> <li data-value="public">Public</li> <li data-value="protected">Public/Protected</li> <li data-value="private" class="selected">All</li> </ul> </div> <input type="checkbox" id="tsd-filter-inherited" checked /> <label class="tsd-widget" for="tsd-filter-inherited">Inherited</label> <input type="checkbox" id="tsd-filter-externals" checked /> <label class="tsd-widget" for="tsd-filter-externals">Externals</label> </div> </div> <a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a> </div> </div> </div> </div> <div class="tsd-page-title"> <div class="container"> <ul class="tsd-breadcrumb"> <li> <a href="../globals.html">@uirouter/angular</a> </li> <li> <a href="../modules/__uirouter_core_src_interface_.html">&quot;@uirouter/core/src/interface&quot;</a> </li> <li> <a href="__uirouter_core_src_interface_.disposable.html">Disposable</a> </li> </ul> <h1>Interface Disposable</h1> </div> </div> </header> <div class="container container-main"> <div class="row"> <div class="col-8 col-content"> <section class="tsd-panel tsd-hierarchy"> <h3>Hierarchy</h3> <ul class="tsd-hierarchy"> <li> <span class="target">Disposable</span> <ul class="tsd-hierarchy"> <li> <a href="__uirouter_core_src_interface_.uirouterplugin.html" class="tsd-signature-type">UIRouterPlugin</a> </li> <li> <a href="__uirouter_core_src_common_coreservices_.locationservices.html" class="tsd-signature-type">LocationServices</a> </li> <li> <a href="__uirouter_core_src_common_coreservices_.locationconfig.html" class="tsd-signature-type">LocationConfig</a> </li> </ul> </li> </ul> </section> <section class="tsd-panel"> <h3>Implemented by</h3> <ul class="tsd-hierarchy"> <li><a href="../classes/__uirouter_core_src_vanilla_baselocationservice_.baselocationservices.html" class="tsd-signature-type">BaseLocationServices</a></li> <li><a href="../classes/__uirouter_core_src_vanilla_hashlocationservice_.hashlocationservice.html" class="tsd-signature-type">HashLocationService</a></li> <li><a href="../classes/__uirouter_core_src_vanilla_memorylocationservice_.memorylocationservice.html" class="tsd-signature-type">MemoryLocationService</a></li> <li><a href="../classes/_location_locationservice_.ng2locationservices.html" class="tsd-signature-type">Ng2LocationServices</a></li> <li><a href="../classes/__uirouter_core_src_vanilla_pushstatelocationservice_.pushstatelocationservice.html" class="tsd-signature-type">PushStateLocationService</a></li> <li><a href="../classes/__uirouter_core_src_state_statequeuemanager_.statequeuemanager.html" class="tsd-signature-type">StateQueueManager</a></li> <li><a href="../classes/__uirouter_core_src_transition_transitionservice_.transitionservice.html" class="tsd-signature-type">TransitionService</a></li> <li><a href="../classes/__uirouter_core_src_globals_.uirouterglobals.html" class="tsd-signature-type">UIRouterGlobals</a></li> <li><a href="../classes/__uirouter_core_src_interface_.uirouterpluginbase.html" class="tsd-signature-type">UIRouterPluginBase</a></li> <li><a href="../classes/__uirouter_core_src_url_urlconfig_.urlconfig.html" class="tsd-signature-type">UrlConfig</a></li> <li><a href="../classes/__uirouter_core_src_url_urlrules_.urlrules.html" class="tsd-signature-type">UrlRules</a></li> </ul> </section> <section class="tsd-panel-group tsd-index-group"> <h2>Index</h2> <section class="tsd-panel tsd-index-panel"> <div class="tsd-index-content"> <section class="tsd-index-section tsd-is-external"> <h3>Methods</h3> <ul class="tsd-index-list"> <li class="tsd-kind-method tsd-parent-kind-interface tsd-is-external"><a href="__uirouter_core_src_interface_.disposable.html#dispose" class="tsd-kind-icon">dispose</a></li> </ul> </section> </div> </section> </section> <section class="tsd-panel-group tsd-member-group tsd-is-external"> <h2>Methods</h2> <section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-interface tsd-is-external"> <a name="dispose" class="tsd-anchor"></a> <h3>dispose</h3> <ul class="tsd-signatures tsd-kind-method tsd-parent-kind-interface tsd-is-external"> <li class="tsd-signature tsd-kind-icon">dispose<span class="tsd-signature-symbol">(</span>router<span class="tsd-signature-symbol">?: </span><a href="../classes/__uirouter_core_src_router_.uirouter.html" class="tsd-signature-type">UIRouter</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li> </ul> <ul class="tsd-descriptions"> <li class="tsd-description"> <aside class="tsd-sources"> <ul> <li>Defined in @uirouter/core/src/interface.ts:117</li> </ul> </aside> <div class="tsd-comment tsd-typography"> <div class="lead"> <p>Instructs the Disposable to clean up any resources</p> </div> </div> <h4 class="tsd-parameters-title">Parameters</h4> <ul class="tsd-parameters"> <li> <h5><span class="tsd-flag ts-flagOptional">Optional</span> router: <a href="../classes/__uirouter_core_src_router_.uirouter.html" class="tsd-signature-type">UIRouter</a></h5> </li> </ul> <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4> </li> </ul> </section> </section> </div> <div class="col-4 col-menu menu-sticky-wrap menu-highlight"> <nav class="tsd-navigation primary"> <ul> <li class="label "> <span></span> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/__uirouter_core_src_router_.uirouter.html">UIRouter</a> </li> <li class="label "> <span>Services</span> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/__uirouter_core_src_state_stateservice_.stateservice.html">State<wbr>Service</a> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/__uirouter_core_src_state_stateregistry_.stateregistry.html">State<wbr>Registry</a> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/__uirouter_core_src_transition_transitionservice_.transitionservice.html">Transition<wbr>Service</a> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/__uirouter_core_src_url_urlservice_.urlservice.html">Url<wbr>Service</a> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/__uirouter_core_src_url_urlconfig_.urlconfig.html">Url<wbr>Config</a> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/__uirouter_core_src_url_urlrules_.urlrules.html">Url<wbr>Rules</a> </li> <li class="label "> <span>Interfaces</span> </li> <li class="current tsd-kind-interface tsd-parent-kind-external-module tsd-is-external"> <a href="_interface_.ng2statedeclaration.html">Ng2<wbr>State<wbr>Declaration</a> </li> <li class="current tsd-kind-interface tsd-parent-kind-external-module tsd-is-external"> <a href="_interface_.uionparamschanged.html">Ui<wbr>OnParams<wbr>Changed</a> </li> <li class="current tsd-kind-interface tsd-parent-kind-external-module tsd-is-external"> <a href="_interface_.uionexit.html">Ui<wbr>OnExit</a> </li> <li class="label "> <span>Components</span> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/_directives_uiview_.uiview.html">UIView</a> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/_directives_uisref_.uisref.html">UISref</a> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/_directives_uisrefactive_.uisrefactive.html">UISref<wbr>Active</a> </li> <li class="label "> <span>Other</span> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/__uirouter_core_src_transition_transition_.transition.html">Transition</a> </li> <li class="current tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/__uirouter_core_src_common_trace_.trace.html">Trace</a> </li> </ul> </nav> <nav class="tsd-navigation secondary menu-sticky"> <ul class="before-current"> <li class=" tsd-kind-class tsd-parent-kind-external-module tsd-is-external"> <a href="../classes/__uirouter_core_src_interface_.uirouterpluginbase.html" class="tsd-kind-icon">UIRouter<wbr>Plugin<wbr>Base</a> </li> </ul> <ul class="current"> <li class="current tsd-kind-interface tsd-parent-kind-external-module tsd-is-external"> <a href="__uirouter_core_src_interface_.disposable.html" class="tsd-kind-icon">Disposable</a> <ul> <li class=" tsd-kind-method tsd-parent-kind-interface tsd-is-external"> <a href="__uirouter_core_src_interface_.disposable.html#dispose" class="tsd-kind-icon">dispose</a> </li> </ul> </li> </ul> <ul class="after-current"> <li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external"> <a href="__uirouter_core_src_interface_.uiinjector.html" class="tsd-kind-icon">UIInjector</a> </li> <li class=" tsd-kind-interface tsd-parent-kind-external-module tsd-is-external"> <a href="__uirouter_core_src_interface_.uirouterplugin.html" class="tsd-kind-icon">UIRouter<wbr>Plugin</a> </li> </ul> </nav> </div> </div> </div> <footer class="with-border-bottom"> <div class="container"> <h2>Legend</h2> <div class="tsd-legend-group"> <ul class="tsd-legend"> <li class="tsd-kind-module"><span class="tsd-kind-icon">Module</span></li> <li class="tsd-kind-object-literal"><span class="tsd-kind-icon">Object literal</span></li> <li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li> <li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li> <li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li> <li class="tsd-kind-index-signature"><span class="tsd-kind-icon">Index signature</span></li> <li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li> <li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li> <li class="tsd-kind-enum-member"><span class="tsd-kind-icon">Enumeration member</span></li> <li class="tsd-kind-property tsd-parent-kind-enum"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-enum"><span class="tsd-kind-icon">Method</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li> <li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-interface"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-interface"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li> <li class="tsd-kind-class tsd-has-type-parameter"><span class="tsd-kind-icon">Class with type parameter</span></li> <li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li> <li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class"><span class="tsd-kind-icon">Accessor</span></li> <li class="tsd-kind-index-signature tsd-parent-kind-class"><span class="tsd-kind-icon">Index signature</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-constructor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited constructor</span></li> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-inherited"><span class="tsd-kind-icon">Inherited accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-protected"><span class="tsd-kind-icon">Protected accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private property</span></li> <li class="tsd-kind-method tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private method</span></li> <li class="tsd-kind-accessor tsd-parent-kind-class tsd-is-private"><span class="tsd-kind-icon">Private accessor</span></li> </ul> <ul class="tsd-legend"> <li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li> <li class="tsd-kind-call-signature tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li> </ul> </div> </div> </footer> <div class="container tsd-generator"> <p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p> </div> <div class="overlay"></div> <script src="../assets/js/main.js"></script> <script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script> </body> </html>
ui-router/ui-router.github.io
_ng2_docs/6.0.2/interfaces/__uirouter_core_src_interface_.disposable.html
HTML
mit
16,515
package com.siondream.core; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.glutils.ShaderProgram; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.JsonReader; import com.badlogic.gdx.utils.JsonValue; import com.badlogic.gdx.utils.JsonValue.JsonIterator; import com.badlogic.gdx.utils.Logger; import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.ObjectMap.Values; public class ShaderManager implements Disposable { private static final String TAG = "ShaderManager"; private static final String file = "data/shaders/shaders.json"; private Logger logger; private ObjectMap<String, ShaderProgram> shaders; public ShaderManager() { logger = new Logger(TAG, Env.debugLevel); logger.info("initialising"); shaders = new ObjectMap<String, ShaderProgram>(); loadJson(); } public ShaderProgram get(String name) { ShaderProgram shader = shaders.get(name, null); if (shader == null) { logger.error("shader " + name + " not found"); } return shader; } @Override public void dispose() { logger.info("shutting down"); Values<ShaderProgram> values = shaders.values(); while (values.hasNext) { values.next().dispose(); } } private void loadJson() { logger.info("loading file " + file); try { JsonReader reader = new JsonReader(); JsonValue root = reader.parse(Gdx.files.internal(file)); JsonIterator rootIt = root.iterator(); while (rootIt.hasNext()) { JsonValue shaderValue = rootIt.next(); String name = shaderValue.get("name").asString(); String vertex = shaderValue.get("vertex").asString(); String fragment = shaderValue.get("fragment").asString(); logger.info("loading shader " + name + " vertex: " + vertex + " fragment: " + fragment); try { ShaderProgram shader = new ShaderProgram(Gdx.files.internal(vertex), Gdx.files.internal(fragment)); if (!shader.isCompiled()) { logger.error("error loading shader " + name); logger.equals(shader.getLog()); } else { shaders.put(name, shader); } } catch (Exception e) { logger.error("error loading shader " + name + " " + e.getMessage()); } } } catch (Exception e) { logger.error("error loading file " + file + " " + e.getMessage()); } } }
saltares/sioncore
src/com/siondream/core/ShaderManager.java
Java
mit
2,340
<?php class Add extends CI_Controller{ //put your code here function __construct() { parent::__construct(); $this->load->library('upload'); $this->load->model('welcome_model'); $this->load->helper(array('form', 'url')); $this->load->helper('text'); $this->load->helper('inflector'); } public function save_add() { $data = array(); $catagory_id= $this->input->post('category_name'); $customer_type= $this->input->post('customer_type'); $add_type= $this->input->post('add_type'); $title_name= $this->input->post('title_name'); $add_text= $this->input->post('add_text'); $price= $this->input->post('price'); $state_id= $this->input->post('state_name'); $city= $this->input->post('city'); $address= $this->input->post('address'); $nick_name= $this->input->post('nick_name'); $email_address= $this->input->post('email_address'); $phone_no= $this->input->post('phone_no'); $today = date('Y-m-d H:i:s'); if(isset($_POST['hide_phone_no'])) { $hide_phone_no=1; } else{ $hide_phone_no=0; } //echo $data['catagory_name'].' '.$data['customer_type'].' '.$data['add_type'].' '.$data['title_name'].' '.$data['add_text'].' '.$data['price']; $check_tmp_email_exist=$this->welcome_model->check_tmp_email_exist($email_address); $tmp_reg = array( 'tmp_name' =>$nick_name, 'tmp_email' =>$email_address, 'tmp_phone' =>$phone_no, 'hide_phone'=>$hide_phone_no ); if( $check_tmp_email_exist) { $tmp_reg_id=$check_tmp_email_exist[0]['tmp_reg_id']; } else{ $tmp_reg_id=$this->welcome_model->insert_new_tmp_reg_data($tmp_reg); } $tmp_product = array( 'cat_id' => $catagory_id, 'p_type' => $add_type, 'tmp_seller' => 1, 'p_name' => $title_name, 'p_model' => 'none', 'p_description' => $add_text, 'p_quantity' => 0, 'price' => $price, 's_id' => 0, 'state_id' => $state_id, 'reg_id' => 0, 'tmp_reg_id' => $tmp_reg_id, 'add_date'=>$today, 'seller_type' => 0, 'status' => 1, 'is_block' => 0, ); $last_product_id=$this->welcome_model->insert_new_tmp_product($tmp_product); $tmp_product_reg = array( 'tmp_reg_id' => $tmp_reg_id, 'p_id' => $last_product_id, 'tmp_address' =>$address, 'tmp_city' =>$city, 'tmp_state_id' =>$state_id, ); $this->welcome_model->insert_new_tmp_product_reg($tmp_product_reg); /////////// Image Upload/////// $files = $_FILES; $cpt = count($_FILES['userfile']['name']); for($i=0; $i<$cpt; $i++) { if(!empty($files['userfile']['name'][$i])){ $_FILES['userfile']['name']= uniqid().'_'.underscore($files['userfile']['name'][$i]); $_FILES['userfile']['type']= $files['userfile']['type'][$i]; $_FILES['userfile']['tmp_name']= $files['userfile']['tmp_name'][$i]; $_FILES['userfile']['error']= $files['userfile']['error'][$i]; $_FILES['userfile']['size']= $files['userfile']['size'][$i]; $this->upload->initialize($this->set_upload_options($_FILES['userfile']['name'])); $this->upload->do_upload(); if($i==0) { $data1=array ( 'p_id'=> $last_product_id, 'main_img_location'=> $_FILES['userfile']['name'] ); } else { $data1=array ( 'p_id'=> $last_product_id, 'img_location'=> $_FILES['userfile']['name'] ); } $this->welcome_model->insert_tmp_product_images($data1); }} redirect('welcome/place_an_add','refresh'); // $this->add_model->save_add_by_category($data); } private function set_upload_options($file_name) { //upload an image options $url=base_url(); $config = array(); $config['file_name'] = $file_name; $config['upload_path'] = 'assets/images/products/'; $config['allowed_types'] = 'gif|jpg|png|jpeg'; $config['max_size'] = '0'; $config['overwrite'] = FALSE; return $config; } }
amanrabby/mylaowai
application/controllers/add.php
PHP
mit
4,962
<!doctype html> <html class="no-js" lang="en"> <head> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="description" data-itemprop="description" content="vdharam.com: Dharmendra Vishwakarma is a mumbai based software developer who loves to code. He has Masters in Data Analytics from National College Of Ireland." /> <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1, user-scalable=no"> <meta name="author" content="dharam"> <meta name="keywords" data-itemprop="keywords" content="dharmendra,dharmendra vishwakarma,vdharam,technology,grails,java,zk,development,code,javascript,jquery,angular,spring,hibernate,product development, web development" /> <meta name="google-site-verification" content="KyGhzO98lb3MRmGBQgblOgAffiXuhRLc-AL2I0DQJiM" /> <link rel="icon" type="image/png" href="../../favicon.ico"> <title>vdharam - Dharmendra Vishwakarma | Project | Stock Market Data warehouse Project</title> <!-- GOOGLE WEB FONTS INCLUDE --> <link href="https://fonts.googleapis.com/css?family=Oswald|Open+Sans:400,600" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="../../css/styles.min.css"> <link id="primary_color_scheme" href="../../css/colors/blue.css" rel="stylesheet" type="text/css"/> <link href="../../resources/styles/font-awesome.min.css" rel="stylesheet" /> <!-- Timeline --> <!--link href="resources/styles/timeline.css" rel="stylesheet" />--> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script> if (window.location.hostname !== 'localhost' && window.location.hostname !== '127.0.0.1') { (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-77723682-1', 'auto'); ga('send', 'pageview'); } </script> <!--Start of Tawk.to Script--> <script type="text/javascript"> var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date(); (function(){ var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0]; s1.async=true; s1.src='https://embed.tawk.to/5a5cb7d4d7591465c706c253/default'; s1.charset='UTF-8'; s1.setAttribute('crossorigin','*'); s0.parentNode.insertBefore(s1,s0); })(); </script> <!--End of Tawk.to Script--> <base href="/"> </head> <body class="multipage"> <div id="load"></div> <!--[if lt IE 8]> <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> <![endif]--> <!-- START PAGE WRAP --> <div class="page-wrap"> <!-- START NAVIGATION --> <nav class="light"> <!-- START CONTAINER --> <div class="container clearfix"> <div class="four columns"> <!-- START LOGO --> <div class="logo large"> <a href="/"><img src="../../images/logo-dv.png" title="logo" alt="Logo"/></a> </div> <!-- END LOGO --> </div><!-- END FOUR COLUMNS --> <div class="twelve columns"> <!-- START NAVIGATION MENU ITEMS --> <ul class="main-menu large" id="nav"> <li><a href="/">Home</a></li> <li><a href="/about-me/">About</a></li> <li><a href="/career/">Career</a></li> <li><a href="/#services">Skills</a></li> <li><a href="/#parallax3">Recommendations</a></li> <li><a href="/projects/" class="active">Projects</a></li> <li><a href="https://drive.google.com/file/d/1ChadjBaEb2HN5NwbH6QTNJ8xD1TWAPot/view?usp=sharing" target="_blank">Resume</a></li> <li><a href="https://vdharam.wordpress.com" target="_blank">Blog</a></li> <li><a href="/#contact">Contact</a></li> </ul> <!-- END NAVIGATION MENU ITEMS --> </div><!-- END TWELVE COLUMNS --> </div><!-- END CONTAINER --> </nav> <!-- END NAVIGATION --> <!-- START PAGE WRAP --> <div class="page-wrap"> <!-- START PROJECT-SINGLE --> <div class="page multipage"> <div class="container"> <div class="row"> <div class="sixteen columns"> <!-- START TITLE --> <div class="title"> <h1>Stock Market Datawarehouse</h1> </div><!-- END TITLE --> </div><!-- END SIXTEEN COLUMNS --> </div><!-- END ROW --> <div> <div> <div> <div> <p class="lead"> <ul class="breadcrumb" style="padding-left:17px"> <li><a href="/">Home</a></li> <li><a href="/projects/">Projects</a></li> <li class="active"><a href="/projects/stocks-datawarehouse-business-intelligence-project/">stocks-datawarehouse-business-intelligence-project</a></li> </ul> </p></div> </div> </div> </div><!-- END OF ROW --> </div><!-- END CONTAINER --> <div class="container"> <div class="row"> <div id="ajaxpage"> <!-- START PROJECT MEDIA --> <div class="eleven columns"> <div class="project-media" style="margin-top: 5px;"> <div class="video"> <iframe width="560" height="315" src="https://www.youtube.com/embed/vntE_DJrFcc" frameborder="0" allowfullscreen></iframe> </div> </div> </div> <!-- END PROJECT MEDIA --> <div class="five columns"> <!-- START PROJECT INFO --> <div class="project-info" style="margin-top: 5px;"> <div class="project-description"> <h3>Project Description</h3> <p>This project is a part of the continuous assessment for Data warehouse and Business Intelligence module where we were asked to architect, populate and explore a Data Warehouse for Business Intelligence.</p> </div> <div class="project-details"> <h3>Project Details</h3> <p><span>Module Name</span>: Datawarehouse & Business Intelligence</p> <p><span>Duration</span>: 17th September, 2018 - 14th December, 2018</p> </div> </div> <!-- END PROJECT INFO --> </div> </div><!-- END AJAX PAGE --> </div><!-- END ROW --> <div class="row"> <div id="ajaxpage"> <!-- START PROJECT MEDIA --> <div class="sixteen columns"> <div class="project-media" style="margin-top: 5px;"> <h3>Business Requirement Document</h3> <div class="video"> <iframe src="https://drive.google.com/file/d/11ZwQMfvQVvhQaPmo_gukIplbG4km4Mi8/preview" width="940" height="480"></iframe> <br> <h3>Project Report Document</h3> <iframe src="https://drive.google.com/file/d/1GC7Vkb-Z6DP8mQNQjNTb3Yn-sKNdlcc-/preview" width="940" height="480"></iframe> </div> </div> <h4>Note:</h4> <p style="color: green">These documentations are shared only as a demonstration of work of author and any contents copied or referred or recreated in any means for own academic or professional purposes will not be accepted and legal actions would be taken against those offenders.</p> <a class="button large" href="/projects/" title="Click here to go to Projects section" >View All Projects</a> </div> <!-- END PROJECT MEDIA --> </div><!-- END AJAX PAGE --> </div><!-- END ROW --> </div><!-- END CONTAINER --> <div class="clear"></div> <!-- START CONTACT SECTION --> <div id="contact" class="page"> <!-- START COPYRIGHT SECTION --> <div class="copyright"> <div class="container clearfix"> <div class="sixteen columns"> <div class="copyright-logo"><a href="#"><img src="../images/logo-dv-footer.png" title="logo" alt="logo"/></a></div> <div class="social-icons"> <div class="social-icon social-email"><a href="mailto:[email protected]" target="_blank" data-original-title="Email">Email</a></div> <div class="social-icon social-linkedin"><a href="https://in.linkedin.com/pub/dharmendra-vishwakarma/57/17/3a9" target="_blank" data-original-title="LinkedIn">LinkedIn</a></div> <div class="social-icon social-twitter"><a href="https://twitter.com/vdharm" target="_blank" data-original-title="Twitter">Twitter</a></div> <div class="social-icon social-github"><a href="https://github.com/dharm18" target="_blank" data-original-title="Github">Github</a></div> <div class="social-icon social-lastfm"><a href="https://stackoverflow.com/users/5379053/dharmendra-vishwakarma" target="_blank" data-original-title="StackOverflow">StackOverflow</a></div> <div class="social-icon social-wordpress"><a href="https://vdharam.wordpress.com" target="_blank" data-original-title="wordpress">wordpress</a></div> <div class="social-icon social-forrst"><a href="http://freecodecamp.com/dharm18" target="_blank" data-original-title="Freecodecamp">Freecodecamp</a></div> </div> <p>Copyright &copy; Dharmendra Vishwakarma (vdharam), 2020 &nbsp;&nbsp;| &nbsp;&nbsp;<a href="http://vdharam.com">This site</a> is hosted on <a href="https://pages.github.com/">GitHub Pages</a> and last updated on 16th January, 2019.&nbsp;&nbsp;| &nbsp;&nbsp;<a href="https://github.com/dharm18/dharm18.github.io" target="_blank">Check Website Code</a></p> <p> Connect with me : <a href="https://in.linkedin.com/pub/dharmendra-vishwakarma/57/17/3a9" target='_blank'> <i class="fa fa-linkedin"></i> LinkedIn </a> | <a href="https://twitter.com/vdharm" target='_blank'> <i class="fa fa-twitter"></i> Twitter </a> | <a href="https://github.com/dharm18" target='_blank'> <i class="fa fa-github"></i> Github </a> | <a href="https://codepen.io/dharm18/" target='_blank'> <i class="fa fa-codepen" aria-hidden="true"></i> Codepen </a> | <a href="https://stackoverflow.com/users/5379053/dharmendra-vishwakarma" target='_blank'> <i class="fa fa-stack-overflow"></i> StackOverflow </a> | <a href="http://freecodecamp.com/dharm18" target='_blank'> <i class="fa fa-free-code-camp"></i> Free Code Camp </a> | <a href="https://www.hackerrank.com/dharm18" target='_blank'> <i class="fa fa-hackerrank"></i> HackerRank </a> | <a href="https://www.quora.com/profile/Dharmendra-Vishwakarma" target='_blank'> <i class="fa fa-quora"></i> Quora </a> | <a href="https://medium.com/@vdharam" target='_blank'> <i class="fa fa-medium"></i> Medium </a> | <a href="https://www.datacamp.com/profile/dharmendra-vishwakarma" target='_blank'> <i class="fa fa-quora"></i> DataCamp </a> </p> </div> <!-- END SIXTEEN COLUMNS --> </div><!-- END CONTAINER --> </div> <!-- END COPYRIGHT SECTION --> </div> <!-- END CONTACT SECTION --> </div><!-- END PAGE WRAP --> <script type="text/javascript" src="../js/dist/onepage-scripts.min.js"></script> </body> </html>
dharm18/dharm18.github.io
projects/stocks-datawarehouse-business-intelligence-project/index.html
HTML
mit
14,072
import { ListBuilder } from '../lists/listBuilder'; import { Descriptor as BaseDescriptor } from './descriptor'; export interface Descriptor extends BaseDescriptor { role?: string; identifier?: string; } export interface BrowseParameters { browseIdentifier: string; limit?: number; offset?: number; } export interface Controller { getter: (deviceId: string, params: BrowseParameters) => ListBuilder | PromiseLike<ListBuilder>; action: (deviceId: string, params: object) => void | PromiseLike<void>; }
NEEOInc/neeo-sdk
dist/lib/models/descriptors/directoryDescriptor.d.ts
TypeScript
mit
529
# -*- coding: utf-8 -*- import unittest import doctest def all_tests_suite(): suite = unittest.TestLoader().loadTestsFromNames([ #'mabo.tests.test_config', #'mabo.tests.test_settings', #'mabo.tests.test_wmi', #'mabo.tests.test_db_pool', #'mabo.tests.test_database', ]) return suite def main(): runner = unittest.TextTestRunner() suite = all_tests_suite() raise SystemExit(not runner.run(suite).wasSuccessful()) if __name__ == '__main__': import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) main()
mabotech/maboss.py
libs/mabolab/mabolab/tests/__init__.py
Python
mit
686
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') describe "Coned" do before do @coned = Coned.new().fetch() end it "should return a response" do @coned.should_not be_nil end it "should have data for each area and neighborhood" do areas = @coned.areas areas.each do |area| area.area_name.should be_an_instance_of String area.custs_out.should_not be_nil area.areas.each do |neighborhood| neighborhood.area_name.should be_an_instance_of String neighborhood.custs_out.should_not be_nil end end end end
ckundo/coned
spec/coned_spec.rb
Ruby
mit
593
import FactoryGuy from 'ember-data-factory-guy'; FactoryGuy.define('order', { default: { account: 'GAS68058614', direction: 'buy', order_type: 'limit', price: 25000, quantity: 100, symbol: 'CDSC', venue: 'YEHKEX' } });
lucas-nelson/stockfighter
tests/factories/orders.js
JavaScript
mit
252
/*! * Weather Icons 2.0.8 * Updated September 19, 2015 * Weather themed icons for Bootstrap * Author - Erik Flowers - [email protected] * Email: [email protected] * Twitter: http://twitter.com/Erik_UX * ------------------------------------------------------------------------------ * Maintained at http://erikflowers.github.io/weather-icons * * License * ------------------------------------------------------------------------------ * - Font licensed under SIL OFL 1.1 - * http://scripts.sil.org/OFL * - CSS, SCSS and LESS are licensed under MIT License - * http://opensource.org/licenses/mit-license.html * - Documentation licensed under CC BY 3.0 - * http://creativecommons.org/licenses/by/3.0/ * - Inspired by and works great as a companion with Font Awesome * "Font Awesome by Dave Gandy - http://fontawesome.io" */ @font-face { font-family: 'weathericons'; src: url('/assets/weathericons-regular-webfont.eot'); src: url('/assets/weathericons-regular-webfont.eot?#iefix') format('embedded-opentype'), url('/assets/weathericons-regular-webfont.woff2') format('woff2'), url('/assets/weathericons-regular-webfont.woff') format('woff'), url('/assets/weathericons-regular-webfont.ttf') format('truetype'), url('/assets/weathericons-regular-webfont.svg#weather_iconsregular') format('svg'); font-weight: normal; font-style: normal; } .wi { display: inline-block; font-family: 'weathericons'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .wi-fw { text-align: center; width: 1.4em; } .wi-rotate-90 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1); -webkit-transform: rotate(90deg); -ms-transform: rotate(90deg); transform: rotate(90deg); } .wi-rotate-180 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2); -webkit-transform: rotate(180deg); -ms-transform: rotate(180deg); transform: rotate(180deg); } .wi-rotate-270 { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3); -webkit-transform: rotate(270deg); -ms-transform: rotate(270deg); transform: rotate(270deg); } .wi-flip-horizontal { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1); -webkit-transform: scale(-1, 1); -ms-transform: scale(-1, 1); transform: scale(-1, 1); } .wi-flip-vertical { filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1); -webkit-transform: scale(1, -1); -ms-transform: scale(1, -1); transform: scale(1, -1); } .wi-day-sunny:before { content: "\f00d"; } .wi-day-cloudy:before { content: "\f002"; } .wi-day-cloudy-gusts:before { content: "\f000"; } .wi-day-cloudy-windy:before { content: "\f001"; } .wi-day-fog:before { content: "\f003"; } .wi-day-hail:before { content: "\f004"; } .wi-day-haze:before { content: "\f0b6"; } .wi-day-lightning:before { content: "\f005"; } .wi-day-rain:before { content: "\f008"; } .wi-day-rain-mix:before { content: "\f006"; } .wi-day-rain-wind:before { content: "\f007"; } .wi-day-showers:before { content: "\f009"; } .wi-day-sleet:before { content: "\f0b2"; } .wi-day-sleet-storm:before { content: "\f068"; } .wi-day-snow:before { content: "\f00a"; } .wi-day-snow-thunderstorm:before { content: "\f06b"; } .wi-day-snow-wind:before { content: "\f065"; } .wi-day-sprinkle:before { content: "\f00b"; } .wi-day-storm-showers:before { content: "\f00e"; } .wi-day-sunny-overcast:before { content: "\f00c"; } .wi-day-thunderstorm:before { content: "\f010"; } .wi-day-windy:before { content: "\f085"; } .wi-solar-eclipse:before { content: "\f06e"; } .wi-hot:before { content: "\f072"; } .wi-day-cloudy-high:before { content: "\f07d"; } .wi-day-light-wind:before { content: "\f0c4"; } .wi-night-clear:before { content: "\f02e"; } .wi-night-alt-cloudy:before { content: "\f086"; } .wi-night-alt-cloudy-gusts:before { content: "\f022"; } .wi-night-alt-cloudy-windy:before { content: "\f023"; } .wi-night-alt-hail:before { content: "\f024"; } .wi-night-alt-lightning:before { content: "\f025"; } .wi-night-alt-rain:before { content: "\f028"; } .wi-night-alt-rain-mix:before { content: "\f026"; } .wi-night-alt-rain-wind:before { content: "\f027"; } .wi-night-alt-showers:before { content: "\f029"; } .wi-night-alt-sleet:before { content: "\f0b4"; } .wi-night-alt-sleet-storm:before { content: "\f06a"; } .wi-night-alt-snow:before { content: "\f02a"; } .wi-night-alt-snow-thunderstorm:before { content: "\f06d"; } .wi-night-alt-snow-wind:before { content: "\f067"; } .wi-night-alt-sprinkle:before { content: "\f02b"; } .wi-night-alt-storm-showers:before { content: "\f02c"; } .wi-night-alt-thunderstorm:before { content: "\f02d"; } .wi-night-cloudy:before { content: "\f031"; } .wi-night-cloudy-gusts:before { content: "\f02f"; } .wi-night-cloudy-windy:before { content: "\f030"; } .wi-night-fog:before { content: "\f04a"; } .wi-night-hail:before { content: "\f032"; } .wi-night-lightning:before { content: "\f033"; } .wi-night-partly-cloudy:before { content: "\f083"; } .wi-night-rain:before { content: "\f036"; } .wi-night-rain-mix:before { content: "\f034"; } .wi-night-rain-wind:before { content: "\f035"; } .wi-night-showers:before { content: "\f037"; } .wi-night-sleet:before { content: "\f0b3"; } .wi-night-sleet-storm:before { content: "\f069"; } .wi-night-snow:before { content: "\f038"; } .wi-night-snow-thunderstorm:before { content: "\f06c"; } .wi-night-snow-wind:before { content: "\f066"; } .wi-night-sprinkle:before { content: "\f039"; } .wi-night-storm-showers:before { content: "\f03a"; } .wi-night-thunderstorm:before { content: "\f03b"; } .wi-lunar-eclipse:before { content: "\f070"; } .wi-stars:before { content: "\f077"; } .wi-storm-showers:before { content: "\f01d"; } .wi-thunderstorm:before { content: "\f01e"; } .wi-night-alt-cloudy-high:before { content: "\f07e"; } .wi-night-cloudy-high:before { content: "\f080"; } .wi-night-alt-partly-cloudy:before { content: "\f081"; } .wi-cloud:before { content: "\f041"; } .wi-cloudy:before { content: "\f013"; } .wi-cloudy-gusts:before { content: "\f011"; } .wi-cloudy-windy:before { content: "\f012"; } .wi-fog:before { content: "\f014"; } .wi-hail:before { content: "\f015"; } .wi-rain:before { content: "\f019"; } .wi-rain-mix:before { content: "\f017"; } .wi-rain-wind:before { content: "\f018"; } .wi-showers:before { content: "\f01a"; } .wi-sleet:before { content: "\f0b5"; } .wi-snow:before { content: "\f01b"; } .wi-sprinkle:before { content: "\f01c"; } .wi-storm-showers:before { content: "\f01d"; } .wi-thunderstorm:before { content: "\f01e"; } .wi-snow-wind:before { content: "\f064"; } .wi-snow:before { content: "\f01b"; } .wi-smog:before { content: "\f074"; } .wi-smoke:before { content: "\f062"; } .wi-lightning:before { content: "\f016"; } .wi-raindrops:before { content: "\f04e"; } .wi-raindrop:before { content: "\f078"; } .wi-dust:before { content: "\f063"; } .wi-snowflake-cold:before { content: "\f076"; } .wi-windy:before { content: "\f021"; } .wi-strong-wind:before { content: "\f050"; } .wi-sandstorm:before { content: "\f082"; } .wi-earthquake:before { content: "\f0c6"; } .wi-fire:before { content: "\f0c7"; } .wi-flood:before { content: "\f07c"; } .wi-meteor:before { content: "\f071"; } .wi-tsunami:before { content: "\f0c5"; } .wi-volcano:before { content: "\f0c8"; } .wi-hurricane:before { content: "\f073"; } .wi-tornado:before { content: "\f056"; } .wi-small-craft-advisory:before { content: "\f0cc"; } .wi-gale-warning:before { content: "\f0cd"; } .wi-storm-warning:before { content: "\f0ce"; } .wi-hurricane-warning:before { content: "\f0cf"; } .wi-wind-direction:before { content: "\f0b1"; } .wi-alien:before { content: "\f075"; } .wi-celsius:before { content: "\f03c"; } .wi-fahrenheit:before { content: "\f045"; } .wi-degrees:before { content: "\f042"; } .wi-thermometer:before { content: "\f055"; } .wi-thermometer-exterior:before { content: "\f053"; } .wi-thermometer-internal:before { content: "\f054"; } .wi-cloud-down:before { content: "\f03d"; } .wi-cloud-up:before { content: "\f040"; } .wi-cloud-refresh:before { content: "\f03e"; } .wi-horizon:before { content: "\f047"; } .wi-horizon-alt:before { content: "\f046"; } .wi-sunrise:before { content: "\f051"; } .wi-sunset:before { content: "\f052"; } .wi-moonrise:before { content: "\f0c9"; } .wi-moonset:before { content: "\f0ca"; } .wi-refresh:before { content: "\f04c"; } .wi-refresh-alt:before { content: "\f04b"; } .wi-umbrella:before { content: "\f084"; } .wi-barometer:before { content: "\f079"; } .wi-humidity:before { content: "\f07a"; } .wi-na:before { content: "\f07b"; } .wi-train:before { content: "\f0cb"; } .wi-moon-new:before { content: "\f095"; } .wi-moon-waxing-crescent-1:before { content: "\f096"; } .wi-moon-waxing-crescent-2:before { content: "\f097"; } .wi-moon-waxing-crescent-3:before { content: "\f098"; } .wi-moon-waxing-crescent-4:before { content: "\f099"; } .wi-moon-waxing-crescent-5:before { content: "\f09a"; } .wi-moon-waxing-crescent-6:before { content: "\f09b"; } .wi-moon-first-quarter:before { content: "\f09c"; } .wi-moon-waxing-gibbous-1:before { content: "\f09d"; } .wi-moon-waxing-gibbous-2:before { content: "\f09e"; } .wi-moon-waxing-gibbous-3:before { content: "\f09f"; } .wi-moon-waxing-gibbous-4:before { content: "\f0a0"; } .wi-moon-waxing-gibbous-5:before { content: "\f0a1"; } .wi-moon-waxing-gibbous-6:before { content: "\f0a2"; } .wi-moon-full:before { content: "\f0a3"; } .wi-moon-waning-gibbous-1:before { content: "\f0a4"; } .wi-moon-waning-gibbous-2:before { content: "\f0a5"; } .wi-moon-waning-gibbous-3:before { content: "\f0a6"; } .wi-moon-waning-gibbous-4:before { content: "\f0a7"; } .wi-moon-waning-gibbous-5:before { content: "\f0a8"; } .wi-moon-waning-gibbous-6:before { content: "\f0a9"; } .wi-moon-third-quarter:before { content: "\f0aa"; } .wi-moon-waning-crescent-1:before { content: "\f0ab"; } .wi-moon-waning-crescent-2:before { content: "\f0ac"; } .wi-moon-waning-crescent-3:before { content: "\f0ad"; } .wi-moon-waning-crescent-4:before { content: "\f0ae"; } .wi-moon-waning-crescent-5:before { content: "\f0af"; } .wi-moon-waning-crescent-6:before { content: "\f0b0"; } .wi-moon-alt-new:before { content: "\f0eb"; } .wi-moon-alt-waxing-crescent-1:before { content: "\f0d0"; } .wi-moon-alt-waxing-crescent-2:before { content: "\f0d1"; } .wi-moon-alt-waxing-crescent-3:before { content: "\f0d2"; } .wi-moon-alt-waxing-crescent-4:before { content: "\f0d3"; } .wi-moon-alt-waxing-crescent-5:before { content: "\f0d4"; } .wi-moon-alt-waxing-crescent-6:before { content: "\f0d5"; } .wi-moon-alt-first-quarter:before { content: "\f0d6"; } .wi-moon-alt-waxing-gibbous-1:before { content: "\f0d7"; } .wi-moon-alt-waxing-gibbous-2:before { content: "\f0d8"; } .wi-moon-alt-waxing-gibbous-3:before { content: "\f0d9"; } .wi-moon-alt-waxing-gibbous-4:before { content: "\f0da"; } .wi-moon-alt-waxing-gibbous-5:before { content: "\f0db"; } .wi-moon-alt-waxing-gibbous-6:before { content: "\f0dc"; } .wi-moon-alt-full:before { content: "\f0dd"; } .wi-moon-alt-waning-gibbous-1:before { content: "\f0de"; } .wi-moon-alt-waning-gibbous-2:before { content: "\f0df"; } .wi-moon-alt-waning-gibbous-3:before { content: "\f0e0"; } .wi-moon-alt-waning-gibbous-4:before { content: "\f0e1"; } .wi-moon-alt-waning-gibbous-5:before { content: "\f0e2"; } .wi-moon-alt-waning-gibbous-6:before { content: "\f0e3"; } .wi-moon-alt-third-quarter:before { content: "\f0e4"; } .wi-moon-alt-waning-crescent-1:before { content: "\f0e5"; } .wi-moon-alt-waning-crescent-2:before { content: "\f0e6"; } .wi-moon-alt-waning-crescent-3:before { content: "\f0e7"; } .wi-moon-alt-waning-crescent-4:before { content: "\f0e8"; } .wi-moon-alt-waning-crescent-5:before { content: "\f0e9"; } .wi-moon-alt-waning-crescent-6:before { content: "\f0ea"; } .wi-moon-0:before { content: "\f095"; } .wi-moon-1:before { content: "\f096"; } .wi-moon-2:before { content: "\f097"; } .wi-moon-3:before { content: "\f098"; } .wi-moon-4:before { content: "\f099"; } .wi-moon-5:before { content: "\f09a"; } .wi-moon-6:before { content: "\f09b"; } .wi-moon-7:before { content: "\f09c"; } .wi-moon-8:before { content: "\f09d"; } .wi-moon-9:before { content: "\f09e"; } .wi-moon-10:before { content: "\f09f"; } .wi-moon-11:before { content: "\f0a0"; } .wi-moon-12:before { content: "\f0a1"; } .wi-moon-13:before { content: "\f0a2"; } .wi-moon-14:before { content: "\f0a3"; } .wi-moon-15:before { content: "\f0a4"; } .wi-moon-16:before { content: "\f0a5"; } .wi-moon-17:before { content: "\f0a6"; } .wi-moon-18:before { content: "\f0a7"; } .wi-moon-19:before { content: "\f0a8"; } .wi-moon-20:before { content: "\f0a9"; } .wi-moon-21:before { content: "\f0aa"; } .wi-moon-22:before { content: "\f0ab"; } .wi-moon-23:before { content: "\f0ac"; } .wi-moon-24:before { content: "\f0ad"; } .wi-moon-25:before { content: "\f0ae"; } .wi-moon-26:before { content: "\f0af"; } .wi-moon-27:before { content: "\f0b0"; } .wi-time-1:before { content: "\f08a"; } .wi-time-2:before { content: "\f08b"; } .wi-time-3:before { content: "\f08c"; } .wi-time-4:before { content: "\f08d"; } .wi-time-5:before { content: "\f08e"; } .wi-time-6:before { content: "\f08f"; } .wi-time-7:before { content: "\f090"; } .wi-time-8:before { content: "\f091"; } .wi-time-9:before { content: "\f092"; } .wi-time-10:before { content: "\f093"; } .wi-time-11:before { content: "\f094"; } .wi-time-12:before { content: "\f089"; } .wi-direction-up:before { content: "\f058"; } .wi-direction-up-right:before { content: "\f057"; } .wi-direction-right:before { content: "\f04d"; } .wi-direction-down-right:before { content: "\f088"; } .wi-direction-down:before { content: "\f044"; } .wi-direction-down-left:before { content: "\f043"; } .wi-direction-left:before { content: "\f048"; } .wi-direction-up-left:before { content: "\f087"; } .wi-wind-beaufort-0:before { content: "\f0b7"; } .wi-wind-beaufort-1:before { content: "\f0b8"; } .wi-wind-beaufort-2:before { content: "\f0b9"; } .wi-wind-beaufort-3:before { content: "\f0ba"; } .wi-wind-beaufort-4:before { content: "\f0bb"; } .wi-wind-beaufort-5:before { content: "\f0bc"; } .wi-wind-beaufort-6:before { content: "\f0bd"; } .wi-wind-beaufort-7:before { content: "\f0be"; } .wi-wind-beaufort-8:before { content: "\f0bf"; } .wi-wind-beaufort-9:before { content: "\f0c0"; } .wi-wind-beaufort-10:before { content: "\f0c1"; } .wi-wind-beaufort-11:before { content: "\f0c2"; } .wi-wind-beaufort-12:before { content: "\f0c3"; } .wi-yahoo-0:before { content: "\f056"; } .wi-yahoo-1:before { content: "\f00e"; } .wi-yahoo-2:before { content: "\f073"; } .wi-yahoo-3:before { content: "\f01e"; } .wi-yahoo-4:before { content: "\f01e"; } .wi-yahoo-5:before { content: "\f017"; } .wi-yahoo-6:before { content: "\f017"; } .wi-yahoo-7:before { content: "\f017"; } .wi-yahoo-8:before { content: "\f015"; } .wi-yahoo-9:before { content: "\f01a"; } .wi-yahoo-10:before { content: "\f015"; } .wi-yahoo-11:before { content: "\f01a"; } .wi-yahoo-12:before { content: "\f01a"; } .wi-yahoo-13:before { content: "\f01b"; } .wi-yahoo-14:before { content: "\f00a"; } .wi-yahoo-15:before { content: "\f064"; } .wi-yahoo-16:before { content: "\f01b"; } .wi-yahoo-17:before { content: "\f015"; } .wi-yahoo-18:before { content: "\f017"; } .wi-yahoo-19:before { content: "\f063"; } .wi-yahoo-20:before { content: "\f014"; } .wi-yahoo-21:before { content: "\f021"; } .wi-yahoo-22:before { content: "\f062"; } .wi-yahoo-23:before { content: "\f050"; } .wi-yahoo-24:before { content: "\f050"; } .wi-yahoo-25:before { content: "\f076"; } .wi-yahoo-26:before { content: "\f013"; } .wi-yahoo-27:before { content: "\f031"; } .wi-yahoo-28:before { content: "\f002"; } .wi-yahoo-29:before { content: "\f031"; } .wi-yahoo-30:before { content: "\f002"; } .wi-yahoo-31:before { content: "\f02e"; } .wi-yahoo-32:before { content: "\f00d"; } .wi-yahoo-33:before { content: "\f083"; } .wi-yahoo-34:before { content: "\f00c"; } .wi-yahoo-35:before { content: "\f017"; } .wi-yahoo-36:before { content: "\f072"; } .wi-yahoo-37:before { content: "\f00e"; } .wi-yahoo-38:before { content: "\f00e"; } .wi-yahoo-39:before { content: "\f00e"; } .wi-yahoo-40:before { content: "\f01a"; } .wi-yahoo-41:before { content: "\f064"; } .wi-yahoo-42:before { content: "\f01b"; } .wi-yahoo-43:before { content: "\f064"; } .wi-yahoo-44:before { content: "\f00c"; } .wi-yahoo-45:before { content: "\f00e"; } .wi-yahoo-46:before { content: "\f01b"; } .wi-yahoo-47:before { content: "\f00e"; } .wi-yahoo-3200:before { content: "\f077"; } .wi-forecast-io-clear-day:before { content: "\f00d"; } .wi-forecast-io-clear-night:before { content: "\f02e"; } .wi-forecast-io-rain:before { content: "\f019"; } .wi-forecast-io-snow:before { content: "\f01b"; } .wi-forecast-io-sleet:before { content: "\f0b5"; } .wi-forecast-io-wind:before { content: "\f050"; } .wi-forecast-io-fog:before { content: "\f014"; } .wi-forecast-io-cloudy:before { content: "\f013"; } .wi-forecast-io-partly-cloudy-day:before { content: "\f002"; } .wi-forecast-io-partly-cloudy-night:before { content: "\f031"; } .wi-forecast-io-hail:before { content: "\f015"; } .wi-forecast-io-thunderstorm:before { content: "\f01e"; } .wi-forecast-io-tornado:before { content: "\f056"; } .wi-wmo4680-0:before, .wi-wmo4680-00:before { content: "\f055"; } .wi-wmo4680-1:before, .wi-wmo4680-01:before { content: "\f013"; } .wi-wmo4680-2:before, .wi-wmo4680-02:before { content: "\f055"; } .wi-wmo4680-3:before, .wi-wmo4680-03:before { content: "\f013"; } .wi-wmo4680-4:before, .wi-wmo4680-04:before { content: "\f014"; } .wi-wmo4680-5:before, .wi-wmo4680-05:before { content: "\f014"; } .wi-wmo4680-10:before { content: "\f014"; } .wi-wmo4680-11:before { content: "\f014"; } .wi-wmo4680-12:before { content: "\f016"; } .wi-wmo4680-18:before { content: "\f050"; } .wi-wmo4680-20:before { content: "\f014"; } .wi-wmo4680-21:before { content: "\f017"; } .wi-wmo4680-22:before { content: "\f017"; } .wi-wmo4680-23:before { content: "\f019"; } .wi-wmo4680-24:before { content: "\f01b"; } .wi-wmo4680-25:before { content: "\f015"; } .wi-wmo4680-26:before { content: "\f01e"; } .wi-wmo4680-27:before { content: "\f063"; } .wi-wmo4680-28:before { content: "\f063"; } .wi-wmo4680-29:before { content: "\f063"; } .wi-wmo4680-30:before { content: "\f014"; } .wi-wmo4680-31:before { content: "\f014"; } .wi-wmo4680-32:before { content: "\f014"; } .wi-wmo4680-33:before { content: "\f014"; } .wi-wmo4680-34:before { content: "\f014"; } .wi-wmo4680-35:before { content: "\f014"; } .wi-wmo4680-40:before { content: "\f017"; } .wi-wmo4680-41:before { content: "\f01c"; } .wi-wmo4680-42:before { content: "\f019"; } .wi-wmo4680-43:before { content: "\f01c"; } .wi-wmo4680-44:before { content: "\f019"; } .wi-wmo4680-45:before { content: "\f015"; } .wi-wmo4680-46:before { content: "\f015"; } .wi-wmo4680-47:before { content: "\f01b"; } .wi-wmo4680-48:before { content: "\f01b"; } .wi-wmo4680-50:before { content: "\f01c"; } .wi-wmo4680-51:before { content: "\f01c"; } .wi-wmo4680-52:before { content: "\f019"; } .wi-wmo4680-53:before { content: "\f019"; } .wi-wmo4680-54:before { content: "\f076"; } .wi-wmo4680-55:before { content: "\f076"; } .wi-wmo4680-56:before { content: "\f076"; } .wi-wmo4680-57:before { content: "\f01c"; } .wi-wmo4680-58:before { content: "\f019"; } .wi-wmo4680-60:before { content: "\f01c"; } .wi-wmo4680-61:before { content: "\f01c"; } .wi-wmo4680-62:before { content: "\f019"; } .wi-wmo4680-63:before { content: "\f019"; } .wi-wmo4680-64:before { content: "\f015"; } .wi-wmo4680-65:before { content: "\f015"; } .wi-wmo4680-66:before { content: "\f015"; } .wi-wmo4680-67:before { content: "\f017"; } .wi-wmo4680-68:before { content: "\f017"; } .wi-wmo4680-70:before { content: "\f01b"; } .wi-wmo4680-71:before { content: "\f01b"; } .wi-wmo4680-72:before { content: "\f01b"; } .wi-wmo4680-73:before { content: "\f01b"; } .wi-wmo4680-74:before { content: "\f076"; } .wi-wmo4680-75:before { content: "\f076"; } .wi-wmo4680-76:before { content: "\f076"; } .wi-wmo4680-77:before { content: "\f01b"; } .wi-wmo4680-78:before { content: "\f076"; } .wi-wmo4680-80:before { content: "\f019"; } .wi-wmo4680-81:before { content: "\f01c"; } .wi-wmo4680-82:before { content: "\f019"; } .wi-wmo4680-83:before { content: "\f019"; } .wi-wmo4680-84:before { content: "\f01d"; } .wi-wmo4680-85:before { content: "\f017"; } .wi-wmo4680-86:before { content: "\f017"; } .wi-wmo4680-87:before { content: "\f017"; } .wi-wmo4680-89:before { content: "\f015"; } .wi-wmo4680-90:before { content: "\f016"; } .wi-wmo4680-91:before { content: "\f01d"; } .wi-wmo4680-92:before { content: "\f01e"; } .wi-wmo4680-93:before { content: "\f01e"; } .wi-wmo4680-94:before { content: "\f016"; } .wi-wmo4680-95:before { content: "\f01e"; } .wi-wmo4680-96:before { content: "\f01e"; } .wi-wmo4680-99:before { content: "\f056"; } .wi-owm-200:before { content: "\f01e"; } .wi-owm-201:before { content: "\f01e"; } .wi-owm-202:before { content: "\f01e"; } .wi-owm-210:before { content: "\f016"; } .wi-owm-211:before { content: "\f016"; } .wi-owm-212:before { content: "\f016"; } .wi-owm-221:before { content: "\f016"; } .wi-owm-230:before { content: "\f01e"; } .wi-owm-231:before { content: "\f01e"; } .wi-owm-232:before { content: "\f01e"; } .wi-owm-300:before { content: "\f01c"; } .wi-owm-301:before { content: "\f01c"; } .wi-owm-302:before { content: "\f019"; } .wi-owm-310:before { content: "\f017"; } .wi-owm-311:before { content: "\f019"; } .wi-owm-312:before { content: "\f019"; } .wi-owm-313:before { content: "\f01a"; } .wi-owm-314:before { content: "\f019"; } .wi-owm-321:before { content: "\f01c"; } .wi-owm-500:before { content: "\f01c"; } .wi-owm-501:before { content: "\f019"; } .wi-owm-502:before { content: "\f019"; } .wi-owm-503:before { content: "\f019"; } .wi-owm-504:before { content: "\f019"; } .wi-owm-511:before { content: "\f017"; } .wi-owm-520:before { content: "\f01a"; } .wi-owm-521:before { content: "\f01a"; } .wi-owm-522:before { content: "\f01a"; } .wi-owm-531:before { content: "\f01d"; } .wi-owm-600:before { content: "\f01b"; } .wi-owm-601:before { content: "\f01b"; } .wi-owm-602:before { content: "\f0b5"; } .wi-owm-611:before { content: "\f017"; } .wi-owm-612:before { content: "\f017"; } .wi-owm-615:before { content: "\f017"; } .wi-owm-616:before { content: "\f017"; } .wi-owm-620:before { content: "\f017"; } .wi-owm-621:before { content: "\f01b"; } .wi-owm-622:before { content: "\f01b"; } .wi-owm-701:before { content: "\f01a"; } .wi-owm-711:before { content: "\f062"; } .wi-owm-721:before { content: "\f0b6"; } .wi-owm-731:before { content: "\f063"; } .wi-owm-741:before { content: "\f014"; } .wi-owm-761:before { content: "\f063"; } .wi-owm-762:before { content: "\f063"; } .wi-owm-771:before { content: "\f011"; } .wi-owm-781:before { content: "\f056"; } .wi-owm-800:before { content: "\f00d"; } .wi-owm-801:before { content: "\f011"; } .wi-owm-802:before { content: "\f011"; } .wi-owm-803:before { content: "\f012"; } .wi-owm-804:before { content: "\f013"; } .wi-owm-900:before { content: "\f056"; } .wi-owm-901:before { content: "\f01d"; } .wi-owm-902:before { content: "\f073"; } .wi-owm-903:before { content: "\f076"; } .wi-owm-904:before { content: "\f072"; } .wi-owm-905:before { content: "\f021"; } .wi-owm-906:before { content: "\f015"; } .wi-owm-957:before { content: "\f050"; } .wi-owm-day-200:before { content: "\f010"; } .wi-owm-day-201:before { content: "\f010"; } .wi-owm-day-202:before { content: "\f010"; } .wi-owm-day-210:before { content: "\f005"; } .wi-owm-day-211:before { content: "\f005"; } .wi-owm-day-212:before { content: "\f005"; } .wi-owm-day-221:before { content: "\f005"; } .wi-owm-day-230:before { content: "\f010"; } .wi-owm-day-231:before { content: "\f010"; } .wi-owm-day-232:before { content: "\f010"; } .wi-owm-day-300:before { content: "\f00b"; } .wi-owm-day-301:before { content: "\f00b"; } .wi-owm-day-302:before { content: "\f008"; } .wi-owm-day-310:before { content: "\f008"; } .wi-owm-day-311:before { content: "\f008"; } .wi-owm-day-312:before { content: "\f008"; } .wi-owm-day-313:before { content: "\f008"; } .wi-owm-day-314:before { content: "\f008"; } .wi-owm-day-321:before { content: "\f00b"; } .wi-owm-day-500:before { content: "\f00b"; } .wi-owm-day-501:before { content: "\f008"; } .wi-owm-day-502:before { content: "\f008"; } .wi-owm-day-503:before { content: "\f008"; } .wi-owm-day-504:before { content: "\f008"; } .wi-owm-day-511:before { content: "\f006"; } .wi-owm-day-520:before { content: "\f009"; } .wi-owm-day-521:before { content: "\f009"; } .wi-owm-day-522:before { content: "\f009"; } .wi-owm-day-531:before { content: "\f00e"; } .wi-owm-day-600:before { content: "\f00a"; } .wi-owm-day-601:before { content: "\f0b2"; } .wi-owm-day-602:before { content: "\f00a"; } .wi-owm-day-611:before { content: "\f006"; } .wi-owm-day-612:before { content: "\f006"; } .wi-owm-day-615:before { content: "\f006"; } .wi-owm-day-616:before { content: "\f006"; } .wi-owm-day-620:before { content: "\f006"; } .wi-owm-day-621:before { content: "\f00a"; } .wi-owm-day-622:before { content: "\f00a"; } .wi-owm-day-701:before { content: "\f009"; } .wi-owm-day-711:before { content: "\f062"; } .wi-owm-day-721:before { content: "\f0b6"; } .wi-owm-day-731:before { content: "\f063"; } .wi-owm-day-741:before { content: "\f003"; } .wi-owm-day-761:before { content: "\f063"; } .wi-owm-day-762:before { content: "\f063"; } .wi-owm-day-781:before { content: "\f056"; } .wi-owm-day-800:before { content: "\f00d"; } .wi-owm-day-801:before { content: "\f000"; } .wi-owm-day-802:before { content: "\f000"; } .wi-owm-day-803:before { content: "\f000"; } .wi-owm-day-804:before { content: "\f00c"; } .wi-owm-day-900:before { content: "\f056"; } .wi-owm-day-902:before { content: "\f073"; } .wi-owm-day-903:before { content: "\f076"; } .wi-owm-day-904:before { content: "\f072"; } .wi-owm-day-906:before { content: "\f004"; } .wi-owm-day-957:before { content: "\f050"; } .wi-owm-night-200:before { content: "\f02d"; } .wi-owm-night-201:before { content: "\f02d"; } .wi-owm-night-202:before { content: "\f02d"; } .wi-owm-night-210:before { content: "\f025"; } .wi-owm-night-211:before { content: "\f025"; } .wi-owm-night-212:before { content: "\f025"; } .wi-owm-night-221:before { content: "\f025"; } .wi-owm-night-230:before { content: "\f02d"; } .wi-owm-night-231:before { content: "\f02d"; } .wi-owm-night-232:before { content: "\f02d"; } .wi-owm-night-300:before { content: "\f02b"; } .wi-owm-night-301:before { content: "\f02b"; } .wi-owm-night-302:before { content: "\f028"; } .wi-owm-night-310:before { content: "\f028"; } .wi-owm-night-311:before { content: "\f028"; } .wi-owm-night-312:before { content: "\f028"; } .wi-owm-night-313:before { content: "\f028"; } .wi-owm-night-314:before { content: "\f028"; } .wi-owm-night-321:before { content: "\f02b"; } .wi-owm-night-500:before { content: "\f02b"; } .wi-owm-night-501:before { content: "\f028"; } .wi-owm-night-502:before { content: "\f028"; } .wi-owm-night-503:before { content: "\f028"; } .wi-owm-night-504:before { content: "\f028"; } .wi-owm-night-511:before { content: "\f026"; } .wi-owm-night-520:before { content: "\f029"; } .wi-owm-night-521:before { content: "\f029"; } .wi-owm-night-522:before { content: "\f029"; } .wi-owm-night-531:before { content: "\f02c"; } .wi-owm-night-600:before { content: "\f02a"; } .wi-owm-night-601:before { content: "\f0b4"; } .wi-owm-night-602:before { content: "\f02a"; } .wi-owm-night-611:before { content: "\f026"; } .wi-owm-night-612:before { content: "\f026"; } .wi-owm-night-615:before { content: "\f026"; } .wi-owm-night-616:before { content: "\f026"; } .wi-owm-night-620:before { content: "\f026"; } .wi-owm-night-621:before { content: "\f02a"; } .wi-owm-night-622:before { content: "\f02a"; } .wi-owm-night-701:before { content: "\f029"; } .wi-owm-night-711:before { content: "\f062"; } .wi-owm-night-721:before { content: "\f0b6"; } .wi-owm-night-731:before { content: "\f063"; } .wi-owm-night-741:before { content: "\f04a"; } .wi-owm-night-761:before { content: "\f063"; } .wi-owm-night-762:before { content: "\f063"; } .wi-owm-night-781:before { content: "\f056"; } .wi-owm-night-800:before { content: "\f02e"; } .wi-owm-night-801:before { content: "\f022"; } .wi-owm-night-802:before { content: "\f022"; } .wi-owm-night-803:before { content: "\f022"; } .wi-owm-night-804:before { content: "\f086"; } .wi-owm-night-900:before { content: "\f056"; } .wi-owm-night-902:before { content: "\f073"; } .wi-owm-night-903:before { content: "\f076"; } .wi-owm-night-904:before { content: "\f072"; } .wi-owm-night-906:before { content: "\f024"; } .wi-owm-night-957:before { content: "\f050"; } .wi-wu-chanceflurries:before { content: "\f064"; } .wi-wu-chancerain:before { content: "\f019"; } .wi-wu-chancesleat:before { content: "\f0b5"; } .wi-wu-chancesnow:before { content: "\f01b"; } .wi-wu-chancetstorms:before { content: "\f01e"; } .wi-wu-clear:before { content: "\f00d"; } .wi-wu-cloudy:before { content: "\f002"; } .wi-wu-flurries:before { content: "\f064"; } .wi-wu-hazy:before { content: "\f0b6"; } .wi-wu-mostlycloudy:before { content: "\f002"; } .wi-wu-mostlysunny:before { content: "\f00d"; } .wi-wu-partlycloudy:before { content: "\f002"; } .wi-wu-partlysunny:before { content: "\f00d"; } .wi-wu-rain:before { content: "\f01a"; } .wi-wu-sleat:before { content: "\f0b5"; } .wi-wu-snow:before { content: "\f01b"; } .wi-wu-sunny:before { content: "\f00d"; } .wi-wu-tstorms:before { content: "\f01e"; } .wi-wu-unknown:before { content: "\f00d"; }
dtrotzjr/greenhouse_rails_data_server
app/assets/stylesheets/weather-icons.css
CSS
mit
30,728
--- layout: page title: Green Industries Executive Retreat date: 2016-05-24 author: Jennifer Alvarado tags: weekly links, java status: published summary: Vivamus ante tellus, cursus a tortor id, egestas. banner: images/banner/meeting-01.jpg booking: startDate: 02/06/2017 endDate: 02/11/2017 ctyhocn: ROAAPHX groupCode: GIER published: true --- Maecenas velit ante, tristique eu aliquet ac, laoreet gravida ante. Donec ut dolor a dui ultrices ornare nec eu odio. Praesent ligula massa, condimentum ut lacus in, scelerisque rutrum elit. Aliquam at risus sed turpis feugiat eleifend. Aliquam mattis justo et nisi vestibulum cursus. In hac habitasse platea dictumst. Cras venenatis arcu nec iaculis suscipit. * Donec malesuada sem eget pharetra hendrerit * Quisque et eros quis est tincidunt tristique eget nec lacus * Ut molestie magna et convallis scelerisque * Fusce sed tortor fringilla, laoreet quam in, congue purus * Maecenas ullamcorper est nec lobortis semper. Sed congue luctus viverra. Pellentesque eget mi sit amet justo porta mollis. Ut euismod felis gravida, fermentum arcu at, elementum nibh. Fusce dapibus metus at sodales consectetur. Donec non tellus iaculis augue ullamcorper vehicula quis a lacus. Etiam fringilla vitae erat iaculis luctus. Curabitur sit amet libero dapibus leo pretium convallis tristique ac ante. Aenean eget metus ut est iaculis molestie vitae in eros. Donec vulputate ex sit amet sapien blandit, a mollis ipsum tincidunt. Sed quis placerat nibh. Phasellus sit amet dolor libero. Ut ut auctor erat. Donec commodo posuere sapien. Nunc in accumsan massa. Etiam pretium eleifend nisi eget egestas. Vestibulum placerat mattis nibh, at pretium mi molestie eget. Donec ut arcu scelerisque, tempus tortor a, egestas urna. Donec non ultrices lectus. Suspendisse vitae ornare velit, id pharetra libero. Sed ac pharetra quam, vitae auctor tellus.
KlishGroup/prose-pogs
pogs/R/ROAAPHX/GIER/index.md
Markdown
mit
1,884
package org.wycliffeassociates.translationrecorder.utilities; /** * Created by sarabiaj on 9/23/2016. */ public interface OnTaskProgressListener { void onTaskProgressUpdate(Long id, int progress); void onTaskComplete(Long id); void onTaskCancel(Long id); void onTaskError(Long id); }
WycliffeAssociates/translationRecorder
translationRecorder/app/src/main/java/org/wycliffeassociates/translationrecorder/utilities/OnTaskProgressListener.java
Java
mit
306
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!-- $Gateweaver: index.php,v 1.2 2007/10/12 19:29:32 cmaxwell Exp $ --> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Products</title> <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=iso-8859-1" /> <meta http-equiv="imagetoolbar" content="no" /> <link rel="stylesheet" type="text/css" href="/style.css" /> <link rel="shortcut icon" href="/favicon.ico" /> </head> <body> <div id="main"> <?php include("../header.php"); ?> <div class="outer"> <div class="inner"> <div class="float-wrap"> <div id="content"> <div class="contentWrap"> <h2><a href="/products/chopstix/" title="Chopstix">Chopstix</a></h2> <h4>Point of Sale software for take-out and delivery restaurants</h4> Chopstix is a complete software solution that provides order entry, receipt printing, order reporting and menu management for take-out and delivery restaurants. The Chopstix solution runs on standard PC hardware and includes an operating system, the Chopstix application, a report generator, and a menu manager. <br /> <br /> <br /> </div> </div> <div class="left"> <br /> <a href="/products/chopstix/" title="Chopstix"> <img src="/images/ChopstixLogo.gif" title="Chopstix Logo" /></a> </div> <div class="clear"></div> </div><!-- float-wrap --> <?php include("../menu.php"); ?> <div class="clear"></div> </div><!-- inner --> </div><!-- outer --> </div><!-- main --> <?php include("../footer.php"); ?> </body> </html>
WrathOfChris/chopstix
www/products/index.php
PHP
mit
1,589
'use strict'; var should = require('should'), request = require('supertest'), app = require('../../server'), mongoose = require('mongoose'), User = mongoose.model('User'), Politician = mongoose.model('Politician'), Party = mongoose.model('Party'), agent = request.agent(app); /** * Globals */ var userCredential, user, adminCredential, admin, party; /** * Party routes tests */ describe('Party CRUD tests', function() { beforeEach(function(done) { // Create user adminCredential userCredential= { username: 'username', password: 'password1' }; adminCredential = { username: 'adminname', password: 'password2' }; // Create a new user user = new User({ firstName: 'Full', lastName: 'Name', displayName: 'Full Name', email: '[email protected]', username: userCredential.username, password: userCredential.password, provider: 'local', roles: ['user'] }); // Create a new admin admin = new User({ firstName: 'Full', lastName: 'Name', displayName: 'Full Name', email: '[email protected]', username: adminCredential.username, password: adminCredential.password, provider: 'local', roles: ['admin'] }); // Save a user to the test db and create new Party user.save(function() { party = { name: 'Party Name' }; admin.save(function() { done(); }); }); }); it('should be able to save Party instance if logged in and admin', function(done) { agent.post('/auth/signin') .send(adminCredential) .expect(200) .end(function(signinErr, signinRes) { // Handle signin error if (signinErr) done(signinErr); // Get the userId var userId = admin.id; // Save a new Party agent.post('/parties') .send(party) .expect(200) .end(function(partySaveErr, partySaveRes) { // Handle Party save error if (partySaveErr) done(partySaveErr); // Get a list of Parties agent.get('/parties') .end(function(partiesGetErr, partiesGetRes) { // Handle Party save error if (partiesGetErr) done(partiesGetErr); // Get Parties list var parties = partiesGetRes.body; // Set assertions (parties[0].user._id).should.equal(userId); (parties[0].name).should.match('Party Name'); // Call the assertion callback done(); }); }); }); }); it('should not be able to save party instance if logged in but not admin', function(done) { agent.post('/auth/signin') .send(userCredential) .expect(200) .end(function(signinErr, signinRes) { // Handle signin error if (signinErr) done(signinErr); // Get the userId var userId = user.id; // Save a new Taxfraud agent.post('/parties') .send(party) .expect(403) .end(function(taxfraudSaveErr, taxfraudSaveRes) { // Handle Taxfraud save error if (taxfraudSaveErr) done(taxfraudSaveErr); // Call the assertion callback done(); }); }); }); it('should not be able to save Party instance if not logged in', function(done) { agent.post('/parties') .send(party) .expect(401) .end(function(partySaveErr, partySaveRes) { // Call the assertion callback done(partySaveErr); }); }); it('should be able to update Party instance if signed in and admin', function(done) { agent.post('/auth/signin') .send(adminCredential) .expect(200) .end(function(signinErr, signinRes) { // Handle signin error if (signinErr) done(signinErr); // Get the userId var userId = admin.id; // Save a new Party agent.post('/parties') .send(party) .expect(200) .end(function(partySaveErr, partySaveRes) { // Handle Party save error if (partySaveErr) done(partySaveErr); // Update Party name party.name = 'WHY YOU GOTTA BE SO MEAN?'; // Update existing Party agent.put('/parties/' + partySaveRes.body._id) .send(party) .expect(200) .end(function(partyUpdateErr, partyUpdateRes) { // Handle Party update error if (partyUpdateErr) done(partyUpdateErr); // Set assertions (partyUpdateRes.body._id).should.equal(partySaveRes.body._id); (partyUpdateRes.body.name).should.match('WHY YOU GOTTA BE SO MEAN?'); // Call the assertion callback done(); }); }); }); }); it('should be able to get a list of Parties if not signed in', function(done) { // Create new Party model instance var partyObj = new Party(party); // Save the Party partyObj.save(function() { // Request Parties request(app).get('/parties') .end(function(req, res) { // Set assertion res.body.should.be.an.Array.with.lengthOf(1); // Call the assertion callback done(); }); }); }); it('should be able to get a single Party if not signed in', function(done) { // Create new Party model instance var partyObj = new Party(party); // Save the Party partyObj.save(function() { request(app).get('/parties/' + partyObj._id) .end(function(req, res) { // Set assertion res.body.should.be.an.Object.with.property('name', party.name); // Call the assertion callback done(); }); }); }); it('should be able to delete Party instance if signed in and admin', function(done) { agent.post('/auth/signin') .send(adminCredential) .expect(200) .end(function(signinErr, signinRes) { // Handle signin error if (signinErr) done(signinErr); // Get the userId var userId = admin.id; // Save a new Party agent.post('/parties') .send(party) .expect(200) .end(function(partySaveErr, partySaveRes) { // Handle Party save error if (partySaveErr) done(partySaveErr); // Delete existing Party agent.delete('/parties/' + partySaveRes.body._id) .send(party) .expect(200) .end(function(partyDeleteErr, partyDeleteRes) { // Handle Party error error if (partyDeleteErr) done(partyDeleteErr); // Set assertions (partyDeleteRes.body._id).should.equal(partySaveRes.body._id); // Call the assertion callback done(); }); }); }); }); it('should not be able to delete Party instance if not signed in', function(done) { // Set Party user party.user = user; // Create new Party model instance var partyObj = new Party(party); // Save the Party partyObj.save(function() { // Try deleting Party request(app).delete('/parties/' + partyObj._id) .expect(401) .end(function(partyDeleteErr, partyDeleteRes) { // Set message assertion (partyDeleteRes.body.message).should.match('User is not logged in'); // Handle Party error error done(partyDeleteErr); }); }); }); afterEach(function(done) { User.remove().exec(); Party.remove().exec(); done(); }); });
jensBergman/Skatten2
app/tests/party.server.routes.test.js
JavaScript
mit
6,918
module Bable module Index class << self # List the implemented readability indexes. # # @return [Array<Symbol>] list of indexes in underscored format. def available_indexes indexes = constants.select do |constant| c = const_get(constant) c.is_a?(Class) && c < Base end indexes.map { |c| c.to_s.underscore.to_sym } end def target_class(index) camelized_class = index.to_s.camelize fail NotExistingIndexError unless const_defined?(camelized_class) const_get(camelized_class) end end class NotExistingIndexError < StandardError; end end end
danimashu/bable
lib/bable/index.rb
Ruby
mit
667
<?php return array ( 'id' => 'sonyericsson_j200c_ver1', 'fallback' => 'sonyericsson_j200_ver1', 'capabilities' => array ( 'uaprof' => 'http://wap.sonyericsson.com/UAprof/J200cR101.xml', 'model_name' => 'J200c', 'max_data_rate' => '40', 'streaming_real_media' => 'none', ), );
cuckata23/wurfl-data
data/sonyericsson_j200c_ver1.php
PHP
mit
303
package com.goodworkalan.strata; import static com.goodworkalan.strata.Leaves.getNextAndLock; import static com.goodworkalan.strata.Leaves.link; import com.goodworkalan.stash.Stash; /** * Split a leaf by creating a new empty leaf to the right of a linked list of * b+tree leaves of duplicate index values and adding the leaf value to the new * leaf. * * @author Alan Gutierrez * * @param <T> * The value type of the b+tree objects. * @param <A> * The address type used to identify an inner or leaf tier. */ final class SplitLinkedListRight<T, A> implements LeafOperation<T, A> { /** The inner tier parent that references the leaf to split. */ private final Tier<T, A> inner; /** * Create a split linked list right operation. * * @param inner * The inner tier parent that references the leaf to split. */ public SplitLinkedListRight(Tier<T, A> inner) { this.inner = inner; } /** * Return true if the given leaf is the last leaf in a linked list of leaves * containing object with identical index values. * * @param mutation * The mutation state container. * @param leaf * The leaf. * @return True if the given leaf is the last leaf in a linked list of * leaves. */ private boolean endOfList(Mutation<T, A> mutation, Tier<T, A> leaf) { Structure<T, A> structure = mutation.getStructure(); Storage<T, A> alloator = mutation.getStructure().getStorage(); if (alloator.isNull(leaf.getNext())) { return true; } Stash stash = mutation.getStash(); Tier<T, A> next = structure.getStorage().load(stash, leaf.getNext()); return structure.getComparableFactory().newComparable(stash, leaf.getRecord(0)).compareTo(next.getRecord(0)) != 0; } /** * Perform the right leaf split and insert the value object. * * @param mutation * The mutation state container. * @param leafLevel * The per level mutation state for the leaf level. * @return True of the operation succeeded. */ public boolean operate(Mutation<T, A> mutation, Level<T, A> leafLevel) { // Get the collection of the core services of the b+tree. Structure<T, A> structure = mutation.getStructure(); // Find the branch that navigates to the leaf child. int branch = inner.find(mutation.getComparable()); Tier<T, A> leaf = structure.getStorage().load(mutation.getStash(), inner.getChildAddress(branch)); // Navigate to the end of the linked list of a linked list of b+tree // leaves of duplicate index values. Tier<T, A> last = leaf; while (!endOfList(mutation, last)) { last = getNextAndLock(mutation, last, leafLevel); } // Create a new leaf and link it to the right of the leaf. Tier<T, A> right = mutation.newLeafTier(); link(mutation, last, right); // Add a branch for the the new leaf in the parent inner tier. inner.addBranch(inner.getIndexOfChildAddress(leaf.getAddress()) + 1, mutation.getObject(), right.getAddress()); // Stage the dirty tiers for write. Stage<T, A> writer = structure.getStage(); writer.dirty(mutation.getStash(), inner); writer.dirty(mutation.getStash(), leaf); writer.dirty(mutation.getStash(), right); // Insert the object value. return new InsertSorted<T, A>(inner).operate(mutation, leafLevel); } }
defunct/strata
src/main/java/com/goodworkalan/strata/SplitLinkedListRight.java
Java
mit
3,607
#!/bin/sh #------------------------------------------------------------------------------ # Iterates over each map file in the subdirectories and pulls out each planet # names, putting them into names.txt # # I wrote this to data-mine the original planet names used in Stars! # # Author: Brandon Arrendondo # License: MIT #------------------------------------------------------------------------------ for i in $(find -type f -name "*.map") do awk 'NR>1 {print $1=$2=$3=""; print $0}' $i | sed -e "/^\s*$/d" | sed -e "s/^\s*//" >> names.txt done fromdos names.txt sort -u -o names.txt names.txt
szarta/stars-research
maps/gather_names.sh
Shell
mit
601
--- title: Finding True Self-Worth date: 03/08/2021 --- If Joseph had entertained any hopes of escaping and finding his way back home, they were dashed on reaching Egypt, where Joseph was resold into a prominent household. Genesis 39:1 tells us that “Potiphar, an officer of Pharaoh, captain of the guard, an Egyptian, bought him from the Ishmaelites” (NKJV). Suddenly the young man was thrust into a strange, new language and culture. Our families and close relationships are pivotal in the development of our self-esteem. Joseph had grown up believing that he was something special—the oldest son of the most beloved wife (Gen. 29:18). He was definitely his father’s favorite—and the only one with a beautiful coat of many colors (Gen. 37:3, 4). But who was he now? A slave, someone who could be bought or sold at will. Look at how quickly his whole situation changed. Look at how quickly life seemed to have turned on him. Indeed, Joseph learns the lesson that we all have to learn. If we are dependent on others to tell us what we are worth, then we will be in for a rough ride and be horribly confused, because not everyone is going to appreciate who we are or what we are like. Instead, we need to find our self-worth in what God thinks of us—how God sees us—and not in the roles that we currently have. `How does God see each of us? (See Isa. 43:1; Mal. 3:17; John 1:12; John 15:15; Rom. 8:14; 1 John 3:1, 2.)` God looks at each of us with glasses tinted with grace. He sees a potential, beauty, and talent that we can’t even imagine. Ultimately, He was prepared to die for us so that we could have the opportunity to become all we were created to be. Though showing us our sinfulness and the great price it cost to redeem us from it, the Cross also shows us our great worth and value to God. Regardless of what others think of us or even what we think about ourselves, God loves us and seeks to redeem us from not only the power of sins now but also from the eternal death that they bring. The key question, then, is always the same: How do we respond to the reality of God’s love, as revealed in Jesus Christ? `There are many groups and individuals telling us to love ourselves as we are and accept ourselves uncritically. Why is this really self-deception? Why is it important that our worth come from outside of ourselves, from the One who made us and knows our true potential?` --- #### Additional Reading: Selected Quotes from Ellen G. White The rabbis understood Christ’s parable as applying to the publicans and sinners; but it has also a wider meaning. By the lost sheep Christ represents not only the individual sinner but the one world that has apostatized and has been ruined by sin. This world is but an atom in the vast dominions over which God presides, yet this little fallen world—the one lost sheep—is more precious in His sight than are the ninety and nine that went not astray from the fold. Christ, the loved Commander in the heavenly courts, stooped from His high estate, laid aside the glory that He had with the Father, in order to save the one lost world. For this He left the sinless worlds on high, the ninety and nine that loved Him, and came to this earth, to be “wounded for our transgressions” and “bruised for our iniquities.” (Isaiah 53:5.) God gave Himself in His Son that He might have the joy of receiving back the sheep that was lost. “Behold, what manner of love the Father hath bestowed upon us, that we should be called the sons of God.” 1 John 3:1.—_Christ’s Object Lessons_, pp. 190, 191. Christ and Him crucified should become the theme of our thoughts and stir the deepest emotions of our souls. The true followers of Christ will appreciate the great salvation which He has wrought for them; and wherever He leads the way, they will follow. They will consider it a privilege to bear whatever burdens Christ may lay upon them. It is through the cross alone that we can estimate the worth of the human soul. Such is the value of men for whom Christ died that the Father is satisfied with the infinite price which He pays for the salvation of man in yielding up His own Son to die for their redemption. What wisdom, mercy, and love in its fullness are here manifested! The worth of man is known only by going to Calvary. In the mystery of the cross of Christ we can place an estimate upon man.—_Testimonies for the Church_, vol. 2, p. 634. Our God is an ever-present help in every time of need. He is perfectly acquainted with the most secret thoughts of our heart, with all the intents and purposes of our souls. When we are in perplexity, even before we open to Him our distress, He is making arrangements for our deliverance. Our sorrow is not unnoticed. He always knows much better than we do, just what is necessary for the good of His children, and He leads us as we would choose to be led if we could discern our own hearts and see our necessities and perils, as God sees them. But finite beings seldom know themselves. They do not understand their own weakness. God knows them better than they know themselves, and He understands how to lead them.—_Our High Calling_, p. 316.
Adventech/sabbath-school-lessons
src/en/2021-03/06/04.md
Markdown
mit
5,191
<?php // autoload_classmap.php @generated by Composer $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'Recurly_Account' => $vendorDir . '/recurly/recurly-client/lib/recurly/account.php', 'Recurly_AccountAcquisition' => $vendorDir . '/recurly/recurly-client/lib/recurly/account_acquisition.php', 'Recurly_AccountBalance' => $vendorDir . '/recurly/recurly-client/lib/recurly/account_balance.php', 'Recurly_AccountList' => $vendorDir . '/recurly/recurly-client/lib/recurly/account_list.php', 'Recurly_Addon' => $vendorDir . '/recurly/recurly-client/lib/recurly/addon.php', 'Recurly_AddonList' => $vendorDir . '/recurly/recurly-client/lib/recurly/addon_list.php', 'Recurly_Address' => $vendorDir . '/recurly/recurly-client/lib/recurly/address.php', 'Recurly_Adjustment' => $vendorDir . '/recurly/recurly-client/lib/recurly/adjustment.php', 'Recurly_AdjustmentList' => $vendorDir . '/recurly/recurly-client/lib/recurly/adjustment_list.php', 'Recurly_ApiRateLimitError' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_Base' => $vendorDir . '/recurly/recurly-client/lib/recurly/base.php', 'Recurly_BillingInfo' => $vendorDir . '/recurly/recurly-client/lib/recurly/billing_info.php', 'Recurly_Client' => $vendorDir . '/recurly/recurly-client/lib/recurly/client.php', 'Recurly_ClientResponse' => $vendorDir . '/recurly/recurly-client/lib/recurly/response.php', 'Recurly_ConfigurationError' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_ConnectionError' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_Coupon' => $vendorDir . '/recurly/recurly-client/lib/recurly/coupon.php', 'Recurly_CouponList' => $vendorDir . '/recurly/recurly-client/lib/recurly/coupon_list.php', 'Recurly_CouponRedemption' => $vendorDir . '/recurly/recurly-client/lib/recurly/redemption.php', 'Recurly_CouponRedemptionList' => $vendorDir . '/recurly/recurly-client/lib/recurly/redemption_list.php', 'Recurly_CreditPayment' => $vendorDir . '/recurly/recurly-client/lib/recurly/credit_payment.php', 'Recurly_CreditPaymentList' => $vendorDir . '/recurly/recurly-client/lib/recurly/credit_payment_list.php', 'Recurly_Currency' => $vendorDir . '/recurly/recurly-client/lib/recurly/currency.php', 'Recurly_CurrencyList' => $vendorDir . '/recurly/recurly-client/lib/recurly/currency_list.php', 'Recurly_CustomField' => $vendorDir . '/recurly/recurly-client/lib/recurly/custom_field.php', 'Recurly_CustomFieldList' => $vendorDir . '/recurly/recurly-client/lib/recurly/custom_field_list.php', 'Recurly_Delivery' => $vendorDir . '/recurly/recurly-client/lib/recurly/delivery.php', 'Recurly_Error' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_ErrorList' => $vendorDir . '/recurly/recurly-client/lib/recurly/error_list.php', 'Recurly_ExportDate' => $vendorDir . '/recurly/recurly-client/lib/recurly/export_date.php', 'Recurly_ExportDateList' => $vendorDir . '/recurly/recurly-client/lib/recurly/export_date_list.php', 'Recurly_ExportFile' => $vendorDir . '/recurly/recurly-client/lib/recurly/export_file.php', 'Recurly_ExportFileList' => $vendorDir . '/recurly/recurly-client/lib/recurly/export_file_list.php', 'Recurly_FieldError' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_ForgedQueryStringError' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_FraudInfo' => $vendorDir . '/recurly/recurly-client/lib/recurly/fraud_info.php', 'Recurly_GiftCard' => $vendorDir . '/recurly/recurly-client/lib/recurly/gift_card.php', 'Recurly_GiftCardList' => $vendorDir . '/recurly/recurly-client/lib/recurly/gift_card_list.php', 'Recurly_HmacHash' => $vendorDir . '/recurly/recurly-client/lib/recurly/util/hmac_hash.php', 'Recurly_Invoice' => $vendorDir . '/recurly/recurly-client/lib/recurly/invoice.php', 'Recurly_InvoiceCollection' => $vendorDir . '/recurly/recurly-client/lib/recurly/invoice_collection.php', 'Recurly_InvoiceList' => $vendorDir . '/recurly/recurly-client/lib/recurly/invoice_list.php', 'Recurly_Link' => $vendorDir . '/recurly/recurly-client/lib/recurly/link.php', 'Recurly_MeasuredUnit' => $vendorDir . '/recurly/recurly-client/lib/recurly/measured_unit.php', 'Recurly_MeasuredUnitList' => $vendorDir . '/recurly/recurly-client/lib/recurly/measured_unit_list.php', 'Recurly_NotFoundError' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_Note' => $vendorDir . '/recurly/recurly-client/lib/recurly/note.php', 'Recurly_NoteList' => $vendorDir . '/recurly/recurly-client/lib/recurly/note_list.php', 'Recurly_Object' => $vendorDir . '/recurly/recurly-client/lib/recurly/base.php', 'Recurly_Pager' => $vendorDir . '/recurly/recurly-client/lib/recurly/pager.php', 'Recurly_Plan' => $vendorDir . '/recurly/recurly-client/lib/recurly/plan.php', 'Recurly_PlanList' => $vendorDir . '/recurly/recurly-client/lib/recurly/plan_list.php', 'Recurly_Purchase' => $vendorDir . '/recurly/recurly-client/lib/recurly/purchase.php', 'Recurly_PushNotification' => $vendorDir . '/recurly/recurly-client/lib/recurly/push_notification.php', 'Recurly_RequestError' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_Resource' => $vendorDir . '/recurly/recurly-client/lib/recurly/resource.php', 'Recurly_ServerError' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_ShippingAddress' => $vendorDir . '/recurly/recurly-client/lib/recurly/shipping_address.php', 'Recurly_ShippingAddressList' => $vendorDir . '/recurly/recurly-client/lib/recurly/shipping_address_list.php', 'Recurly_Stub' => $vendorDir . '/recurly/recurly-client/lib/recurly/stub.php', 'Recurly_Subscription' => $vendorDir . '/recurly/recurly-client/lib/recurly/subscription.php', 'Recurly_SubscriptionAddOn' => $vendorDir . '/recurly/recurly-client/lib/recurly/subscription_addon.php', 'Recurly_SubscriptionList' => $vendorDir . '/recurly/recurly-client/lib/recurly/subscription_list.php', 'Recurly_Tax_Detail' => $vendorDir . '/recurly/recurly-client/lib/recurly/tax_detail.php', 'Recurly_Transaction' => $vendorDir . '/recurly/recurly-client/lib/recurly/transaction.php', 'Recurly_TransactionError' => $vendorDir . '/recurly/recurly-client/lib/recurly/transaction_error.php', 'Recurly_TransactionList' => $vendorDir . '/recurly/recurly-client/lib/recurly/transaction_list.php', 'Recurly_UnauthorizedError' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_UniqueCouponCodeList' => $vendorDir . '/recurly/recurly-client/lib/recurly/unique_coupon_code_list.php', 'Recurly_Usage' => $vendorDir . '/recurly/recurly-client/lib/recurly/usage.php', 'Recurly_UsageList' => $vendorDir . '/recurly/recurly-client/lib/recurly/usage_list.php', 'Recurly_ValidationError' => $vendorDir . '/recurly/recurly-client/lib/recurly/errors.php', 'Recurly_js' => $vendorDir . '/recurly/recurly-client/lib/recurly/recurly_js.php', 'S3v4\\S3' => $vendorDir . '/tpyo/amazon-s3-php-class/S3.php', 'S3v4\\S3Exception' => $vendorDir . '/tpyo/amazon-s3-php-class/S3.php', 'S3v4\\S3Request' => $vendorDir . '/tpyo/amazon-s3-php-class/S3.php', 'lessc' => $vendorDir . '/wikimedia/less.php/lessc.inc.php', );
unaio/una
upgrade/files/12.1.0-13.0.0.A1/files/plugins/composer/autoload_classmap.php
PHP
mit
7,579
module.exports = function(grunt) { grunt.initConfig({ jshint: { all: ['Gruntfile.js', 'hulk.js'], options: { "forin": true, "latedef": true, "unused": true, "trailing": true } }, uglify: { options: { mangle: { except: ['jQuery'] }, banner: '/* Hulk v0.1 | (c) 2013 Kevin Burke | License: MIT */\n', compress: true }, my_target: { files: { 'hulk.min.js': ['hulk.js'] } } }, qunit: { files: ['tests/test.html'] }, sass: { dist: { files: { 'css/hulk-all.css': 'scss/hulk-all.scss', 'css/hulk.css': 'scss/hulk.scss', 'css/hulk-colors.css': 'scss/hulk-colors.scss', } } }, watch: { scripts: { files: 'hulk.js', tasks: ['jshint', 'uglify'] }, css: { files: '**/*.scss', tasks: ['sass'] } } }); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-uglify'); //grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-watch'); };
kevinburke/hulk
Gruntfile.js
JavaScript
mit
1,546
# Author:: Fastly Inc <[email protected]> # Copyright:: Copyright (c) 2011 Fastly Inc # License:: Distributes under the same terms as Ruby # A client library for interacting with the Fastly web acceleration service require 'fastly/gem_version' require 'fastly/util' require 'fastly/fetcher' require 'fastly/client' require 'fastly/base' require 'fastly/belongs_to_service_and_version' require 'fastly/acl' require 'fastly/acl_entry' require 'fastly/backend' require 'fastly/cache_setting' require 'fastly/condition' require 'fastly/customer' require 'fastly/dictionary' require 'fastly/dictionary_item' require 'fastly/director' require 'fastly/domain' require 'fastly/header' require 'fastly/healthcheck' require 'fastly/gzip' require 'fastly/invoice' require 'fastly/match' require 'fastly/papertrail_logging' require 'fastly/request_setting' require 'fastly/response_object' require 'fastly/service' require 'fastly/settings' require 'fastly/snippet' require 'fastly/dynamic_snippet' require 'fastly/sumologic_logging' require 'fastly/syslog' require 'fastly/s3_logging' require 'fastly/gcs_logging' require 'fastly/user' require 'fastly/vcl' require 'fastly/version' # Top-level Fastly class class Fastly include Fastly::Fetcher # Create a new Fastly client. Options are # # user:: your Fastly login # password:: your Fastly password # api_key:: your Fastly api key # # You only need to pass in C<api_key> OR C<user> and C<password>. # # Some methods require full username and password rather than just auth token. def initialize(opts) if opts[:api_key].nil? && (opts[:password].nil? || opts[:user].nil?) raise ArgumentError, "Required options missing. Please pass either ':api_key' or both ':user' and ':password'." end client(opts) self end # Whether or not we're authed at all by either username & password or API key def authed? client.authed? end # Whether or not we're fully (username and password) authed # Some methods require full username and password rather than just auth token def fully_authed? client.fully_authed? end # Return a Customer object representing the customer of the current logged in user. def current_customer fail AuthRequired unless authed? @current_customer ||= get(Customer) end # Return a User object representing the current logged in user. # NOTE: requires you to be fully authed - will not work with only an API key def current_user fail FullAuthRequired unless fully_authed? @current_user ||= get(User) end # Purge the specified path from your cache. def purge(url, soft=false) client.purge(url, soft ? { headers: { 'Fastly-Soft-Purge' => "1"} } : {}) end # Fetches historical stats for each of your fastly services and groups the results by service id. # # If you pass in a :field opt then fetches only the specified field. # If you pass in a :service opt then fetches only the specified service. # The :field and :service opts can be combined. # # If you pass in an :aggregate flag then fetches historical stats information aggregated across all of your Fastly services. This cannot be combined with :field and :service. # # Other options available are: # # from:: earliest time from which to fetch historical statistics # to:: latest time from which to fetch historical statistics # by:: the sampling rate used to produce the result set (minute, hour, day) # region:: restrict query to a particular region # # See http://docs.fastly.com/docs/stats for details. def stats(opts) if opts[:aggregate] && (opts[:field] || opts[:service]) fail Error, "You can't specify a field or a service for an aggregate request" end url = '/stats' url += '/aggregate' if opts.delete(:aggregate) if service = opts.delete(:service) url += "/service/#{service}" end if field = opts.delete(:field) url += "/field/#{field}" end client.get_stats(url, opts) end # Returns usage information aggregated across all Fastly services and grouped by region. # # If the :by_month flag is passed then returns total usage information aggregated by month as well as grouped by service & region. # # If the :by_service flag is passed then returns usage information aggregated by service and grouped by service & region. # # Other options available are: # # from:: earliest time from which to fetch historical statistics # to:: latest time from which to fetch historical statistics # by:: the sampling rate used to produce the result set (minute, hour, day) # region:: restrict query to a particular region # # See http://docs.fastly.com/docs/stats for details. def usage(opts) url = '/stats/usage' url += '_by_month' if opts.delete(:by_month) url += '_by_service' if opts.delete(:by_service) client.get_stats(url, opts) end # Fetches the list of codes for regions that are covered by the Fastly CDN service. def regions client.get_stats('/stats/regions') end [ACL, ACLEntry, User, Customer, Backend, CacheSetting, Condition, Dictionary, DictionaryItem, Director, Domain, Header, Healthcheck, Gzip, Match, PapertrailLogging, RequestSetting, ResponseObject, Service, Snippet, S3Logging, Syslog, VCL, Version].each do |klass| type = Util.class_to_path(klass) if klass.respond_to?(:pluralize) plural = klass.pluralize else plural = "#{type}s" end if klass.respond_to?(:singularize) singular = klass.singularize else singular = type end # unless the class doesn't have a list path or it already exists unless klass.list_path.nil? || klass.respond_to?("list_#{plural}".to_sym) send :define_method, "list_#{plural}".to_sym do |*args| list(klass, *args) end end send :define_method, "get_#{singular}".to_sym do |*args| get(klass, *args) end send :define_method, "create_#{singular}".to_sym do |obj| create(klass, obj) end send :define_method, "update_#{singular}".to_sym do |obj| update(klass, obj) end send :define_method, "delete_#{singular}".to_sym do |obj| delete(klass, obj) end end # :method: create_version(opts) # opts must contain a service_id param ## # :method: create_backend(opts) # opts must contain service_id, version and name params ## # :method: create_dictionary(opts) # opts must contain service_id, version and name params ## # :method: create_dictionary_item(opts) # opts must contain service_id, dictionary_id, item_key and item_value params ## # :method: create_director(opts) # opts must contain service_id, version and name params ## # :method: create_domain(opts) # opts must contain service_id, version and name params ## # :method: create_match(opts) # opts must contain service_id, version and name params ## # :method: create_healthcheck(opts) # opts must contain service_id, version and name params ## # :method: create_s3_logging(opts) # opts must contain service_id, version and name params ## # :method: create_papertrail_logging(opts) # opts must contain service_id, version and name params ## # :method: create_syslog(opts) # opts must contain service_id, version and name params ## # :method: create_vcl(opts) # opts must contain service_id, version and name params ## # :method: create_condition(opts) # opts must contain service_id, version and name params ## # :method: create_cache_setting(opts) # opts must contain service_id, version and name params ## # :method: create_header(opts) # opts must contain service_id, version and name params ## # :method: create_gzip(opts) # opts must contain service_id, version and name params ## # :method: create_request_setting(opts) # opts must contain service_id, version and name params ## # :method: create_response_object(opts) # opts must contain service_id, version and name params ## # :method: get_user(id) # Get a User ## # :method: get_customer(id) # Get a customer ## # :method: get_service(id) # Get a Service ## # :method: get_version(service_id, number) # Get a Version ## # :method: get_backend(service_id, number, name) # Get a backend ## # :method: get_dictionary(service_id, number, name) # Get a single dictionary ## # :method: get_dictionary_item(service_id, dictionary_id, name) # Get a single dictionary item ## # :method: get_director(service_id, number, name) # Get a Director ## # :method: get_domain(service_id, number, name) # Get a Domain ## # :method: get_healthcheck(service_id, number, name) # Get a Healthcheck ## # :method: get_match(service_id, number, name) # Get a Match ## # :method: get_s3_logging(service_id, number, name) # Get a S3 logging ## # :method: get_papertrail_logging(service_id, number, name) # Get a Papertrail logging stream config ## # :method: get_syslog(service_id, number, name) # Get a Syslog ## # :method: get_vcl(service_id, number, name) # Get a VCL ## # :method: get_snippet(service_id, number, name) # Get a VCL snippet ## # :method: get_version(service_id, number, name) # Get a Version ## # :method: get_settings(service_id, number, name) # Get a Settings ## # :method: get_condition(service_id, number, name) # Get a Condition ## # :method: get_cache_setting(service_id, number, name) # Get a Cache Setting ## # :method: get_gzip(service_id, number, name) # Get a Gzip ## # :method: get_header(service_id, number, name) # Get a Header ## # :method: get_request_setting(service_id, number, name) # Get a Request Setting ## # :method: get_response_object(service_id, number, name) # Get a Response Object ## # :method: update_user(user) # You can also call # user.save! ## # :method: update_customer(customer) # You can also call # customer.save! ## # :method: update_service(service) # You can also call # service.save! ## # :method: update_version(version) # You can also call # version.save! ## # :method: update_backend(backend) # You can also call # backend.save! ## # :method: update_dictionary(dictionary) # You can also call # dictionary.save! ## # :method: update_dictionary_item(dictionary_item) # You can also call # dictionary_item.save! ## # :method: update_director(director) # You can also call # director.save! ## # :method: update_domain(domain) # You can also call # domain.save! ## # :method: update_healthcheck(healthcheck) # You can also call # healthcheck.save! ## # :method: update_match(match) # You can also call # match.save! ## # :method: update_settings(settings) # You can also call # settings.save! ## # :method: update_s3_logging(s3_logging) # You can also call # s3_logging.save! ## # :method: update_papertrail_logging(papertrail_logging) # You can also call # papertrail_logging.save! ## # :method: update_syslog(syslog) # You can also call # syslog.save! ## # :method: update_vcl(vcl) # You can also call # vcl.save! ## # :method: update_snippet(snippet) # You can also call # snippet.save! ## # :method: update_cache_setting(cache_setting) # You can also call # cache_setting.save! ## # :method: update_header(header) # You can also call # header.save! ## # :method: update_gzip(gzip) # You can also call # gzip.save! ## # :method: update_request_setting(request_setting) # You can also call # request_setting.save! ## # :method: update_response_object(response_object) # You can also call # response_object.save! ## # :method: update_condition(condition) # You can also call # condition.save! ## # :method: update_version(version) # You can also call # version.save! ## # :method: delete_user(user) # You can also call # user.delete! ## # :method: delete_customer(customer) # You can also call # customer.delete! ## # :method: delete_service(service) # You can also call # service.delete! ## # :method: delete_version(version) # You can also call # version.delete! ## # :method:delete_backend(backend) # You can also call # backend.delete! ## # :method: delete_dictionary(dictionary) # You can also call # dictionary.delete! ## # :method: delete_dictionary_item(dictionary_item) # You can also call # dictionary_item.delete! ## # :method: delete_director(backend) # You can also call # backend.delete! ## # :method: delete_domain(domain # You can also call # domain.delete! ## # :method: delete_healthcheck(healthcheck) # You can also call # healthcheck.delete! ## # :method: delete_match(match) # You can also call # match.delete!(match) ## # :method: delete_s3_logging(s3_logging) # You can also call # s3_logging.delete! ## # :method: delete_papertrail_logging(papertrail_logging) # You can also call # papertrail_logging.delete! ## # :method: delete_syslog(syslog) # You can also call # syslog.delete! ## # :method: delete_vcl(vcl) # You can also call # vcl.delete! ## # :method: delete_snippet(snippet) # You can also call # snippet.delete! ## # :method: delete_cache_setting(cache_setting) # You can also call # cache_setting.delete! ## # :method: delete_header(header) # You can also call # header.delete! ## # :method: delete_gzip(gzip) # You can also call # gzip.delete! ## # :method: delete_request_setting(request_setting) # You can also call # request_setting.delete! ## # :method: delete_response_object(response_object) # You can also call # response_object.delete! ## # :method: delete_condition(condition) # You can also call # condition.delete! ## # :method: delete_version(version) # You can also call # version.delete! # :method: list_users(:service_id => service.id, :version => version.number) # # Get a list of all users # :method: list_customers(:service_id => service.id, :version => version.number) # # Get a list of all customers # :method: list_versions(:service_id => service.id, :version => version.number) # # Get a list of all versions # :method: list_services(:service_id => service.id, :version => version.number) # # Get a list of all services # :method: list_backends(:service_id => service.id, :version => version.number) # # Get a list of all backends # :method: list_directors(:service_id => service.id, :version => version.number) # # Get a list of all directors # :method: list_dictionaries(:service_id => service.id, :version => version.number) # # Get a list of all dictionaries # :method: list_dictionary_items(:service_id => service.id, :dictionary_id => dictionary.name) # # Get a list of all items belonging to a dictionary # :method: list_domains(:service_id => service.id, :version => version.number) # # Get a list of all domains # :method: list_healthchecks(:service_id => service.id, :version => version.number) # # Get a list of all healthchecks # :method: list_matchs(:service_id => service.id, :version => version.number) # # Get a list of all matches # :method: list_syslogs(:service_id => service.id, :version => version.number) # # Get a list of all syslogs # :method: list_vcls(:service_id => service.id, :version => version.number) # # Get a list of all vcls # :method: list_snippets(:service_id => service.id, :version => version.number) # # Get a list of all vcl snippets # :method: list_conditions(:service_id => service.id, :version => version.number) # # Get a list of all conditions # :method: list_cache_settings(:service_id => service.id, :version => version.number) # # Get a list of all cache settings # :method: list_headers(:service_id => service.id, :version => version.number) # # Get a list of all headers # :method: list_gzips(:service_id => service.id, :version => version.number) # # Get a list of all gzips # :method: list_request_settings(:service_id => service.id, :version => version.number) # # Get a list of all request_settings # :method: list_response_objects(:service_id => service.id, :version => version.number) # # Get a list of all response_objects # :method: list_versions(:service_id => service.id, :version => version.number) # # Get a list of all versions ## # Attempts to load various config options in the form # # <key> = <value> # # From a file. # # Skips whitespace and lines starting with C<#>. # def self.load_config(file) options = {} return options unless File.exist?(file) File.open(file, 'r') do |infile| while line = infile.gets line.chomp! next if line =~ /^#/ next if line =~ /^\s*$/ next unless line =~ /=/ line.strip! key, val = line.split(/\s*=\s*/, 2) options[key.to_sym] = val end end options end ## # Tries to load options from the file[s] passed in using, # C<load_options>, stopping when it finds the first one. # # Then it overrides those options with command line options # of the form # # --<key>=<value> # def self.get_options(*files) options = {} files.each do |file| next unless File.exist?(file) options = load_config(file) break end while ARGV.size > 0 && ARGV[0] =~ /^-+(\w+)\=(\w+)$/ options[$1.to_sym] = $2 ARGV.shift end fail "Couldn't find options from command line arguments or #{files.join(', ')}" unless options.size > 0 options end end
seekingalpha/fastly-ruby
lib/fastly.rb
Ruby
mit
17,991
package download_manager.services; import data.object_holder.DownloadData; /** * This Interface is used to implement the call back mechanism for a running * download task. * * @author shibaprasad * @version 1.0 */ public interface OnRunningListener { //The download status code. public static final int RUNNING = 1; public static final int CLOSE = 5; /** * This method is called when the download is going to start. * * @param downloadData the download data that belong to the task. * @param downloadTask the download task that calls this method. */ public void beforeDownloadStart(DownloadData downloadData, DownloadTask downloadTask); /** * This method is called when the download is running and the * controller thread need to update the view. * * @param status the download status. Check this interface to check status code. * @param downloadData the download data that belong to the task. * @param downloadTask the download task that calls this method. */ public void downloadRunning(int status, DownloadData downloadData, DownloadTask downloadTask); }
msoftware/aio-video-downloader
src/download_manager/services/OnRunningListener.java
Java
mit
1,163
<?php /** * This file is part of the Cubiche package. * * Copyright (c) Cubiche * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Cubiche\Core\Selector\Tests\Units; /** * Count Tests Class. * * @author Ivannis Suárez Jerez <[email protected]> */ class CountTests extends SelectorTestCase { /** * Test apply. */ public function testApply() { $this /* @var \Cubiche\Core\Selector\Count $count */ ->given($count = $this->newTestedInstance()) ->then() ->integer($count->apply(array(6, 7, 8, 9))) ->isEqualTo(4) ->integer($count->apply(array(6, 7, 8, 9, 5))) ->isEqualTo(5) ->integer($count->apply(array())) ->isEqualTo(0) ; } }
cubiche/cubiche
src/Cubiche/Core/Selector/Tests/Units/CountTests.php
PHP
mit
920
Ext.define('Travelly.view.NewPicture', { extend: 'Ext.Panel', xtype: 'newpicture', requires: [ 'Ext.TitleBar', 'Ext.Button', 'Ext.Img', 'Ext.field.Text' ], config: { height: '100%', width: '100%', centered: true, showAnimation: 'slideIn', hideAnimation: 'slideOut', hidden: true, items: [ { docked: 'top', xtype: 'titlebar', title: 'New Photo' }, { xtype: 'container', width: '100%', height: '100%', layout: { type: 'vbox', pack: 'center', align: 'center' }, items: [ { xtype: 'image', id: 'photoPreview', width: '100%', flex: 8 }, { xtype: 'textfield', id: 'photoTitle', clearIcon: true, width: '90%', margin: '5 0 0 0', flex: 1 }, { xtype: 'label', id: 'progressLabel', html: '', width: '90%', margin: '5 0 0 0' }, { xtype: 'container', flex: 1, layout: { type: 'hbox', pack: 'center', align: 'center' }, items: [ { xtype: 'button', id: 'retakePhotoBtn', text: 'Retake', iconCls: 'photo', flext: 1, margin: '0 5 0 5' }, { xtype: 'button', id: 'savePhotoBtn', text: 'Save', iconCls: 'check', flext: 1, margin: '0 5 0 5' }, { xtype: 'button', id: 'cancelPhotoBtn', text: 'Close', iconCls: 'delete', flext: 1, margin: '0 5 0 5' } ] } ] } ] } });
cybind/travelly
app/view/NewPicture.js
JavaScript
mit
3,026
package cmd import ( "bufio" "fmt" "io/ioutil" "os" "runtime" "syscall" "golang.org/x/crypto/ssh/terminal" "strconv" "path/filepath" "errors" "github.com/varunamachi/orekng/data" "github.com/varunamachi/orekng/data/sqlite" "github.com/varunamachi/orekng/olog" passlib "gopkg.in/hlandau/passlib.v1" cli "gopkg.in/urfave/cli.v1" ) //OrekClient - Defines a client impl used to execute commands from cli type OrekClient interface { GetAllUsers() (users []*data.User, err error) GetUser(userName string) (users *data.User, err error) GetUserWithEmail(email string) (user *data.User, err error) CreateUser(user *data.User) (err error) UpdateUser(user *data.User) (err error) DeleteUser(userName string) (err error) GetAllEndpoints() (endpoints []*data.Endpoint, err error) GetEndpoint(endpointID string) (endpoint *data.Endpoint, err error) CreateEndpoint(endpoint *data.Endpoint) (err error) UpdateEndpoint(endpoint *data.Endpoint) (err error) DeleteEndpoint(endpointID string) (err error) GetAllVariables() (variables []*data.Variable, err error) GetVariablesForEndpoint(endpointID string) (variables []*data.Variable, err error) GetVariable(variableID string) (variable *data.Variable, err error) CreateVariable(variable *data.Variable) (err error) UpdateVariable(variable *data.Variable) (err error) DeleteVariable(variableID string) (err error) GetAllParameters() (parameters []*data.Parameter, err error) GetParametersForEndpoint(endpointID string) (parameters []*data.Parameter, err error) GetParameter(parameterID string) (parameter *data.Parameter, err error) CreateParameter(parameter *data.Parameter) (err error) UpdateParameter(parameter *data.Parameter) (err error) DeleteParameter(parameterID string) (err error) GetAllUserGroups() (groups []*data.UserGroup, err error) GetUserGroup(userGroupID string) (group *data.UserGroup, err error) CreateUserGroup(userGroup *data.UserGroup) (err error) UpdateUserGroup(userGroup *data.UserGroup) (err error) DeleteUserGroup(usergroupID string) (err error) AddUserToGroup(userName, groupID string) (err error) RemoveUserFromGroup(userName, groupID string) (err error) GetUsersInGroup(groupID string) (userInGroup []*data.User, err error) GetGroupsForUser(userName string) (groupsForUser []*data.UserGroup, err error) AddVariableValue(variableID, value string) (err error) ClearValuesForVariable(variableID string) (err error) GetValuesForVariable(variableID string) (values []*string, err error) SetPassword(userName, password string) (err error) UpdatePassword(userName, currentPassword, newPassword string) (err error) } //LocalClient - This is local client which executes the command in the current //process, also uses data source directly type LocalClient struct { data.OrekDataStore } //SetPassword - sets the password for the user func (ds LocalClient) SetPassword(userName, password string) (err error) { var hash string hash, err = passlib.Hash(password) if err == nil { err = data.GetStore().SetPasswordHash(userName, hash) } return err } //DeleteUser - Deletes the user with given name func (ds LocalClient) DeleteUser(userName string) (err error) { err = ds.DeleteUsers(userName) return err } //DeleteEndpoint - Deletes the user with given name func (ds LocalClient) DeleteEndpoint(endpointID string) (err error) { err = ds.DeleteEndpoints(endpointID) return err } //DeleteVariable - Deletes the variable with given ID func (ds LocalClient) DeleteVariable(variableID string) (err error) { err = ds.DeleteVariables(variableID) return err } //DeleteParameter - deletes the parameter with given ID func (ds LocalClient) DeleteParameter(parameterID string) (err error) { err = ds.DeleteParameters(parameterID) return err } //DeleteUserGroup - deletes user group with given ID func (ds LocalClient) DeleteUserGroup(usergroupID string) (err error) { err = ds.DeleteUserGroups(usergroupID) return err } //UpdatePassword - updates the password for the user func (ds LocalClient) UpdatePassword(userName, currentPassword, newPassword string) (err error) { var newHash, oldHash, dbHash string newHash, err = passlib.Hash(newPassword) oldHash, err = passlib.Hash(oldHash) dbHash, err = data.GetStore().GetPasswordHash(userName) if err == nil { if oldHash == dbHash { data.GetStore().UpdatePasswordHash(userName, newHash) } else { err = errors.New("Current password does not match") } } return err } //CliCommandProvider - gives commands supported by the application type CliCommandProvider interface { GetCommand() cli.Command } //OrekApp - contains command providers and runs the app type OrekApp struct { CommandProviders []CliCommandProvider } //AskSecret - asks password from user, does not echo charectors func askSecret() (secret string, err error) { var pbyte []byte pbyte, err = terminal.ReadPassword(int(syscall.Stdin)) if err == nil { secret = string(pbyte) fmt.Println() } return secret, err } //RegisterCommandProvider - registers a command provider func (orek *OrekApp) RegisterCommandProvider(cmdProvider CliCommandProvider) { if cmdProvider != nil { orek.CommandProviders = append(orek.CommandProviders, cmdProvider) } } func fromOrekDir(relative string) (path string) { home := os.Getenv("HOME") if runtime.GOOS == "windows" { home = os.Getenv("APPDATA") } return filepath.Join(home, ".orek", relative) } //Run - runs the application func (orek *OrekApp) Run(args []string) (err error) { if runtime.GOOS != "windows" { } app := cli.NewApp() app.ErrWriter = ioutil.Discard app.Name = "Orek" app.Version = "0.0.1" app.Authors = []cli.Author{ cli.Author{ Name: "Varun Amachi", Email: "[email protected]", }, } app.Flags = []cli.Flag{ cli.StringFlag{ Name: "ds", Value: "sqlite", Usage: "Datasource name, sqlite|postgres", }, cli.StringFlag{ Name: "db-path", Value: fromOrekDir("orek.db"), Usage: "Path to SQLite database [Only applicable for SQLite]", }, cli.StringFlag{ Name: "ds-host", Value: "localhost", Usage: "DataBase host name [Not applicable for SqliteDataSource]", }, cli.IntFlag{ Name: "ds-port", Value: 5432, Usage: "DataBase port [Not applicable for SqliteDataSource]", }, cli.StringFlag{ Name: "db-name", Value: "orek", Usage: "DataBase name [Not applicable for SqliteDataSource]", }, cli.StringFlag{ Name: "db-user", Value: "", Usage: "DataBase username [Not applicable for SqliteDataSource]", }, cli.StringFlag{ Name: "db-password", Value: "", Usage: "Option db password for testing " + "[Not applicable for SqliteDataSource]", }, } app.Before = func(ctx *cli.Context) (err error) { argetr := ArgGetter{Ctx: ctx} ds := argetr.GetRequiredString("ds") var store data.OrekDataStore if ds == "sqlite" { path := argetr.GetRequiredString("db-path") dirPath := filepath.Dir(path) if _, err := os.Stat(dirPath); os.IsNotExist(err) { err = os.Mkdir(dirPath, 0755) olog.PrintError("Orek", err) } store, err = sqlite.Init(&sqlite.Options{ Path: path, }) if err == nil { data.SetStore(store) // err = data.GetStore().Init() if err != nil { olog.Fatal("Orek", "Data Store initialization failed: %v", err) } else { olog.Info("Orek", "%s Data Store initialized", store.Name()) } } } else if ds == "postgres" { host := argetr.GetRequiredString("db-host") port := argetr.GetRequiredInt("db-port") dbName := argetr.GetRequiredString("db-name") user := argetr.GetRequiredString("db-user") pswd := argetr.GetString("db-password") if len(pswd) == 0 { fmt.Printf("Password for %s: ", user) var pbyte []byte pbyte, err = terminal.ReadPassword(int(syscall.Stdin)) if err != nil { olog.Fatal("Orek", "Could not retrieve DB password: %v", err) } else { pswd = string(pbyte) } } olog.Print("Orek", `Postgres isnt supported yet. Here are the args Host: %s, Port: %d, DbName: %s, User: %s`, host, port, dbName, user) } else { olog.Fatal("Orek", "Unknown datasource %s requested", ds) } return err } app.Commands = make([]cli.Command, 0, 30) for _, cmdp := range orek.CommandProviders { app.Commands = append(app.Commands, cmdp.GetCommand()) } err = app.Run(args) return err } //ArgGetter - this struct and its method are helpers to combine getting args //from commandline arguments or from reading from console. Also handles errors //when required arguments are not provided type ArgGetter struct { Ctx *cli.Context Err error } func readInput(text *string) (err error) { scanner := bufio.NewScanner(os.Stdin) *text = "" for scanner.Scan() { *text = scanner.Text() break } err = scanner.Err() return err } //GetString - gives a string argument either from commandline or from blocking //user input, this method doesnt complain even if the arg-value is empty func (retriever *ArgGetter) GetString(key string) (val string) { if retriever.Err != nil { return val } val = retriever.Ctx.String(key) if !retriever.Ctx.IsSet(key) && len(val) == 0 { fmt.Print(key + ": ") err := readInput(&val) if err != nil { val = "" } } return val } //GetRequiredString - gives a string argument either from commandline or from //blocking user input, this method sets the error if required arg-val is empty func (retriever *ArgGetter) GetRequiredString(key string) (val string) { if retriever.Err != nil { return val } val = retriever.Ctx.String(key) if !retriever.Ctx.IsSet(key) && len(val) == 0 { fmt.Print(key + "*: ") err := readInput(&val) if err != nil || len(val) == 0 { val = "" retriever.Err = fmt.Errorf("Required argument %s not provided", key) } } return val } //GetRequiredSecret - gives a string argument either from commandline or from //blocking user input, this method sets the error if required arg-val is empty func (retriever *ArgGetter) GetRequiredSecret(key string) (val string) { if retriever.Err != nil { return val } val = retriever.Ctx.String(key) if !retriever.Ctx.IsSet(key) && len(val) == 0 { fmt.Print(key + "*: ") var err error val, err = askSecret() if err != nil || len(val) == 0 { val = "" retriever.Err = fmt.Errorf("Required argument %s not provided", key) } } return val } //GetRequiredInt - gives a Integer argument either from commandline or from //blocking user input, this method sets the error if required arg-val is empty func (retriever *ArgGetter) GetRequiredInt(key string) (val int) { if retriever.Err != nil { return val } val = retriever.Ctx.Int(key) if !retriever.Ctx.IsSet(key) && val == 0 { fmt.Print(key + ": ") var strval string err := readInput(&strval) if err != nil || len(strval) == 0 { val = 0 retriever.Err = fmt.Errorf("Required argument %s not provided", key) } else { val, err = strconv.Atoi(strval) if err != nil { retriever.Err = fmt.Errorf("Invalid value for %s given", key) val = 0 } } } return val } //GetInt - gives a Integer argument either from commandline or from blocking //user input, this method doesnt complain even if the arg-value is empty func (retriever *ArgGetter) GetInt(key string) (val int) { if retriever.Err != nil { return val } val = retriever.Ctx.Int(key) if !retriever.Ctx.IsSet(key) && val == 0 { fmt.Print(key + ": ") var strval string err := readInput(&strval) if err != nil || len(strval) == 0 { val = 0 } else { val, err = strconv.Atoi(strval) if err != nil { val = 0 } } } return val } //GetRequiredBool - gives a Boolean argument either from commandline or from //blocking user input, this method sets the error if required arg-val is empty func (retriever *ArgGetter) GetRequiredBool(key string) (val bool) { if retriever.Err != nil { return val } val = retriever.Ctx.Bool(key) // if !retriever.Ctx.IsSet(key) { // fmt.Print(key + ": ") // var strval string // err := readInput(&strval) // trimmed := strings.TrimSpace(strval) // if err != nil || len(trimmed) == 0 { // val = false // retriever.Err = fmt.Errorf("Required argument %s not provided", key) // } else { // val = strings.ToUpper(trimmed) == "TRUE" || trimmed == "1" // if err != nil { // retriever.Err = fmt.Errorf("Invalid value for %s given", key) // val = false // } // } // } return val } //GetBool - gives a Boolean argument either from commandline or from blocking //user input, this method doesnt complain even if the arg-value is empty func (retriever *ArgGetter) GetBool(key string) (val bool) { if retriever.Err != nil { return val } val = retriever.Ctx.Bool(key) // if !retriever.Ctx.IsSet(key) { // fmt.Print(key + ": ") // var strval string // err := readInput(&strval) // if err != nil || len(strval) == 0 { // val = false // } else { // trimmed := strings.TrimSpace(strval) // val = strings.ToUpper(trimmed) == "TRUE" || trimmed == "1" // if err != nil { // val = false // } // } // } return val }
varunamachi/orekng
cmd/orek.go
GO
mit
13,083
var _ = require("lodash"); module.exports = function(index, request){ var allMatches = []; index.forEach(function(entry){ if (_.includes(entry.tags, request.phrase)){ var exactMatch = { filename: entry.filename, context: request.phrase, weight: 1, type: "keyword-full" }; allMatches.push(exactMatch); } var wordMatches = _.intersection(entry.tags, request.words); if (wordMatches.length > 0){ var match = { filename: entry.filename, context: wordMatches.join(" "), weight: wordMatches.length/ request.words.length, type: "keyword" }; if (wordMatches.length === request.words.length){ match.type = "keyword-full"; } allMatches.push(match); } }); return allMatches; };
geekytime/gif-grabber
lib/find-phrase-matches.js
JavaScript
mit
817
/* * align.cpp for FR-HIT * Copyright (c) 2010-2011 Beifang Niu All Rights Reserved. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include<algorithm> #include<cmath> #include<bitset> #include<omp.h> #include "align.h" using namespace std; extern bit8_t alphabet[]; extern bit8_t reg_alphabet[]; extern bit8_t rev_alphabet[]; // Reads Ns filtering extern bit8_t nvfilter[]; extern char rev_char[]; extern char chain_flag[]; extern char nt_code[]; extern char revnt_code[]; // For alignment DP int BLOSUM62[] = { 4, // A -1, 5, // R -2, 0, 6, // N -2,-2, 1, 6, // D 0,-3,-3,-3, 9, // C -1, 1, 0, 0,-3, 5, // Q -1, 0, 0, 2,-4, 2, 5, // E 0,-2, 0,-1,-3,-2,-2, 6, // G -2, 0, 1,-1,-3, 0, 0,-2, 8, // H -1,-3,-3,-3,-1,-3,-3,-4,-3, 4, // I -1,-2,-3,-4,-1,-2,-3,-4,-3, 2, 4, // L -1, 2, 0,-1,-3, 1, 1,-2,-1,-3,-2, 5, // K -1,-1,-2,-3,-1, 0,-2,-3,-2, 1, 2,-1, 5, // M -2,-3,-3,-3,-2,-3,-3,-3,-1, 0, 0,-3, 0, 6, // F -1,-2,-2,-1,-3,-1,-1,-2,-2,-3,-3,-1,-2,-4, 7, // P 1,-1, 1, 0,-1, 0, 0, 0,-1,-2,-2, 0,-1,-2,-1, 4, // S 0,-1, 0,-1,-1,-1,-1,-2,-2,-1,-1,-1,-1,-2,-1, 1, 5, // T -3,-3,-4,-4,-2,-2,-3,-2,-2,-3,-2,-3,-1, 1,-4,-3,-2,11, // W -2,-2,-2,-3,-2,-1,-2,-3, 2,-1,-1,-2,-1, 3,-3,-2,-2, 2, 7, // Y 0,-3,-3,-3,-1,-2,-2,-3,-3, 3, 1,-2, 1,-1,-2,-2, 0,-3,-1, 4, // V -2,-1, 3, 4,-3, 0, 1,-1, 0,-3,-4, 0,-3,-3,-2, 0,-1,-4,-3,-3, 4, // B -1, 0, 0, 1,-3, 3, 4,-2, 0,-3,-3, 1,-1,-3,-1, 0,-1,-3,-2,-2, 1, 4, // Z 0,-1,-1,-1,-2,-1,-1,-1,-1,-1,-1,-1,-1,-1,-2, 0, 0,-2,-1,-1,-1,-1,-1 // X //A R N D C Q E G H I L K M F P S T W Y V B Z X //0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 6 20 }; int na2idx[] = {0, 4, 1, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 4, 4, 4, 4, 4}; // idx for A B C D E F G H I J K L M N O P // Q R S T U V W X Y Z // so aa2idx[ X - 'A'] => idx_of_X, eg aa2idx['A' - 'A'] => 0, // and aa2idx['M'-'A'] => 4 int BLOSUM62_na[] = { 1, // A -2, 1, // C -2,-2, 1, // G -2,-2,-2, 1, // T -2,-2,-2, 1, 1, // U -2,-2,-2,-2,-2, 1 // N //A C G T U N //0 1 2 3 3 4 }; void AA_MATRIX::init() { gap = -11; ext_gap = -1; for (int i=0; i<MAX_GAP; i++) { gap_array[i] = gap + i * ext_gap; } int k = 0; for (int i=0; i<MAX_AA; i++) { for ( int j=0; j<=i; j++) { matrix[j][i] = matrix[i][j] = BLOSUM62[k++]; } } } // END void AA_MATRIX::init() void AA_MATRIX::set_gap(int gap1, int ext_gap1) { gap = gap1; ext_gap = ext_gap1; for (int i=0; i<MAX_GAP; i++) { gap_array[i] = gap + i * ext_gap; } } // END void AA_MATRIX::set_gap void AA_MATRIX::set_matrix(int *mat1) { int k = 0; for (int i=0; i<MAX_AA; i++) { for (int j=0; j<=i; j++) { matrix[j][i] = matrix[i][j] = mat1[k++]; } } } // END void AA_MATRIX::set_matrix void AA_MATRIX::set_to_na() { gap = -6; ext_gap = -1; for (int i=0; i<MAX_GAP; i++) { gap_array[i] = gap + i * ext_gap; } int k = 0; for (int i=0; i<MAX_NA; i++) { for (int j=0; j<=i; j++) { matrix[j][i] = matrix[i][j] = BLOSUM62_na[k++]; } } } // END void AA_MATRIX::set_to_na // Assign memory for DP alignment variables void WorkingPara::init() { for (int i=0; i<_MaxPartLen; i++) { score_mat[i] = new int [_MaxPartLen]; iden_mat[i] = new int [_MaxPartLen]; from1_mat[i] = new int [_MaxPartLen]; from2_mat[i] = new int [_MaxPartLen]; alnln_mat[i] = new int [_MaxPartLen]; } align_len=param.align_len; best_nas=param.best_nas; best_kmers=param.best_kmers; } void WorkingPara::final() { // Release dp variables for (int i=0; i<_MaxPartLen; i++) { delete [] score_mat[i]; delete [] iden_mat[i]; delete [] from1_mat[i]; delete [] from2_mat[i]; delete [] alnln_mat[i]; } } // Create seed profile ReadAlign::ReadAlign() { // count aligned reads num n_aligned = 0; // cutoff parameters band_width = param.band; } // Entry point for parallel void ReadAlign::DoBatch(RefSeq &ref, ReadClass &readA, ifstream &finRead, ofstream &fout) { _str_align.clear(); bit32_t naligned(0); vector<ReadInf>::iterator _pread; WorkingPara wp; int morereads(1); int iam=0; int np=1; // Parallel entry point #pragma omp parallel private(_pread, wp) { #if defined (_OPENMP) iam = omp_get_thread_num(); #pragma omp single if (param.ncpu == 0) { param.ncpu=omp_get_num_threads(); } //cerr<<param.ncpu<<" cpu used"<<endl; //np = omp_get_num_threads(); #endif while (morereads) { #pragma omp barrier #pragma omp single { morereads = readA.LoadBatchReads(finRead); ImportBatchReads(readA.num, &readA.mreads); } if (morereads) { naligned=0; #pragma omp for schedule(dynamic, 100) reduction(+:naligned) for (long tt=0; tt<num_reads; tt++) { _pread = pmreads->begin() + tt; // min read filtering if (_pread->seq.size() >= param.min_read_size) { //-g=1 (global), using new filtering cutoff if (param.global_signal == 1) { //wp.align_len = (_pread->length*param.global_part)/100;//nbps wp.align_len = _pread->length; wp.best_nas = (wp.align_len*param.identity)/100; wp.best_kmers = wp.align_len - (wp.align_len-wp.best_nas)*4 - 3;//4-mers } //Ns filtering if (ConvertBinaySeq(_pread, wp) == 0) { GenerateSeeds(_pread->length, wp); if (AlignProcess(ref, _pread, str_align[iam], wp)) naligned++; } } } #pragma omp single { for (int i=0; i<param.ncpu; i++) { fout<<str_align[i]; //result write str_align[i].clear(); } cerr << readA._index << " reads finished. " << Cal_AllTime() << " secs passed" << endl; n_aligned += naligned; } } //end of if } //end of while } //end of parallel part } // Convert string seq to binary type int ReadAlign::ConvertBinaySeq(vector<ReadInf>::iterator &_pread, WorkingPara &wp) { int i,j,h,g; int nxs =0; bit24_t _a; string::iterator _sp; string::reverse_iterator _sq; // Direct chain h = _a.a = 0; for (_sp = _pread->seq.begin(), i = 1; _sp!=_pread->seq.end(); _sp++, i++) { _a.a<<=2; _a.a|=alphabet[*_sp]; // Assign iseq value wp.iseqquery[i-1] = alphabet[*_sp]; nxs += nvfilter[*_sp]; if (0 == i%12) { wp.bseq[h] = _a; #ifdef DEBUG cerr<<" h "<<h<<endl; bitset <24> bs((long)wp.bseq[h].a); cerr<<" " <<bs<<endl; bs.reset(); #endif h++; _a.a = 0; } } if (nxs >= wp.best_nas) return 1; if (_pread->length%12) { _a.a<<=24-(_pread->length%12)*2; wp.bseq[h]=_a; } // Reverse seq h = _a.a = 0; for (_sq=_pread->seq.rbegin(), i=1; _sq != _pread->seq.rend(); _sq++, i++) { _a.a<<=2; _a.a|=rev_alphabet[*_sq]; // Assign ciseq value (reverse strain) wp.ciseqquery[i-1]=rev_alphabet[*_sq]; if (0 == i%12) { wp.cbseq[h] = _a; h++; _a.a=0; } } if (_pread->length%12) { _a.a<<=24-(_pread->length%12)*2; wp.cbseq[h] = _a; } // test iseq and ciseq (only debug) #ifdef DEBUG cerr << endl; for (i=0; i<_pread->length; i++) { cerr << int(iseqquery[i]); } cerr << endl; #endif return 0; } // Get seeds of reads one base one seed void ReadAlign::GenerateSeeds(int _read_length, WorkingPara &wp) { int j(_read_length - param.seed_size + 1); for (int i=0; i<j; i++) { int b = (i%12 + param.seed_size)*2; //some kind of end position wp.seeds[i] = b<=24? ( wp.bseq[i/12].a>>(24-b))&param.seed_bits : (wp.bseq[i/12].a<<(b-24)| wp.bseq[i/12+1].a>>48-b)&param.seed_bits; wp.cseeds[i] = b<=24? (wp.cbseq[i/12].a>>(24-b))&param.seed_bits : (wp.cbseq[i/12].a<<(b-24)|wp.cbseq[i/12+1].a>>48-b)&param.seed_bits; #ifdef DEBUG bitset <26> bs2((long)cseeds[i]); cerr << " " << bs2 << endl; bs2.reset(); #endif } } // OOP redo void ReadAlign::AhitCollect(int _read_length, int seedstep, RefSeq &ref, bit32_t *seeds, vector<bit64_t> &Ahit) { int temp_loc; bit32_t m,j,seed; bit64_t Ta_hit; ref_id_t *_refid; ref_loc_t *_refloc; Hit _hit; // Seed num of read bit32_t snum(_read_length - param.seed_size + 1); for(int i=0; i<snum; i+=seedstep) { seed = seeds[i]; // bit32_t if ((m=ref.index[seed].n) == 0) continue; //no match // List of seeded reference locations _refid = ref.index[seed].id; _refloc = ref.index[seed].loc; for (j=0; j!= m; j++) { // Seed location _hit.chr = _refid[j]; // Start position of possible alignment to read temp_loc = _refloc[j] - i; // Beyond the boundary( ref: 0) _hit.loc = temp_loc >= 0 ? temp_loc : 0; // Load refid and location in one 64 bit Ta_hit = ((bit64_t)_refid[j]<<32)|_hit.loc; Ahit.push_back(Ta_hit); } } } // OOP redo void ReadAlign::HitcansCollect(bit64_t tcc, RefSeq &ref, int _read_length, WorkingPara &wp) { int t_loc; bit32_t ccflag; bit64_t tcc0; ref_loc_t ttloc; Hit_Can Hitcan; //alignment hit sample ccflag = 0; for (bit32_t d = 1; d< wp.Ahit.size(); d++) { // vary in seed_size length scope if ((wp.Ahit[d] - tcc) <= param.seed_size) { if (ccflag == 0) { //get id and loc Hitcan.chr = tcc>>32; tcc0 = tcc<<32; ttloc = tcc0>>32; t_loc = ttloc - param.seed_size; // get alignment location info Hitcan._begin = t_loc > 0 ? t_loc : 0; // alignlength = read length add 2 folds seedsize Hitcan._end = ttloc + _read_length + 2*param.seed_size; if (Hitcan._end > (ref.title[Hitcan.chr].size-1)) Hitcan._end = ref.title[Hitcan.chr].size; wp._hit_Cans.push_back(Hitcan); ccflag = 1; } } else { tcc = wp.Ahit[d]; ccflag = 0; } } } // Merge adjoining blocks void ReadAlign::MergeAdjoiningBlock(WorkingPara &wp) { int d; Hit_Can Hitcan; // Alignment candidates filtering if (wp._hit_Cans.size() > 1) { Hitcan = wp._hit_Cans[0]; for (d=1; d< wp._hit_Cans.size(); d++) { if ((wp._hit_Cans[d].chr!=Hitcan.chr) || (int(Hitcan._end-wp._hit_Cans[d]._begin) < 0)) { //not same chr, or are apart wp.perfect_hit.push_back(Hitcan); Hitcan = wp._hit_Cans[d]; } else { //if overlap, merge to extend it //ref part length limit MAX_READ //maybe lost some alignment but it is enough if ((Hitcan._end - Hitcan._begin) < MAX_READ) Hitcan._end = wp._hit_Cans[d]._end; } } wp.perfect_hit.push_back(Hitcan); } else if (wp._hit_Cans.size() == 1) { //only one hit wp.perfect_hit.push_back(wp._hit_Cans[0]); } } // 4-mers checking void ReadAlign::CreateFourmers(char *iseqquery, int _read_length, WorkingPara &wp) { int j, sk, mm,c22; int lencc = _read_length - 3; // Get 4-mers value of query for (sk=0; sk<NAA4; sk++) { wp.taap[sk] = 0; } for (j=0; j<lencc; j++) { c22 = iseqquery[j]*NAA3 + iseqquery[j+1]*NAA2 + iseqquery[j+2]*NAA1 + iseqquery[j+3]; wp.taap[c22]++; } // Make index for (sk=0,mm=0; sk<NAA4; sk++) { wp.aap_begin[sk] = mm; mm += wp.taap[sk]; wp.taap[sk] = 0; } for (j=0; j<lencc; j++) { c22 = iseqquery[j]*NAA3 + iseqquery[j+1]*NAA2 + iseqquery[j+2]*NAA1 + iseqquery[j+3]; wp.aap_list[wp.aap_begin[c22]+wp.taap[c22]++] = j; } } // Main filtering and alignment part int ReadAlign::AlignProcess(RefSeq &ref, vector<ReadInf>::iterator &_pread, string &os, WorkingPara &wp) { // e-value int eHSP = expectedHSPlength(mink,_pread->length,ref.sum_length,Hh); // expect HSP length for e-value computing int eLengthSeq = effectiveLengthSeq(_pread->length,eHSP,mink); bit64_t eLengthDB = effectiveLengthDb(ref.sum_length,eHSP,ref.total_num,mink); double eValue; double read_identity_d; int trys; int seedstep; int repreports; int len; int len1; int best_sum; int RefBegin; int RefEnd; int alnln; int tiden_no; int read_cov; int read_identity; int talign_info[5]; // Alignment and filtering int band_left; int band_right; int _RecruitedSignal(0); int best_score; Hit_Can Hitcan; bit24_t *_m; bit32_t i,j,d,b; bit64_t tcc; OutputSort Outputunit; // Output sorting vector<OutputSort> Outputlist; // Get part of ref seq for alignment char seqjseg[_MaxPartLen]; // Result output container char _ch[1000]; MerSort Gramunit; vector< MerSort > Gramsort; //qgrams sorting seedstep = 1;//speedup using step q-gram of query read if (_pread->length >= param.lenforstep) seedstep = 2; // Alignment and 4 mers counting len = _pread->length; // 0:both; 1:direct only; 2:complementary only. default=0 direct chain if ((0 == param.chains) ||(1 == param.chains)) { AhitCollect(_pread->length, seedstep, ref, wp.seeds, wp.Ahit); // get alignment candidates if (wp.Ahit.size() > 1) { sort(wp.Ahit.begin(),wp.Ahit.end()); tcc = wp.Ahit[0]; HitcansCollect(tcc, ref, _pread->length, wp); } wp.Ahit.resize(0); // Release memory MergeAdjoiningBlock(wp); // Merge adjoining blocks wp._hit_Cans.resize(0); // get 4-mers value of query CreateFourmers(wp.iseqquery, _pread->length, wp); // for 4-kmers count filtering and alignment for (d = 0; d< wp.perfect_hit.size(); d++) { Hitcan = wp.perfect_hit[d]; RefEnd = Hitcan._end; RefBegin = Hitcan._begin; // candidate alignment length len1 = RefEnd - RefBegin; _m = ref.bfa[Hitcan.chr].s; // get iseq of ref j = 0; for (i=RefBegin; i<RefEnd; i++) { b = (i%12 + 1)*2; // seed_bits = 3 seqjseg[j] = b<=24 ? (_m[i/12].a>>(24-b))&3 : (_m[i/12].a<<(b-24)|_m[i/12+1].a>>48-b)&3; j++; } // debug only #ifdef DEBUG cerr << "len1 " << len1 << " RefBegin " << RefBegin << " RefEnd " << RefEnd << endl; #endif diag_test_aapn_est_circular(seqjseg, len, len1, best_sum, band_left, band_right, wp); #ifdef DEBUG cerr << "band_left " << band_left << " band_right " << band_right << endl; #endif if (best_sum < wp.best_kmers) continue; Gramunit.chr = Hitcan.chr; Gramunit._begin = RefBegin; Gramunit._end = RefEnd; Gramunit.qgrams = best_sum; // location of alignment begin Gramunit.bandleft = band_left; //location of alignment end Gramunit.bandright = band_right; Gramsort.push_back(Gramunit); } // release candidate hits vector memory wp.perfect_hit.resize(0); sort(Gramsort.begin(),Gramsort.end()); trys = 0;//try DPs repreports = 0;//repeats reported //for dp alignment for (d = 0; d< Gramsort.size(); d++) { Gramunit = Gramsort[d]; RefEnd = Gramunit._end; RefBegin = Gramunit._begin; //candidate alignment length len1 = RefEnd - RefBegin; _m = ref.bfa[Gramunit.chr].s; //get iseq of ref j = 0; for (i=RefBegin; i<RefEnd; i++) { b = (i%12 + 1)*2; seqjseg[j] = b<=24? (_m[i/12].a>>(24-b))&3 : (_m[i/12].a<<(b-24)|_m[i/12+1].a>>48-b)&3; j++; } // band alignment function local_band_align2(wp.iseqquery, seqjseg, len, len1, best_score, Gramunit.bandleft, Gramunit.bandright, talign_info, tiden_no, alnln, wp); read_cov = abs(talign_info[2] - talign_info[1]) + 1; if (param.global_signal == 1) { read_identity = (tiden_no * 100)/_pread->length; read_identity_d = (double)(tiden_no * 100)/_pread->length; } else { if (read_cov < wp.align_len) { trys++; if (trys>param.maxtrys) break; continue; } read_identity = (tiden_no * 100)/alnln; read_identity_d = (double)(tiden_no * 100)/alnln; } if (read_identity < param.identity) { trys++; if (trys > param.maxtrys) break; continue; } // get e-value eValue = rawScoreToExpect(best_score, mink, lamda, eLengthSeq, eLengthDB); if (eValue > param.evalue) { continue; } trys = 0; _RecruitedSignal = 1; // be recruited repreports++; // write alignment output to fout if (param.report_repeat_hits == 0) { if (param.outputformat == 1) { //1:PSL fromat sprintf(_ch, "%d\t%d\t0\t0\t0\t0\t0\t0\t+\t%s\t%d\t%d\t%d\t%s\t%d\t%d\t%d\t1\t%d,\t%d,\t%d,\n", tiden_no, read_cov-tiden_no, _pread->name.c_str(), _pread->length, talign_info[1],\ talign_info[2]+1, ref.title[Gramunit.chr].name.c_str(), ref.title[Gramunit.chr].size,\ RefBegin+talign_info[3], RefBegin+talign_info[4]+1, read_cov,talign_info[1],\ RefBegin+talign_info[3]); } else { //0:FR-HIT format sprintf(_ch, "%s\t%dnt\t%.1e\t%d\t%d\t%d\t+\t%0.2f%\t%s\t%d\t%d\n", _pread->name.c_str(), _pread->length, eValue,read_cov,talign_info[1]+1,\ talign_info[2]+1, read_identity_d, ref.title[Gramunit.chr].name.c_str(), \ RefBegin+talign_info[3]+1, RefBegin+talign_info[4]+1); } #pragma omp critical os.append(_ch); } else { // for repeats report if (repreports > param.report_repeat_hits) break; else { Outputunit.eva=eValue; if (param.outputformat == 1) { sprintf(Outputunit.och, "%d\t%d\t0\t0\t0\t0\t0\t0\t+\t%s\t%d\t%d\t%d\t%s\t%d\t%d\t%d\t1\t%d,\t%d,\t%d,\n", tiden_no,read_cov-tiden_no,_pread->name.c_str(),_pread->length,talign_info[1],talign_info[2]+1,\ ref.title[Gramunit.chr].name.c_str(), ref.title[Gramunit.chr].size,RefBegin+talign_info[3],\ RefBegin+talign_info[4]+1, read_cov, talign_info[1], RefBegin+talign_info[3]); } else { sprintf(Outputunit.och, "%s\t%dnt\t%.1e\t%d\t%d\t%d\t+\t%0.2f%\t%s\t%d\t%d\n", \ _pread->name.c_str(),_pread->length,eValue,read_cov,talign_info[1]+1,talign_info[2]+1,\ read_identity_d,ref.title[Gramunit.chr].name.c_str(),RefBegin+talign_info[3]+1,\ RefBegin+talign_info[4]+1); } Outputlist.push_back(Outputunit); } } }// end dp alignment Gramsort.resize(0); } // Random recruited finished //if ((param.report_repeat_hits == 0)&&(_RecruitedSignal == 1)) return 1; //complementary chain | done if ((0 == param.chains) || (2 == param.chains)) { AhitCollect(_pread->length, seedstep, ref, wp.cseeds, wp.Ahit); // get alignment candidates if (wp.Ahit.size() > 1) { sort(wp.Ahit.begin(),wp.Ahit.end());//sort Ahit tcc = wp.Ahit[0]; HitcansCollect(tcc, ref, _pread->length, wp); }// end get alignment candidates wp.Ahit.resize(0);//release initial seeds hits vector memory MergeAdjoiningBlock(wp);// Merge adjoining blocks wp._hit_Cans.resize(0); // Get 4-mers value of query CreateFourmers(wp.ciseqquery, _pread->length, wp); // analysis hits for 4-kmers count filter and alignment for (d = 0; d< wp.perfect_hit.size(); d++) { Hitcan = wp.perfect_hit[d]; RefEnd = Hitcan._end; RefBegin = Hitcan._begin; len1 = RefEnd - RefBegin; // candidate alignment length _m = ref.bfa[Hitcan.chr].s; // get reference // get iseq of ref j = 0; for (i=RefBegin; i<RefEnd; i++) { b = (i%12 + 1)*2; //seed_bits seqjseg[j] = b<=24? (_m[i/12].a>>(24-b))&3 : (_m[i/12].a<<(b-24)|_m[i/12+1].a>>48-b)&3; j++; } diag_test_aapn_est_circular(seqjseg, len, len1, best_sum, band_left, band_right, wp); // filtering using 4-mers if (best_sum < wp.best_kmers) continue; Gramunit.chr = Hitcan.chr; Gramunit._begin = RefBegin; Gramunit._end = RefEnd; Gramunit.qgrams = best_sum; // location of alignment begin Gramunit.bandleft = band_left; // location of alignment end Gramunit.bandright = band_right; Gramsort.push_back(Gramunit); } wp.perfect_hit.resize(0); sort(Gramsort.begin(),Gramsort.end()); trys = 0; //try DPs repreports = 0; //repeats reported //for dp alignment for (d = 0; d< Gramsort.size(); d++) { Gramunit = Gramsort[d]; RefEnd = Gramunit._end; RefBegin = Gramunit._begin; // candidate alignment length len1 = RefEnd - RefBegin; _m = ref.bfa[Gramunit.chr].s; // get iseq of ref j = 0; for (i=RefBegin; i<RefEnd; i++) { b = (i%12 + 1)*2; //seed_bits seqjseg[j] = b<=24? (_m[i/12].a>>(24-b))& 3: (_m[i/12].a<<(b-24)|_m[i/12+1].a>>48-b)&3; j++; } // band DP alignment local_band_align2(wp.ciseqquery,seqjseg,len,len1,best_score,Gramunit.bandleft,Gramunit.bandright,talign_info,tiden_no,alnln,wp); // the alignment length of read read_cov = abs(talign_info[2] - talign_info[1]) + 1; if (param.global_signal == 1) { read_identity = (tiden_no * 100)/_pread->length; read_identity_d = (double)(tiden_no * 100)/_pread->length; } else { if (read_cov < wp.align_len) { trys++; if (trys>param.maxtrys) break; continue; } read_identity = (tiden_no * 100)/alnln; read_identity_d = (double)(tiden_no * 100)/alnln; } if (read_identity < param.identity) { trys++; if (trys>param.maxtrys) break; continue; } // get evalue eValue = rawScoreToExpect(best_score,mink,lamda,eLengthSeq,eLengthDB); if (eValue > param.evalue) continue; trys = 0; // be recruited _RecruitedSignal = 1; repreports++; // write alignment output to fout if (param.report_repeat_hits == 0) { if (param.outputformat == 1) { //1:PSL fromat sprintf(_ch, "%d\t%d\t0\t0\t0\t0\t0\t0\t-\t%s\t%d\t%d\t%d\t%s\t%d\t%d\t%d\t1\t%d,\t%d,\t%d,\n", tiden_no,read_cov-tiden_no,_pread->name.c_str(),_pread->length,_pread->length-talign_info[2]-1,\ _pread->length-talign_info[1],ref.title[Gramunit.chr].name.c_str(),ref.title[Gramunit.chr].size,\ RefBegin+talign_info[3],RefBegin+talign_info[4]+1,read_cov,talign_info[1],\ RefBegin+talign_info[3]); } else { //0:FR-HIT format sprintf(_ch, "%s\t%dnt\t%.1e\t%d\t%d\t%d\t-\t%0.2f%\t%s\t%d\t%d\n", _pread->name.c_str(),\ _pread->length,eValue,read_cov,_pread->length-talign_info[1],_pread->length-talign_info[2],\ read_identity_d, ref.title[Gramunit.chr].name.c_str(),RefBegin+talign_info[3]+1,\ RefBegin+talign_info[4]+1); } #pragma omp critical os.append(_ch); } else { // for repeats report, only random one if (repreports > param.report_repeat_hits) break; else { Outputunit.eva=eValue; if (param.outputformat == 1) { sprintf(Outputunit.och, "%d\t%d\t0\t0\t0\t0\t0\t0\t-\t%s\t%d\t%d\t%d\t%s\t%d\t%d\t%d\t1\t%d,\t%d,\t%d,\n", tiden_no,read_cov-tiden_no,_pread->name.c_str(),_pread->length, _pread->length-talign_info[2]-1,\ _pread->length-talign_info[1],ref.title[Gramunit.chr].name.c_str(),ref.title[Gramunit.chr].size,\ RefBegin+talign_info[3],RefBegin+talign_info[4]+1,read_cov,talign_info[1],RefBegin+talign_info[3]); } else { sprintf(Outputunit.och, "%s\t%dnt\t%.1e\t%d\t%d\t%d\t-\t%0.2f%\t%s\t%d\t%d\n", _pread->name.c_str(),\ _pread->length,eValue,read_cov,_pread->length-talign_info[1],_pread->length-talign_info[2],\ read_identity_d,ref.title[Gramunit.chr].name.c_str(),RefBegin+talign_info[3]+1,\ RefBegin+talign_info[4]+1); } Outputlist.push_back(Outputunit); } } //end if } // end 4-mers filtering and alignment Gramsort.resize(0);//release candidate hits vector memory } //end complementary chain processing //output N best top hits if (param.report_repeat_hits != 0) if (Outputlist.size()>0) { sort(Outputlist.begin(),Outputlist.end()); j = Outputlist.size(); if (j>param.report_repeat_hits) j = param.report_repeat_hits; #pragma omp critical { for (i=0; i<j; i++) os.append(Outputlist[i].och); } Outputlist.resize(0); } return _RecruitedSignal; } //filtering HSP fasta//len1:reads length, len2:ref seq segment len, iseq2:ref seq segment binary int ReadAlign::diag_test_aapn_est_circular(char iseq2[],int len1,int len2, int &best_sum,int &band_left, int &band_right,WorkingPara &wp) { int i, j, k; int nall = len1 + len2 - 1; int *pp = wp.diag_score; for (i=nall; i; i--) *pp++=0; int len22 = len2 - 3; int i1 = len1 - 1; for (i=0; i<len22; i++, i1++, iseq2++) { int c22 = iseq2[0]*NAA3 + iseq2[1]*NAA2 + iseq2[2]*NAA1 + iseq2[3]; if ((j = wp.taap[c22]) == 0) continue; pp = wp.aap_list+ wp.aap_begin[c22]; for (; j; j--, pp++) { wp.diag_score[i1 - *pp]++; } } // find the best band range int required_aa1 = wp.best_nas; int band_b = required_aa1 >= 1 ? required_aa1-1:0; int band_e = nall - required_aa1; int band_m = ( band_b+band_width-1 < band_e ) ? band_b+band_width-1 : band_e; int best_score = 0; for (i=band_b; i<=band_m; i++) { best_score += wp.diag_score[i]; } int from = band_b; int end = band_m; int score = best_score; for (k=from, j=band_m+1; j<band_e; j++) { score -= wp.diag_score[k++]; score += wp.diag_score[j]; if (score > best_score) { from = k; end = j; best_score = score; } } for (j=from; j<=end; j++) { if ( wp.diag_score[j] < 5 ) { best_score -= wp.diag_score[j]; from++; }else break; } for (j=end; j>=from; j--) { if ( wp.diag_score[j] < 5 ) { best_score -= wp.diag_score[j]; end--; } else break; } band_left = from - len1 + 1; band_right = end - len1 + 1; best_sum = best_score; return 1; } int ReadAlign::local_band_align2(char iseq1[], char iseq2[], int len1, int len2, int &best_score, int band_left, int band_right, int *talign_info, int &iden_no, int &alnln, WorkingPara &wp) { //iseq1: binary read sequence, len1: reads length //iseq2: ref seq segment, len2: ref seq length int **score_mat(wp.score_mat); int **iden_mat(wp.iden_mat); int **from1_mat(wp.from1_mat); int **from2_mat(wp.from2_mat); int **alnln_mat(wp.alnln_mat); int *gap_array(mat.gap_array); int &from1(talign_info[1]); int &from2(talign_info[3]); int &end1(talign_info[2]); int &end2(talign_info[4]); int i, j, k, j1; int jj, kk; int best_score1, iden_no1; int best_from1, best_from2, best_alnln; iden_no = 0; from1=0; from2=0; if ((band_right >= len2) || (band_left <= -len1) || (band_left > band_right)) return 0; int bandwidth = band_right - band_left + 1; for (i=0; i<len1; i++) for (j1=0; j1<bandwidth; j1++) //here index j1 refer to band column score_mat[i][j1] = 0; best_score = 0; if (band_left < 0) { //set score to left border of the matrix within band int tband = (band_right < 0) ? band_right : 0; for (k=band_left; k<=tband; k++) { i = -k; j1 = k - band_left; if (( score_mat[i][j1] = mat.matrix[iseq1[i]][iseq2[0]] ) > best_score) { best_score = score_mat[i][j1]; from1 = i; from2 = 0; end1 = i; end2 = 0; alnln = 1; } iden_mat[i][j1] = (iseq1[i] == iseq2[0]) ? 1 : 0; from1_mat[i][j1] = i; from2_mat[i][j1] = 0; alnln_mat[i][j1] = 1; } } if (band_right >=0) { //set score to top border of the matrix within band int tband = (band_left > 0) ? band_left : 0; for (i=0,j=tband; j<=band_right; j++) { j1 = j - band_left; if (( score_mat[i][j1] = mat.matrix[iseq1[i]][iseq2[j]] ) > best_score) { best_score = score_mat[i][j1]; from1 = i; from2 = j; end1 = i; end2 = j; alnln = 0; } iden_mat[i][j1] = (iseq1[i] == iseq2[j]) ? 1 : 0; from1_mat[i][j1] = i; from2_mat[i][j1] = j; alnln_mat[i][j1] = 1; } } for (i=1; i<len1; i++) { for (j1=0; j1<bandwidth; j1++) { j = j1 + i + band_left; if (j<1 || j>=len2) continue; // from (i-1,j-1) if ((best_score1 = score_mat[i-1][j1] )> 0) { iden_no1 = iden_mat[i-1][j1]; best_from1 = from1_mat[i-1][j1]; best_from2 = from2_mat[i-1][j1]; best_alnln = alnln_mat[i-1][j1] + 1; } else { best_score1 = 0; iden_no1 = 0; best_from1 = i; best_from2 = j; best_alnln = 1; } // from last row int s1, k0; k0 = (-band_left+1-i > 0) ? -band_left+1-i : 0; for (k=j1-1, kk=0; k>=k0; k--, kk++) { if ((s1 = score_mat[i-1][k] + gap_array[kk] ) > best_score1) { best_score1 = s1; iden_no1 = iden_mat[i-1][k]; best_from1 = from1_mat[i-1][k]; best_from2 = from2_mat[i-1][k]; best_alnln = alnln_mat[i-1][k]+kk+2; } } k0 = (j-band_right-1 > 0) ? j-band_right-1 : 0; for (k=i-2, jj=j1+1,kk=0; k>=k0; k--,kk++,jj++) { if ((s1 = score_mat[k][jj] + gap_array[kk] ) > best_score1) { best_score1 = s1; iden_no1 = iden_mat[k][jj]; best_from1 = from1_mat[k][jj]; best_from2 = from2_mat[k][jj]; best_alnln = alnln_mat[k][jj]+kk+2; } } best_score1 += mat.matrix[iseq1[i]][iseq2[j]]; if (iseq1[i] == iseq2[j]) iden_no1++; score_mat[i][j1] = best_score1; iden_mat[i][j1] = iden_no1; from1_mat[i][j1] = best_from1; from2_mat[i][j1] = best_from2; alnln_mat[i][j1] = best_alnln; if (best_score1 > best_score) { best_score = best_score1; iden_no = iden_no1; end1 = i; end2 = j; from1 = best_from1; from2 = best_from2; alnln = best_alnln; } } //END for j1 } //END for (i=1; i<len1; i++) //printscorematrix(len1,bandwidth); return 1; } //END int local_band_align2 void ReadAlign::printscorematrix(int **sm, int xlen, int ylen) { for (int i=0; i<xlen; i++) { for (int j=0; j<ylen; j++) cerr<<sm[i][j]<<' '; cerr<<endl; } cerr<<endl; }
Beifang/fr-hit
align.cpp
C++
mit
37,834
<!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 v4.7.0 - v4.7.3: 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 v4.7.0 - v4.7.3 </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_1FunctionTemplate.html">FunctionTemplate</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">v8::FunctionTemplate Member List</div> </div> </div><!--header--> <div class="contents"> <p>This is the complete list of members for <a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a>, including all inherited members.</p> <table class="directory"> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>Context</b> (defined in <a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a>)</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"><span class="mlabel">friend</span></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>GetFunction</b>(Local&lt; Context &gt; context) (defined in <a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a>)</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#a90d838f3456d300bd19d2a2cb98645bd">HasInstance</a>(Local&lt; Value &gt; object)</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#abc11c462facf11bafd541892815c5425">Inherit</a>(Local&lt; FunctionTemplate &gt; parent)</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#a00dd9725566908e8fd14064542f5a781">InstanceTemplate</a>()</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#a3c6a525ee4e0d72afa77be8e34861f83">New</a>(Isolate *isolate, FunctionCallback callback=0, Local&lt; Value &gt; data=Local&lt; Value &gt;(), Local&lt; Signature &gt; signature=Local&lt; Signature &gt;(), int length=0)</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"><span class="mlabel">static</span></td></tr> <tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>ObjectTemplate</b> (defined in <a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a>)</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"><span class="mlabel">friend</span></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#aa2bcc2652b5f0fdbc666d943ccf72021">PrototypeTemplate</a>()</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#a91d2e0643e8c5a53ab1d75f7766c2422">ReadOnlyPrototype</a>()</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#a4a184aca244174c7fe52d58871d3129e">RemovePrototype</a>()</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1Template.html#a623b9f0cdd87dc861516f276cc9a7cfa">Set</a>(Local&lt; Name &gt; name, Local&lt; Data &gt; value, PropertyAttribute attributes=None)</td><td class="entry"><a class="el" href="classv8_1_1Template.html">v8::Template</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>Set</b>(Isolate *isolate, const char *name, Local&lt; Data &gt; value) (defined in <a class="el" href="classv8_1_1Template.html">v8::Template</a>)</td><td class="entry"><a class="el" href="classv8_1_1Template.html">v8::Template</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#a5ffdc68d8035b02ed7583950b76ef91f">SetAcceptAnyReceiver</a>(bool value)</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>SetAccessorProperty</b>(Local&lt; Name &gt; name, Local&lt; FunctionTemplate &gt; getter=Local&lt; FunctionTemplate &gt;(), Local&lt; FunctionTemplate &gt; setter=Local&lt; FunctionTemplate &gt;(), PropertyAttribute attribute=None, AccessControl settings=DEFAULT) (defined in <a class="el" href="classv8_1_1Template.html">v8::Template</a>)</td><td class="entry"><a class="el" href="classv8_1_1Template.html">v8::Template</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#a49babb7ea2d786a483a71514209455b6">SetCallHandler</a>(FunctionCallback callback, Local&lt; Value &gt; data=Local&lt; Value &gt;())</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#a491e77dc7ceb5b0fe75880d11f2dbe9e">SetClassName</a>(Local&lt; String &gt; name)</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#ade426e8a21d777ae6100e6c1aa7bfaee">SetHiddenPrototype</a>(bool value)</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#a5faf23b28ee3480b23ce054d0f389a75">SetLength</a>(int length)</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1Template.html#ae23966bef9b32df6ced859a39b4a1f19">SetNativeDataProperty</a>(Local&lt; String &gt; name, AccessorGetterCallback getter, AccessorSetterCallback setter=0, Local&lt; Value &gt; data=Local&lt; Value &gt;(), PropertyAttribute attribute=None, Local&lt; AccessorSignature &gt; signature=Local&lt; AccessorSignature &gt;(), AccessControl settings=DEFAULT)</td><td class="entry"><a class="el" href="classv8_1_1Template.html">v8::Template</a></td><td class="entry"></td></tr> <tr bgcolor="#f0f0f0"><td class="entry"><b>SetNativeDataProperty</b>(Local&lt; Name &gt; name, AccessorNameGetterCallback getter, AccessorNameSetterCallback setter=0, Local&lt; Value &gt; data=Local&lt; Value &gt;(), PropertyAttribute attribute=None, Local&lt; AccessorSignature &gt; signature=Local&lt; AccessorSignature &gt;(), AccessControl settings=DEFAULT) (defined in <a class="el" href="classv8_1_1Template.html">v8::Template</a>)</td><td class="entry"><a class="el" href="classv8_1_1Template.html">v8::Template</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html#a007fd05a3fa3c960bf7ddbc05c724d2b">V8_DEPRECATE_SOON</a>(&quot;Use maybe version&quot;, Local&lt; Function &gt; GetFunction())</td><td class="entry"><a class="el" href="classv8_1_1FunctionTemplate.html">v8::FunctionTemplate</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>
v8-dox/v8-dox.github.io
c1effb1/html/classv8_1_1FunctionTemplate-members.html
HTML
mit
11,697
<!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.9.1"/> <title>V8 API Reference Guide for io.js v2.3.2: Class Members - Functions</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 style="padding-left: 0.5em;"> <div id="projectname">V8 API Reference Guide for io.js v2.3.2 </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.9.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#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="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li> <li class="current"><a href="functions.html"><span>Class&#160;Members</span></a></li> </ul> </div> <div id="navrow3" class="tabs2"> <ul class="tablist"> <li><a href="functions.html"><span>All</span></a></li> <li class="current"><a href="functions_func.html"><span>Functions</span></a></li> <li><a href="functions_vars.html"><span>Variables</span></a></li> <li><a href="functions_type.html"><span>Typedefs</span></a></li> <li><a href="functions_enum.html"><span>Enumerations</span></a></li> </ul> </div> <div id="navrow4" class="tabs3"> <ul class="tablist"> <li><a href="functions_func.html#index_a"><span>a</span></a></li> <li><a href="functions_func_b.html#index_b"><span>b</span></a></li> <li><a href="functions_func_c.html#index_c"><span>c</span></a></li> <li><a href="functions_func_d.html#index_d"><span>d</span></a></li> <li><a href="functions_func_e.html#index_e"><span>e</span></a></li> <li><a href="functions_func_f.html#index_f"><span>f</span></a></li> <li><a href="functions_func_g.html#index_g"><span>g</span></a></li> <li><a href="functions_func_h.html#index_h"><span>h</span></a></li> <li><a href="functions_func_i.html#index_i"><span>i</span></a></li> <li><a href="functions_func_j.html#index_j"><span>j</span></a></li> <li><a href="functions_func_l.html#index_l"><span>l</span></a></li> <li><a href="functions_func_m.html#index_m"><span>m</span></a></li> <li><a href="functions_func_n.html#index_n"><span>n</span></a></li> <li><a href="functions_func_o.html#index_o"><span>o</span></a></li> <li><a href="functions_func_p.html#index_p"><span>p</span></a></li> <li><a href="functions_func_r.html#index_r"><span>r</span></a></li> <li><a href="functions_func_s.html#index_s"><span>s</span></a></li> <li class="current"><a href="functions_func_t.html#index_t"><span>t</span></a></li> <li><a href="functions_func_u.html#index_u"><span>u</span></a></li> <li><a href="functions_func_v.html#index_v"><span>v</span></a></li> <li><a href="functions_func_w.html#index_w"><span>w</span></a></li> <li><a href="functions_func_~.html#index_~"><span>~</span></a></li> </ul> </div> </div><!-- top --> <!-- 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 class="contents"> &#160; <h3><a class="anchor" id="index_t"></a>- t -</h3><ul> <li>TakeHeapSnapshot() : <a class="el" href="classv8_1_1_heap_profiler.html#acaff4d33babbca49a7308c89e2d910cc">v8::HeapProfiler</a> </li> <li>TerminateExecution() : <a class="el" href="classv8_1_1_isolate.html#ad212b2e0b66ff5d586cd79cfa0b555fb">v8::Isolate</a> , <a class="el" href="classv8_1_1_v8.html#a23fe97e88020bf23ad009f7a4bdb0192">v8::V8</a> </li> <li>ThrowException() : <a class="el" href="classv8_1_1_isolate.html#aba648b3c00dc9f1ef2a22195d99e22e8">v8::Isolate</a> </li> <li>ToArrayIndex() : <a class="el" href="classv8_1_1_value.html#ae810be0ae81a87f677592d0176daac48">v8::Value</a> </li> <li>TryCatch() : <a class="el" href="classv8_1_1_try_catch.html#adc9b1b11e73b0325df727914c348053d">v8::TryCatch</a> </li> <li>TurnOnAccessCheck() : <a class="el" href="classv8_1_1_object.html#a6e9fe342c0f77995defa6b479d01a3bd">v8::Object</a> </li> </ul> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated on Tue Aug 11 2015 23:50:02 for V8 API Reference Guide for io.js v2.3.2 by &#160;<a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.9.1 </small></address> </body> </html>
v8-dox/v8-dox.github.io
1a51f00/html/functions_func_t.html
HTML
mit
7,026
<!DOCTYPE html> <html> <head> <title>Lists of Texts Analyzed for Sentiment | Lingo Lemur</title> <link rel="stylesheet" src="//normalize-css.googlecode.com/svn/trunk/normalize.css" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/css/foundation.min.css"> <link href="https://fonts.googleapis.com/css?family=Raleway" rel="stylesheet" type="text/css"> <!-- app.css holds customized style --> <link rel='stylesheet' href='../public/stylesheets/app.css'> </head> <body> <!-- begin top nav --> <div class="contain-to-grid sticky"> <nav class="top-bar" data-topbar role="navigation"> <ul class="title-area"> <li class="name"> <h1><a href="/">Lingo Lemur</a></h1> </li> <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone --> <li class="toggle-topbar menu-icon"><a href="#"><span></span></a></li> </ul> <section class="top-bar-section"> <!-- Right Nav Section --> <ul class="right"> <li class="active"><a href="/lists">Analysis Examples</a></li> <li class="has-dropdown"> <a href="#">Menu</a> <ul class="dropdown"> <li><a href="/about-us">About Us</a></li> <li><a href="mailto:[email protected]">Contact Us</a></li> </ul> </li> </ul> </section> </nav> </div> <!-- end top nav --> <div class="row"> <div class="medium-11 large-centered columns"> <h1><small>This is the list title</small></h1> <p id="list-description">This is where the description of the list goes.</p> <p>This list is organized from most positive to most negative. Each analyized text is rated on a scale of 5 (most positive) to -5 (most negative).</p> <div id="returnlist"></div> <div class="medium-11 large-centered columns"> <p id="returnString" class="returnString panel callout radius"></p> </div> </div> </div> <!-- scripts --> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src='../public/javascripts/list.js' type='text/javascript'></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/js/foundation.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/js/foundation/foundation.topbar.js"></script> <script> $(document).foundation(); </script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-70387133-1', 'auto'); ga('send', 'pageview'); </script> </body> </html>
timcmiller/nlp_project
views/list.html
HTML
mit
2,929
"""This module defines functions to interact with stash extensions.""" import os import shutil from stash.system.shcommon import _STASH_EXTENSION_BIN_PATH as EBP from stash.system.shcommon import _STASH_EXTENSION_MAN_PATH as EMP from stash.system.shcommon import _STASH_EXTENSION_FSI_PATH as EFP from stash.system.shcommon import _STASH_EXTENSION_PATCH_PATH as EPP from stashutils.core import load_from_dir # alias load_from_dir (so you can access it trough this namespace) load_from_dir = load_from_dir def create_file(dest, content): """ creates a file at dest with content. If content is a string or unicode, use it as the content. Otherwise, use content.read() as the content. """ if not isinstance(content, (str, unicode)): content = content.read() with open(dest, "wb") as f: f.write(content) return dest def create_page(name, content): """ creates a manpage with name filled with content. If content is a list or tuple, instead create a dir and fill it with pages created from the elements of this list. The list should consist of tuples of (ending, content) """ path = os.path.join(EMP, name) if isinstance(content, (list, tuple)): # create a bunch of pages if os.path.exists(path): shutil.rmtree(path) os.mkdir(path) for n, element in enumerate(content, 1): ending, elementcontent = element pagename = "{b}/page_{n}.{e}".format(n=n, e=ending, b=path) create_page(pagename, elementcontent) return path else: return create_file(path, content) def create_command(name, content): """creates a script named name filled with content""" path = os.path.join(EBP, name) return create_file(path, content) def create_fsi_file(name, content): """creates a fsi extension named name filled with content""" path = os.path.join(EFP, name) return create_file(path, content) def create_patch_file(name, content): """creates a patch extension named name filled with content""" path = os.path.join(EPP, name) return create_file(path, content)
cclauss/stash
lib/stashutils/extensions.py
Python
mit
1,999
Getting Start Guide ==================== This module only deals linking user with the role and rest is handled by [ZfcRbac](https://github.com/ZF-Commons/zfc-rbac). Just for example, we will have three roles: ```php <?php return [ 'zfc_rbac' => [ 'role_provider' => [ 'ZfcRbac\Role\InMemoryRoleProvider' => [ 'admin' => [ 'children' => ['member'], 'permissions' => [ 'post.delete' ] ], 'member' => [ 'children' => ['guest'], 'permissions' => [ 'post.add', 'post.edit', ] ], 'guest' => [ 'permissions' => [ 'post.view', ] ] ] ], 'guards' => [ 'ZfcRbac\Guard\RouteGuard' => [ 'backend*' => ['member'], ] ] ], ]; ``` To add a role to the user, or edit a user`s role from you controller: ```php namespace Application\Controller; use Zend\Mvc\Controller\AbstractActionController; use Zend\View\Model\ViewModel; use AcploUserRbac\Entity\UserRoleLinker; Class MyUserController extends AbstractActionController { protected $userRoleLinkerMapper; public function addAction() { // support user($user) is already added $userRoleLinker = new UserRoleLinker(); $userRoleLinker->setUser($user); $userRoleLinker->setRoleId('member'); $this->getUserRoleLinkerMapper()->insert($userRoleLinker); // role is added to the user } public function editAction() { // to edit the role of a user, you will have to delete the record and add a new record // suppose $user is an instance of ZfcUser\Entity\UserInterface $userRoleLinker = $this->getUserRoleLinkerMapper()->findByUser($user)->current(); // if a user has only one role $this->getUserRoleLinkerMapper()->delete($userRoleLinker); $userRoleLinker->setRoleId('admin'); $this->getUserRoleLinkerMapper()->insert($userRoleLinker); } public function getUserRoleLinkerMapper() { if (!$this->userRoleLinkerMapper) { $this->userRoleLinkerMapper = $this->getServiceLocator()->get('AcploUserRbac\UserRoleLinkerMapper'); } return $this->userRoleLinkerMapper; } } ```
acplo/AcploUserRBac
docs/getting-started.md
Markdown
mit
2,555
@font-face {font-family: "map-icons";src: url("../fonts/map-icons.eot");src: url("../fonts/map-icons.eot#iefix") format("embedded-opentype"),url("../fonts/map-icons.ttf") format("truetype"),url("../fonts/map-icons.woff") format("woff"),url("../fonts/map-icons.svg#map-icons") format("svg");font-weight: normal;font-style: normal;} .map-icon-label .map-icon {font-size: 24px;color: #fff;line-height: 48px;text-align: center;white-space: nowrap;} .map-icon {font-family: "map-icons";speak: none;font-style: normal;font-weight: normal;font-variant: normal;text-transform: none;line-height: 1;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;} .map-icon-abseiling:before {content: "";} .map-icon-accounting:before {content: "";} .map-icon-airport:before {content: "";} .map-icon-amusement-park:before {content: "";} .map-icon-aquarium:before {content: "";} .map-icon-archery:before {content: "";} .map-icon-art-gallery:before {content: "";} .map-icon-assistive-listening-system:before {content: "";} .map-icon-atm:before {content: "";} .map-icon-audio-description:before {content: "";} .map-icon-bakery:before {content: "";} .map-icon-bank:before {content: "";} .map-icon-bar:before {content: "";} .map-icon-baseball:before {content: "";} .map-icon-beauty-salon:before {content: "";} .map-icon-bicycle-store:before {content: "";} .map-icon-bicycling:before {content: "";} .map-icon-boat-ramp:before {content: "";} .map-icon-boat-tour:before {content: "";} .map-icon-boating:before {content: "";} .map-icon-book-store:before {content: "";} .map-icon-bowling-alley:before {content: "";} .map-icon-braille:before {content: "";} .map-icon-bus-station:before {content: "";} .map-icon-cafe:before {content: "";} .map-icon-campground:before {content: "";} .map-icon-canoe:before {content: "";} .map-icon-car-dealer:before {content: "";} .map-icon-car-rental:before {content: "";} .map-icon-car-repair:before {content: "";} .map-icon-car-wash:before {content: "";} .map-icon-casino:before {content: "";} .map-icon-cemetery:before {content: "";} .map-icon-chairlift:before {content: "";} .map-icon-church:before {content: "";} .map-icon-circle:before {content: "";} .map-icon-city-hall:before {content: "";} .map-icon-climbing:before {content: "";} .map-icon-closed-captioning:before {content: "";} .map-icon-clothing-store:before {content: "";} .map-icon-compass:before {content: "";} .map-icon-convenience-store:before {content: "";} .map-icon-courthouse:before {content: "";} .map-icon-cross-country-skiing:before {content: "";} .map-icon-crosshairs:before {content: "";} .map-icon-dentist:before {content: "";} .map-icon-department-store:before {content: "";} .map-icon-diving:before {content: "";} .map-icon-doctor:before {content: "";} .map-icon-electrician:before {content: "";} .map-icon-electronics-store:before {content: "";} .map-icon-embassy:before {content: "";} .map-icon-expand:before {content: "";} .map-icon-female:before {content: "";} .map-icon-finance:before {content: "";} .map-icon-fire-station:before {content: "";} .map-icon-fish-cleaning:before {content: "";} .map-icon-fishing-pier:before {content: "";} .map-icon-fishing:before {content: "";} .map-icon-florist:before {content: "";} .map-icon-food:before {content: "";} .map-icon-fullscreen:before {content: "";} .map-icon-funeral-home:before {content: "";} .map-icon-furniture-store:before {content: "";} .map-icon-gas-station:before {content: "";} .map-icon-general-contractor:before {content: "";} .map-icon-golf:before {content: "";} .map-icon-grocery-or-supermarket:before {content: "";} .map-icon-gym:before {content: "";} .map-icon-hair-care:before {content: "";} .map-icon-hang-gliding:before {content: "";} .map-icon-hardware-store:before {content: "";} .map-icon-health:before {content: "";} .map-icon-hindu-temple:before {content: "";} .map-icon-horse-riding:before {content: "";} .map-icon-hospital:before {content: "";} .map-icon-ice-fishing:before {content: "";} .map-icon-ice-skating:before {content: "";} .map-icon-inline-skating:before {content: "";} .map-icon-insurance-agency:before {content: "";} .map-icon-jet-skiing:before {content: "";} .map-icon-jewelry-store:before {content: "";} .map-icon-kayaking:before {content: "";} .map-icon-laundry:before {content: "";} .map-icon-lawyer:before {content: "";} .map-icon-library:before {content: "";} .map-icon-liquor-store:before {content: "";} .map-icon-local-government:before {content: "";} .map-icon-location-arrow:before {content: "";} .map-icon-locksmith:before {content: "";} .map-icon-lodging:before {content: "";} .map-icon-low-vision-access:before {content: "";} .map-icon-male:before {content: "";} .map-icon-map-pin:before {content: "";} .map-icon-marina:before {content: "";} .map-icon-mosque:before {content: "";} .map-icon-motobike-trail:before {content: "";} .map-icon-movie-rental:before {content: "";} .map-icon-movie-theater:before {content: "";} .map-icon-moving-company:before {content: "";} .map-icon-museum:before {content: "";} .map-icon-natural-feature:before {content: "";} .map-icon-night-club:before {content: "";} .map-icon-open-captioning:before {content: "";} .map-icon-painter:before {content: "";} .map-icon-park:before {content: "";} .map-icon-parking:before {content: "";} .map-icon-pet-store:before {content: "";} .map-icon-pharmacy:before {content: "";} .map-icon-physiotherapist:before {content: "";} .map-icon-place-of-worship:before {content: "";} .map-icon-playground:before {content: "";} .map-icon-plumber:before {content: "";} .map-icon-point-of-interest:before {content: "";} .map-icon-police:before {content: "";} .map-icon-political:before {content: "";} .map-icon-post-box:before {content: "";} .map-icon-post-office:before {content: "";} .map-icon-postal-code-prefix:before {content: "";} .map-icon-postal-code:before {content: "";} .map-icon-rafting:before {content: "";} .map-icon-real-estate-agency:before {content: "";} .map-icon-restaurant:before {content: "";} .map-icon-roofing-contractor:before {content: "";} .map-icon-route-pin:before {content: "";} .map-icon-route:before {content: "";} .map-icon-rv-park:before {content: "";} .map-icon-sailing:before {content: "";} .map-icon-school:before {content: "";} .map-icon-scuba-diving:before {content: "";} .map-icon-search:before {content: "";} .map-icon-shield:before {content: "";} .map-icon-shopping-mall:before {content: "";} .map-icon-sign-language:before {content: "";} .map-icon-skateboarding:before {content: "";} .map-icon-ski-jumping:before {content: "";} .map-icon-skiing:before {content: "";} .map-icon-sledding:before {content: "";} .map-icon-snow-shoeing:before {content: "";} .map-icon-snow:before {content: "";} .map-icon-snowboarding:before {content: "";} .map-icon-snowmobile:before {content: "";} .map-icon-spa:before {content: "";} .map-icon-square-pin:before {content: "";} .map-icon-square-rounded:before {content: "";} .map-icon-square:before {content: "";} .map-icon-stadium:before {content: "";} .map-icon-storage:before {content: "";} .map-icon-store:before {content: "";} .map-icon-subway-station:before {content: "";} .map-icon-surfing:before {content: "";} .map-icon-swimming:before {content: "";} .map-icon-synagogue:before {content: "";} .map-icon-taxi-stand:before {content: "";} .map-icon-tennis:before {content: "";} .map-icon-toilet:before {content: "";} .map-icon-trail-walking:before {content: "";} .map-icon-train-station:before {content: "";} .map-icon-transit-station:before {content: "";} .map-icon-travel-agency:before {content: "";} .map-icon-unisex:before {content: "";} .map-icon-university:before {content: "";} .map-icon-veterinary-care:before {content: "";} .map-icon-viewing:before {content: "";} .map-icon-volume-control-telephone:before {content: "";} .map-icon-walking:before {content: "";} .map-icon-waterskiing:before {content: "";} .map-icon-whale-watching:before {content: "";} .map-icon-wheelchair:before {content: "";} .map-icon-wind-surfing:before {content: "";} .map-icon-zoo:before {content: "";} .map-icon-zoom-in-alt:before {content: "";} .map-icon-zoom-in:before {content: "";} .map-icon-zoom-out-alt:before {content: "";} .map-icon-zoom-out:before {content: "";}
gerdums/gerdums.github.io
contents/ui/gareth-matson/fonts/map-icons/css/map-icons.css
CSS
mit
8,709
/*! @file Defines `boost::hana::Monad`. @copyright Louis Dionne 2013-2016 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_CONCEPT_MONAD_HPP #define BOOST_HANA_CONCEPT_MONAD_HPP #include <hana/fwd/concept/monad.hpp> #include <hana/chain.hpp> #include <hana/config.hpp> #include <hana/core/default.hpp> #include <hana/core/tag_of.hpp> #include <hana/detail/integral_constant.hpp> #include <hana/flatten.hpp> BOOST_HANA_NAMESPACE_BEGIN template <typename M> struct Monad : hana::integral_constant<bool, !is_default<flatten_impl<typename tag_of<M>::type>>::value || !is_default<chain_impl<typename tag_of<M>::type>>::value > { }; BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_CONCEPT_MONAD_HPP
freezestudio/hana.zh
hana/concept/monad.hpp
C++
mit
863
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Coq bench</title> <link rel="shortcut icon" type="image/png" href="../../../../../favicon.png" /> <link href="../../../../../bootstrap.min.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"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <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="../../..">Unstable</a></li> <li class="active"><a href="">hott / contrib:ltl dev</a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li><a href="../../../../../about.html">About</a></li> </ul> </div> </div> </div> <div class="article"> <div class="row"> <div class="col-md-12"> <a href="../../..">« Up</a> <h1>contrib:ltl <small>dev</small></h1> <table class="table table-striped text-center"> <thead> <tr> <td>Date</td> <td>Time</td> <td>Relative</td> <td>Status</td> </tr> </thead> <tbody> <tr> <td>2014-12-17</td> <td>15:25:52</td> <td><script>document.write(moment("2014-12-17 15:25:52 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td> <td class="success"><a href="2014-12-17_15-25-52.html">3 s</a></td> </tr> <tr> <td>2014-12-03</td> <td>16:42:07</td> <td><script>document.write(moment("2014-12-03 16:42:07 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td> <td class="success"><a href="2014-12-03_16-42-07.html">3 s</a></td> </tr> <tr> <td>2014-12-02</td> <td>15:31:10</td> <td><script>document.write(moment("2014-12-02 15:31:10 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td> <td class="info"><a href="2014-12-02_15-31-10.html">Not compatible with this Coq</a></td> </tr> <tr> <td>2014-12-01</td> <td>14:28:38</td> <td><script>document.write(moment("2014-12-01 14:28:38 +0000", "YYYY-MM-DD HH:mm:ss Z").fromNow());</script></td> <td class="info"><a href="2014-12-01_14-28-38.html">Not compatible with this Coq</a></td> </tr> </tbody> </table> </div> </div> </div> <hr/> <div class="footer"> <p class="text-center"> <small>Sources are on <a href="https://github.com/coq-bench">GitHub</a>. © Guillaume Claret.</small> </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>
coq-bench/coq-bench.github.io-old
clean/Linux-x86_64-4.02.1-1.2.0/unstable/hott/contrib:ltl/dev/index.html
HTML
mit
4,332
public class NumberOfPathsToReachLastCell_DC { // here we are given min cost and we have to find number of ways to reach last cell in those cost almost same as min cost to reach last cell public int numberOfPaths(int array[][], int row, int col, int cost) { if (cost < 0) {//BASE CASE return 0; } if (row == 0 && col == 0) { //BASE CASE return (array[0][0] - cost == 0) ? 1 : 0; } if (row == 0) { //BASE CASE: If we're at first row, we can only go left return numberOfPaths(array, 0, col - 1, cost - array[row][col]); } if (col == 0) { //BASE CASE: if we're at first column, we can only go up return numberOfPaths(array, row - 1, 0, cost - array[row][col]); } int noOfPathsFromPreviousRow = numberOfPaths(array, row - 1, col, cost - array[row][col]); //Find Paths till last Row int noOfPathsFromPreviousCol = numberOfPaths(array, row, col - 1, cost - array[row][col]); //Find Paths till last Col return noOfPathsFromPreviousRow + noOfPathsFromPreviousCol; }//end of method public static void main(String[] args) { int[][] array = { { 4, 7, 1, 6 }, { 5, 7, 3, 9 }, { 3, 2, 1, 2 }, { 7, 1, 6, 3 } }; int cost = 25; NumberOfPathsToReachLastCell_DC nop = new NumberOfPathsToReachLastCell_DC(); System.out.println("Total paths with cost " + cost + " are " + nop.numberOfPaths(array, array.length - 1, array[0].length - 1, cost)); }//end of method }//end of class
Bernardinhouessou/Projets_Autres
Java Projets (TPs - Autres)/Autres/Data-structures-and-Algorithm/NumberOfPathsToReachLastCell_DC.java
Java
mit
1,446
import React, { PropTypes } from 'react'; class GoogleMap extends React.Component { constructor(props, context) { super(props, context); } componentDidMount() { const gmaps = this.props.googlemaps; const location = this.props.defaultLocation; const center = location.center || { lat: 0, lng: 0 }; const zoom = location.zoom || 10; this.map = new gmaps.Map(this.mapDiv, { center, zoom, mapTypeId: gmaps.MapTypeId.TERRAIN, streetViewControl: false, scaleControl: true }); if (location.bounds) { this.map.fitBounds(location.bounds); } this.forceUpdate(); // Ensures that children get re-rendered after the map becomes available. } componentDidUpdate(prevProps) { let location = this.props.defaultLocation; if (prevProps.defaultLocation !== location) { if (location.center) { this.map.panTo(location.center); } if (location.zoom) { this.map.setZoom(location.zoom); } if (location.bounds) { this.map.fitBounds(location.bounds); } } } renderChildren() { const {children} = this.props; if (!children) return; return React.Children.map(children, c => { return React.cloneElement(c, { map: this.map, googlemaps: this.props.googlemaps }); }); } render() { return ( <div ref={map => this.mapDiv = map} style={{ width: "100%", height: "90vh" }}> {this.renderChildren()} </div > ); } } GoogleMap.propTypes = { googlemaps: PropTypes.object.isRequired, defaultLocation: PropTypes.object.isRequired, children: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.node), PropTypes.node, ]) }; export default GoogleMap;
alistairmgreen/soaring-analyst
src/components/googlemap/GoogleMap.js
JavaScript
mit
1,770
# IconfontPreview iconfont 文件预览 __[Mac App Store](https://itunes.apple.com/cn/app/iconfontpreview/id1197961160)__ ## 2.0 * 去掉 css 依赖, 直接读取 ttf 获取信息 * 程序整体重构, 架构变为 document-base * NSTableView -> NSCollectionView * 支持 Finder 中右键打开, 拖动文件到 icon 打开, 拖动文件到程序窗口打开, dock 根据历史打开 * 菜单栏重写, 支持快捷键 * 修正了由于没有配置权限 bookmake, 导致打开上次保存的地址时权限不足报错 * 修正了 utf-32 编码解析溢出 * [icomoon](https://icomoon.io/) * [material-icons](https://material.io/icons/) * without storyboard & xib ## 1.0.0 * 预览iconfont文件 * 点击拷贝unicode值 * font-awesome & iconfont 已经测试通过 * 自动保存上次打开路径 * 通过解析字体文件 ttf 和对应配置文件 css 解析做展示 * [font-awesome](http://fontawesome.io/) * [iconfont](http://iconfont.cn/) * without storyboard & xib ## todo * 自建的 mainmenu 里面 open recent 记录更新
thisfin/IconfontPreview
README.md
Markdown
mit
1,044
<html> <head> <meta charset="UTF-8"/> <meta itemprop='identifier' content='191063'/> <meta itemprop='datePublished' content='2014-09-09'/> <meta itemprop='datePublished-pubid' content='121'/> </head> COMISSÃO PERMANENTE DE LICITAÇÃO <p align="center" class="MsoBodyText"> <b> COMISSÃO PERMANENTE DE LICITAÇÃO </b> </p> <h2 align="center"> AVISO DE LICITAÇÃO </h2> <p class="MsoNormal"> </p> <h2> REFERENTE AO EDITAL DE TOMADA DE PREÇOS TP Nº 001/2014, PARA P RESTAÇÃO DE SERVIÇOS DE ENGENHARIA DE ELABORAÇÃO DE PLANO DE MOBILIDADE URBANA SUSTENTÁVEL DA CIDADE DO RIO DE JANEIRO. </h2> <h2> PROCESSO: 03/001.310/2014 </h2> <p class="MsoNormal"> </p> <p class="MsoSubtitle"> A Comissão Permanente de Licitação torna público que: </p> <p class="MsoSubtitle"> 1) Foram apresentadas as contrarrazões pelos assessores técnicos designados no presente certame ao recurso interposto pela CONCREMAT ENGENHARIA E TECNOLOGIA S.A. (processo 03/002.946/2014), que concluíram pela manutenção das notas auferidas às propostas técnicas , sendo assim, o recurso indeferido pela autoridade superior . </p> <p class="MsoNormal"> 2) A Comissão Permanente de Licitação torna público que a sessão da abertura do <b> envelope “C” </b> - <b> PROPOSTA DE PREÇO </b> , referente à Tomada de Preços nº TP - 001/2014, será realizada no dia 11 de setembro de 2014, às 11:00 horas, na Rua Dona Mariana, nº 48, 7º andar/ Auditório – Botafogo, Rio de Janeiro. </p> </html>
okfn-brasil/queriDO
content/filtrado/191063.html
HTML
mit
1,703
<section> <nav-bar class="nav"></nav-bar> <article data-ng-init="bridgeCtrl.check()"> <h2 data-ng-if="bridgeCtrl.bridgeExists && !bridgeCtrl.editing">{{bridgeCtrl.bridge.name}}</h2> <button class="edit-button" data-ng-if="bridgeCtrl.bridgeExists && !bridgeCtrl.editing" type="button" data-ng-click="bridgeCtrl.edit()"><i class="fa fa-pencil" aria-hidden="true"></i></button> <p data-ng-if="bridgeCtrl.bridgeExists && !bridgeCtrl.editing"> URL: {{bridgeCtrl.bridge.url}} </p> <p data-ng-if="bridgeCtrl.bridgeExists && !bridgeCtrl.editing"> Bridge Key: {{bridgeCtrl.bridge.bridgeKey}} </p> <form data-ng-submit="bridgeCtrl.bridgeExists ? bridgeCtrl.update() : bridgeCtrl.save()" data-ng-if="bridgeCtrl.editing || !bridgeCtrl.bridgeExists"> <label for="name">Bridge Name</label> <input data-ng-model="bridgeCtrl.bridge.name" type="text" name="name"> <label for="url">URL</label> <input data-ng-model="bridgeCtrl.bridge.url" type="text" name="url"> <label for="bridge-key">Bridge Key</label> <input data-ng-model="bridgeCtrl.bridge.bridgeKey" type="text" name="bridge-key"> <button type="submit">Save Changes</button> <button data-ng-click="bridgeCtrl.cancel()" data-ng-if="bridgeCtrl.editing" type="button" name="cancel" class="secondary">Cancel Update</button> </form> <a data-ng-if="bridgeCtrl.bridgeExists && !bridgeCtrl.editing" href="/#/light/create" class="button center">Add Light</a> </article> </section>
hue-manatee/hue-manatee
app/templates/views/bridge_view.html
HTML
mit
1,517
# C# app that runs as a Windows Service that executes tasks. This software is under the [MIT License](https://opensource.org/licenses/MIT) Release: [![Release](https://img.shields.io/github/release/rollemira/Rollem.TaskRunnerService.svg)](https://github.com/rollemira/Rollem.TaskRunnerService/releases/latest) Build: [![Build status](https://ci.appveyor.com/api/projects/status/al224v4w5pqd60y5/branch/master?svg=true)](https://ci.appveyor.com/project/rollemira/rollem-taskrunnerservice/branch/master) Tools: * CI with [AppVeyor](https://appveyor.com) * Builds with [Cake](http://cakebuild.net) 3rd party libraries: * [AutoMapper](https://github.com/AutoMapper/AutoMapper) * [log4net](https://logging.apache.org/log4net/) * [MedallionShell](https://github.com/madelson/MedallionShell) * [Newtonsoft.Json](http://www.newtonsoft.com/json) * [Topshelf](http://topshelf-project.com/)
rollemira/Rollem.TaskRunnerService
README.md
Markdown
mit
887
/* * MIT License * * Copyright (c) 2017 Donato Rimenti * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ // Gets the DB. var db = db.getSiblingDB('enron'); // Finds the emails and counts them. var elements = db.messages.aggregate( [ // Filters unused fields in order to // make data lighter. { $project : { "headers.From" : 1, "headers.To" : 1, "headers.Message-ID" : 1, "_id" : 0 } }, // Unwinds the recipients. { $unwind : "$headers.To" }, // Removes duplicates recipients for // the same emails. { $group : { _id : { messageId : "$headers.Message-ID", from : "$headers.From", to : "$headers.To" } } }, // Counts the emails. { $group : { _id : { from : "$_id.from", to : "$_id.to" }, emails : { $sum : 1 } } }, // Sorts them by email count desc. { $sort : { emails : -1 } }, // Gets only the first result. { $limit : 1 } ], // Option to handle more than 16MB // result collections. {allowDiskUse : true} ); // Prints the result. print("Solution : "); while(elements.hasNext()){ printjson(elements.next()); }
aurasphere/mongodb-university-classes
M101J - MongoDB for Java Developers/Week 7 - Case Studies & Final Exam/Question 2/Question 2 Solution.js
JavaScript
mit
2,586
<?php namespace CB\InicioBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class PedidoType extends AbstractType { /** * @param FormBuilderInterface $builder * @param array $options */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('fecha') ->add('estado') ->add('direccion') ->add('libros') ->add('usuario') ; } /** * @param OptionsResolverInterface $resolver */ public function setDefaultOptions(OptionsResolverInterface $resolver) { $resolver->setDefaults(array( 'data_class' => 'CB\InicioBundle\Entity\Pedido' )); } /** * @return string */ public function getName() { return 'cb_iniciobundle_pedido'; } }
miltonSosa/proyectoING2
src/CB/InicioBundle/Form/PedidoType.php
PHP
mit
977
import StringStreamer from '../../src/streamer/string-streamer.js' import Mol2Parser from '../../src/parser/mol2-parser.js' import { assert } from 'chai' import path from 'path' import fs from 'fs' describe('parser/mol2-parser', function () { describe('parsing', function () { it('basic', function () { var file = path.join(__dirname, '/../data/adrenalin.mol2') var str = fs.readFileSync(file, 'utf-8') var streamer = new StringStreamer(str) var mol2Parser = new Mol2Parser(streamer) return mol2Parser.parse().then(function (structure) { assert.strictEqual(structure.atomCount, 26) assert.strictEqual(structure.bondCount, 26) }) }) }) })
j0kaso/ngl
test/parser/tests-mol2-parser.js
JavaScript
mit
705
IMPLICIT DOUBLE PRECISION(A-H,O-Z) PARAMETER (NX=3200) C C.....Declare arrays. DIMENSION XA(NX),AR(NX,NX),WCH(NX),ZR(NX,NX) DIMENSION FV1(NX),FV2(NX) DATA PI/3.141592653589793D0/ DATA NPRIN/0/ DATA NWRIT/20/ INTEGER :: L LOGICAL :: MORLJ ZMA = 242271.817297 ZMB = 242271.817297 L = 1000 RMAX = 100.0D0 RMIN = 5.0D0 C6 = 6870.1 C8 = 0.0D0 C10 = 0.0D0 C12 = 709538221.031 XMIN = 6.5 XMAX = 25.0 DX = (XMAX-XMIN)/DBLE(NX) ZMU=ZMA*ZMB/(ZMA+ZMB) DHART = C6**2/(4.0*C12) R0 = (C12/C6)**(1.0/6.0)*2.0**(1.0/6.0) BETA = 6.0/R0 DO I=1,NX X = XMIN + (I-1)*DX CALL VSUB_M(X,V1,R0,BETA,DHART,L,ZMU) CALL VSUB_LJ(X,V2,R0,C6,C8,C10,C12,L,ZMU) CALL VSUB_MLR3(X,V3,L,ZMU) WRITE(*,*)X,V2,V3 ENDDO END C SUBROUTINE VSUB_MLR3(X,V,L,MU) C ************************************************************** C.....SUBROUTINE TO COMPUTE POTENTIAL ENERGY AT SEPERATION X (IN C.....ATOMIC UNITS). THE VALUE OF THE POTENTIAL IS RETURNED IN V, C.....AGAIN IN ATOMIC UNITS.THE POTENTIAL ENERGY IS ASSUMED TO C.....TO BE A MLR3 POTNETIAL AS DEFINDED IN JCP 132 094105 2010 C.....FOR GROUND STATE CEASIUM DIMERS IMPLICIT DOUBLE PRECISION(A-H,O-Z) DIMENSION PHI(19) BRtoAng = 0.52917721080000002 R = X*BrtoAng ! scipy.constants.physical_constants["Bohr radius"][0]*1.0E10 CM_1toHar = 4.5563352527603877e-06 ! De = De*100.0/(scipy.constants.Rydberg*2.0) PHI(1) = -2.48715027 PHI(2) = -0.7250527 PHI(3) = -1.988236 PHI(4) = -0.671755 PHI(5) = -1.202501 PHI(6) = -0.020151 PHI(7) = -0.5414 PHI(8) = 0.2298 PHI(9) = 1.3964 PHI(10) = 0.687 PHI(11) = -8.655 PHI(12) = 1.73 PHI(13) = 32.2 PHI(14) = -2.66 PHI(15) = -61.0 PHI(16) = 6.1 PHI(17) = 65.6 PHI(18) = -2.0 PHI(19) = -28.0 Re = 4.6479723 De = 3649.847 C6 = 3.315E7 C8 = 1.29962E9 C12 = 5.136E10 MCS = 132.905451933 RMIN = 3.1 RMAX = 20.1 DR = 0.001 RREF = 5.47 P = 5.0 M = 6.0 Q = 4.0 A = 1.79 ULRR = C6/R**6 + C8/R**8 + C12/R**12 ULRRe = C6/Re**6 + C8/Re**8 + C12/Re**12 YM = (R**M-RREF**M)/(R**M+RREF**M) YQ = (R**Q-RREF**Q)/(R**Q+RREF**Q) PHIMLR3 = 0.0 DO I=1,19 PHIMLR3 = PHIMLR3 + PHI(I)*YQ!**I ENDDO PHIMLR3 = PHIMLR3*(1.0-YM) PHIINF = 0.5*((2.0*De*Re**6)/(C6)) PHIMLR3 = PHIMLR3 + YM*PHIINF YPA = (X**P-Re**P)/(X**P+A*Re**P) V = De*(1.0-(ULRR/ULRRe)*EXP(-PHIMLR3*YPA))**2 - De V = V*4.5563352527603877e-06 V = V + DBLE(L)*(DBLE(L)+1.0)/(2.0*MU*X**2) RETURN END SUBROUTINE VSUB_M(X,V,R0,BETA,DHART,L,MU) C ************************************************************** C.....SUBROUTINE TO COMPUTE POTENTIAL ENERGY AT SEPERATION X (IN C.....ATOMIC UNITS). THE VALUE OF THE POTENTIAL IS RETURNED IN V, C.....AGAIN IN ATOMIC UNITS.THE POTENTIAL ENERGY IS ASSUMED TO C..... BE A MORSE CURVE:V(X) = DHART * (EXP(-BETA*(X-R0)) - 1)**2 C..... THE FOLLOWING DATA CONSTANTS REPRESENT : C..... DHART : THE DISSOCIATION ENERGY FOR THE GIVEN MOLECULE C..... BETA : THE EXPONENTIAL PARAMETER C..... R0 : THE BOND LENGTH AT EQUILIBRIUM FOR GIVEN MOLECULE C ************************************************************** IMPLICIT DOUBLE PRECISION(A-H,O-Z) DOUBLE PRECISION :: MU INTEGER :: L C DATA DHART/0.2250073497D0/ C DATA BETA/1.1741D0/ C DATA R0/1.7329D0/ C.....Set morse curve parameters. ARG=X-R0 ARG=-BETA*ARG EF=DEXP(ARG) EF=1.0D0-EF EF=EF*EF V=DHART*EF-DHART V = V + DBLE(L)*(DBLE(L)+1.0)/(2.0*MU*X**2) RETURN END CC SUBROUTINE VSUB_LJ(X,V,R0,C6,C8,C10,C12,L,MU) C ************************************************************** C.....SUBROUTINE TO COMPUTE POTENTIAL ENERGY AT SEPERATION X (IN C.....ATOMIC UNITS). THE VALUE OF THE POTENTIAL IS RETURNED IN V, C.....AGAIN IN ATOMIC UNITS.THE POTENTIAL ENERGY IS ASSUMED TO C..... BE A MORSE CURVE:V(X) = DHART * (EXP(-BETA*(X-R0)) - 1)**2 C..... THE FOLLOWING DATA CONSTANTS REPRESENT : C..... DHART : THE DISSOCIATION ENERGY FOR THE GIVEN MOLECULE C..... BETA : THE EXPONENTIAL PARAMETER C..... R0 : THE BOND LENGTH AT EQUILIBRIUM FOR GIVEN MOLECULE C ************************************************************** IMPLICIT DOUBLE PRECISION(A-H,O-Z) DOUBLE PRECISION :: MU INTEGER :: L C DATA DHART/0.2250073497D0/ C DATA BETA/1.1741D0/ C DATA R0/1.7329D0/ C.....Set morse curve parameters. V =C12/X**12-C10/X**6-C8/X**6-C6/X**6 V = V + DBLE(L)*(DBLE(L)+1.0)/(2.0*MU*X**2) RETURN END C C
jfecroft/DOS
data/alkalis/jfec_cs2_singlet_mlr3/mlr3.f
FORTRAN
mit
5,392
package net.violet.platform.util; /** * Classe pour une paire immutable d'éléments non nul. * * @param <E1> type du premier élément. * @param <E2> type du second élément. */ public class Pair<E1, E2> { private E1 firstElement; private E2 secondElement; public Pair(E1 inFirstElement, E2 inSecondElement) { this(inFirstElement, inSecondElement, true); } public Pair(E1 inFirstElement, E2 inSecondElement, boolean throwNull) { if ((inFirstElement == null) && throwNull) { throw new NullPointerException("first element is null"); } this.firstElement = inFirstElement; this.secondElement = inSecondElement; } public E1 getFirst() { return this.firstElement; } public E2 getSecond() { return this.secondElement; } @Override public String toString() { return "{" + this.firstElement + ", " + this.secondElement + "}"; } @Override public int hashCode() { return this.firstElement.hashCode() * 17 + this.secondElement.hashCode(); } @Override public boolean equals(Object inAlter) { if (!(inAlter instanceof Pair)) { return false; } final Pair alterAsPair = (Pair) inAlter; return alterAsPair.firstElement.equals(this.firstElement) && (((alterAsPair.secondElement == null) && (this.secondElement == null)) || ((alterAsPair.secondElement != null) && alterAsPair.secondElement.equals(this.secondElement))); } public void setFirst(E1 firstElement) { this.firstElement = firstElement; } public void setSecond(E2 secondElement) { this.secondElement = secondElement; } }
sebastienhouzet/nabaztag-source-code
server/OS/net/violet/platform/util/Pair.java
Java
mit
1,540
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Class: Duns</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" /> <script type="text/javascript"> // <![CDATA[ function popupCode( url ) { window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400") } function toggleCode( id ) { if ( document.getElementById ) elem = document.getElementById( id ); else if ( document.all ) elem = eval( "document.all." + id ); else return false; elemStyle = elem.style; if ( elemStyle.display != "block" ) { elemStyle.display = "block" } else { elemStyle.display = "none" } return true; } // Make codeblocks hidden by default document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" ) // ]]> </script> </head> <body> <div id="classHeader"> <table class="header-table"> <tr class="top-aligned-row"> <td><strong>Class</strong></td> <td class="class-name-in-header">Duns</td> </tr> <tr class="top-aligned-row"> <td><strong>In:</strong></td> <td> <a href="../files/lib/duns-lookup_rb.html"> lib/duns-lookup.rb </a> <br /> </td> </tr> <tr class="top-aligned-row"> <td><strong>Parent:</strong></td> <td> Object </td> </tr> </table> </div> <!-- banner header --> <div id="bodyContent"> <div id="contextContent"> <div id="description"> <h1>Synopsis</h1> <p> The <a href="Duns.html">Duns</a> library provides a small wrapper around the Dun &amp; Bradstreet website&#8216;s advanced search functionality. Currently it only implements searching for company by DUNS number. </p> <h2>Example</h2> <pre> require 'rubygems' require 'kdonovan-duns-lookup' Duns.lookup_duns( *invalid_number* ) # =&gt; nil Duns.lookup_duns( *some_valid_number* ) # =&gt; {:name =&gt; *a_name*, :address =&gt; *an_address*} </pre> </div> </div> <div id="method-list"> <h3 class="section-bar">Methods</h3> <div class="name-list"> <a href="#M000006">enforce_duns_formatting</a>&nbsp;&nbsp; <a href="#M000004">extract_address</a>&nbsp;&nbsp; <a href="#M000005">extract_name</a>&nbsp;&nbsp; <a href="#M000003">extract_search_results</a>&nbsp;&nbsp; <a href="#M000001">lookup_duns</a>&nbsp;&nbsp; <a href="#M000002">update_advanced_search_url</a>&nbsp;&nbsp; </div> </div> </div> <!-- if includes --> <div id="section"> <!-- if method_list --> <div id="methods"> <h3 class="section-bar">Public Class methods</h3> <div id="method-M000001" class="method-detail"> <a name="M000001"></a> <div class="method-heading"> <a href="Duns.src/M000001.html" target="Code" class="method-signature" onclick="popupCode('Duns.src/M000001.html');return false;"> <span class="method-name">lookup_duns</span><span class="method-args">(number)</span> </a> </div> <div class="method-description"> <p> Look up a given DUNS number in the D&amp;B database. If the number is found, returns a hash with :name and :address keys. Otherwise, returns nil. </p> </div> </div> <div id="method-M000002" class="method-detail"> <a name="M000002"></a> <div class="method-heading"> <a href="Duns.src/M000002.html" target="Code" class="method-signature" onclick="popupCode('Duns.src/M000002.html');return false;"> <span class="method-name">update_advanced_search_url</span><span class="method-args">()</span> </a> </div> <div class="method-description"> <p> Updates the internal URL used as the base for advanced searches. </p> <p> The D&amp;B website uses lots of extraneous (to us) URL params, and I have no idea what they all mean. If the base URL stops working, this method will try to set a new one by visiting the main page and finding &amp; clicking an Advanced Search link. </p> <p> This is mostly a precaution, but if searches stop working a good first bet would be to try running this method. If search is still broken, something actually changed in the D&amp;B HTML and we&#8216;ll need to retool the gem. </p> </div> </div> <h3 class="section-bar">Protected Class methods</h3> <div id="method-M000006" class="method-detail"> <a name="M000006"></a> <div class="method-heading"> <a href="Duns.src/M000006.html" target="Code" class="method-signature" onclick="popupCode('Duns.src/M000006.html');return false;"> <span class="method-name">enforce_duns_formatting</span><span class="method-args">(orig_number)</span> </a> </div> <div class="method-description"> <p> Strip out non-numeric characters, and raise error if remaining number is still invalid </p> </div> </div> <div id="method-M000004" class="method-detail"> <a name="M000004"></a> <div class="method-heading"> <a href="Duns.src/M000004.html" target="Code" class="method-signature" onclick="popupCode('Duns.src/M000004.html');return false;"> <span class="method-name">extract_address</span><span class="method-args">(td)</span> </a> </div> <div class="method-description"> <p> Retrieve an address from the proper D&amp;B HTML for the td element </p> </div> </div> <div id="method-M000005" class="method-detail"> <a name="M000005"></a> <div class="method-heading"> <a href="Duns.src/M000005.html" target="Code" class="method-signature" onclick="popupCode('Duns.src/M000005.html');return false;"> <span class="method-name">extract_name</span><span class="method-args">(td)</span> </a> </div> <div class="method-description"> <p> Retrieve a name from the proper D&amp;B HTML for the td element </p> </div> </div> <div id="method-M000003" class="method-detail"> <a name="M000003"></a> <div class="method-heading"> <a href="Duns.src/M000003.html" target="Code" class="method-signature" onclick="popupCode('Duns.src/M000003.html');return false;"> <span class="method-name">extract_search_results</span><span class="method-args">(page)</span> </a> </div> <div class="method-description"> <p> Given a search page, extract the results </p> </div> </div> </div> </div> <div id="validator-badges"> <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p> </div> </body> </html>
kdonovan/duns-lookup
doc/classes/Duns.html
HTML
mit
7,432
local argv = {...} local f = thread.status(thread.getPID(coroutine.running())).stdin for k, v in pairs(argv) do f = fs.open(shell.resolve(argv[1]), "r") write(f.readAll()) end if #argv == 0 then write(f.readAll()) end
TsarN/uber-os
packages/coreutils/cat.lua
Lua
mit
232
class AddHomePageAndSchoolsPageToNotifications < ActiveRecord::Migration def change add_column :notifications, :home_page, :boolean, default: true add_column :notifications, :schools_page, :boolean, default: true end end
joelmahoney/discoverbps
db/migrate/20140216024105_add_home_page_and_schools_page_to_notifications.rb
Ruby
mit
231
function transform(input::AbstractDict) end
exercism/xjulia
exercises/practice/etl/etl.jl
Julia
mit
46
from datetime import timedelta from django.contrib.auth.models import User from django.utils import timezone from djblets.features.testing import override_feature_checks from djblets.testing.decorators import add_fixtures from djblets.webapi.errors import PERMISSION_DENIED from djblets.webapi.testing.decorators import webapi_test_template from oauth2_provider.generators import (generate_client_id, generate_client_secret) from oauth2_provider.models import AccessToken from reviewboard.oauth.models import Application from reviewboard.webapi.models import WebAPIToken class BasicTestsMetaclass(type): """Metaclass to automate common tests for resources. An API test class can set this as its metaclass in order to automatically add common test methods to ensure basic functionality and access control works. The class must have a ``resource`` attribute pointing to a WebAPIResource instance, and ``sample_api_url`` pointing to a sample URL for the API that will be used in the test strings. The class can also set ``test_http_methods`` to a tuple of HTTP methods that should be tested. By default, this includes DELETE, GET, POST and PUT. By default, tests will also be repeated on Local Sites. This can be disabled by setting ``test_local_sites = False``. """ def __new__(meta, name, bases, d): test_local_sites = d.get('test_local_sites', True) test_api_token_access = d.get('test_api_token_access', True) test_oauth_token_access = d.get('test_oauth_token_access', True) resource = d['resource'] is_singleton = False is_list = False if 'test_http_methods' in d: test_http_methods = d['test_http_methods'] else: test_http_methods = ('DELETE', 'GET', 'POST', 'PUT') d['test_http_methods'] = test_http_methods if (hasattr(resource, 'required_features') and resource.required_features): d['override_features'] = { feature.feature_id: True for feature in resource.required_features } else: d['override_features'] = {} if name == 'ResourceListTests': is_list = True elif name == 'ResourceTests': is_singleton = True if 'DELETE' in test_http_methods and not is_list: if 'DELETE' not in resource.allowed_methods: mixins = (BasicDeleteNotAllowedTestsMixin,) elif test_local_sites: mixins = (BasicDeleteTestsWithLocalSiteMixin,) if test_api_token_access: mixins += (BasicDeleteTestsWithLocalSiteAndAPITokenMixin,) if test_oauth_token_access: mixins += ( BasicDeleteTestsWithLocalSiteAndOAuthTokenMixin, ) else: mixins = (BasicDeleteTestsMixin,) bases = mixins + bases if 'GET' in test_http_methods: if is_list: if test_local_sites: mixins = (BasicGetListTestsWithLocalSiteMixin,) if test_api_token_access: mixins += ( BasicGetListTestsWithLocalSiteAndAPITokenMixin, ) if test_oauth_token_access: mixins += ( BasicGetListTestsWithLocalSiteAndOAuthTokenMixin, ) else: mixins = (BasicGetListTestsMixin,) else: if test_local_sites: mixins = (BasicGetItemTestsWithLocalSiteMixin,) if test_api_token_access: mixins += ( BasicGetItemTestsWithLocalSiteAndAPITokenMixin, ) if test_oauth_token_access: mixins += ( BasicGetItemTestsWithLocalsSiteAndOAuthTokenMixin, ) else: mixins = (BasicGetItemTestsMixin,) bases = mixins + bases if 'POST' in test_http_methods and (is_list or is_singleton): if 'POST' not in resource.allowed_methods: mixins = (BasicPostNotAllowedTestsMixin,) elif test_local_sites: mixins = (BasicPostTestsWithLocalSiteMixin,) if test_api_token_access: mixins += (BasicPostTestsWithLocalSiteAndAPITokenMixin,) if test_oauth_token_access: mixins += ( BasicPostTestsWithLocalSiteAndOAuthTokenMixin, ) else: mixins = (BasicPostTestsMixin,) bases = mixins + bases if 'PUT' in test_http_methods and not is_list: if 'PUT' not in resource.allowed_methods: mixins = (BasicPutNotAllowedTestsMixin,) elif test_local_sites: mixins = (BasicPutTestsWithLocalSiteMixin,) if test_api_token_access: mixins += (BasicPutTestsWithLocalSiteAndAPITokenMixin,) if test_oauth_token_access: mixins += ( BasicPutTestsWithLocalSiteAndOAuthTokenMixin, ) else: mixins = (BasicPutTestsMixin,) bases = mixins + bases return super(BasicTestsMetaclass, meta).__new__(meta, name, bases, d) class BasicTestsMixin(object): """Base class for a mixin for basic API tests.""" not_owner_status_code = 403 not_owner_error = PERMISSION_DENIED def compare_item(self, item_rsp, obj): raise NotImplementedError("%s doesn't implement compare_item" % self.__class__.__name__) def _close_file_handles(self, post_data): for value in post_data.values(): if hasattr(value, 'close'): value.close() def _authenticate_basic_tests(self, with_local_site=False, with_admin=False, with_webapi_token=False, webapi_token_local_site_id=None, with_oauth_token=False, oauth_application_enabled=True, user=None): if user is None: user = self._login_user(local_site=with_local_site, admin=with_admin) session = self.client.session if with_webapi_token: webapi_token = WebAPIToken.objects.get_or_create( user=user, token='abc123', local_site_id=webapi_token_local_site_id)[0] session['webapi_token_id'] = webapi_token.pk if with_oauth_token: application = Application.objects.get_or_create( local_site_id=webapi_token_local_site_id, user=user, defaults={ 'authorization_grant_type': Application.GRANT_IMPLICIT, 'client_id': generate_client_id(), 'client_secret': generate_client_secret(), 'client_type': Application.CLIENT_PUBLIC, 'enabled': oauth_application_enabled, 'name': 'Test Application', 'redirect_uris': 'http://example.com', 'user': user, }, )[0] if application.enabled != oauth_application_enabled: application.enabled = oauth_application_enabled application.save(update_fields=('enabled',)) access_token = AccessToken.objects.create( application=application, user=user, token='abc123', scope=' '.join({ '%s:%s' % (self.resource.scope_name, self.resource.HTTP_SCOPE_METHOD_MAP[method]) for method in self.resource.allowed_methods }), expires=timezone.now() + timedelta(hours=1), ) session['oauth2_token_id'] = access_token.pk if with_webapi_token or with_oauth_token: session.save() return user class BasicDeleteTestsMixin(BasicTestsMixin): """Mixin to add basic HTTP DELETE unit tests. The subclass must implement ``setup_basic_delete_test`` and ``check_delete_result``. It may also set ``basic_delete_fixtures`` to a list of additional fixture names to import, and ``basic_delete_use_admin`` to ``True`` if it wants to run the test as an administrator user. """ basic_delete_fixtures = [] basic_delete_use_admin = False def setup_basic_delete_test(self, user, with_local_site, local_site_name): raise NotImplementedError( "%s doesn't implement setup_basic_delete_test" % self.__class__.__name__) def check_delete_result(self, user, *args): raise NotImplementedError("%s doesn't implement check_delete_result" % self.__class__.__name__) @webapi_test_template def test_delete(self): """Testing the DELETE <URL> API""" self.load_fixtures(self.basic_delete_fixtures) self._login_user(admin=self.basic_delete_use_admin) url, cb_args = self.setup_basic_delete_test(self.user, False, None) self.assertFalse(url.startswith('/s/' + self.local_site_name)) with override_feature_checks(self.override_features): self.api_delete(url) self.check_delete_result(self.user, *cb_args) @webapi_test_template def test_delete_not_owner(self): """Testing the DELETE <URL> API without owner""" self.load_fixtures(self.basic_delete_fixtures) user = User.objects.get(username='doc') self.assertNotEqual(user, self.user) url, cb_args = self.setup_basic_delete_test(user, False, None) self.assertFalse(url.startswith('/s/' + self.local_site_name)) with override_feature_checks(self.override_features): rsp = self.api_delete(url, expected_status=self.not_owner_status_code) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], self.not_owner_error.code) class BasicDeleteTestsWithLocalSiteMixin(BasicDeleteTestsMixin): """Adds basic HTTP DELETE unit tests with Local Sites. This extends BasicDeleteTestsMixin to also perform equivalent tests on Local Sites. """ @add_fixtures(['test_site']) @webapi_test_template def test_delete_with_site(self): """Testing the DELETE <URL> API with access to a local site""" user, url, cb_args = self._setup_test_delete_with_site() with override_feature_checks(self.override_features): self.api_delete(url) self.check_delete_result(user, *cb_args) @add_fixtures(['test_site']) @webapi_test_template def test_delete_with_site_no_access(self): """Testing the DELETE <URL> API without access to a local site""" user, url, cb_args = self._setup_test_delete_with_site() self._login_user() with override_feature_checks(self.override_features): rsp = self.api_delete(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) def _setup_test_delete_with_site(self, **auth_kwargs): self.load_fixtures(self.basic_delete_fixtures) with_local_site = auth_kwargs.setdefault('with_local_site', True) user = self._authenticate_basic_tests( with_admin=self.basic_delete_use_admin, **auth_kwargs) if with_local_site: url, cb_args = self.setup_basic_delete_test(user, True, self.local_site_name) else: url, cb_args = self.setup_basic_delete_test(user, False, None) self.assertEqual(url.startswith('/s/' + self.local_site_name), with_local_site) return user, url, cb_args class BasicDeleteTestsWithLocalSiteAndAPITokenMixin(object): """Adds basic HTTP DELETE unit tests with Local Sites and API tokens. This adds additional tests for checking API token access for local sites. """ @add_fixtures(['test_site']) @webapi_test_template def test_delete_with_restrict_site_and_allowed(self): """Testing the DELETE <URL> API with access to a local site and session restricted to the site """ user, url, cb_args = self._setup_test_delete_with_site( with_webapi_token=True, webapi_token_local_site_id=self.local_site_id) with override_feature_checks(self.override_features): self.api_delete(url) self.check_delete_result(user, *cb_args) @add_fixtures(['test_site']) @webapi_test_template def test_delete_with_restrict_site_and_not_allowed(self): """Testing the DELETE <URL> API with access to a local site and session restricted to a different site """ user, url, cb_args = self._setup_test_delete_with_site( with_webapi_token=True, webapi_token_local_site_id=self.local_site_id + 1) with override_feature_checks(self.override_features): rsp = self.api_delete(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class BasicDeleteTestsWithLocalSiteAndOAuthTokenMixin(object): """Adds basic HTTP DELETE unit tests with Local Sites and OAuth tokens.""" @add_fixtures(['test_site']) @webapi_test_template def test_delete_site_with_oauth_token_enabled_allowed(self): """Testing the DELETE <URL> API with access to a local site using an OAuth token for an enabled application on the current site """ user, url, cb_args = self._setup_test_delete_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, ) with override_feature_checks(self.override_features): self.api_delete(url) self.check_delete_result(user, *cb_args) @add_fixtures(['test_site']) @webapi_test_template def test_delete_site_with_oauth_token_enabled_disallowed(self): """Testing the DELETE <URL> API with access to a local site using an OAuth token for an enabled application on a different site """ user, url, cb_args = self._setup_test_delete_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id + 1, ) with override_feature_checks(self.override_features): rsp = self.api_delete(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_delete_site_with_oauth_token_disabled_disallowed(self): """Testing the DELETE <URL> API with access to a local site using an OAuth token for a disabled application on the current site """ user, url, cb_args = self._setup_test_delete_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, oauth_application_enabled=False, ) with override_feature_checks(self.override_features): rsp = self.api_delete(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_delete_no_site_with_site_oauth_token_disallowed(self): """Testing the DELETE <URL> API with access to a local site using an OAuth token meant for a local site on the root """ user, url, cb_args = self._setup_test_delete_with_site( with_local_site=False, with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, ) with override_feature_checks(self.override_features): rsp = self.api_delete(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_delete_site_with_global_oauth_token_disallowed(self): """Testing the DELETE <URL> API with access to a local site using an OAuth token for the root on a local site """ user, url, cb_args = self._setup_test_delete_with_site( with_oauth_token=True, webapi_token_local_site_id=None, ) with override_feature_checks(self.override_features): rsp = self.api_delete(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class BasicDeleteNotAllowedTestsMixin(BasicTestsMixin): """Mixin to add HTTP 405 Not Allowed tests for HTTP DELETE. The subclass must implement ``setup_http_not_allowed_item_test``, which will be reused for all HTTP 405 Not Allowed tests on the class. """ def setup_http_not_allowed_item_test(self, user): raise NotImplementedError( "%s doesn't implement setup_http_not_allowed_item_test" % self.__class__.__name__) @webapi_test_template def test_delete_method_not_allowed(self): """Testing the DELETE <URL> API gives Method Not Allowed""" url = self.setup_http_not_allowed_item_test(self.user) with override_feature_checks(self.override_features): self.api_delete(url, expected_status=405) class BasicGetItemTestsMixin(BasicTestsMixin): """Mixin to add basic HTTP GET unit tests for item resources. The subclass must implement ``setup_basic_get_test``. It may also set ``basic_get_fixtures`` to a list of additional fixture names to import. """ basic_get_fixtures = [] basic_get_returns_json = True basic_get_use_admin = False def setup_basic_get_test(self, user, with_local_site, local_site_name): raise NotImplementedError("%s doesn't implement setup_basic_get_test" % self.__class__.__name__) @webapi_test_template def test_get(self): """Testing the GET <URL> API""" self.load_fixtures(self.basic_get_fixtures) self._login_user(admin=self.basic_get_use_admin) url, mimetype, item = self.setup_basic_get_test(self.user, False, None) self.assertFalse(url.startswith('/s/' + self.local_site_name)) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_mimetype=mimetype, expected_json=self.basic_get_returns_json) if self.basic_get_returns_json: self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.item_result_key, rsp) item_rsp = rsp[self.resource.item_result_key] self.compare_item(item_rsp, item) else: self.compare_item(rsp, item) class BasicGetItemTestsWithLocalSiteMixin(BasicGetItemTestsMixin): """Adds basic HTTP GET unit tests for item resources with Local Sites. This extends BasicGetItemTestsMixin to also perform equivalent tests on Local Sites. """ @add_fixtures(['test_site']) @webapi_test_template def test_get_with_site(self): """Testing the GET <URL> API with access to a local site""" user, url, mimetype, item = self._setup_test_get_with_site() with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_mimetype=mimetype, expected_json=self.basic_get_returns_json) if self.basic_get_returns_json: self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.item_result_key, rsp) item_rsp = rsp[self.resource.item_result_key] self.compare_item(item_rsp, item) else: self.compare_item(rsp, item) @add_fixtures(['test_site']) @webapi_test_template def test_get_with_site_no_access(self): """Testing the GET <URL> API without access to a local site""" user, url, mimetype, item = self._setup_test_get_with_site() self._login_user() with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) def _setup_test_get_with_site(self, **auth_kwargs): self.load_fixtures(self.basic_get_fixtures) with_local_site = auth_kwargs.setdefault('with_local_site', True) user = self._authenticate_basic_tests( with_admin=self.basic_get_use_admin, **auth_kwargs) if with_local_site: url, mimetype, item = \ self.setup_basic_get_test(user, True, self.local_site_name) else: url, mimetype, item = self.setup_basic_get_test(user, False, None) self.assertEqual(url.startswith('/s/' + self.local_site_name), with_local_site) return user, url, mimetype, item class BasicGetItemTestsWithLocalSiteAndAPITokenMixin(object): """Adds HTTP GET tests for item resources with Local Sites and API tokens. This adds additional tests for checking API token access for local sites. """ @add_fixtures(['test_site']) @webapi_test_template def test_get_with_restrict_site_and_allowed(self): """Testing the GET <URL> API with access to a local site and session restricted to the site """ user, url, mimetype, item = self._setup_test_get_with_site( with_webapi_token=True, webapi_token_local_site_id=self.local_site_id) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_mimetype=mimetype, expected_json=self.basic_get_returns_json) if self.basic_get_returns_json: self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.item_result_key, rsp) item_rsp = rsp[self.resource.item_result_key] self.compare_item(item_rsp, item) else: self.compare_item(rsp, item) @add_fixtures(['test_site']) @webapi_test_template def test_get_with_restrict_site_and_not_allowed(self): """Testing the GET <URL> API with access to a local site and session restricted to a different site """ user, url, mimetype, item = self._setup_test_get_with_site( with_webapi_token=True, webapi_token_local_site_id=self.local_site_id + 1) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class BasicGetItemTestsWithLocalsSiteAndOAuthTokenMixin(object): """Add basic HTTP GET item unit tests with Local Sites and OAuth tokens.""" @add_fixtures(['test_site']) @webapi_test_template def test_get_site_with_oauth_token_enabled_allowed(self): """Testing the GET <URL> API with access to a local site using an OAuth token for an enabled application on the current site """ user, url, mimetype, item = self._setup_test_get_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, ) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_mimetype=mimetype, expected_json=self.basic_get_returns_json) if self.basic_get_returns_json: self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.item_result_key, rsp) item_rsp = rsp[self.resource.item_result_key] self.compare_item(item_rsp, item) else: self.compare_item(rsp, item) @add_fixtures(['test_site']) @webapi_test_template def test_get_site_with_oauth_token_enabled_disallowed(self): """Testing the GET <URL> API with access to a local site using an OAuth token for an enabled application on a different site """ user, url, mimetype, item = self._setup_test_get_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id + 1, ) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_get_site_with_oauth_token_disabled_disallowed(self): """Testing the GET <URL> API with access to a local site using an OAuth token for a disabled application on the current site """ user, url, mimetype, item = self._setup_test_get_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, oauth_application_enabled=False, ) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_get_no_site_with_site_oauth_token_disallowed(self): """Testing the GET <URL> API with access to a local site using an OAuth token meant for a local site on the root """ user, url, mimetype, item = self._setup_test_get_with_site( with_local_site=False, with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, ) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_get_site_with_global_oauth_token_disallowed(self): """Testing the GET <URL> API with access to a local site using an OAuth token for the root on a local site """ user, url, mimetype, item = self._setup_test_get_with_site( with_oauth_token=True, webapi_token_local_site_id=None, ) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class BasicGetListTestsMixin(BasicTestsMixin): """Mixin to add basic HTTP GET unit tests for list resources. The subclass must implement ``setup_basic_get_test``. It may also set ``basic_get_fixtures`` to a list of additional fixture names to import. """ basic_get_fixtures = [] basic_get_use_admin = False def setup_basic_get_test(self, user, with_local_site, local_site_name, populate_items): raise NotImplementedError("%s doesn't implement setup_basic_get_test" % self.__class__.__name__) @webapi_test_template def test_get(self): """Testing the GET <URL> API""" self.load_fixtures(self.basic_get_fixtures) self._login_user(admin=self.basic_get_use_admin) url, mimetype, items = self.setup_basic_get_test(self.user, False, None, True) self.assertFalse(url.startswith('/s/' + self.local_site_name)) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_mimetype=mimetype) self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.list_result_key, rsp) items_rsp = rsp[self.resource.list_result_key] self.assertEqual(len(items), len(items_rsp)) for i in range(len(items)): self.compare_item(items_rsp[i], items[i]) class BasicGetListTestsWithLocalSiteMixin(BasicGetListTestsMixin): """Adds basic HTTP GET unit tests for list resources with Local Sites. This extends BasicGetListTestsMixin to also perform equivalent tests on Local Sites. """ @add_fixtures(['test_site']) @webapi_test_template def test_get_with_site(self): """Testing the GET <URL> API with access to a local site""" user, url, mimetype, items = self._setup_test_get_list_with_site() with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_mimetype=mimetype) self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.list_result_key, rsp) items_rsp = rsp[self.resource.list_result_key] self.assertEqual(len(items), len(items_rsp)) for i in range(len(items)): self.compare_item(items_rsp[i], items[i]) @add_fixtures(['test_site']) @webapi_test_template def test_get_with_site_no_access(self): """Testing the GET <URL> API without access to a local site""" user, url, mimetype, items = self._setup_test_get_list_with_site() self._login_user() rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) def _setup_test_get_list_with_site(self, **auth_kwargs): self.load_fixtures(self.basic_get_fixtures) with_local_site = auth_kwargs.setdefault('with_local_site', True) user = self._login_user(local_site=with_local_site, admin=self.basic_get_use_admin) if with_local_site: url, mimetype, items = self.setup_basic_get_test( user, True, self.local_site_name, True) else: url, mimetype, items = self.setup_basic_get_test( user, False, None, True) user = self._authenticate_basic_tests( with_admin=self.basic_get_use_admin, user=user, **auth_kwargs) self.assertEqual(url.startswith('/s/' + self.local_site_name), with_local_site) return user, url, mimetype, items class BasicGetListTestsWithLocalSiteAndAPITokenMixin(object): """Adds HTTP GET tests for lists with Local Sites and API tokens. This adds additional tests for checking API token access for local sites. """ @add_fixtures(['test_site']) @webapi_test_template def test_get_with_restrict_site_and_allowed(self): """Testing the GET <URL> API with access to a local site and session restricted to the site """ user, url, mimetype, items = self._setup_test_get_list_with_site( with_webapi_token=True, webapi_token_local_site_id=self.local_site_id) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_mimetype=mimetype) self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.list_result_key, rsp) items_rsp = rsp[self.resource.list_result_key] self.assertEqual(len(items), len(items_rsp)) for i in range(len(items)): self.compare_item(items_rsp[i], items[i]) @add_fixtures(['test_site']) @webapi_test_template def test_get_with_restrict_site_and_not_allowed(self): """Testing the GET <URL> API with access to a local site and session restricted to a different site """ user, url, mimetype, items = self._setup_test_get_list_with_site( with_webapi_token=True, webapi_token_local_site_id=self.local_site_id + 1) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class BasicGetListTestsWithLocalSiteAndOAuthTokenMixin(object): """Add basic HTTP GET list unit tests with Local Sites and OAuth tokens.""" @add_fixtures(['test_site']) @webapi_test_template def test_get_list_site_with_oauth_token_enabled_allowed(self): """Testing the GET <URL> API with access to a local site using an OAuth token for an enabled application on the current site """ user, url, mimetype, items = self._setup_test_get_list_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, ) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_mimetype=mimetype) self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.list_result_key, rsp) items_rsp = rsp[self.resource.list_result_key] self.assertEqual(len(items), len(items_rsp)) for i in range(len(items)): self.compare_item(items_rsp[i], items[i]) @add_fixtures(['test_site']) @webapi_test_template def test_get_list_site_with_oauth_token_enabled_disallowed(self): """Testing the GET <URL> API with access to a local site using an OAuth token for an enabled application on a different site """ user, url, mimetype, items = self._setup_test_get_list_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id + 1, ) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_get_list_site_with_oauth_token_disabled_disallowed(self): """Testing the GET <URL> API with access to a local site using an OAuth token for a disabled application on the current site """ user, url, mimetype, items = self._setup_test_get_list_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, oauth_application_enabled=False, ) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_get_list_no_site_with_site_oauth_token_disallowed(self): """Testing the GET <URL> API with access to a local site using an OAuth token meant for a local site on the root """ user, url, mimetype, items = self._setup_test_get_list_with_site( with_local_site=False, with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, ) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_get_list_site_with_global_oauth_token_disallowed(self): """Testing the GET <URL> API with access to a local site using an OAuth token for the root on a local site """ user, url, mimetype, items = self._setup_test_get_list_with_site( with_oauth_token=True, webapi_token_local_site_id=None, ) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class BasicPostTestsMixin(BasicTestsMixin): """Mixin to add basic HTTP POST unit tests. The subclass must implement ``setup_basic_post_test`` and ``check_post_result``. It may also set ``basic_post_fixtures`` to a list of additional fixture names to import, and ``basic_post_use_admin`` to ``True`` if it wants to run the test as an administrator user. """ basic_post_fixtures = [] basic_post_use_admin = False basic_post_success_status = 201 def setup_basic_post_test(self, user, with_local_site, local_site_name, post_valid_data): raise NotImplementedError("%s doesn't implement setup_basic_post_test" % self.__class__.__name__) def check_post_result(self, user, rsp, *args): raise NotImplementedError("%s doesn't implement check_post_result" % self.__class__.__name__) @webapi_test_template def test_post(self): """Testing the POST <URL> API""" self.load_fixtures(self.basic_post_fixtures) self._login_user(admin=self.basic_post_use_admin) url, mimetype, post_data, cb_args = \ self.setup_basic_post_test(self.user, False, None, True) self.assertFalse(url.startswith('/s/' + self.local_site_name)) with override_feature_checks(self.override_features): rsp = self.api_post(url, post_data, expected_mimetype=mimetype, expected_status=self.basic_post_success_status) self._close_file_handles(post_data) self.assertEqual(rsp['stat'], 'ok') self.check_post_result(self.user, rsp, *cb_args) class BasicPostTestsWithLocalSiteMixin(BasicPostTestsMixin): """Adds basic HTTP POST unit tests with Local Sites. This extends BasicPostTestsMixin to also perform equivalent tests on Local Sites. """ @add_fixtures(['test_site']) @webapi_test_template def test_post_with_site(self): """Testing the POST <URL> API with access to a local site""" user, url, mimetype, post_data, cb_args = \ self._setup_test_post_with_site() with override_feature_checks(self.override_features): rsp = self.api_post(url, post_data, expected_mimetype=mimetype, expected_status=self.basic_post_success_status) self._close_file_handles(post_data) self.assertEqual(rsp['stat'], 'ok') self.check_post_result(user, rsp, *cb_args) @add_fixtures(['test_site']) @webapi_test_template def test_post_with_site_no_access(self): """Testing the POST <URL> API without access to a local site""" user, url, mimetype, post_data, cb_args = \ self._setup_test_post_with_site() self._login_user() with override_feature_checks(self.override_features): rsp = self.api_post(url, post_data, expected_status=403) self._close_file_handles(post_data) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) def _setup_test_post_with_site(self, **auth_kwargs): self.load_fixtures(self.basic_post_fixtures) with_local_site = auth_kwargs.setdefault('with_local_site', True) user = self._authenticate_basic_tests( with_admin=self.basic_post_use_admin, **auth_kwargs) if with_local_site: url, mimetype, post_data, cb_args = \ self.setup_basic_post_test(user, True, self.local_site_name, True) else: url, mimetype, post_data, cb_args = \ self.setup_basic_post_test(user, False, None, True) self.assertEqual(url.startswith('/s/' + self.local_site_name), with_local_site) return user, url, mimetype, post_data, cb_args class BasicPostTestsWithLocalSiteAndAPITokenMixin(object): """Adds HTTP POST tests with Local Sites and API tokens. This adds additional tests for checking API token access for local sites. """ @add_fixtures(['test_site']) @webapi_test_template def test_post_with_restrict_site_and_allowed(self): """Testing the POST <URL> API with access to a local site and session restricted to the site """ user, url, mimetype, post_data, cb_args = \ self._setup_test_post_with_site( with_webapi_token=True, webapi_token_local_site_id=self.local_site_id) with override_feature_checks(self.override_features): rsp = self.api_post(url, post_data, expected_mimetype=mimetype, expected_status=self.basic_post_success_status) self._close_file_handles(post_data) self.assertEqual(rsp['stat'], 'ok') self.check_post_result(user, rsp, *cb_args) @add_fixtures(['test_site']) @webapi_test_template def test_post_with_restrict_site_and_not_allowed(self): """Testing the POST <URL> API with access to a local site and session restricted to a different site """ user, url, mimetype, post_data, cb_args = \ self._setup_test_post_with_site( with_webapi_token=True, webapi_token_local_site_id=self.local_site_id + 1) with override_feature_checks(self.override_features): rsp = self.api_post(url, post_data, expected_status=403) self._close_file_handles(post_data) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class BasicPostTestsWithLocalSiteAndOAuthTokenMixin(object): """Adds basic HTTP POST unit tests with Local Sites and OAuth tokens.""" @add_fixtures(['test_site']) @webapi_test_template def test_post_site_with_oauth_token_enabled_allowed(self): """Testing the POST <URL> API with access to a local site using an OAuth token for an enabled application on the current site """ user, url, mimetype, post_data, cb_args = \ self._setup_test_post_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, ) with override_feature_checks(self.override_features): rsp = self.api_post(url, post_data, expected_mimetype=mimetype, expected_status=self.basic_post_success_status) self._close_file_handles(post_data) self.assertEqual(rsp['stat'], 'ok') self.check_post_result(user, rsp, *cb_args) @add_fixtures(['test_site']) @webapi_test_template def test_post_site_with_oauth_token_enabled_disallowed(self): """Testing the POST <URL> API with access to a local site using an OAuth token for an enabled application on a different site """ user, url, mimetype, post_data, cb_args = \ self._setup_test_post_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id + 1, ) with override_feature_checks(self.override_features): rsp = self.api_post(url, post_data, expected_status=403) self._close_file_handles(post_data) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_post_site_with_oauth_token_disabled_disallowed(self): """Testing the POST <URL> API with access to a local site using an OAuth token for a disabled application on the current site """ user, url, mimetype, post_data, cb_args = \ self._setup_test_post_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, oauth_application_enabled=False, ) with override_feature_checks(self.override_features): rsp = self.api_post(url, post_data, expected_status=403) self._close_file_handles(post_data) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_post_no_site_with_site_oauth_token_disallowed(self): """Testing the POST <URL> API with access to a local site using an OAuth token meant for a local site on the root """ user, url, mimetype, post_data, cb_args = \ self._setup_test_post_with_site( with_local_site=False, with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, ) with override_feature_checks(self.override_features): rsp = self.api_post(url, post_data, expected_status=403) self._close_file_handles(post_data) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_post_site_with_global_oauth_token_disallowed(self): """Testing the POST <URL> API with access to a local site using an OAuth token for the root on a local site """ user, url, mimetype, post_data, cb_args = \ self._setup_test_post_with_site( with_oauth_token=True, webapi_token_local_site_id=None, ) with override_feature_checks(self.override_features): rsp = self.api_post(url, post_data, expected_status=403) self._close_file_handles(post_data) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class BasicPostNotAllowedTestsMixin(BasicTestsMixin): """Mixin to add HTTP 405 Not Allowed tests for HTTP POST. The subclass must implement ``setup_http_not_allowed_list_test``. """ def setup_http_not_allowed_list_test(self, user): raise NotImplementedError( "%s doesn't implement setup_http_not_allowed_list_test" % self.__class__.__name__) @webapi_test_template def test_post_method_not_allowed(self): """Testing the POST <URL> API gives Method Not Allowed""" url = self.setup_http_not_allowed_list_test(self.user) with override_feature_checks(self.override_features): self.api_post(url, {}, expected_status=405) class BasicPutTestsMixin(BasicTestsMixin): """Mixin to add basic HTTP PUT unit tests. The subclass must implement ``setup_basic_put_test`` and ``check_put_result``. It may also set ``basic_put_fixtures`` to a list of additional fixture names to import, and ``basic_put_use_admin`` to ``True`` if it wants to run the test as an administrator user. """ basic_put_fixtures = [] basic_put_use_admin = False def setup_basic_put_test(self, user, with_local_site, local_site_name, put_valid_data): raise NotImplementedError("%s doesn't implement setup_basic_put_test" % self.__class__.__name__) def check_put_result(self, user, item_rsp, item, *args): raise NotImplementedError("%s doesn't implement check_put_result" % self.__class__.__name__) @webapi_test_template def test_put(self): """Testing the PUT <URL> API""" self.load_fixtures(self.basic_put_fixtures) self._login_user(admin=self.basic_put_use_admin) url, mimetype, put_data, item, cb_args = \ self.setup_basic_put_test(self.user, False, None, True) self.assertFalse(url.startswith('/s/' + self.local_site_name)) with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_mimetype=mimetype) self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.item_result_key, rsp) self.check_put_result(self.user, rsp[self.resource.item_result_key], item, *cb_args) @webapi_test_template def test_put_not_owner(self): """Testing the PUT <URL> API without owner""" self.load_fixtures(self.basic_put_fixtures) user = User.objects.get(username='doc') self.assertNotEqual(user, self.user) url, mimetype, put_data, item, cb_args = \ self.setup_basic_put_test(user, False, None, False) self.assertFalse(url.startswith('/s/' + self.local_site_name)) with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_status=self.not_owner_status_code) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], self.not_owner_error.code) class BasicPutTestsWithLocalSiteMixin(BasicPutTestsMixin): """Adds basic HTTP PUT unit tests with Local Sites. This extends BasicPutTestsMixin to also perform equivalent tests on Local Sites. """ @add_fixtures(['test_site']) @webapi_test_template def test_put_with_site(self): """Testing the PUT <URL> API with access to a local site""" user, url, mimetype, put_data, item, cb_args = \ self._setup_test_put_with_site() with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_mimetype=mimetype) self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.item_result_key, rsp) self.check_put_result(user, rsp[self.resource.item_result_key], item, *cb_args) @add_fixtures(['test_site']) @webapi_test_template def test_put_with_site_no_access(self): """Testing the PUT <URL> API without access to a local site""" user, url, mimetype, put_data, item, cb_args = \ self._setup_test_put_with_site() self._login_user() with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) def _setup_test_put_with_site(self, **auth_kwargs): self.load_fixtures(self.basic_put_fixtures) with_local_site = auth_kwargs.setdefault('with_local_site', True) user = self._authenticate_basic_tests( with_admin=self.basic_put_use_admin, **auth_kwargs) if with_local_site: url, mimetype, put_data, item, cb_args = \ self.setup_basic_put_test(user, True, self.local_site_name, True) else: url, mimetype, put_data, item, cb_args = \ self.setup_basic_put_test(user, False, None, True) self.assertEqual(url.startswith('/s/' + self.local_site_name), with_local_site) return user, url, mimetype, put_data, item, cb_args class BasicPutTestsWithLocalSiteAndAPITokenMixin(object): """Adds HTTP PUT tests with Local Sites and API tokens. This adds additional tests for checking API token access for local sites. """ @add_fixtures(['test_site']) @webapi_test_template def test_put_with_restrict_site_and_allowed(self): """Testing the PUT <URL> API with access to a local site and session restricted to the site """ user, url, mimetype, put_data, item, cb_args = \ self._setup_test_put_with_site( with_webapi_token=True, webapi_token_local_site_id=self.local_site_id) with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_mimetype=mimetype) self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.item_result_key, rsp) self.check_put_result(user, rsp[self.resource.item_result_key], item, *cb_args) @add_fixtures(['test_site']) @webapi_test_template def test_put_with_restrict_site_and_not_allowed(self): """Testing the PUT <URL> API with access to a local site and session restricted to a different site """ user, url, mimetype, put_data, item, cb_args = \ self._setup_test_put_with_site( with_webapi_token=True, webapi_token_local_site_id=self.local_site_id + 1) with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class BasicPutTestsWithLocalSiteAndOAuthTokenMixin(object): """Adds basic HTTP PUT unit tests with Local Sites and OAuth tokens.""" @add_fixtures(['test_site']) @webapi_test_template def test_put_site_with_oauth_token_enabled_allowed(self): """Testing the PUT <URL> API with access to a local site using an OAuth token for an enabled application on the current site """ user, url, mimetype, put_data, item, cb_args = \ self._setup_test_put_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, ) with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_mimetype=mimetype) self.assertEqual(rsp['stat'], 'ok') self.assertIn(self.resource.item_result_key, rsp) self.check_put_result(user, rsp[self.resource.item_result_key], item, *cb_args) @add_fixtures(['test_site']) @webapi_test_template def test_put_site_with_oauth_token_enabled_disallowed(self): """Testing the PUT <URL> API with access to a local site using an OAuth token for an enabled application on a different site """ user, url, mimetype, put_data, item, cb_args = \ self._setup_test_put_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id + 1, ) with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_put_site_with_oauth_token_disabled_disallowed(self): """Testing the PUT <URL> API with access to a local site using an OAuth token for a disabled application on the current site """ user, url, mimetype, put_data, item, cb_args = \ self._setup_test_put_with_site( with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, oauth_application_enabled=False, ) with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_put_no_site_with_site_oauth_token_disallowed(self): """Testing the PUT <URL> API with access to a local site using an OAuth token meant for a local site on the root """ user, url, mimetype, put_data, item, cb_args = \ self._setup_test_put_with_site( with_local_site=False, with_oauth_token=True, webapi_token_local_site_id=self.local_site_id, ) with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_site']) @webapi_test_template def test_put_site_with_global_oauth_token_disallowed(self): """Testing the PUT <URL> API with access to a local site using an OAuth token for the root on a local site """ user, url, mimetype, put_data, item, cb_args = \ self._setup_test_put_with_site( with_oauth_token=True, webapi_token_local_site_id=None, ) with override_feature_checks(self.override_features): rsp = self.api_put(url, put_data, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class BasicPutNotAllowedTestsMixin(BasicTestsMixin): """Mixin to add HTTP 405 Not Allowed tests for HTTP PUT. The subclass must implement ``setup_http_not_allowed_item_test``, which will be reused for all HTTP 405 Not Allowed tests on the class. """ def setup_http_not_allowed_item_test(self, user): raise NotImplementedError( "%s doesn't implement setup_http_not_allowed_item_test" % self.__class__.__name__) @webapi_test_template def test_put_method_not_allowed(self): """Testing the PUT <URL> API gives Method Not Allowed""" url = self.setup_http_not_allowed_item_test(self.user) with override_feature_checks(self.override_features): self.api_put(url, {}, expected_status=405) class BaseReviewRequestChildMixin(object): """Base class for tests for children of ReviewRequestResource. This will test that the resources are only accessible when the user has access to the review request itself (such as when the review request is private due to being in an invite-only repository or group). This applies to immediate children and any further down the tree. """ basic_get_returns_json = True override_features = {} def setup_review_request_child_test(self, review_request): raise NotImplementedError( "%s doesn't implement setup_review_request_child_test" % self.__class__.__name__) @add_fixtures(['test_scmtools']) @webapi_test_template def test_get_with_private_group(self): """Testing the GET <URL> API with access to review request on a private group """ group = self.create_review_group(invite_only=True) group.users.add(self.user) repository = self.create_repository(tool_name='Test') review_request = self.create_review_request(publish=True, repository=repository) review_request.target_groups.add(group) url, mimetype = self.setup_review_request_child_test(review_request) with override_feature_checks(self.override_features): self.api_get(url, expected_mimetype=mimetype, expected_json=self.basic_get_returns_json) @add_fixtures(['test_scmtools']) @webapi_test_template def test_get_with_private_group_no_access(self): """Testing the GET <URL> API without access to review request on a private group """ group = self.create_review_group(invite_only=True) repository = self.create_repository(tool_name='Test') review_request = self.create_review_request(publish=True, repository=repository) review_request.target_groups.add(group) url, mimetype = self.setup_review_request_child_test(review_request) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) @add_fixtures(['test_scmtools']) @webapi_test_template def test_get_with_private_repo(self): """Testing the GET <URL> API with access to review request on a private repository """ repository = self.create_repository(public=False, tool_name='Test') repository.users.add(self.user) review_request = self.create_review_request(repository=repository, publish=True) url, mimetype = self.setup_review_request_child_test(review_request) with override_feature_checks(self.override_features): self.api_get(url, expected_mimetype=mimetype, expected_json=self.basic_get_returns_json) @add_fixtures(['test_scmtools']) @webapi_test_template def test_get_with_private_repo_no_access(self): """Testing the GET <URL> API without access to review request on a private repository """ repository = self.create_repository(public=False, tool_name='Test') review_request = self.create_review_request(repository=repository, publish=True) url, mimetype = self.setup_review_request_child_test(review_request) with override_feature_checks(self.override_features): rsp = self.api_get(url, expected_status=403) self.assertEqual(rsp['stat'], 'fail') self.assertEqual(rsp['err']['code'], PERMISSION_DENIED.code) class ReviewRequestChildListMixin(BaseReviewRequestChildMixin): """Tests for list resources that are children of ReviewRequestResource.""" class ReviewRequestChildItemMixin(BaseReviewRequestChildMixin): """Tests for item resources that are children of ReviewRequestResource."""
reviewboard/reviewboard
reviewboard/webapi/tests/mixins.py
Python
mit
62,838
import fs from 'fs'; import path from 'path'; const { LALOG_LEVEL, LOGGLY_TOKEN, PLANT_IMAGE_COMPLETE, PLANT_IMAGE_HOST, PLANT_IMAGE_PORT, } = process.env; if ( !LALOG_LEVEL || !LOGGLY_TOKEN || !PLANT_IMAGE_COMPLETE || !PLANT_IMAGE_HOST || !PLANT_IMAGE_PORT ) { // eslint-disable-next-line no-console console.error(`Missing env value(s): LALOG_LEVEL: '${LALOG_LEVEL}', LOGGLY_TOKEN: '${LOGGLY_TOKEN}', PLANT_IMAGE_COMPLETE: '${PLANT_IMAGE_COMPLETE}', PLANT_IMAGE_HOST: '${PLANT_IMAGE_HOST}', PLANT_IMAGE_PORT: '${PLANT_IMAGE_PORT}', `); process.exit(1); } const envTs = ` export default { LALOG_LEVEL: '${LALOG_LEVEL}', LOGGLY_TOKEN: '${LOGGLY_TOKEN}', PLANT_IMAGE_COMPLETE: '${PLANT_IMAGE_COMPLETE}', PLANT_IMAGE_HOST: '${PLANT_IMAGE_HOST}', PLANT_IMAGE_PORT: '${PLANT_IMAGE_PORT}', }; `; // eslint-disable-next-line security/detect-non-literal-fs-filename fs.writeFileSync(path.join(__dirname, 'env.ts'), envTs);
guyellis/plant-image-lambda
devops/setenv.ts
TypeScript
mit
977
<!DOCTYPE html> <html> <head> <title>Redactor is awesome!</title> <meta charset="utf-8"> <link rel="stylesheet" href="http://imperavi.com/js/redactor/redactor.css" /> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <script src="http://imperavi.com/js/redactor/redactor.js"></script> <!-- Redactor's plugin --> <script src="clips.js"></script> <link rel="stylesheet" href="clips.css" /> <!-- Call Redactor --> <script type="text/javascript"> $(document).ready( function () { $('#redactor').redactor({ focus : true, plugins: ['clips'] }); } ); </script> <!-- Site styles --> <style type="text/css"> html, body { margin : 0; padding : 0; } body { font-family : Helvetica, Arial, sans-serif; font-size : 14px; } #page { width : 940px; margin : 50px auto; } </style> </head> <body> <div id="page"> <textarea id="redactor" name="content" style="width: 99%; height: 400px;"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </textarea> <!-- Clips Modal HTML --> <div id="clipsmodal" style="display: none;"> <section> <ul class="redactor_clips_box"> <li> <a href="#" class="redactor_clip_link">Lorem ipsum …</a> <div class="redactor_clip" style="display: none;"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div> </li> <li> <a href="#" class="redactor_clip_link">Red label</a> <div class="redactor_clip" style="display: none;"> <span class="label-red">Label</span> </div> </li> </ul> </section> <footer> <a href="#" class="redactor_modal_btn redactor_btn_modal_close">Close</a> </footer> </div> </div> </body> </html>
neowutran/Nuitinfo
nuitinfo/protected/common/lib/vendor/2amigos/yiiwheels/widgets/redactor/assets/js/plugins/clips/index.html
HTML
mit
3,365
<?php namespace tourze\Http\Request\Client; use Doctrine\Common\Inflector\Inflector; use ReflectionClass; use tourze\Base\Base; use tourze\Base\Exception\BaseException; use tourze\Http\Exception\HttpException; use tourze\Http\Http; use tourze\Http\Response; use tourze\Http\Request; use tourze\Http\Request\RequestClient; /** * 内部执行的请求 * * @package tourze\Http\Request\Client */ class InternalClient extends RequestClient { /** * 处理请求 * * $request->execute(); * * @param Request $request * @param Response $response * @return \tourze\Http\Response * @throws \tourze\Base\Exception\BaseException */ public function executeRequest(Request $request, Response $response) { $className = 'Controller'; // 控制器 $controller = $request->controller; $className = Inflector::classify($controller) . $className; // 目录 $directory = $request->directory; if ($directory) { $directory = str_replace('/', '\\', $directory); $className = $directory . $className; } // 保存请求状态 $previous = Request::$current; Request::$current = $request; Base::getLog()->info(__METHOD__ . ' controller class', [ 'class' => $className, ]); try { if ( ! class_exists($className)) { Base::getLog()->debug(__METHOD__ . ' class not found', [ 'class' => $className, ]); throw HttpException::factory(Http::NOT_FOUND, 'The requested URL :uri was not found on this server.', [ ':uri' => $request->uri, ])->request($request); } $class = new ReflectionClass($className); if ($class->isAbstract()) { Base::getLog()->error(__METHOD__ . ' calling abstract controller class', [ 'class' => $className, ]); throw new BaseException('Cannot create instances of abstract :controller', [ ':controller' => $className, ]); } $controller = $class->newInstance([ 'request' => $request, 'response' => $response, ]); $response = $class->getMethod('execute')->invoke($controller); if ( ! $response instanceof Response) { Base::getLog()->error(__METHOD__ . ' unknown response type'); throw new BaseException('Controller failed to return a Response'); } } catch (HttpException $e) { if (null === $e->request()) { $e->request($request); } $response = $e->getResponse(); } Request::$current = $previous; return $response; } }
tourze/http
src/Request/Client/InternalClient.php
PHP
mit
2,994
package main import ( "fmt" "os" "reflect" "testing" "time" ) type testpair struct { GivenInput string ExpectedOutput time.Time } func TestDateParsing(t *testing.T) { tests := []testpair{ {"01.01.2000", time.Date(2000, time.Month(1), 1, 0, 0, 0, 0, time.UTC)}, {"01.01.2016", time.Date(2016, time.Month(1), 1, 0, 0, 0, 0, time.UTC)}, {"15.03.2014", time.Date(2014, time.Month(3), 15, 0, 0, 0, 0, time.UTC)}, {"31.03.2061", time.Date(2061, time.Month(3), 31, 0, 0, 0, 0, time.UTC)}, {"30.11.1997", time.Date(1997, time.Month(11), 30, 0, 0, 0, 0, time.UTC)}, } for _, pair := range tests { fmt.Fprintln(os.Stderr, "Test pair :", pair) fmt.Fprintln(os.Stderr, "Input string :", pair.GivenInput) fmt.Fprintln(os.Stderr, "Expected time :", pair.ExpectedOutput) date := parseDate(pair.GivenInput) fmt.Fprintln(os.Stderr, "Parse date :", date) if !reflect.DeepEqual(date, pair.ExpectedOutput) { t.Error("Not the expected result for : ", pair) } } } type testpair1 struct { GivenInput []string ExpectedOutput string } func TestComputedDurationFormating(t *testing.T) { tests := []testpair1{ {[]string{"01.01.2000", "01.01.2016"}, "16 years, total 5844 days"}, {[]string{"15.12.2014", "14.02.2016"}, "1 year, 1 month, total 426 days"}, {[]string{"01.01.2016", "18.08.2016"}, "7 months, total 230 days"}, } for _, pair := range tests { fmt.Fprintln(os.Stderr, "Test pair :", pair) fmt.Fprintln(os.Stderr, "Input string :", pair.GivenInput) fmt.Fprintln(os.Stderr, "Expected time :", pair.ExpectedOutput) duration := computeDuration(pair.GivenInput[0], pair.GivenInput[1]) fmt.Fprintln(os.Stderr, "Computed duration :", duration) if duration != pair.ExpectedOutput { t.Error("Not the expected result for : ", pair) } } } type testpair2 struct { GivenInput int ExpectedOutput bool } //Leap Years are any year that can be exactly divided by 4 (such as 2012, 2016, etc) //except if it can be exactly divided by 100, then it isn't (such as 2100, 2200, etc) //except if it can be exactly divided by 400, then it is (such as 2000, 2400) func TestIsLeapYear(t *testing.T) { tests := []testpair2{ {2012, true}, {2016, true}, {2100, false}, {2200, false}, {2000, true}, {2400, true}, {1885, false}, {1975, false}, } for _, pair := range tests { fmt.Fprintln(os.Stderr, "Test pair :", pair) fmt.Fprintln(os.Stderr, "Input string :", pair.GivenInput) fmt.Fprintln(os.Stderr, "Expected time :", pair.ExpectedOutput) test := isLeapYear(pair.GivenInput) fmt.Fprintln(os.Stderr, "Is leap year ? :", test) if test != pair.ExpectedOutput { t.Error("Not the expected result for : ", pair) } } }
TGITS/programming-workouts
go/src/github.com/TGITS/go-workouts/codingame/practice/easy/how_time_flies/howtimeflies_test.go
GO
mit
2,695
package consensus import ( "testing" "github.com/NebulousLabs/Sia/modules" "github.com/NebulousLabs/Sia/types" ) // TestIntegrationChangeLog does a general test of the changelog by creating a // subscriber that subscribes partway into startup and checking that the // correct ordering of blocks are provided. func TestIntegrationChangeLog(t *testing.T) { if testing.Short() { t.SkipNow() } // Get a blank consensus set tester so that the mocked subscriber can join // immediately after genesis. cst, err := blankConsensusSetTester("TestIntegrationChangeLog") if err != nil { t.Fatal(err) } // Add a mocked subscriber and check that it receives the correct number of // blocks. ms := newMockSubscriber() cst.cs.ConsensusSetSubscribe(&ms, modules.ConsensusChangeBeginning) if ms.updates[0].AppliedBlocks[0].ID() != cst.cs.blockRoot.Block.ID() { t.Fatal("subscription did not correctly receive the genesis block") } if len(ms.updates) != 1 { t.Fatal("subscription resulted in the wrong number of blocks being sent") } // Create a copy of the subscriber that will subscribe to the consensus at // the tail of the updates. tailSubscriber := ms.copySub() cst.cs.ConsensusSetSubscribe(&tailSubscriber, tailSubscriber.updates[len(tailSubscriber.updates)-1].ID) if len(tailSubscriber.updates) != 1 { t.Fatal("subscription resulted in the wrong number of blocks being sent") } // Create a copy of the subscriber that will join when it is not at 0, but it is behind. behindSubscriber := ms.copySub() cst.addSiafunds() cst.mineSiacoins() cst.cs.ConsensusSetSubscribe(&behindSubscriber, behindSubscriber.updates[len(behindSubscriber.updates)-1].ID) if types.BlockHeight(len(behindSubscriber.updates)) != cst.cs.dbBlockHeight()+1 { t.Fatal("subscription resulted in the wrong number of blocks being sent") } if len(ms.updates) != len(tailSubscriber.updates) { t.Error("subscribers have inconsistent update chains") } if len(ms.updates) != len(behindSubscriber.updates) { t.Error("subscribers have inconsisitent update chains") } }
johnathanhowell/Sia
modules/consensus/changelog_test.go
GO
mit
2,074
import fs = require('fs'); import path = require('path'); import mkdirp = require('mkdirp'); import getStdin = require('get-stdin'); import { ncp } from 'ncp'; export class IOService { readFile(filename: string, encoding: string = 'utf8'): Promise<string> { return new Promise<string>((res, rej) => fs.readFile(filename, encoding, (err, data) => err ? rej(err) : res(data))); } writeFile(data: string, filename: string, encoding: string = 'utf8'): Promise<void> { return new Promise<void>((res, rej) => fs.writeFile(filename, data, { encoding }, (err) => err ? rej(err) : res())); } fileExists(filename: string): Promise<boolean> { return new Promise<boolean>((res, rej) => fs.exists(filename, (exists) => res(exists))); } async mkDir(directory: string): Promise<void> { return new Promise<void>((res, rej) => mkdirp(directory, (err) => err ? rej(err) : res())); } async ensureDirectoryExists(filename: string): Promise<void> { const dir = path.dirname(filename); await this.mkDir(dir); } /** * Copies a directory recursively from source to destination * * @param source Source directory * @param destination Destination directory */ copyDirectory(source: string, destination: string): Promise<void> { return new Promise<void>((res, rej) => ncp(source, destination, (err) => err ? rej(err) : res())); } /** * Returns the contents of std-in */ async readStdin(): Promise<string> { // Get input file const input = await getStdin(); if (!input) throw new Error('Please specify an input file'); return input; } }
ksm2/metagram
modules/@metagram/framework/services/IOService.ts
TypeScript
mit
1,614
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>windows::basic_handle::native</title> <link rel="stylesheet" href="../../../../../doc/src/boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> <link rel="home" href="../../../boost_asio.html" title="Boost.Asio"> <link rel="up" href="../windows__basic_handle.html" title="windows::basic_handle"> <link rel="prev" href="lowest_layer_type.html" title="windows::basic_handle::lowest_layer_type"> <link rel="next" href="native_handle.html" title="windows::basic_handle::native_handle"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td> <td align="center"><a href="../../../../../index.html">Home</a></td> <td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="lowest_layer_type.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../windows__basic_handle.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="native_handle.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> <div class="section"> <div class="titlepage"><div><div><h4 class="title"> <a name="boost_asio.reference.windows__basic_handle.native"></a><a class="link" href="native.html" title="windows::basic_handle::native">windows::basic_handle::native</a> </h4></div></div></div> <p> <a class="indexterm" name="idp105410064"></a> (Deprecated: Use <code class="computeroutput"><span class="identifier">native_handle</span><span class="special">()</span></code>.) Get the native handle representation. </p> <pre class="programlisting"><span class="identifier">native_type</span> <span class="identifier">native</span><span class="special">();</span> </pre> <p> This function may be used to obtain the underlying representation of the handle. This is intended to allow access to native handle functionality that is not otherwise provided. </p> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright &#169; 2003-2015 Christopher M. Kohlhoff<p> Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="lowest_layer_type.html"><img src="../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../windows__basic_handle.html"><img src="../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../boost_asio.html"><img src="../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="native_handle.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a> </div> </body> </html>
calvinfarias/IC2015-2
BOOST/boost_1_61_0/libs/asio/doc/html/boost_asio/reference/windows__basic_handle/native.html
HTML
mit
3,631
from django.template import loader, RequestContext from django.core.xheaders import populate_xheaders from django.http import Http404, HttpResponse from django.core.paginator import Paginator, InvalidPage # GAE: added imports from django.views.generic.create_update import lookup_object from copy import copy def object_list(request, queryset, paginate_by=None, page=None, allow_empty=True, template_name=None, template_loader=loader, extra_context=None, context_processors=None, template_object_name='object', mimetype=None): """ Generic list of objects. Templates: ``<app_label>/<model_name>_list.html`` Context: object_list list of objects is_paginated are the results paginated? results_per_page number of objects per page (if paginated) has_next is there a next page? has_previous is there a prev page? page the current page next the next page previous the previous page pages number of pages, total hits number of objects, total last_on_page the result number of the last of object in the object_list (1-indexed) first_on_page the result number of the first object in the object_list (1-indexed) page_range: A list of the page numbers (1-indexed). """ if extra_context is None: extra_context = {} # GAE: Removed queryset._clone() if paginate_by: paginator = Paginator(queryset, paginate_by, allow_empty_first_page=allow_empty) if not page: page = request.GET.get('page', 1) try: page_number = int(page) except ValueError: if page == 'last': page_number = paginator.num_pages else: # Page is not 'last', nor can it be converted to an int. raise Http404 try: page_obj = paginator.page(page_number) except InvalidPage: raise Http404 c = RequestContext(request, { '%s_list' % template_object_name: page_obj.object_list, 'paginator': paginator, 'page_obj': page_obj, # Legacy template context stuff. New templates should use page_obj # to access this instead. 'is_paginated': page_obj.has_other_pages(), 'results_per_page': paginator.per_page, 'has_next': page_obj.has_next(), 'has_previous': page_obj.has_previous(), 'page': page_obj.number, 'next': page_obj.next_page_number(), 'previous': page_obj.previous_page_number(), 'first_on_page': page_obj.start_index(), 'last_on_page': page_obj.end_index(), 'pages': paginator.num_pages, 'hits': paginator.count, 'page_range': paginator.page_range, }, context_processors) else: c = RequestContext(request, { # GAE: Limit number of results, so there are no timeouts '%s_list' % template_object_name: queryset.fetch(301), 'paginator': None, 'page_obj': None, 'is_paginated': False, }, context_processors) if not allow_empty and len(queryset) == 0: raise Http404 for key, value in extra_context.items(): if callable(value): c[key] = value() else: c[key] = value if not template_name: model = queryset.model template_name = "%s/%s_list.html" % (model._meta.app_label, model._meta.object_name.lower()) t = template_loader.get_template(template_name) return HttpResponse(t.render(c), mimetype=mimetype) def object_detail(request, queryset, object_id=None, slug=None, slug_field='slug', template_name=None, template_name_field=None, template_loader=loader, extra_context=None, context_processors=None, template_object_name='object', mimetype=None): """ Generic detail of an object. Templates: ``<app_label>/<model_name>_detail.html`` Context: object the object """ if extra_context is None: extra_context = {} model = queryset.model # GAE: Reuse modified lookup_object obj = lookup_object(model, object_id, slug, slug_field, queryset) if not template_name: template_name = "%s/%s_detail.html" % (model._meta.app_label, model._meta.object_name.lower()) if template_name_field: template_name_list = [getattr(obj, template_name_field), template_name] t = template_loader.select_template(template_name_list) else: t = template_loader.get_template(template_name) c = RequestContext(request, { template_object_name: obj, }, context_processors) for key, value in extra_context.items(): if callable(value): c[key] = value() else: c[key] = value response = HttpResponse(t.render(c), mimetype=mimetype) # GAE: changed last parameter to obj.key() populate_xheaders(request, response, model, obj.key()) return response
certik/chess
common/appenginepatch/appenginepatcher/generic_views/list_detail.py
Python
mit
5,261
const fs = require('fs') const path = require('path') const chai = require('chai') const sinon = require('sinon') const should = chai.should() const ConfigureService = require('../../configure') describe('configure service test', () => { describe('create service test', () => { it('should ok', () => { const service = new ConfigureService() service.should.have.property('options') service.should.have.property('serviceManager') }) it('should allow create by static method', () => { const service = ConfigureService.create() service.should.have.property('options') service.should.have.property('serviceManager') }) }) describe('init service test', () => { it('should ok', () => { const app = { env: 'development' } const serviceManager = { get: function() {} } const dirService = { CONFIG_ROOT: '/123/abc/' } const service = new ConfigureService({}, serviceManager) const sandbox = sinon.sandbox.create() sandbox.mock(serviceManager).expects('get').once().withExactArgs('directory').returns(dirService) sandbox.mock(fs).expects('existsSync').once().withExactArgs(dirService.CONFIG_ROOT).returns(true) sandbox.mock(service).expects('loadConfig').once().withExactArgs(app.env) service.init(app) sandbox.verifyAndRestore() }) it('should reject with Configure Root Path not exists', () => { const app = { env: 'development' } const serviceManager = { get: function() {} } const dirService = { CONFIG_ROOT: '/123/abc/' } const service = new ConfigureService({}, serviceManager) const sandbox = sinon.sandbox.create() sandbox.mock(serviceManager).expects('get').once().withExactArgs('directory').returns(dirService) sandbox.mock(fs).expects('existsSync').once().withExactArgs(dirService.CONFIG_ROOT).returns(false) try { service.init(app) } catch(err) { err.should.have.property('message').equal('Configure Root Path not exists') } sandbox.verifyAndRestore() }) }) describe('load config test', () => { it('should ok', () => { const service = new ConfigureService() const sandbox = sinon.sandbox.create() sandbox.stub(service, 'loadConfigFile').onFirstCall().returns({a: 1}) .onSecondCall().returns({b: 2}) sandbox.mock(service).expects('wrapConfig').withExactArgs({a: 1}, {b: 2}) service.loadConfig("development") sandbox.verifyAndRestore() }) it('should allow load config file', () => { const fileName = "test.txt" const service = new ConfigureService() const sandbox = sinon.sandbox.create() service.setConfigRoot("/a/b/c") sandbox.mock(fs).expects('readFileSync').once().withExactArgs(path.join('/a/b/c', fileName), { encoding: 'utf8' }) .returns(JSON.stringify({ a: 1 })) const ret = service.loadConfigFile(fileName) ret.should.deep.equal({ a : 1 }) }) it('should allow wrap config', () => { const arg1 = {a : 1} const arg2 = {b : 2} const service = new ConfigureService() const sandbox = sinon.sandbox.create() service.wrapConfig(arg1, arg2) }) }) describe('test getter setter', () => { it('should ok', () => { const service = new ConfigureService() const sandbox = sinon.sandbox.create() const configure = { get: function() {}, has: function() {} } sandbox.stub(service, 'getConfigRoot').returns("/a/b") sandbox.stub(service, 'loadConfig').returns(configure) sandbox.mock(configure).expects('get').withExactArgs(1) sandbox.mock(configure).expects('has').withExactArgs(2) service.init({}) service.get(1) service.has(2) sandbox.verifyAndRestore() }) }) })
ginkgojs/ginkgo
test/configure/service.test.js
JavaScript
mit
3,846
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // Les informations générales relatives à un assembly dépendent de // l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations // associées à un assembly. [assembly: AssemblyTitle("Veloose.Windows")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Veloose.Windows")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Les informations de version pour un assembly se composent des quatre valeurs suivantes : // // Version principale // Version secondaire // Numéro de build // Révision // // Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut // en utilisant '*', comme indiqué ci-dessous : // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: ComVisible(false)]
EnzoPL/Veloose
Veloose/Veloose.Windows/Properties/AssemblyInfo.cs
C#
mit
1,134
<?php namespace SimpleFileUploader; use SimpleFileUploader\Exception\UploadException; use SimpleFileUploader\Exception\FileTypeNotAllowedException; use SimpleFileUploader\Exception\DestinationNotSetException; class FileUploader { private $allowed_file_types = []; private $destination = null; private $filename; /** * Usado para informar os tipos de arquivos permitidos a serem recebidos pelo formulário. * Os tipos informados devem ser por mime type. Cada parâmetro um tipo diferente. * Exemplo: * $FileUploader->allowTypes('image/jpg', 'image/png', 'image/gif'); */ public function allowTypes() { $types = func_get_args(); $this->allowed_file_types = $types; return $this; } /** * Usado para informar o diretório para onde será enviado o arquivo recebido. * Deve ser o caminho completo. * @param string $destination o caminho completo para onde será enviado o arquivo recebido. */ public function setDestination($destination) { if(!preg_match('/[\/]$/', $destination)) $destination .= '/'; if(!is_dir($destination)) throw new \InvalidArgumentException('Diretório $destination não encontrado.'); $this->destination = $destination; } /** * Retorna o caminho do diretório para onde é enviado o arquivo recebido. */ public function getDestination() { if(empty($this->destination)) throw new DestinationNotSetException(); return $this->destination; } /** * Valida se o arquivo recebido pelo formulário é um arquivo com o tipo permitido através do método FileUploader::allowTypes() * @param array $data um array com o conteúdo da variável global $_FILES. */ private function _validateDataType($data) { if(empty($this->allowed_file_types)) return true; $finfo = new \finfo(FILEINFO_MIME_TYPE); if(!in_array($finfo->file($data['tmp_name']), $this->allowed_file_types)) throw new FileTypeNotAllowedException(); return true; } private function _validateFormDataStructure($data) { if(!isset($data['error']) and !isset($data['tmp_name'])) throw new \Exception('A estrutura dos dados do arquivo é inválida.'); } /** * Usado para informar o nome que o arquivo recebido terá após a conclusão do upload no diretório informado através de FileUploader::destination(). * @param string $filename o nome final do arquivo sem extensão. */ public function setFilename($filename) { $this->filename = $filename; } /** * Valida os dados recebidos e executa o upload. * Será feito o upload de um arquivo apenas. Se o array $_FILES é um array com informações de upload de multiplos arquivos, então essa função deve ser chamada uma vez para cada um deles. * @param array $formData as informações do arquivo enviado no formato do array $_FILES de um único arquivo. * @param string $path (opcional) o caminho para onde o arquivo deve ser enviado. Substitui o valor informado através de FileUploader::destination(). */ public function upload($formData, $path = null) { $this->_validateFormDataStructure($formData); if($formData['error'] == UPLOAD_ERR_OK) { $this->_validateDataType($formData); if (empty($path)) $path = $this->getDestination(); if (!empty($this->filename)) $filename = $this->getFilename(); else $filename = md5($formData['name'] . date('hisdmY')); $fullpathUploadedFile = $path . $filename . '.' . pathinfo($formData['name'], PATHINFO_EXTENSION); if (move_uploaded_file($formData['tmp_name'], $fullpathUploadedFile)) return $fullpathUploadedFile; } return false; } } ?>
bruno-schmidt/simple-file-uploader
src/FileUploader.php
PHP
mit
3,715
--- layout: post title: 閃燈蠻好玩的耶 date: '2011-03-08T04:35:48+08:00' tags: - 攝影 tumblr_url: http://blog.jln.co/post/3703429347/閃燈蠻好玩的耶 --- <div class="posterous_autopost"><p>剛剛再瀏覽了一下昨天在桃源仙谷拍的照片, 發現閃燈真的還蠻有趣的, 以前對閃燈的觀念完全是錯誤的, 以前只想到晚上拍照打閃燈拍起來很死白, 所以都盡可能調高ISO, 光圈, 但拍起來不是燥點多不然就是對焦點不對該清楚的不清楚, 其實該檢討自己拍的太爛啦!閃燈還真蠻好用的</p> <p><a href="http://www.flickr.com/photos/julianshen/5502048386/" title="P1040559 by Julian Shen, on Flickr"><img src="http://farm6.static.flickr.com/5217/5502048386_b4bd160edf.jpg" height="334" alt="P1040559" width="500"/></a></p> <p>這張照片其實也沒啥問題, 該清楚的清楚, 該亮的亮, 只是總覺得平平的&hellip;.後來對照到這張</p> <p><a href="http://www.flickr.com/photos/julianshen/5502055680/" title="P1040625 by Julian Shen, on Flickr"><img src="http://farm6.static.flickr.com/5013/5502055680_a2b9f3f925.jpg" height="500" alt="P1040625" width="334"/></a></p> <p>看來感覺稍稍好一點, 稍微有點立體感, 鏡頭是同一支(Pentax Super Takumar 135mm), 差別是這張有閃燈從側邊打</p> <p>真該來好好學學閃燈的用法了, 現在都還是在亂用的階段&hellip; Orz</p></div>
julianshen/myblog
_posts/tumblr/2011-03-08-閃燈蠻好玩的耶.html
HTML
mit
1,419
# Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file.
JustasTam/ESB
config/initializers/filter_parameter_logging.rb
Ruby
mit
136
/* jshint sub: true */ var url = require('url'); /** * Add custom campaign parameters to your URLs. * @module utm-builder * * @param {String} link - Original URL * @param {String} source * @param {String} medium * @param {String} campaign * @param {String} [content] * @param {String} [term] */ module.exports = function(link, source, medium, campaign, content, term) { if (!link) { throw new Error('link can not be empty'); } if (!source) { throw new Error('source can not be empty'); } if (!medium) { throw new Error('medium can not be empty'); } if (!campaign) { throw new Error('campaign can not be empty'); } var parsedLink = url.parse(link, true); parsedLink.query = parsedLink.query || {}; parsedLink.query['utm_source'] = source; parsedLink.query['utm_medium'] = medium; parsedLink.query['utm_campaign'] = campaign; if (content != null) { parsedLink.query['utm_content'] = content; } if (term != null) { parsedLink.query['utm_term'] = term; } // remove 'search' property according documentation // http://nodejs.org/api/url.html#url_url_format_urlobj delete parsedLink.search; return url.format(parsedLink); };
mahnunchik/utm-builder
index.js
JavaScript
mit
1,201
 namespace ImpactMan.Models.Menu.MenuCommands { using Enumerations.Game; using System; using Attributes; using Context.Models; using Core; using Interfaces.Core; using Microsoft.Xna.Framework.Content; public class RegisterMenuButtonMenuCommand : MenuCommand { [InjectAttribute] private MenuInitializer menuController; [InjectAttribute] private ContentManager content; public RegisterMenuButtonMenuCommand(IEngine engine) : base(engine) { } public override void Execute(User user) { base.Execute(user); this.menuController.Initialize("RegisterMenu"); this.menuController.Load(this.content); State.GameState = GameState.SignUpMenu; this.Engine.ClearCurrentUserDetails(); this.Engine.ChangeErrorMessage(String.Empty); } } }
SoftMetalicana/ImpactMan
ImpactMan/ImpactMan/Models/Menu/MenuCommands/RegisterMenuButtonMenuCommand.cs
C#
mit
935
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package robocontrol.graphinterface; import robocontrol.Connection; /** * * @author maxx */ public class graphDef extends javax.swing.JFrame { /** * Creates new form graphDef */ public graphDef(Connection conexao, graphMain father) { this.father = father; initComponents(); this.conexao = conexao; this.jTextField1.setText(conexao.ip); this.jTextField2.setText(String.valueOf(conexao.port)); } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jTextField1 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Definições"); setAlwaysOnTop(true); setBounds(new java.awt.Rectangle(100, 100, 0, 0)); setResizable(false); setType(java.awt.Window.Type.POPUP); jTextField1.setText("192.168.100.100"); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/confirm.png"))); // NOI18N jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/cancel.png"))); // NOI18N jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); jLabel2.setText(":"); jTextField2.setText("1000"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed father.setEnabled(true); this.dispose(); }//GEN-LAST:event_jButton2ActionPerformed private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed conexao.ip = this.jTextField1.getText(); conexao.port = Integer.parseInt(this.jTextField2.getText().toString()); father.setEnabled(true); this.dispose(); }//GEN-LAST:event_jButton1ActionPerformed /** * @param args the command line arguments */ private Connection conexao; private graphMain father; // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JLabel jLabel2; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; // End of variables declaration//GEN-END:variables }
thiagorogelio/RoboControl
src/robocontrol/graphinterface/graphDef.java
Java
mit
6,147
MIT License Copyright (c) 2017 Sean Zhou Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SeanZhouSiyuan/responsive-news-site-demo
LICENSE.md
Markdown
mit
1,065
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>The Box — Chapter 1 — Magic of CSS — Adam Schwartz</title> <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> <link rel="icon" href="/magic-of-css/favicon.ico"> <link rel="stylesheet" href="../../css/base.css"> <link rel="stylesheet" href="../../css/logo.css"> <link rel="stylesheet" href="../../css/chapter.css"> <script src="../../js/chapters.js"></script> </head> <body> <div class="page"> <a class="logo" href="/magic-of-css"><h1 class="the-magic-of">The Magic of CSS</h1><div class="css-rainbow"><div class="css-letter css-rainbow-c"><div class="rainbow"><div class="bands"></div></div></div><div class="css-letter css-rainbow-s css-rainbow-s-1"><div class="top-half"><div class="rainbow"><div class="bands"></div></div></div><div class="bottom-half"><div class="rainbow"><div class="bands"></div></div></div></div><div class="css-letter css-rainbow-s css-rainbow-s-2"><div class="top-half"><div class="rainbow"><div class="bands"></div></div></div><div class="bottom-half"><div class="rainbow"><div class="bands"></div></div></div></div></div></a> <div class="chapter"> <h1> <span class="number">Chapter 1</span> <span class="title">The Box</span> </h1> <h2>Box model</h2> <p>In CSS, the <a href="http://www.w3.org/TR/CSS2/box.html">box model</a><sup><a href="#cite-1">[1]</a></sup> describes the rectangular boxes that are generated for elements laid out in the page.</p> <p>Essentially, everything is a rectangle.</p> <figure> <img src="images/box-model.svg"> <figcaption> <div class="figcaption"> A picture of the box model<sup><a href="#cite-1">[1]</a></sup> </div> </figcaption> </figure> <p>Some interesting facts:</p> <ul> <li><code>border-radius</code> rounds out the corners of this box.</li> <li><code>box-shadow</code> adds a shadow to this box.</li> <li><code>outline</code> and <code>box-shadow</code> aren’t part of the box, and therefore have no effect on the layout.</li> </ul> <style> .meta-contextual-display { display: none } html[data-user-agent*="Chrome"] .meta-contextual-display, html[data-user-agent*="iPad"] .meta-contextual-display, html[data-user-agent*="iPhone"] .meta-contextual-display, html[data-user-agent*="iPod"] .meta-contextual-display { display: block } </style> <div class="meta meta-contextual-display"> <p>Quick note: most CSS properties in this textbook can be clicked to obtain contextual information. Try clicking <code>box-shadow</code>, for example.</p> </div> <h2>Box sizing</h2> <p>The <code>box-sizing</code> property gives you a little control around how boxes are sized within this model. The two possible values for <code>box-sizing</code> are <code>content-box</code> and <code>border-box</code><sup><a href="#cite-2">[2]</a></sup>.</p> <dl> <dt><code>content-box</code></dt> <dd><em>The default.</em> When computing the size of a box, padding and border are added.</dd> <dt><code>border-box</code></dt> <dd>When computing the size of a box, padding and border are folded in.</dd> </dl> <p>For example:</p> <h3>Example</h3> <p>Both of these boxes have the following CSS, but one has <code>box-sizing</code> <code>content-box</code> and the other <code>border-box</code>.</p> <div class="example-wrapper"> <style> .example-box-sizing .box { height: 5em; width: 5em; padding: 1em; border: .25em solid } </style> <pre><code>.box { height: 5em; width: 5em; padding: 1em; border: .25em solid }</code></pre> <div class="example side-by-side example-box-sizing"> <div class="left"> <p><code>content-box</code></p> <div class="example-content"> <div class="box" style="box-sizing: content-box; -moz-box-sizing: content-box"></div> </div> </div> <div class="right"> <p><code>border-box</code></p> <div class="example-content"> <div class="box" style="box-sizing: border-box; -moz-box-sizing: border-box"></div> </div> </div> </div> </div> <p>In the <code>border-box</code> case, the width and height of the <code>.box</code> are <code>5em</code>, <em>exactly what we set</em>. In the <code>content-box</code> case, the width and height are <code>7.5em = 5 + (2 * 1) + (2 * .25)</code>, since we need to include the padding and border on both sides.</p> <h3 class="magic">Flexible inputs</h3> <p>One of the benefits of using <code>border-box</code> is you can set a <code>padding</code> and <code>width</code> of <em>mixed units</em> without creating strange sizing edge cases. One fantastic use for this is creating flexible inputs with a fixed padding size.</p> <p>In the example below, our input has a specific padding in <code>em</code>s and yet we can still specify a width in <code>%</code> (<code>padding: .4em .55em</code> and <code>width: 100%</code>, respectively).</p> <div class="example-wrapper"> <style> .example-flexible-input .example-content { background: #eee } .example-flexible-input .box { background: #ccc; width: 75%; padding: 1em } .example-flexible-input .box-inner { overflow: hidden } .example-flexible-input .box-inner p:first-child { margin-top: 0 } .example-flexible-input input[type="text"] { box-sizing: border-box; width: 100%; padding: .4em .55em; font-size: inherit; font-family: inherit; color: inherit; border: 0; border-radius: .25em; outline: none } </style> <pre><code>input[type="text"] { /* Flexibility */ box-sizing: border-box; width: 100%; /* Styling */ padding: .4em .55em; font-size: inherit; font-family: inherit; color: inherit; border: 0; border-radius: .25em; outline: none }</code></pre> <div class="example example-flexible-input"> <div class="example-content"> <div class="box"> <div class="box-inner"> <p>Box</p> <input type="text" placeholder="Text input"> </div> </div> </div> <p> <input type="range" class="example-flexible-input-slider" min="20" max="100" value="75"> <span> &nbsp;&nbsp;<code>width: <span class="example-flexible-input-slider-value">75%</span></code></span> </p> <p>Adjust the box width and observe the input sizes itself perfectly within the box while maintaining a fixed padding.</p> </div> </div> <script> (function(){ var handler, slider; handler = function(e) { var width = e.target.valueAsNumber + '%'; document.querySelector('.example-flexible-input-slider-value').innerHTML = width; Array.prototype.slice.call(document.querySelectorAll('.example-flexible-input .box')).forEach(function(box){ box.style.width = width; }); }; slider = document.querySelector('.example-flexible-input-slider'); slider.addEventListener('change', handler); slider.addEventListener('input', handler); })(); </script> <h3>tl;dr</h3> <p>If you want <code>height</code> and <code>width</code> to behave in the most intuitive way, <a href="http://www.paulirish.com/2012/box-sizing-border-box-ftw/">listen to Paul Irish</a><sup><a href="#cite-3">[3]</a></sup> and put this at the top of your CSS:</p> <pre><code>html { box-sizing: border-box } *, *::before, *::after { box-sizing: inherit }</code></pre> <hr> <h3>Further reading</h3> <ul> <li><a href="http://caniuse.com/css3-boxsizing">Can I Use: CSS3 Box-sizing?</a></li> <li><a href="https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Getting_Started/Boxes">MDN: Boxes</a></li> </ul> <h3>Citations</h3> <ol> <li><a id="cite-1" href="http://www.w3.org/TR/CSS2/box.html">w3: Box model</a></li> <li><a id="cite-2" href="https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing">MDN: box-sizing</a> — There is also <code>padding-box</code>, but don’t worry about that.</li> <li><a id="cite-3" href="http://www.paulirish.com/2012/box-sizing-border-box-ftw/">Paul Irish: * { Box-sizing: Border-box } FTW</a></li> </ol> <hr> <nav class="chapter-navigation"> <a class="previous-chapter" href="../preface"> <span class="title preface-title">Preface</span> </a> <a class="next-chapter" href="../2-layout"> <span class="number">2</span> <span class="title">Layout</span> </a> </nav> </div> </div> <script src="../../js/footer.js"></script> </body> </html>
adamschwartz/magic-of-css
chapters/1-the-box/index.html
HTML
mit
11,700
%%%%%%%%%%%%%%% \begin{frame}{} \centerline{\LARGE Relation} \vspace{0.60cm} \fignocaption{width = 0.60\textwidth}{figs/wulin-relation} \centerline{燕小六: ``帮我照顾好我七舅姥爷和我外甥女''} \end{frame} %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% \begin{frame}{} \[ G = \set{(a,b): a \text{ 是}\; b \text{ 的舅姥爷}} \] \[ N = \set{(a,b): a \text{ 是}\; b \text{ 的外甥女}} \] \[ \blue{G \cup N} \] \pause \begin{columns} \column{0.30\textwidth} \begin{description} \item[``$B$''] Brother \item[``$S$''] Sister \end{description} \column{0.30\textwidth} \begin{description} \item[``$F$''] Father \item[``$M$''] Mother \end{description} \column{0.30\textwidth} \begin{description} \item[``$O$''] Son \item[``$D$''] Dau. \end{description} \end{columns} \vspace{0.80cm} \begin{columns} \column{0.50\textwidth} \pause \[ G = B \circ M \circ M \] \column{0.50\textwidth} \pause \[ N = D \circ S \] \end{columns} \pause \vspace{0.60cm} \[ \red{G = (B \circ M) \circ M = B \circ (M \circ M)} \] \end{frame} %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% \begin{frame}{} \[ R \subseteq X \times Y \] \centerline{$R$ is a relation \red{\bf from} $X$ \red{\bf to} $Y$.} \vspace{0.20cm} \[ R \subseteq X \times X \] \begin{center} $R$ is a relation \red{\bf on} $X$. \teal{\small (over)} \end{center} \end{frame} %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% \begin{frame}{} \begin{definition}[Equivalence Relation] $R$ is an \blue{equivalence relation} on $X$ if $R$ is \begin{description} \item[Reflexive:] $x R x$ \vspace{-0.30cm} \fignocaption{width = 0.20\textwidth}{figs/reflexive} \item[Symmetric:] $x R y \implies y R x$ \fignocaption{width = 0.25\textwidth}{figs/symmetric} \item[Transitive:] $x R y \land y R z \implies x R z$ \fignocaption{width = 0.30\textwidth}{figs/transitive} \end{description} \end{definition} \end{frame} %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% \begin{frame}{} \begin{definition}[Equivalence Class] \[ (X, \sim) \] The equivalence class of $x$ is a \red{\it set}: \[ E_{x} = \set{y \in X: x \sim y} \; \red{= [x]_{\sim}} \; \blue{= [x]} \] \end{definition} \end{frame} %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% \begin{frame}{} \begin{exampleblock}{Equivalence Relation (UD $10.5$)} \[ (X, \sim) \] Prove that \[ \forall x, y \in X: [x]_{\sim} = [y]_{\sim} \iff x \sim y. \] \end{exampleblock} \end{frame} %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% \begin{frame}{} \centerline{\blue{\bf Equivalence Relations/Classes as Abstractions}} \fignocaption{width = 0.25\textwidth}{figs/modulo-clock} \pause \fignocaption{width = 0.40\textwidth}{figs/conference-hall-group} \end{frame} %%%%%%%%%%%%%%% %%%%%%%%%%%%%%% \begin{frame}{} \begin{exampleblock}{Equivalence Relations/Classes on Polynomials (UD $10.8$)} \[ p(x) = a_n x^n + a_{n-1} x^{n-1} + \cdots + a_1 x^1 + a_0 \quad (a_j \in \mathbb{R}, n \in \mathbb{N}) \] \begin{enumerate}[(a)] \item \[ p \sim q \iff p(0) = q(0) \] \[ p(x) = x \] \item \[ p \sim q \iff \text{deg}(p) = \text{deg}(q) \] \[ p(x) = 3x + 5 \] \item \[ p \sim q \iff \text{deg}(p) \le \text{deg}(q) \] \[ p(x) = x^2 \] \end{enumerate} \end{exampleblock} \end{frame} %%%%%%%%%%%%%%%
hengxin/problem-solving-class-lectures
2017/2017-autumn-1st-semester/1-9-relation/1-9-relation-I/parts/relation.tex
TeX
mit
3,496
#ifndef _AI_H_ #define _AI_H_ #include "CBoard.h" #include "CMoveList.h" #include "CHashTable.h" #include "CTime.h" class AI { public: AI(CBoard& board) : m_board(board), m_nodes(), m_hashTable(), m_hashEntry(), m_moveList(), m_timeEnd(), m_pvSearch(), m_killerMove() {m_moveList.clear();} CMove find_best_move(int wTime = 0, int bTime = 0, int movesToGo = 0); private: int search(int alpha, int beta, int level, CMoveList& pv); int quiescence(int alpha, int beta, CMoveList& pv); CBoard& m_board; unsigned long m_nodes; CHashTable m_hashTable; CHashEntry m_hashEntry; CMoveList m_moveList; CTime m_timeEnd; bool m_pvSearch; CMove m_killerMove; }; // end of class AI #endif // _AI_H_
MJoergen/mchess2
ai.h
C
mit
812
function getActivityId() { return window.sessionStorage.getItem("evaluatedActivity"); } function getGroupId() { return window.sessionStorage.getItem("evaluatedGroup"); } function getTeacherId() { //TODO rimuovere questo!!!! //return window.sessionStorage.getItem(); return Share.getInstance().id; } function getPilotsite() { //TODO rimuovere questo!!!! //window.sessionStorage.setItem("pilotsite", 10); return window.sessionStorage.getItem('sessionId'); } function getActivities(pilotSite, responseHandler) { var formData = new FormData(); formData.append("func", "getActivities"); formData.append("pilotSite", pilotSite); makeAjaxCall(formData, responseHandler); } function getActivityCategories(activityId, responseHandler) { var formData = new FormData(); formData.append("func", "getActivityCategories"); formData.append("activity", activityId); formData.append("pilotSite", getPilotsite()); makeAjaxCall(formData, responseHandler); } function getCategoryCriterias(categoryId, responseHandler) { var formData = new FormData(); console.log(categoryId); console.log(getActivityId()); formData.append("func", "getCategoryCriterias"); formData.append("category", categoryId); formData.append("activity", getActivityId()); makeAjaxCall(formData, responseHandler); } function getSelfEvaluation(activityId, groupId, responseHandler) { var formData = new FormData(); formData.append("func", "getSelfEvaluation"); formData.append("activity", activityId); formData.append("group", groupId); makeAjaxCall(formData, responseHandler); } function getCategorySelfEvaluation(activityId, categoryId, groupId, responseHandler) { var formData = new FormData(); formData.append("func", "getCategorySelfEvaluation"); formData.append("activity", activityId); formData.append("category", categoryId); formData.append("group", groupId); makeAjaxCall(formData, responseHandler); } function saveSelfEvaluation(selfEvaluation, groupId, responseHandler) { var formData = new FormData(); formData.append("func", "saveSelfEvaluation"); selfEvaluation.Group = groupId; formData.append("selfEvaluation", JSON.stringify(selfEvaluation)); makeAjaxCall(formData, responseHandler); } /////TEACHER FUNC function getGroupListForEvaluation(responseHandler) { var formData = new FormData(); formData.append("func", "getGroupListForEvaluation"); formData.append("pilotSite", getPilotsite()); formData.append("teacher", getTeacherId()); makeAjaxCall(formData, responseHandler); } function submitEvaluation(evaluation, responseHandler) { var formData = new FormData(); formData.append("func", "saveEvaluation"); formData.append("evaluation", JSON.stringify(evaluation)); makeAjaxCall(formData, responseHandler); } function getActivityForEdit(activityId, responseHandler) { var formData = new FormData(); formData.append("func", "getActivityForEdit"); formData.append("activity", activityId); makeAjaxCall(formData, responseHandler); } function getAllCategories(responseHandler) { var formData = new FormData(); formData.append("func", "getAllCategories"); makeAjaxCall(formData, responseHandler); } function submitActivity(activity, responseHandler) { var formData = new FormData(); formData.append("func", "submitActivity"); formData.append("activity", JSON.stringify(activity)); makeAjaxCall(formData, responseHandler); } function submitSeleteActivity(activityId, responseHandler) { var formData = new FormData(); formData.append("func", "deleteActivity"); formData.append("activity", activityId); makeAjaxCall(formData, responseHandler); } function getEvaluatedActivities(teacherId, responseHandler) { var formData = new FormData(); formData.append("func", "getEvaluatedActivities"); formData.append("teacher", teacherId); formData.append("pilotSite", getPilotsite()); makeAjaxCall(formData, responseHandler); } function getTeachersActivities(teacherId, responseHandler) { var formData = new FormData(); formData.append("func", "getTeachersActivities"); formData.append("teacher", teacherId); formData.append("pilotSite", getPilotsite()); makeAjaxCall(formData, responseHandler); } function getSelectedActivityCriterias(activityId, categoryId, responseHandler){ var formData = new FormData(); formData.append("func", "getSelectedActivityCriterias"); formData.append("activity", activityId); formData.append("category", categoryId); makeAjaxCall(formData, responseHandler); } function getGroupEvaluationFromLearningAnalytics(groupName, responseHandler) { $.ajax({ url: 'https://cs.uef.fi/~tapanit/ecraft2learn/api/pilot_2/get_student_models_pilot_2.php', //dataType: 'text', //cache: false, //contentType: false, //processData: false, data: 'sessionId=' + getPilotsite() + '&users=' + groupName, type: 'POST', async: false, success: function (php_script_response) { responseHandler(php_script_response); } }); } function criterias(categoryId) { var formData = new FormData(); formData.append("func", "getCategortCriterias"); formData.append("category", categoryId); makeAjaxCall(formData, addActivityCriterias); } ///////// function ping(handler) { var formData = new FormData(); formData.append("func", "ping"); makeAjaxCall(formData, handler); } //var url = "http://cs.uef.fi/~ec2l/seval.php"; var url = "https://cs.uef.fi/~ec2l/selfEvaluationManager.php"; //var url = "http://localhost/php/selfEvaluationManager.php"; function makeAjaxCall(formData, handler, async = true) { //if (!handler) // handler = successHandler; $.ajax({ url: url, dataType: 'text', //cache: false, contentType: false, processData: false, data: formData, type: 'POST', async: async, success: function (php_script_response) { handler(php_script_response); }, error: (error) => { console.log(error); } }); } function successHandler(phpResult) { console.log(phpResult); }
tapanit-e/eCraft2Learn-analysis
js/SelfEvaluation/SelfEvaluationManager.js
JavaScript
mit
6,359
# encoding: UTF-8 require 'test_helper' module Smurfville class StyleguideHelperTest < ActionView::TestCase test 'foreground_color' do # dark colors assert_equal "white", foreground_color("#012123") assert_equal "white", foreground_color("#000") # bright colors assert_equal "black", foreground_color("#efefef") assert_equal "black", foreground_color("white") assert_equal "white", foreground_color("red") # non-colors # => black = default assert_equal "black", foreground_color("schmuddelgelb") assert_equal "black", foreground_color(nil) end end end
railslove/smurfville
test/unit/helpers/smurf/styleguide_helper_test.rb
Ruby
mit
634
<?php /* * This file is part of the AntiMattr Shipment Tracking Library, a library by Matthew Fitzgerald. * * (c) 2015 Matthew Fitzgerald * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace AntiMattr\ShipmentTracking\Exception; /** * @author Matthew Fitzgerald <[email protected]> */ class NotFoundException extends AbstractShipmentTrackingException { private $data; public function setData($data) { $this->data = $data; } public function getData() { return $this->data; } }
antimattr/shipment-tracking
src/AntiMattr/ShipmentTracking/Exception/NotFoundException.php
PHP
mit
625
package com.att.m2x.android.services; import android.util.Log; import com.att.m2x.android.exceptions.M2XApiException; import com.att.m2x.android.listeners.ResponseListener; import com.att.m2x.android.listeners.TypedResponseListener; import com.att.m2x.android.model.Response; import com.att.m2x.android.network.ApiV2Response; import com.att.m2x.android.services.model.LocationResult; import com.att.m2x.android.utils.ArrayUtils; import org.json.JSONException; import org.json.JSONObject; import java.text.ParseException; import java.util.Map; /** * Extracts typed values from a {@link Response} and delegates to {@link TypedResponseListener}. * Includes a few implementations. Used only in service classes */ abstract class BaseResponseListener<T> implements ResponseListener { private final TypedResponseListener<T> listener; public BaseResponseListener(TypedResponseListener<T> listener) { this.listener = listener; } @Override public void onRequestCompleted(ApiV2Response result, int requestCode) { Log.i("APIV2Response", "result.raw: "+result.getRawBody()); if (result.getStatus() >= 200 && result.getStatus() < 300) { try { T value = parseResponse(result.getJsonBody()); listener.onRequestCompleted(value); } catch (JSONException | ParseException e) { listener.onRequestException(new M2XApiException(e)); } } else { listener.onRequestError(Response.fromJsonObject(result.getJsonObject())); } } @Override public void onRequestError(ApiV2Response error, int requestCode) { Response response = null; if (error.getJsonObject() != null) { response = Response.fromJsonObject(error.getJsonObject()); } else if (error.getRaw() != null) { try { JSONObject errorJson = new JSONObject(error.getRaw()); response = Response.fromJsonObject(errorJson); } catch (JSONException e) { Log.d("APIV2Error", "Unable to parse response object"); } } if (response == null) { response = new Response(); } listener.onRequestError(response); } @Override public void onRequestException(M2XApiException exception, int requestCode) { listener.onRequestException(exception); } abstract T parseResponse(JSONObject jsonObject) throws JSONException, ParseException; static class ResponseObjectListener extends BaseResponseListener<Response> { ResponseObjectListener(TypedResponseListener<Response> listener) { super(listener); } @Override Response parseResponse(JSONObject jsonObject) throws JSONException { return Response.fromJsonObject(jsonObject); } } static class EmptyResponseListener extends BaseResponseListener<Void> { EmptyResponseListener(TypedResponseListener<Void> listener) { super(listener); } @Override Void parseResponse(JSONObject jsonObject) throws JSONException { return null; } } static class StringResponseListener extends BaseResponseListener<String> { private final String field; StringResponseListener(TypedResponseListener<String> listener, String field) { super(listener); this.field = field; } @Override String parseResponse(JSONObject jsonObject) throws JSONException { return jsonObject.getString(field); } } static class MapResponseListener extends BaseResponseListener<Map<String, String>> { public MapResponseListener(TypedResponseListener<Map<String, String>> listener) { super(listener); } @Override Map<String, String> parseResponse(JSONObject jsonObject) throws JSONException, ParseException { return ArrayUtils.jsonObjectToMap(jsonObject); } } /** * Created by collinbrown on 10/15/17. */ static class NewLocationResponseListener implements ResponseListener { private final TypedResponseListener<LocationResult> listener; NewLocationResponseListener(TypedResponseListener<LocationResult> listener) { this.listener = listener; } @Override public void onRequestCompleted(ApiV2Response result, int requestCode) { if (result.getStatus() >= 200 && result.getStatus() < 300) { listener.onRequestCompleted(LocationResult.fromApiV2Response(result)); } else { listener.onRequestError(Response.fromJsonObject(result.getJsonObject())); } } @Override public void onRequestError(ApiV2Response error, int requestCode) { Response response = null; if (error.getJsonObject() != null) { response = Response.fromJsonObject(error.getJsonObject()); } else if (error.getRaw() != null) { try { JSONObject errorJson = new JSONObject(error.getRaw()); response = Response.fromJsonObject(errorJson); } catch (JSONException e) { Log.d("APIV2Error", "Unable to parse response object"); } } if (response == null) { response = new Response(); } listener.onRequestError(response); } @Override public void onRequestException(M2XApiException exception, int requestCode) { listener.onRequestException(exception); } } }
attm2x/m2x-android
app/src/main/java/com/att/m2x/android/services/BaseResponseListener.java
Java
mit
5,725
// // MPIMixBoardViewController.h // Multipeer.Instrument // // Created by Kyle Beyer on 6/10/14. // Copyright (c) 2014 Kyle Beyer. All rights reserved. // #import <UIKit/UIKit.h> #import <AVFoundation/AVFoundation.h> @interface MPIMixBoardViewController : UITableViewController<UITableViewDataSource, UITableViewDelegate, AVAudioPlayerDelegate> @property (strong, nonatomic) IBOutlet UITableView *participantTableView; @property (weak, nonatomic) IBOutlet UITextField *nameInput; @property (weak, nonatomic) IBOutlet UILabel *timeLabel; @property (weak, nonatomic) IBOutlet UILabel *timeWithOffsetLabel; - (IBAction)discoverClicked:(id)sender; - (IBAction)advertiseChanged:(id)sender; - (IBAction)browseChanged:(id)sender; @end
kbeyer/Multipeer.Instrument
Source/MixBoardViewController.h
C
mit
737
#include "parser.hpp" #include <iostream> #include <fstream> int main(int argc, char** argv) { if(argc < 2) { std::cout << "Requires a filename\n"; return -1; } // parse the file Parser parser(argv[1]); parser.parse(); // MAGIC const Module* module = parser.getModule(); // add dump stuff here as I make tests return 0; }
bfeip/Lain
src/parser/main.cpp
C++
mit
352
<?php namespace App\Modules\SelmarinelGallery\Providers; use App; use Config; use Lang; use View; use Illuminate\Support\ServiceProvider; class SelmarinelGalleryServiceProvider extends ServiceProvider { /** * Register the SelmarinelGallery module service provider. * * @return void */ public function register() { // This service provider is a convenient place to register your modules // services in the IoC container. If you wish, you may make additional // methods or service providers to keep the code more focused and granular. App::register('App\Modules\SelmarinelGallery\Providers\RouteServiceProvider'); $this->registerNamespaces(); } /** * Register the SelmarinelGallery module resource namespaces. * * @return void */ protected function registerNamespaces() { Lang::addNamespace('selmarinel_gallery', realpath(__DIR__.'/../Resources/Lang')); View::addNamespace('selmarinel_gallery', base_path('resources/views/vendor/selmarinel_gallery')); View::addNamespace('selmarinel_gallery', realpath(__DIR__.'/../Resources/Views')); } }
Selmarinel/ivankogroup
app/Modules/SelmarinelGallery/Providers/SelmarinelGalleryServiceProvider.php
PHP
mit
1,082
// // CoverView.h // Dish by.me // // Created by 전수열 on 13. 4. 28.. // Copyright (c) 2013년 Joyfl. All rights reserved. // #import <UIKit/UIKit.h> @interface CoverView : UIImageView - (void)open; - (void)openAfterDelay:(NSTimeInterval)delay; - (void)closeCompletion:(void (^)(CoverView *coverView))completion; @end
Joyfl/Dish-by.me
Dish by.me/Views/CoverView.h
C
mit
330
exports.open = function(e){ var ua = navigator.userAgent.toLowerCase(); var isAndroid = ua.indexOf("android") > -1; var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; if(iOS){ window.location.replace('https://itunes.apple.com/app/imprint-x/id1141358425'); } else if(isAndroid){ window.location.replace('https://play.google.com/store/apps/details?id=nu.morgondag.imprintx'); } else { window.location.replace('http://store.steampowered.com/app/434310/'); } }
MorgondagDev/web-imprint-x
src/lib/open.js
JavaScript
mit
495
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <meta name="description" content="API documentation for the Rust `pathconf` fn in crate `libc`."> <meta name="keywords" content="rust, rustlang, rust-lang, pathconf"> <title>libc::pathconf - Rust</title> <link rel="stylesheet" type="text/css" href="../rustdoc.css"> <link rel="stylesheet" type="text/css" href="../main.css"> <link rel="shortcut icon" href="https://doc.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <nav class="sidebar"> <a href='../libc/index.html'><img src='https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png' alt='' width='100'></a> <p class='location'><a href='index.html'>libc</a></p><script>window.sidebarCurrent = {name: 'pathconf', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script> </nav> <nav class="sub"> <form class="search-form js-only"> <div class="search-container"> <input class="search-input" name="search" autocomplete="off" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"> </div> </form> </nav> <section id='main' class="content fn"> <h1 class='fqn'><span class='in-band'><a href='index.html'>libc</a>::<wbr><a class='fn' href=''>pathconf</a></span><span class='out-of-band'><span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> [<span class='inner'>&#x2212;</span>] </a> </span><a id='src-540' class='srclink' href='../src/libc/unix/mod.rs.html#295' title='goto source code'>[src]</a></span></h1> <pre class='rust fn'>pub unsafe extern fn pathconf(path: <a class='primitive' href='https://doc.rust-lang.org/nightly/std/primitive.pointer.html'>*const <a class='type' href='../libc/type.c_char.html' title='libc::c_char'>c_char</a></a>, name: <a class='type' href='../libc/type.c_int.html' title='libc::c_int'>c_int</a>) -&gt; <a class='type' href='../libc/type.c_long.html' title='libc::c_long'>c_long</a></pre></section> <section id='search' class="content hidden"></section> <section class="footer"></section> <aside id="help" class="hidden"> <div> <h1 class="hidden">Help</h1> <div class="shortcuts"> <h2>Keyboard Shortcuts</h2> <dl> <dt>?</dt> <dd>Show this help dialog</dd> <dt>S</dt> <dd>Focus the search field</dd> <dt>&larrb;</dt> <dd>Move up in search results</dd> <dt>&rarrb;</dt> <dd>Move down in search results</dd> <dt>&#9166;</dt> <dd>Go to active search result</dd> </dl> </div> <div class="infos"> <h2>Search Tricks</h2> <p> Prefix searches with a type followed by a colon (e.g. <code>fn:</code>) to restrict the search to a given type. </p> <p> Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>. </p> <p> Search functions by type signature (e.g. <code>vec -> usize</code>) </p> </div> </div> </aside> <script> window.rootPath = "../"; window.currentCrate = "libc"; window.playgroundUrl = ""; </script> <script src="../jquery.js"></script> <script src="../main.js"></script> <script defer src="../search-index.js"></script> </body> </html>
ebfull/ebfull.github.io
pcap/libc/fn.pathconf.html
HTML
mit
4,341