code
stringlengths 3
1.01M
| repo_name
stringlengths 5
116
| path
stringlengths 3
311
| language
stringclasses 30
values | license
stringclasses 15
values | size
int64 3
1.01M
|
|---|---|---|---|---|---|
/***
* * WHAT
* * Exported functions from debug.cc
* * FILE
* * $Source:$
* * COPYRIGHT
* * (C) Kyushu University
***/
#ifndef __freevars_h__
#define __freevars_h__
/*****************************************************************************/
/** free.vdm *****************************************************************/
/*****************************************************************************/
#include "semvalues.h"
class Free {
public:
static SET<TYPE_AS_Name> IdentInPattern (const TYPE_AS_PatternBind &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInExpr (
const TYPE_AS_Expr &,
const SET<TYPE_AS_Name> &);
static TYPE_SEM_BlkEnv FreeMapToBlkEnv (const MAP<TYPE_AS_Name, TYPE_SEM_VAL> &);
private:
static SET<TYPE_AS_Name> eset;
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> emap;
static SET<TYPE_AS_Name> IdentInBind (const TYPE_AS_Bind &);
static SET<TYPE_AS_Name> IdentInMultBind (const TYPE_AS_MultBind &);
static SET<TYPE_AS_Name> IdentInMultBindSeq (const SEQ<TYPE_AS_MultBind> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInBind (
const TYPE_AS_Bind &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInMultBindSeq (
const SEQ<TYPE_AS_MultBind> &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInDefExpr (
const TYPE_AS_DefExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInLetExpr (
const TYPE_AS_LetExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInFnDef (
const TYPE_AS_FnDef &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInPreExpr (
const Generic &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInPostExpr (
const Generic &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInLetBeSTExpr (
const TYPE_AS_LetBeSTExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInIfExpr (
const TYPE_AS_IfExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInElseifExpr (
const SEQ<TYPE_AS_ElseifExpr> &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInCasesExpr (
const TYPE_AS_CasesExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInPrefixExpr (
const TYPE_AS_PrefixExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInBinaryExpr (
const TYPE_AS_BinaryExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInAllOrExistsExpr (
const TYPE_AS_AllOrExistsExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInExistsUniqueExpr (
const TYPE_AS_ExistsUniqueExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInSetEnumerationExpr (
const TYPE_AS_SetEnumerationExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInSetComprehensionExpr (
const TYPE_AS_SetComprehensionExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInSetRangeExpr (
const TYPE_AS_SetRangeExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInSeqEnumerationExpr (
const TYPE_AS_SeqEnumerationExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInSeqComprehensionExpr (
const TYPE_AS_SeqComprehensionExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInSubSequenceExpr (
const TYPE_AS_SubSequenceExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInSeqModifyMapOverrideExpr (
const TYPE_AS_SeqModifyMapOverrideExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInMapEnumerationExpr (
const TYPE_AS_MapEnumerationExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInMapComprehensionExpr (
const TYPE_AS_MapComprehensionExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInTupleConstructorExpr (
const TYPE_AS_TupleConstructorExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInRecordConstructorExpr (
const TYPE_AS_RecordConstructorExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInRecordModifierExpr (
const TYPE_AS_RecordModifierExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInTokenConstructorExpr(
const TYPE_AS_TokenConstructorExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInTupleSelectExpr(
const TYPE_AS_TupleSelectExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInTypeJudgementExpr(
const TYPE_AS_TypeJudgementExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInPreConditionApplyExpr(
const TYPE_AS_PreConditionApplyExpr &,
const SET<TYPE_AS_Name>&);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInApplyExpr (
const TYPE_AS_ApplyExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInLambdaExpr (
const TYPE_AS_LambdaExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInFieldSelectExpr (
const TYPE_AS_FieldSelectExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInFctTypeInstExpr (
const TYPE_AS_FctTypeInstExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInIsExpr (
const TYPE_AS_IsExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInNarrowExpr (
const TYPE_AS_NarrowExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInName (
const TYPE_AS_Name &,
const SET<TYPE_AS_Name> &);
#ifdef VDMSL
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInOldName (
const TYPE_AS_OldName &,
const SET<TYPE_AS_Name> &);
#endif //VDMSL
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInBracketedExpr (
const TYPE_AS_BracketedExpr &,
const SET<TYPE_AS_Name> &);
static MAP<TYPE_AS_Name, TYPE_SEM_VAL> FreeInIotaExpr (
const TYPE_AS_IotaExpr & IotaE,
const SET<TYPE_AS_Name> & id_s);
static Generic LookUpInTopEnv (const TYPE_AS_Name &);
};
#endif // __freevars_h__
// Force emacs to use C++ mode for this file.
//// Local Variables:
//// mode: c++
//// End:
|
vdmtools/vdmtools
|
code/eval/freevars.h
|
C
|
gpl-3.0
| 9,862
|
/* +---------------------------------------------------------------------------+
| The Mobile Robot Programming Toolkit (MRPT) C++ library |
| |
| http://www.mrpt.org/ |
| |
| Copyright (C) 2005-2011 University of Malaga |
| |
| This software was written by the Machine Perception and Intelligent |
| Robotics Lab, University of Malaga (Spain). |
| Contact: Jose-Luis Blanco <jlblanco@ctima.uma.es> |
| |
| This file is part of the MRPT project. |
| |
| MRPT is free software: you can redistribute it and/or modify |
| it under the terms of the GNU General Public License as published by |
| the Free Software Foundation, either version 3 of the License, or |
| (at your option) any later version. |
| |
| MRPT is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| GNU General Public License for more details. |
| |
| You should have received a copy of the GNU General Public License |
| along with MRPT. If not, see <http://www.gnu.org/licenses/>. |
| |
+---------------------------------------------------------------------------+ */
/*---------------------------------------------------------------
APPLICATION: Camera calibration GUI
AUTHOR: Jose Luis Blanco, based on code from the OpenCV library.
---------------------------------------------------------------*/
#include "camera_calib_guiMain.h"
#include "CDlgCalibWizardOnline.h"
//(*InternalHeaders(camera_calib_guiDialog)
#include <wx/settings.h>
#include <wx/font.h>
#include <wx/intl.h>
#include <wx/string.h>
//*)
#include <wx/filedlg.h>
#include <wx/msgdlg.h>
#include <wx/progdlg.h>
#include <mrpt/gui/WxUtils.h>
using namespace mrpt;
using namespace mrpt::utils;
using namespace mrpt::vision;
using namespace mrpt::gui;
using namespace std;
#include "../wx-common/CMyRedirector.h"
#include "CAboutBox.h"
#define USE_EXTERNAL_STORAGE_IMGS 1
// VARIABLES ================================
TCalibrationImageList lst_images; // Here are all the images: file_name -> data
mrpt::utils::TCamera camera_params;
// END VARIABLES ============================
#include "imgs/icono_main.xpm"
#include "../wx-common/mrpt_logo.xpm"
// A custom Art provider for customizing the icons:
class MyArtProvider : public wxArtProvider
{
protected:
virtual wxBitmap CreateBitmap(const wxArtID& id,
const wxArtClient& client,
const wxSize& size);
};
// CreateBitmap function
wxBitmap MyArtProvider::CreateBitmap(const wxArtID& id,
const wxArtClient& client,
const wxSize& size)
{
if (id == wxART_MAKE_ART_ID(MAIN_ICON)) return wxBitmap(icono_main_xpm);
if (id == wxART_MAKE_ART_ID(IMG_MRPT_LOGO)) return wxBitmap(mrpt_logo_xpm);
// Any wxWidgets icons not implemented here
// will be provided by the default art provider.
return wxNullBitmap;
}
//(*IdInit(camera_calib_guiDialog)
const long camera_calib_guiDialog::ID_BUTTON8 = wxNewId();
const long camera_calib_guiDialog::ID_BUTTON1 = wxNewId();
const long camera_calib_guiDialog::ID_BUTTON2 = wxNewId();
const long camera_calib_guiDialog::ID_BUTTON9 = wxNewId();
const long camera_calib_guiDialog::ID_LISTBOX1 = wxNewId();
const long camera_calib_guiDialog::ID_STATICTEXT5 = wxNewId();
const long camera_calib_guiDialog::ID_CHOICE1 = wxNewId();
const long camera_calib_guiDialog::ID_STATICTEXT1 = wxNewId();
const long camera_calib_guiDialog::ID_SPINCTRL1 = wxNewId();
const long camera_calib_guiDialog::ID_STATICTEXT2 = wxNewId();
const long camera_calib_guiDialog::ID_SPINCTRL2 = wxNewId();
const long camera_calib_guiDialog::ID_RADIOBOX1 = wxNewId();
const long camera_calib_guiDialog::ID_STATICTEXT3 = wxNewId();
const long camera_calib_guiDialog::ID_TEXTCTRL1 = wxNewId();
const long camera_calib_guiDialog::ID_STATICTEXT6 = wxNewId();
const long camera_calib_guiDialog::ID_TEXTCTRL3 = wxNewId();
const long camera_calib_guiDialog::ID_CHECKBOX1 = wxNewId();
const long camera_calib_guiDialog::ID_TEXTCTRL2 = wxNewId();
const long camera_calib_guiDialog::ID_BUTTON3 = wxNewId();
const long camera_calib_guiDialog::ID_BUTTON6 = wxNewId();
const long camera_calib_guiDialog::ID_BUTTON7 = wxNewId();
const long camera_calib_guiDialog::ID_BUTTON5 = wxNewId();
const long camera_calib_guiDialog::ID_BUTTON4 = wxNewId();
const long camera_calib_guiDialog::ID_CUSTOM2 = wxNewId();
const long camera_calib_guiDialog::ID_SCROLLEDWINDOW2 = wxNewId();
const long camera_calib_guiDialog::ID_PANEL2 = wxNewId();
const long camera_calib_guiDialog::ID_CUSTOM1 = wxNewId();
const long camera_calib_guiDialog::ID_SCROLLEDWINDOW3 = wxNewId();
const long camera_calib_guiDialog::ID_PANEL3 = wxNewId();
const long camera_calib_guiDialog::ID_XY_GLCANVAS = wxNewId();
const long camera_calib_guiDialog::ID_PANEL1 = wxNewId();
const long camera_calib_guiDialog::ID_NOTEBOOK1 = wxNewId();
//*)
BEGIN_EVENT_TABLE(camera_calib_guiDialog,wxDialog)
//(*EventTable(camera_calib_guiDialog)
//*)
END_EVENT_TABLE()
camera_calib_guiDialog::camera_calib_guiDialog(wxWindow* parent,wxWindowID id)
{
// Load my custom icons:
#if wxCHECK_VERSION(2, 8, 0)
wxArtProvider::Push(new MyArtProvider);
#else
wxArtProvider::PushProvider(new MyArtProvider);
#endif
//(*Initialize(camera_calib_guiDialog)
wxStaticBoxSizer* StaticBoxSizer2;
wxFlexGridSizer* FlexGridSizer4;
wxFlexGridSizer* FlexGridSizer16;
wxStaticBoxSizer* StaticBoxSizer4;
wxFlexGridSizer* FlexGridSizer10;
wxFlexGridSizer* FlexGridSizer3;
wxFlexGridSizer* FlexGridSizer5;
wxFlexGridSizer* FlexGridSizer9;
wxFlexGridSizer* FlexGridSizer2;
wxFlexGridSizer* FlexGridSizer7;
wxStaticBoxSizer* StaticBoxSizer3;
wxFlexGridSizer* FlexGridSizer15;
wxFlexGridSizer* FlexGridSizer18;
wxFlexGridSizer* FlexGridSizer8;
wxFlexGridSizer* FlexGridSizer13;
wxFlexGridSizer* FlexGridSizer12;
wxFlexGridSizer* FlexGridSizer6;
wxStaticBoxSizer* StaticBoxSizer1;
wxFlexGridSizer* FlexGridSizer1;
wxFlexGridSizer* FlexGridSizer17;
wxStaticBoxSizer* StaticBoxSizer5;
Create(parent, id, _("Camera calibration GUI - Part of the MRPT project"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxMAXIMIZE_BOX, _T("id"));
FlexGridSizer1 = new wxFlexGridSizer(1, 2, 0, 0);
FlexGridSizer1->AddGrowableCol(1);
FlexGridSizer1->AddGrowableRow(0);
FlexGridSizer2 = new wxFlexGridSizer(3, 1, 0, 0);
FlexGridSizer2->AddGrowableCol(0);
FlexGridSizer2->AddGrowableRow(0);
FlexGridSizer2->AddGrowableRow(2);
StaticBoxSizer1 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("List of images"));
FlexGridSizer4 = new wxFlexGridSizer(2, 1, 0, 0);
FlexGridSizer4->AddGrowableCol(0);
FlexGridSizer4->AddGrowableRow(1);
FlexGridSizer5 = new wxFlexGridSizer(0, 4, 0, 0);
btnCaptureNow = new wxButton(this, ID_BUTTON8, _("Grab now..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON8"));
wxFont btnCaptureNowFont(wxDEFAULT,wxDEFAULT,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
btnCaptureNow->SetFont(btnCaptureNowFont);
FlexGridSizer5->Add(btnCaptureNow, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
Button11 = new wxButton(this, ID_BUTTON1, _("Add image(s)..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
FlexGridSizer5->Add(Button11, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
Button22 = new wxButton(this, ID_BUTTON2, _("Clear all"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
FlexGridSizer5->Add(Button22, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
btnSaveImages = new wxButton(this, ID_BUTTON9, _("Save all..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON9"));
btnSaveImages->Disable();
FlexGridSizer5->Add(btnSaveImages, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer4->Add(FlexGridSizer5, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer15 = new wxFlexGridSizer(1, 2, 0, 0);
FlexGridSizer15->AddGrowableCol(0);
FlexGridSizer15->AddGrowableRow(0);
lbFiles = new wxListBox(this, ID_LISTBOX1, wxDefaultPosition, wxSize(294,84), 0, 0, wxLB_ALWAYS_SB|wxVSCROLL|wxHSCROLL|wxALWAYS_SHOW_SB, wxDefaultValidator, _T("ID_LISTBOX1"));
FlexGridSizer15->Add(lbFiles, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer16 = new wxFlexGridSizer(0, 1, 0, 0);
StaticText5 = new wxStaticText(this, ID_STATICTEXT5, _("Zoom:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT5"));
FlexGridSizer16->Add(StaticText5, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
cbZoom = new wxChoice(this, ID_CHOICE1, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE1"));
cbZoom->Append(_("25%"));
cbZoom->Append(_("50%"));
cbZoom->Append(_("75%"));
cbZoom->SetSelection( cbZoom->Append(_("100%")) );
cbZoom->Append(_("150%"));
cbZoom->Append(_("200%"));
cbZoom->Append(_("300%"));
cbZoom->Append(_("400%"));
cbZoom->Append(_("500%"));
FlexGridSizer16->Add(cbZoom, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer15->Add(FlexGridSizer16, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer4->Add(FlexGridSizer15, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
StaticBoxSizer1->Add(FlexGridSizer4, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer2->Add(StaticBoxSizer1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
StaticBoxSizer3 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Checkerboard detection parameters"));
FlexGridSizer6 = new wxFlexGridSizer(2, 2, 0, 0);
FlexGridSizer6->AddGrowableCol(0);
FlexGridSizer6->AddGrowableCol(1);
StaticBoxSizer4 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Number of inner corners: "));
FlexGridSizer17 = new wxFlexGridSizer(1, 4, 0, 0);
StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("In X:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
FlexGridSizer17->Add(StaticText1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
edSizeX = new wxSpinCtrl(this, ID_SPINCTRL1, _T("5"), wxDefaultPosition, wxSize(50,-1), 0, 1, 200, 5, _T("ID_SPINCTRL1"));
edSizeX->SetValue(_T("5"));
FlexGridSizer17->Add(edSizeX, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticText2 = new wxStaticText(this, ID_STATICTEXT2, _("In Y:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
FlexGridSizer17->Add(StaticText2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
edSizeY = new wxSpinCtrl(this, ID_SPINCTRL2, _T("8"), wxDefaultPosition, wxSize(50,-1), 0, 1, 200, 8, _T("ID_SPINCTRL2"));
edSizeY->SetValue(_T("8"));
FlexGridSizer17->Add(edSizeY, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer4->Add(FlexGridSizer17, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer6->Add(StaticBoxSizer4, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
wxString __wxRadioBoxChoices_1[2] =
{
_("OpenCV\'s default"),
_("Scaramuzza et al.\'s")
};
rbMethod = new wxRadioBox(this, ID_RADIOBOX1, _(" Detector method: "), wxDefaultPosition, wxDefaultSize, 2, __wxRadioBoxChoices_1, 1, 0, wxDefaultValidator, _T("ID_RADIOBOX1"));
FlexGridSizer6->Add(rbMethod, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
StaticBoxSizer5 = new wxStaticBoxSizer(wxHORIZONTAL, this, _(" Size of quads (in mm): "));
FlexGridSizer18 = new wxFlexGridSizer(1, 4, 0, 0);
StaticText3 = new wxStaticText(this, ID_STATICTEXT3, _("In X:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT3"));
FlexGridSizer18->Add(StaticText3, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
edLengthX = new wxTextCtrl(this, ID_TEXTCTRL1, _("40.0"), wxDefaultPosition, wxSize(40,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL1"));
FlexGridSizer18->Add(edLengthX, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticText6 = new wxStaticText(this, ID_STATICTEXT6, _("In Y:"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT6"));
FlexGridSizer18->Add(StaticText6, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
edLengthY = new wxTextCtrl(this, ID_TEXTCTRL3, _("40.0"), wxDefaultPosition, wxSize(40,-1), 0, wxDefaultValidator, _T("ID_TEXTCTRL3"));
FlexGridSizer18->Add(edLengthY, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer5->Add(FlexGridSizer18, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer6->Add(StaticBoxSizer5, 1, wxALL|wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL, 2);
cbNormalize = new wxCheckBox(this, ID_CHECKBOX1, _("Normalize image"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHECKBOX1"));
cbNormalize->SetValue(true);
FlexGridSizer6->Add(cbNormalize, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
StaticBoxSizer3->Add(FlexGridSizer6, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer2->Add(StaticBoxSizer3, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
StaticBoxSizer2 = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Calibration"));
FlexGridSizer7 = new wxFlexGridSizer(2, 1, 0, 0);
FlexGridSizer7->AddGrowableCol(0);
FlexGridSizer7->AddGrowableRow(0);
FlexGridSizer9 = new wxFlexGridSizer(1, 1, 0, 0);
FlexGridSizer9->AddGrowableCol(0);
FlexGridSizer9->AddGrowableRow(0);
txtLog = new wxTextCtrl(this, ID_TEXTCTRL2, _("(Calibration results)"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxVSCROLL, wxDefaultValidator, _T("ID_TEXTCTRL2"));
wxFont txtLogFont = wxSystemSettings::GetFont(wxSYS_OEM_FIXED_FONT);
if ( !txtLogFont.Ok() ) txtLogFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
txtLogFont.SetPointSize(9);
txtLog->SetFont(txtLogFont);
FlexGridSizer9->Add(txtLog, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer7->Add(FlexGridSizer9, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer8 = new wxFlexGridSizer(2, 3, 0, 0);
FlexGridSizer8->AddGrowableCol(0);
FlexGridSizer8->AddGrowableCol(1);
btnRunCalib = new wxButton(this, ID_BUTTON3, _("Calibrate"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
btnRunCalib->SetDefault();
wxFont btnRunCalibFont(wxDEFAULT,wxDEFAULT,wxFONTSTYLE_NORMAL,wxBOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
btnRunCalib->SetFont(btnRunCalibFont);
FlexGridSizer8->Add(btnRunCalib, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
btnSave = new wxButton(this, ID_BUTTON6, _("Save matrices..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON6"));
FlexGridSizer8->Add(btnSave, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer8->Add(-1,-1,1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
btnManualRect = new wxButton(this, ID_BUTTON7, _("Manual params..."), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON7"));
FlexGridSizer8->Add(btnManualRect, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
btnAbout = new wxButton(this, ID_BUTTON5, _("About"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON5"));
FlexGridSizer8->Add(btnAbout, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
btnClose = new wxButton(this, ID_BUTTON4, _("Quit"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON4"));
FlexGridSizer8->Add(btnClose, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
FlexGridSizer7->Add(FlexGridSizer8, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
StaticBoxSizer2->Add(FlexGridSizer7, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer2->Add(StaticBoxSizer2, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
FlexGridSizer1->Add(FlexGridSizer2, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
FlexGridSizer3 = new wxFlexGridSizer(1, 1, 0, 0);
FlexGridSizer3->AddGrowableCol(0);
FlexGridSizer3->AddGrowableRow(0);
Notebook1 = new wxNotebook(this, ID_NOTEBOOK1, wxDefaultPosition, wxSize(719,570), 0, _T("ID_NOTEBOOK1"));
Panel2 = new wxPanel(Notebook1, ID_PANEL2, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL2"));
FlexGridSizer13 = new wxFlexGridSizer(1, 1, 0, 0);
FlexGridSizer13->AddGrowableCol(0);
FlexGridSizer13->AddGrowableRow(0);
ScrolledWindow2 = new wxScrolledWindow(Panel2, ID_SCROLLEDWINDOW2, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL, _T("ID_SCROLLEDWINDOW2"));
FlexGridSizer11 = new wxFlexGridSizer(0, 1, 0, 0);
FlexGridSizer11->AddGrowableCol(0);
FlexGridSizer11->AddGrowableRow(0);
bmpOriginal = new mrpt::gui::wxMRPTImageControl(ScrolledWindow2,ID_CUSTOM2,wxDefaultPosition.x,wxDefaultPosition.y,wxSize(640,480).GetWidth(), wxSize(640,480).GetHeight() );
FlexGridSizer11->Add(bmpOriginal, 1, wxALL|wxALIGN_LEFT|wxALIGN_TOP, 0);
ScrolledWindow2->SetSizer(FlexGridSizer11);
FlexGridSizer11->Fit(ScrolledWindow2);
FlexGridSizer11->SetSizeHints(ScrolledWindow2);
FlexGridSizer13->Add(ScrolledWindow2, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
Panel2->SetSizer(FlexGridSizer13);
FlexGridSizer13->Fit(Panel2);
FlexGridSizer13->SetSizeHints(Panel2);
Panel3 = new wxPanel(Notebook1, ID_PANEL3, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL3"));
FlexGridSizer10 = new wxFlexGridSizer(1, 1, 0, 0);
FlexGridSizer10->AddGrowableCol(0);
FlexGridSizer10->AddGrowableRow(0);
ScrolledWindow3 = new wxScrolledWindow(Panel3, ID_SCROLLEDWINDOW3, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL, _T("ID_SCROLLEDWINDOW3"));
FlexGridSizer14 = new wxFlexGridSizer(1, 1, 0, 0);
FlexGridSizer14->AddGrowableCol(0);
FlexGridSizer14->AddGrowableRow(0);
bmpRectified = new mrpt::gui::wxMRPTImageControl(ScrolledWindow3,ID_CUSTOM1,wxDefaultPosition.x,wxDefaultPosition.y,wxSize(640,480).GetWidth(), wxSize(640,480).GetHeight() );
FlexGridSizer14->Add(bmpRectified, 1, wxALL|wxALIGN_LEFT|wxALIGN_TOP, 0);
ScrolledWindow3->SetSizer(FlexGridSizer14);
FlexGridSizer14->Fit(ScrolledWindow3);
FlexGridSizer14->SetSizeHints(ScrolledWindow3);
FlexGridSizer10->Add(ScrolledWindow3, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
Panel3->SetSizer(FlexGridSizer10);
FlexGridSizer10->Fit(Panel3);
FlexGridSizer10->SetSizeHints(Panel3);
Panel1 = new wxPanel(Notebook1, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
FlexGridSizer12 = new wxFlexGridSizer(1, 1, 0, 0);
FlexGridSizer12->AddGrowableCol(0);
FlexGridSizer12->AddGrowableRow(0);
m_3Dview = new CMyGLCanvas(Panel1,ID_XY_GLCANVAS,wxDefaultPosition,wxSize(-1,300),wxTAB_TRAVERSAL,_T("ID_XY_GLCANVAS"));
FlexGridSizer12->Add(m_3Dview, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
Panel1->SetSizer(FlexGridSizer12);
FlexGridSizer12->Fit(Panel1);
FlexGridSizer12->SetSizeHints(Panel1);
Notebook1->AddPage(Panel2, _("Original Image"), false);
Notebook1->AddPage(Panel3, _("Rectified image and reprojected points"), true);
Notebook1->AddPage(Panel1, _("3D view"), false);
FlexGridSizer3->Add(Notebook1, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 2);
FlexGridSizer1->Add(FlexGridSizer3, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
SetSizer(FlexGridSizer1);
FlexGridSizer1->Fit(this);
FlexGridSizer1->SetSizeHints(this);
Connect(ID_BUTTON8,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&camera_calib_guiDialog::OnbtnCaptureNowClick);
Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&camera_calib_guiDialog::OnAddImage);
Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&camera_calib_guiDialog::OnListClear);
Connect(ID_BUTTON9,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&camera_calib_guiDialog::OnbtnSaveImagesClick);
Connect(ID_LISTBOX1,wxEVT_COMMAND_LISTBOX_SELECTED,(wxObjectEventFunction)&camera_calib_guiDialog::OnlbFilesSelect);
Connect(ID_CHOICE1,wxEVT_COMMAND_CHOICE_SELECTED,(wxObjectEventFunction)&camera_calib_guiDialog::OncbZoomSelect);
Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&camera_calib_guiDialog::OnbtnRunCalibClick);
Connect(ID_BUTTON6,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&camera_calib_guiDialog::OnbtnSaveClick);
Connect(ID_BUTTON7,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&camera_calib_guiDialog::OnbtnManualRectClick);
Connect(ID_BUTTON5,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&camera_calib_guiDialog::OnbtnAboutClick);
Connect(ID_BUTTON4,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&camera_calib_guiDialog::OnbtnCloseClick);
//*)
camera_params.intrinsicParams(0,0) = 0; // Indicate calib didn't run yet.
wxIcon icon;
icon.CopyFromBitmap( wxBitmap(wxImage( icono_main_xpm )) );
this->SetIcon( icon );
this->show3Dview(); // Empty 3D scene
Center();
this->SetTitle( _U( format("Camera calibration %s - Part of the MRPT project",CAMERA_CALIB_GUI_VERSION).c_str() ) );
Maximize();
}
camera_calib_guiDialog::~camera_calib_guiDialog()
{
//(*Destroy(camera_calib_guiDialog)
//*)
this->clearListImages();
}
// Ask the user for new files to add to the list:
void camera_calib_guiDialog::OnAddImage(wxCommandEvent& event)
{
try
{
wxFileDialog dlg(
this,
_("Select image(s) to open"),
_("."),
_(""),
_("Image files (*.bmp;*.png;*.jpg)|*.bmp;*.png;*.jpg|All files (*.*)|*.*"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_MULTIPLE | wxFD_PREVIEW );
if (wxID_OK!=dlg.ShowModal()) return;
wxBusyCursor waitcur;
wxArrayString files;
dlg.GetPaths(files);
wxProgressDialog progDia(
wxT("Adding image files"),
wxT("Processing..."),
files.Count() , // range
this, // parent
wxPD_CAN_ABORT |
wxPD_APP_MODAL |
wxPD_SMOOTH |
wxPD_AUTO_HIDE |
wxPD_ELAPSED_TIME |
wxPD_ESTIMATED_TIME |
wxPD_REMAINING_TIME);
wxTheApp->Yield(); // Let the app. process messages
int counter_loops=0;
for (unsigned int i=0;i<files.Count();i++)
{
if (counter_loops++ % 5 == 0)
{
if (!progDia.Update( i ))
break;
wxTheApp->Yield(); // Let the app. process messages
}
const string fil = string(files[i].mb_str());
TImageCalibData dat;
#if USE_EXTERNAL_STORAGE_IMGS
// Optimization: Use external storage:
// ---------------------------------------
//string tmp_check = mrpt::system::getTempFileName()+".jpg";
//string tmp_rectified = mrpt::system::getTempFileName()+".jpg";
//dat.img_original.saveToFile(tmp_check);
//dat.img_original.saveToFile(tmp_rectified);
// mark all imgs. as external storage:
dat.img_original.setExternalStorage(fil);
//dat.img_checkboard.setExternalStorage(tmp_check);
//dat.img_rectified.setExternalStorage(tmp_rectified);
dat.img_original.unload();
//dat.img_checkboard.unload();
//dat.img_rectified.unload();
#else
// All in memory:
if (!dat.img_original.loadFromFile(fil))
{
wxMessageBox(_U(format("Error loading file: %s",fil.c_str()).c_str()), _("Error"));
this->updateListOfImages();
return;
}
#endif
lst_images[fil] = dat;
}
this->updateListOfImages();
}
catch(std::exception &e)
{
wxMessageBox(_U(e.what()),_("Error"),wxICON_INFORMATION,this);
}
}
void camera_calib_guiDialog::clearListImages()
{
lst_images.clear();
}
// Clear list of images.
void camera_calib_guiDialog::OnListClear(wxCommandEvent& event)
{
this->clearListImages();
this->updateListOfImages();
}
void camera_calib_guiDialog::OnbtnRunCalibClick(wxCommandEvent& event)
{
try
{
txtLog->Clear();
CMyRedirector redire(txtLog, true, 10);
const unsigned int check_size_x = edSizeX->GetValue();
const unsigned int check_size_y = edSizeY->GetValue();
const double check_squares_length_X_meters = 0.001 * atof( string(edLengthX->GetValue().mb_str()).c_str() );
const double check_squares_length_Y_meters = 0.001 * atof( string(edLengthY->GetValue().mb_str()).c_str() );
const bool normalize_image = cbNormalize->GetValue();
const bool useScaramuzzaAlternativeDetector = rbMethod->GetSelection() == 1;
wxBusyCursor waitcur;
bool res = mrpt::vision::checkerBoardCameraCalibration(
lst_images,
check_size_x,
check_size_y,
check_squares_length_X_meters,
check_squares_length_Y_meters,
camera_params,
normalize_image,
NULL /* MSE */,
false /* skip draw */,
useScaramuzzaAlternativeDetector);
refreshDisplayedImage();
if (!res)
wxMessageBox(_("Calibration finished with error: Please check the text log to see what's wrong"), _("Error"));
if (res)
show3Dview();
}
catch(std::exception &e)
{
wxMessageBox(_U(e.what()),_("Error"),wxICON_INFORMATION,this);
}
}
void camera_calib_guiDialog::OnbtnCloseClick(wxCommandEvent& event)
{
Close();
}
void camera_calib_guiDialog::OnbtnAboutClick(wxCommandEvent& event)
{
CAboutBox dlg(this);
dlg.ShowModal();
}
// save matrices:
void camera_calib_guiDialog::OnbtnSaveClick(wxCommandEvent& event)
{
if (camera_params.intrinsicParams(0,0)==0)
{
wxMessageBox(_("Run the calibration first"),_("Error"));
return;
}
{
wxFileDialog dlg(
this,
_("Save intrinsic parameters matrix"),
_("."),
_("intrinsic_matrix.txt"),
_("Text files (*.txt)|*.txt|All files (*.*)|*.*"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if (wxID_OK!=dlg.ShowModal()) return;
camera_params.intrinsicParams.saveToTextFile( string(dlg.GetPath().mb_str()) );
}
{
wxFileDialog dlg(
this,
_("Save distortion parameters"),
_("."),
_("distortion_matrix.txt"),
_("Text files (*.txt)|*.txt|All files (*.*)|*.*"),
wxFD_SAVE | wxFD_OVERWRITE_PROMPT );
if (wxID_OK!=dlg.ShowModal()) return;
CMatrixDouble M(1,4);
for (unsigned i=0;i<4;i++)
M(0,i) = camera_params.dist[i];
M.saveToTextFile( string(dlg.GetPath().mb_str()) );
}
}
// Update the listbox from lst_img_files
void camera_calib_guiDialog::updateListOfImages()
{
lbFiles->Clear();
for (TCalibrationImageList::iterator s=lst_images.begin();s!=lst_images.end();++s)
lbFiles->Append(_U(s->first.c_str()));
btnSaveImages->Enable( !lst_images.empty() );
refreshDisplayedImage();
}
// Shows the image selected in the listbox:
void camera_calib_guiDialog::refreshDisplayedImage()
{
try
{
if (!lbFiles->GetCount())
{
// No images:
return;
}
// Assure there's one selected:
if (lbFiles->GetSelection()==wxNOT_FOUND)
lbFiles->SetSelection(0);
const string selFile = string(lbFiles->GetStringSelection().mb_str());
TCalibrationImageList::iterator it = lst_images.find(selFile);
if (it==lst_images.end()) return;
// Zoom:
const std::string strZoom = string(cbZoom->GetStringSelection().mb_str());
const double zoomVal = 0.01*atof(strZoom.c_str());
ASSERT_(zoomVal>0 && zoomVal<30)
TImageSize imgSizes(0,0);
// Generate the images on-the-fly:
CImage imgOrgColor;
it->second.img_original.colorImage(imgOrgColor);
imgSizes = imgOrgColor.getSize();
// Rectify:
CImage imgRect;
if (camera_params.intrinsicParams(0,0)==0)
{
// Not calibrated yet:
imgRect = imgOrgColor;
imgRect.scaleImage(imgSizes.x*zoomVal,imgSizes.y*zoomVal, IMG_INTERP_NN);
}
else
{
imgOrgColor.rectifyImage(imgRect,camera_params.intrinsicParams, camera_params.getDistortionParamsAsVector());
imgRect.scaleImage(imgSizes.x*zoomVal,imgSizes.y*zoomVal, IMG_INTERP_NN);
// Draw reprojected:
for (unsigned int k=0;k<it->second.projectedPoints_undistorted.size();k++)
imgRect.drawCircle( zoomVal*it->second.projectedPoints_undistorted[k].x, zoomVal*it->second.projectedPoints_undistorted[k].y, 4, TColor(0,255,64) );
imgRect.drawCircle( 10,10, 4, TColor(0,255,64) );
imgRect.textOut(18,4,"Reprojected corners",TColor::white);
}
// Zoom images:
imgOrgColor.scaleImage(imgSizes.x*zoomVal,imgSizes.y*zoomVal, IMG_INTERP_NN);
imgSizes = imgOrgColor.getSize();
CImage imgCheck = imgOrgColor;
// Draw the board:
for (unsigned int k=0;k<it->second.detected_corners.size();k++)
{
imgCheck.cross(it->second.detected_corners[k].x *zoomVal, it->second.detected_corners[k].y *zoomVal, TColor::blue, 3 );
imgCheck.drawCircle( it->second.projectedPoints_distorted[k].x*zoomVal, it->second.projectedPoints_distorted[k].y*zoomVal, 4, TColor(0,255,64) );
}
imgCheck.drawCircle( 10,10, 4, TColor(0,255,64) );
imgCheck.textOut(18,4,"Reprojected corners",TColor::white);
imgCheck.cross( 10,30, TColor::blue, 3 );
imgCheck.textOut(18,24,"Detected corners",TColor::white);
this->bmpOriginal->AssignImage( imgCheck );
this->bmpRectified->AssignImage( imgRect );
it->second.img_original.unload();
// Plot:
this->bmpOriginal->SetMinSize(wxSize(imgSizes.x,imgSizes.y));
this->bmpOriginal->SetMaxSize(wxSize(imgSizes.x,imgSizes.y));
this->bmpOriginal->SetSize(imgSizes.x,imgSizes.y);
this->bmpRectified->SetMinSize(wxSize(imgSizes.x,imgSizes.y));
this->bmpRectified->SetMaxSize(wxSize(imgSizes.x,imgSizes.y));
this->bmpRectified->SetSize(imgSizes.x,imgSizes.y);
this->FlexGridSizer11->RecalcSizes();
this->FlexGridSizer14->RecalcSizes();
//this->ScrolledWindow2->SetVirtualSize(wxSize(imgSizes.x,imgSizes.y));
//this->ScrolledWindow3->SetVirtualSize(wxSize(imgSizes.x,imgSizes.y));
this->ScrolledWindow2->SetScrollbars(1,1,imgSizes.x,imgSizes.y);
this->ScrolledWindow3->SetScrollbars(1,1,imgSizes.x,imgSizes.y);
this->bmpOriginal->Refresh(false);
this->bmpRectified->Refresh(false);
}
catch(std::exception &e)
{
wxMessageBox(_U(e.what()),_("Error"),wxICON_INFORMATION,this);
}
}
void camera_calib_guiDialog::OnlbFilesSelect(wxCommandEvent& event)
{
refreshDisplayedImage();
}
void camera_calib_guiDialog::show3Dview()
{
mrpt::opengl::COpenGLScenePtr scene = mrpt::opengl::COpenGLScene::Create();
const unsigned int check_size_x = edSizeX->GetValue();
const unsigned int check_size_y = edSizeY->GetValue();
const double check_squares_length_X_meters = 0.001 * atof( string(edLengthX->GetValue().mb_str()).c_str() );
const double check_squares_length_Y_meters = 0.001 * atof( string(edLengthY->GetValue().mb_str()).c_str() );
if (!check_squares_length_X_meters || !check_squares_length_Y_meters) return;
opengl::CGridPlaneXYPtr grid = opengl::CGridPlaneXY::Create(0,check_size_x*check_squares_length_X_meters, 0, check_size_y*check_squares_length_Y_meters, 0, check_squares_length_X_meters );
scene->insert( grid );
for (TCalibrationImageList::iterator it=lst_images.begin();it!=lst_images.end();++it)
{
if (!it->second.detected_corners.empty())
{
mrpt::opengl::CSetOfObjectsPtr cor = mrpt::opengl::stock_objects::CornerXYZ();
cor->setName( mrpt::system::extractFileName(it->first) );
cor->enableShowName(true);
cor->setScale(0.1);
cor->setPose( it->second.reconstructed_camera_pose );
scene->insert( cor );
}
}
//scene->insert( mrpt::opengl::stock_objects::CornerXYZ() );
this->m_3Dview->m_openGLScene = scene;
this->m_3Dview->Refresh();
}
// Enter calib. params manually:
void camera_calib_guiDialog::OnbtnManualRectClick(wxCommandEvent& event)
{
wxMessageBox(_("Please, enter calibration parameters manually next to overpass automatically obtained parameters."),_("Manual parameters"));
wxString s;
if (camera_params.intrinsicParams(0,0)==0)
{
wxMessageBox(_("Run the calibration first"),_("Error"));
return;
}
s = wxGetTextFromUser(_("Focus length in X pixel size (fx):"),_("Manual parameters"),wxString::Format(wxT("%.07f"),camera_params.intrinsicParams(0,0)), this );
if (s.IsEmpty()) return;
if (!s.ToDouble(&camera_params.intrinsicParams(0,0))) { wxMessageBox(_("Invalid number")); return; }
s = wxGetTextFromUser(_("Focus length in Y pixel size (fy):"),_("Manual parameters"),wxString::Format(wxT("%.07f"),camera_params.intrinsicParams(1,1)), this );
if (s.IsEmpty()) return;
if (!s.ToDouble(&camera_params.intrinsicParams(1,1))) { wxMessageBox(_("Invalid number")); return; }
s = wxGetTextFromUser(_("Image center X (cx):"),_("Manual parameters"),wxString::Format(wxT("%.07f"),camera_params.intrinsicParams(0,2)), this );
if (s.IsEmpty()) return;
if (!s.ToDouble(&camera_params.intrinsicParams(0,2))) { wxMessageBox(_("Invalid number")); return; }
s = wxGetTextFromUser(_("Image center Y (cy):"),_("Manual parameters"),wxString::Format(wxT("%.07f"),camera_params.intrinsicParams(1,2)), this );
if (s.IsEmpty()) return;
if (!s.ToDouble(&camera_params.intrinsicParams(1,2))) { wxMessageBox(_("Invalid number")); return; }
s = wxGetTextFromUser(_("Distortion param p1:"),_("Manual parameters"),wxString::Format(wxT("%.07f"),camera_params.dist[0]), this );
if (s.IsEmpty()) return;
if (!s.ToDouble(&camera_params.dist[0])) { wxMessageBox(_("Invalid number")); return; }
s = wxGetTextFromUser(_("Distortion param p2:"),_("Manual parameters"),wxString::Format(wxT("%.07f"),camera_params.dist[1]), this );
if (s.IsEmpty()) return;
if (!s.ToDouble(&camera_params.dist[1])) { wxMessageBox(_("Invalid number")); return; }
s = wxGetTextFromUser(_("Distortion param k1:"),_("Manual parameters"),wxString::Format(wxT("%.07f"),camera_params.dist[2]), this );
if (s.IsEmpty()) return;
if (!s.ToDouble(&camera_params.dist[2])) { wxMessageBox(_("Invalid number")); return; }
s = wxGetTextFromUser(_("Distortion param k2:"),_("Manual parameters"),wxString::Format(wxT("%.07f"),camera_params.dist[3]), this );
if (s.IsEmpty()) return;
if (!s.ToDouble(&camera_params.dist[3])) { wxMessageBox(_("Invalid number")); return; }
refreshDisplayedImage();
}
void camera_calib_guiDialog::OnbtnCaptureNowClick(wxCommandEvent& event)
{
CDlgCalibWizardOnline dlg(this);
// Set pattern params:
dlg.edLengthX->SetValue( this->edLengthX->GetValue() );
dlg.edLengthY->SetValue( this->edLengthY->GetValue() );
dlg.edSizeX->SetValue( this->edSizeX->GetValue() );
dlg.edSizeY->SetValue( this->edSizeY->GetValue() );
dlg.cbNormalize->SetValue( this->cbNormalize->GetValue() );
// Run:
dlg.ShowModal();
// Get params:
this->edLengthX->SetValue( dlg.edLengthX->GetValue() );
this->edLengthY->SetValue( dlg.edLengthY->GetValue() );
this->edSizeX->SetValue( dlg.edSizeX->GetValue() );
this->edSizeY->SetValue( dlg.edSizeY->GetValue() );
this->cbNormalize->SetValue( dlg.cbNormalize->GetValue() );
// Get images:
lst_images = dlg.m_calibFrames;
this->updateListOfImages();
}
void camera_calib_guiDialog::OnbtnSaveImagesClick(wxCommandEvent& event)
{
try
{
if (lst_images.empty()) return;
wxDirDialog dlg(this,_("Select the directory where to save the images"),_("."));
if (dlg.ShowModal()==wxID_OK)
{
string dir = string(dlg.GetPath().mb_str());
for (TCalibrationImageList::iterator s=lst_images.begin();s!=lst_images.end();++s)
s->second.img_original.saveToFile( dir+string("/")+s->first+string(".png") );
}
}
catch(std::exception &e)
{
wxMessageBox(_U(e.what()),_("Error"),wxICON_INFORMATION,this);
}
}
void camera_calib_guiDialog::OncbZoomSelect(wxCommandEvent& event)
{
refreshDisplayedImage();
}
|
gamman/MRPT
|
apps/camera-calib/camera_calib_guiMain.cpp
|
C++
|
gpl-3.0
| 36,557
|
<?php
/*-----------------------------------------------------------------------------------*/
/* Add Menu items */
/*-----------------------------------------------------------------------------------*/
add_action('admin_menu', 'twistory_plugin_menu');
function twistory_plugin_menu() {
//Page setting
add_menu_page( 'Hackatweet', 'Hackatweet', 'edit_pages', 'twistory', 'twistory_settings', plugins_url( '../images/twitter.png' , __FILE__ ), 44 );
add_submenu_page( 'twistory', 'Settings','Settings', 'edit_pages', 'twistory', 'twistory_settings');
add_submenu_page( 'twistory', 'Hashtags','Hashtag', 'edit_pages', 'twistory_hashtag', 'twistory_hashtag');
}
function twistory_options(){
echo "Admin Page Test";
}
/*-----------------------------------------------------------------------------------*/
/* Remove Unwanted Admin Menu Items */
/*-----------------------------------------------------------------------------------*/
if ( get_option( 'twistory_dedicated_install' ) != '' ):
function remove_admin_menu_items() {
remove_menu_page('edit.php');
remove_menu_page('upload.php');
remove_menu_page('edit.php?post_type=page');
remove_menu_page('edit-comments.php');
}
add_action('admin_menu', 'remove_admin_menu_items');
endif;
|
manafactory/SocialCamera
|
plugins/hackatweet/includes/twistory_menu.php
|
PHP
|
gpl-3.0
| 1,270
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_79) on Wed Aug 12 14:21:17 ICT 2015 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>Uses of Class uk.co.crider.jablus.gui.Field</title>
<meta name="date" content="2015-08-12">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class uk.co.crider.jablus.gui.Field";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../uk/co/crider/jablus/gui/Field.html" title="class in uk.co.crider.jablus.gui">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?uk/co/crider/jablus/gui/class-use/Field.html" target="_top">Frames</a></li>
<li><a href="Field.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class uk.co.crider.jablus.gui.Field" class="title">Uses of Class<br>uk.co.crider.jablus.gui.Field</h2>
</div>
<div class="classUseContainer">No usage of uk.co.crider.jablus.gui.Field</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../../uk/co/crider/jablus/gui/Field.html" title="class in uk.co.crider.jablus.gui">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../../../../../../overview-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?uk/co/crider/jablus/gui/class-use/Field.html" target="_top">Frames</a></li>
<li><a href="Field.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
Cride5/jablus
|
dist/javadoc/uk/co/crider/jablus/gui/class-use/Field.html
|
HTML
|
gpl-3.0
| 4,210
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>drilldownchart.cpp Example File | Qt Charts 5.7</title>
<link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
<script type="text/javascript">
window.onload = function(){document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");};
</script>
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<table><tr>
<td ><a href="../qtdoc/supported-platforms-and-configurations.html#qt-5-7">Qt 5.7</a></td><td ><a href="qtcharts-index.html">Qt Charts</a></td><td ><a href="qtcharts-piechartdrilldown-example.html">Piechart Drilldown Example</a></td><td >drilldownchart.cpp Example File</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.7.0 Reference Documentation</td>
</tr></table>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">drilldownchart.cpp Example File</h1>
<span class="subtitle">piechartdrilldown/drilldownchart.cpp</span>
<!-- $$$piechartdrilldown/drilldownchart.cpp-description -->
<div class="descr"> <a name="details"></a>
<pre class="cpp">
<span class="comment">/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Charts module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:GPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 or (at your option) any later version
** approved by the KDE Free Qt Foundation. The licenses are as published by
** the Free Software Foundation and appearing in the file LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/</span>
<span class="preprocessor">#include "drilldownchart.h"</span>
<span class="preprocessor">#include "drilldownslice.h"</span>
QT_CHARTS_USE_NAMESPACE
DrilldownChart<span class="operator">::</span>DrilldownChart(<span class="type"><a href="../qtwidgets/qgraphicsitem.html">QGraphicsItem</a></span> <span class="operator">*</span>parent<span class="operator">,</span> <span class="type"><a href="../qtcore/qt.html">Qt</a></span><span class="operator">::</span>WindowFlags wFlags)
: <span class="type"><a href="qchart.html">QChart</a></span>(<span class="type"><a href="qchart.html">QChart</a></span><span class="operator">::</span>ChartTypeCartesian<span class="operator">,</span> parent<span class="operator">,</span> wFlags)<span class="operator">,</span>
m_currentSeries(<span class="number">0</span>)
{
}
DrilldownChart<span class="operator">::</span><span class="operator">~</span>DrilldownChart()
{
}
<span class="type">void</span> DrilldownChart<span class="operator">::</span>changeSeries(<span class="type"><a href="qabstractseries.html">QAbstractSeries</a></span> <span class="operator">*</span>series)
{
<span class="comment">// NOTE: if the series is owned by the chart it will be deleted</span>
<span class="comment">// here the "window" owns the series...</span>
<span class="keyword">if</span> (m_currentSeries)
removeSeries(m_currentSeries);
m_currentSeries <span class="operator">=</span> series;
addSeries(series);
setTitle(series<span class="operator">-</span><span class="operator">></span>name());
}
<span class="type">void</span> DrilldownChart<span class="operator">::</span>handleSliceClicked(<span class="type"><a href="qpieslice.html">QPieSlice</a></span> <span class="operator">*</span>slice)
{
DrilldownSlice <span class="operator">*</span>drilldownSlice <span class="operator">=</span> <span class="keyword">static_cast</span><span class="operator"><</span>DrilldownSlice <span class="operator">*</span><span class="operator">></span>(slice);
changeSeries(drilldownSlice<span class="operator">-</span><span class="operator">></span>drilldownSeries());
}
<span class="preprocessor">#include "moc_drilldownchart.cpp"</span>
</pre>
</div>
<!-- @@@piechartdrilldown/drilldownchart.cpp -->
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2016 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|
angeloprudentino/QtNets
|
Doc/qtcharts/qtcharts-piechartdrilldown-drilldownchart-cpp.html
|
HTML
|
gpl-3.0
| 5,968
|
/***************************************************************************
* GFitsTableULongCol.hpp - FITS table unsigned long column class *
* ----------------------------------------------------------------------- *
* copyright (C) 2010-2012 by Juergen Knoedlseder *
* ----------------------------------------------------------------------- *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
***************************************************************************/
/**
* @file GFitsTableULongCol.hpp
* @brief FITS table unsigned long integer column class interface definition
* @author Juergen Knoedlseder
*/
#ifndef GFITSTABLEULONGCOL_HPP
#define GFITSTABLEULONGCOL_HPP
/* __ Includes ___________________________________________________________ */
#include <string>
#include "GFitsTableCol.hpp"
/***********************************************************************//**
* @class GFitsTableULongCol
*
* @brief FITS table unsigned long integer column
*
* This class implements a FITS table unsigned long integer column.
***************************************************************************/
class GFitsTableULongCol : public GFitsTableCol {
public:
// Constructors and destructors
GFitsTableULongCol(void);
GFitsTableULongCol(const std::string& name, const int& length,
const int& size = 1);
GFitsTableULongCol(const GFitsTableULongCol& column);
virtual ~GFitsTableULongCol(void);
// Operators
GFitsTableULongCol& operator= (const GFitsTableULongCol& column);
unsigned long& operator() (const int& row, const int& inx = 0);
const unsigned long& operator() (const int& row, const int& inx = 0) const;
// Implement virtual methods
virtual void clear(void);
virtual GFitsTableULongCol* clone(void) const;
virtual std::string string(const int& row, const int& col = 0) const;
virtual double real(const int& row, const int& col = 0) const;
virtual int integer(const int& row, const int& col = 0) const;
virtual void insert(const int& rownum, const int& nrows);
virtual void remove(const int& rownum, const int& nrows);
// Other methods
unsigned long* data(void) { return m_data; }
void nulval(const unsigned long* value);
unsigned long* nulval(void) { return m_nulval; }
private:
// Private methods
void init_members(void);
void copy_members(const GFitsTableULongCol& column);
void free_members(void);
std::string ascii_format(void) const;
std::string binary_format(void) const;
void alloc_data(void);
void release_data(void);
void alloc_nulval(const unsigned long* value);
void init_data(void);
void* ptr_data(void) { return m_data; }
void* ptr_nulval(void) { return m_nulval; }
// Private data area
unsigned long* m_data; //!< Data vector
unsigned long* m_nulval; //!< NULL value
};
#endif /* GFITSTABLEULONGCOL_HPP */
|
cdeil/gammalib
|
include/GFitsTableULongCol.hpp
|
C++
|
gpl-3.0
| 4,249
|
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<!-- Meta Tags -->
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="description" content="HairCare- Beauty Salon & Barber HTML5 Template for Women & Men" />
<meta name="keywords" content="building,business,construction,cleaning,transport,workshop" />
<meta name="author" content="ThemeMascot" />
<!-- Page Title -->
<title>HairCare- Beauty Salon & Barber HTML5 Template for Women & Men</title>
<!-- Favicon and Touch Icons -->
<link href="images/favicon.png" rel="shortcut icon" type="image/png">
<link href="images/apple-touch-icon.png" rel="apple-touch-icon">
<link href="images/apple-touch-icon-72x72.png" rel="apple-touch-icon" sizes="72x72">
<link href="images/apple-touch-icon-114x114.png" rel="apple-touch-icon" sizes="114x114">
<link href="images/apple-touch-icon-144x144.png" rel="apple-touch-icon" sizes="144x144">
<!-- Stylesheet -->
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="css/jquery-ui.min.css" rel="stylesheet" type="text/css">
<link href="css/animate.css" rel="stylesheet" type="text/css">
<link href="css/css-plugin-collections.css" rel="stylesheet"/>
<!-- CSS | menuzord megamenu skins -->
<link id="menuzord-menu-skins" href="css/menuzord-skins/menuzord-rounded-boxed.css" rel="stylesheet"/>
<!-- CSS | Main style file -->
<link href="css/style-main.css" rel="stylesheet" type="text/css">
<!-- CSS | Theme Color -->
<link href="css/colors/theme-skin-lemon.css" rel="stylesheet" type="text/css">
<!-- CSS | Preloader Styles -->
<link href="css/preloader.css" rel="stylesheet" type="text/css">
<!-- CSS | Custom Margin Padding Collection -->
<link href="css/custom-bootstrap-margin-padding.css" rel="stylesheet" type="text/css">
<!-- CSS | Responsive media queries -->
<link href="css/responsive.css" rel="stylesheet" type="text/css">
<!-- CSS | Style css. This is the file where you can place your own custom css code. Just uncomment it and use it. -->
<!-- <link href="css/style.css" rel="stylesheet" type="text/css"> -->
<!-- external javascripts -->
<script src="js/jquery-2.1.4.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- JS | jquery plugin collection for this theme -->
<script src="js/jquery-plugin-collection.js"></script>
<!-- HTML5 shim and Respond.js for 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 class="">
<div id="wrapper">
<!-- preloader -->
<div id="preloader">
<div id="spinner">
<img src="images/preloaders/1.gif" alt="">
</div>
<div id="disable-preloader" class="btn btn-default btn-sm">Disable Preloader</div>
</div>
<!-- Header -->
<header id="header" class="header">
<div class="header-top sm-text-center bg-theme-colored">
<div class="container">
<div class="row">
<div class="col-md-4">
<nav>
<ul class="list-inline sm-text-center text-left flip mt-5">
<li> <a class="text-white" href="#">FAQ</a> </li>
<li class="text-white">|</li>
<li> <a class="text-white" href="#">Help Desk</a> </li>
<li class="text-white">|</li>
<li> <a class="text-white" href="#">Support</a> </li>
</ul>
</nav>
</div>
<div class="col-md-6">
<div class="widget m-0 mt-5 no-border">
<ul class="list-inline text-right sm-text-center">
<li class="pl-10 pr-10 mb-0 pb-0">
<div class="header-widget text-white"><i class="fa fa-phone"></i> 123-456-789 </div>
</li>
<li class="pl-10 pr-10 mb-0 pb-0">
<div class="header-widget text-white"><i class="fa fa-envelope-o"></i> contact@yourdomain.com </div>
</li>
</ul>
</div>
</div>
<div class="col-md-2 text-right flip sm-text-center">
<div class="widget m-0">
<ul class="styled-icons icon-dark icon-circled icon-theme-colored icon-sm">
<li class="mb-0 pb-0"><a href="#"><i class="fa fa-facebook"></i></a></li>
<li class="mb-0 pb-0"><a href="#"><i class="fa fa-twitter"></i></a></li>
<li class="mb-0 pb-0"><a href="#"><i class="fa fa-instagram"></i></a></li>
<li class="mb-0 pb-0"><a href="#"><i class="fa fa-linkedin text-white"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="header-nav">
<div class="header-nav-wrapper navbar-scrolltofixed bg-lighter">
<div class="container">
<nav id="menuzord-right" class="menuzord no-bg"> <a class="menuzord-brand pull-left flip" href="javascript:void(0)"><img src="http://placehold.it/178x55" alt=""></a>
<ul class="menuzord-menu">
<li class="active"><a href="#home">Home</a>
<ul class="dropdown">
<li><a href="#">Multi Layouts</a>
<ul class="dropdown">
<li><a href="index-mp-layout1.html">Layout1</a></li>
<li><a href="index-mp-layout2.html">Layout2</a></li>
<li><a href="index-mp-layout3.html">Layout3</a></li>
<li><a href="index-mp-layout4.html">Layout4</a></li>
<li><a href="index-mp-layout5.html">Layout5</a></li>
<li><a href="index-mp-layout6.html">Layout6</a></li>
<li><a href="index-mp-layout7.html">Layout7</a></li>
</ul>
</li>
<li><a href="#">Single Layouts</a>
<ul class="dropdown">
<li><a href="index-sp-layout1.html">Layout1</a></li>
<li><a href="index-sp-layout2.html">Layout2</a></li>
<li><a href="index-sp-layout3.html">Layout3</a></li>
<li><a href="index-sp-layout4.html">Layout4</a></li>
<li><a href="index-sp-layout5.html">Layout5</a></li>
<li><a href="index-sp-layout6.html">Layout6</a></li>
<li><a href="index-sp-layout7.html">Layout7</a></li>
</ul>
</li>
<li><a href="#">Boxed Layouts</a>
<ul class="dropdown">
<li><a href="index-boxed-mp-layout1.html">Boxed Multi Page Layout1</a></li>
<li><a href="index-boxed-mp-layout2.html">Boxed Multi Page Layout2</a></li>
<li><a href="index-boxed-mp-layout3.html">Boxed Multi Page Layout3</a></li>
<li><a href="index-boxed-mp-layout4.html">Boxed Multi Page Layout4</a></li>
<li><a href="index-boxed-mp-layout5.html">Boxed Multi Page Layout5</a></li>
<li><a href="index-boxed-mp-layout6.html">Boxed Multi Page Layout6</a></li>
<li><a href="index-boxed-mp-layout7.html">Boxed Multi Page Layout7</a></li>
<li><a href="index-boxed-sp-layout1.html">Boxed Single Page Layout1</a></li>
<li><a href="index-boxed-sp-layout2.html">Boxed Single Page Layout2</a></li>
<li><a href="index-boxed-sp-layout3.html">Boxed Single Page Layout3</a></li>
<li><a href="index-boxed-sp-layout4.html">Boxed Single Page Layout4</a></li>
<li><a href="index-boxed-sp-layout5.html">Boxed Single Page Layout5</a></li>
<li><a href="index-boxed-sp-layout6.html">Boxed Multi Page Layout6</a></li>
<li><a href="index-boxed-sp-layout7.html">Boxed Multi Page Layout7</a></li>
</ul>
</li>
<li><a href="#">RTL Layouts</a>
<ul class="dropdown">
<li><a href="index-rtl-mp-layout1.html">RTL Multi Page Layout1</a></li>
<li><a href="index-rtl-mp-layout2.html">RTL Multi Page Layout2</a></li>
<li><a href="index-rtl-mp-layout3.html">RTL Multi Page Layout3</a></li>
<li><a href="index-rtl-mp-layout4.html">RTL Multi Page Layout4</a></li>
<li><a href="index-rtl-mp-layout5.html">RTL Multi Page Layout5</a></li>
<li><a href="index-rtl-mp-layout6.html">RTL Multi Page Layout6</a></li>
<li><a href="index-rtl-mp-layout7.html">RTL Multi Page Layout7</a></li>
</ul>
</li>
<li><a href="#">Dark Layouts</a>
<ul class="dropdown">
<li><a href="index-dark-mp-layout1.html">Dark Multi Page Layout1</a></li>
<li><a href="index-dark-mp-layout2.html">Dark Multi Page Layout2</a></li>
<li><a href="index-dark-mp-layout3.html">Dark Multi Page Layout3</a></li>
<li><a href="index-dark-mp-layout4.html">Dark Multi Page Layout4</a></li>
<li><a href="index-dark-mp-layout5.html">Dark Multi Page Layout5</a></li>
<li><a href="index-dark-mp-layout6.html">Dark Multi Page Layout6</a></li>
<li><a href="index-dark-mp-layout7.html">Dark Multi Page Layout7</a></li>
</ul>
</li>
<li><a href="#">Magazine Home Layouts <span class="label label-warning">New</span></a>
<ul class="dropdown">
<li><a href="index-hot-magazine-home-layout1.html">Magazine Home layout1</a></li>
<li><a href="index-hot-magazine-home-layout2.html">Magazine Home layout2</a></li>
</ul>
</li>
<li><a href="#">Portfolio Home Layouts <span class="label label-warning">New</span></a>
<ul class="dropdown">
<li><a href="index-hot-portfolio-presentation-layout1.html">Portfolio Presentation Layout1</a></li>
<li><a href="index-hot-portfolio-presentation-layout2.html">Portfolio Presentation Layout2</a></li>
<li><a href="index-hot-portfolio-presentation-layout3.html">Portfolio Presentation Layout3</a></li>
<li><a href="index-hot-portfolio-presentation-layout4.html">Portfolio Presentation Layout4</a></li>
</ul>
</li>
<li><a href="#">Hot Layouts <span class="label label-warning">New</span></a>
<ul class="dropdown">
<li><a href="index-hot-slider-split.html">Split Slider</a></li>
<li><a href="index-hot-slider-fullpage.html">Fullpage Slider</a></li>
<li><a href="index-hot-slider-vertical.html">Vertical Slider</a></li>
<li><a href="index-hot-parallax-home.html">Parallax Home Layout</a></li>
<li><a href="index-hot-personal-home-layout1.html">Personal Home Layout 1</a></li>
<li><a href="index-hot-personal-home-layout2.html">Personal Home Layout 2</a></li>
</ul>
</li>
<li><a href="index-hot-shop-home.html">Shop Home <span class="label label-warning">New</span></a></li>
<li><a href="#">Home Variations</a>
<ul class="dropdown">
<li><a href="home-variation-revslider.html">Revolution Slider</a></li>
<li><a href="home-variation-bg-parallax.html">Bg Parallax Image</a></li>
<li><a href="home-variation-bg-static.html">Bg Static Image</a></li>
<li><a href="home-variation-maximageslider.html">Maximage Slider</a></li>
<li><a href="home-variation-typed-text.html">Typed Text</a></li>
<li><a href="home-variation-bg-video.html">Bg Video</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Features</a>
<ul class="dropdown">
<li><a href="features-preloader.html">Preloaders</a></li>
<li><a href="#">Sliders</a>
<ul class="dropdown">
<li><a href="features-premium-templates-rev-slider.html">Revolution Slider - All In One</a></li>
</ul>
</li>
<li><a href="#">Header</a>
<ul class="dropdown">
<li><a href="features-header-style1.html">Header Style One</a></li>
<li><a href="features-header-style2.html">Header Style Two</a></li>
<li><a href="features-header-style3.html">Header Style Three</a></li>
<li><a href="features-header-style4.html">Header Style Four</a></li>
</ul>
</li>
<li><a href="#">Page Title</a>
<ul class="dropdown">
<li><a href="features-page-title-bg-dark.html">Bg Dark</a></li>
<li><a href="features-page-title-bg-white.html">Bg White</a></li>
<li><a href="features-page-title-bg-image.html">Bg Image</a></li>
<li><a href="features-page-title-bg-image-parallax.html">Bg Image Parallax</a></li>
<li><a href="features-page-title-bg-pattern.html">Bg Pattern</a></li>
<li><a href="features-page-title-bg-video.html">Bg Video</a></li>
<li><a href="features-page-title-mini-version.html">Mini Version</a></li>
<li><a href="features-page-title-big-version.html">Big Version</a></li>
<li><a href="features-page-title-extra-big-version.html">Extra Big Version</a></li>
<li><a href="features-page-title-text-center.html">Text Center</a></li>
<li><a href="features-page-title-text-left.html">Text Left</a></li>
<li><a href="features-page-title-text-right.html">Text Right</a></li>
</ul>
</li>
<li><a href="#">Menu Style</a>
<ul class="dropdown">
<li><a href="features-menu-style-border-top.html">Border Top</a></li>
<li><a href="features-menu-style-border-bottom.html">Border Bottom</a></li>
<li><a href="features-menu-style-border-boxed.html">Border Boxed</a></li>
<li><a href="features-menu-style-border-left.html">Border Left</a></li>
<li><a href="features-menu-style-border-top-bottom.html">Border Top Bottom</a></li>
<li><a href="features-menu-style-bottom-trace.html">Bottom Trace</a></li>
<li><a href="features-menu-style-boxed.html">Boxed</a></li>
<li><a href="features-menu-style-colored.html">Colored</a></li>
<li><a href="features-menu-style-dark.html">Dark</a></li>
<li><a href="features-menu-style-gradient.html">Gradient</a></li>
<li><a href="features-menu-style-rounded-boxed.html">Rounded Boxed</a></li>
<li><a href="features-menu-style-shadow.html">Shadow</a></li>
<li><a href="features-menu-style-strip.html">Strip</a></li>
<li><a href="features-menu-style-subcolored.html">Sub-Colored</a></li>
<li><a href="features-menu-style-top-bottom-boxed-border.html">Top Bottom Boxed Border</a></li>
</ul>
</li>
<li><a href="#">Form</a>
<ul class="dropdown">
<li><a href="#">Registration Form</a>
<ul class="dropdown">
<li><a href="form-register-style1.html">Form style 1</a></li>
<li><a href="form-register-style2.html">Form style 2</a></li>
<li><a href="form-register-style3.html">Form style 3</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Popup Promo Box</a>
<ul class="dropdown">
<li><a href="features-popup-promo-box.html">Default</a></li>
<li><a href="features-popup-promo-box-cookie-enabled.html">Cookie Enabled</a></li>
</ul>
</li>
<li><a href="#">Footer</a>
<ul class="dropdown">
<li><a href="features-footer-dark-style1.html#footer">Footer Dark One</a></li>
<li><a href="features-footer-dark-style2.html#footer">Footer Dark Two</a></li>
<li><a href="features-footer-dark-style3.html#footer">Footer Dark Three</a></li>
<li><a href="features-footer-dark-style4.html#footer">Footer Dark Four</a></li>
<li><a href="features-footer-white-style1.html#footer">Footer White One</a></li>
<li><a href="features-footer-white-style2.html#footer">Footer White Two</a></li>
<li><a href="features-footer-white-style3.html#footer">Footer White Three</a></li>
<li><a href="features-footer-white-style4.html#footer">Footer White Four</a></li>
</ul>
</li>
<li><a href="#">Active Forms</a>
<ul class="dropdown">
<li><a href="#">Contact Form</a>
<ul class="dropdown">
<li><a href="page-contact1.html">Form style 1</a></li>
<li><a href="page-contact2.html">Form style 2</a></li>
<li><a href="page-contact3.html">Form style 3</a></li>
<li><a href="page-contact4.html">Form style 4</a></li>
</ul>
</li>
<li><a href="#">Subscribe Form</a>
<ul class="dropdown">
<li><a href="form-subscribe.html">Form style 1</a></li>
</ul>
</li>
<li><a href="#">Appointment Form</a>
<ul class="dropdown">
<li><a href="form-appointment-style1.html">Form style 1</a></li>
<li><a href="form-appointment-style2.html">Form style 2</a></li>
<li><a href="form-appointment-style3.html">Form style 3</a></li>
</ul>
</li>
<li><a href="#">Job Apply Form</a>
<ul class="dropdown">
<li><a href="form-job-apply-style1.html">Form style 1</a></li>
<li><a href="form-job-apply-style2.html">Form style 2</a></li>
<li><a href="form-job-apply-style3.html">Form style 3</a></li>
</ul>
</li>
<li><a href="#">Quick Contact Form</a>
<ul class="dropdown">
<li><a href="form-quick-contact-style1.html">Form style 1</a></li>
<li><a href="form-quick-contact-style2.html">Form style 2</a></li>
<li><a href="form-quick-contact-style3.html">Form style 3</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Pages</a>
<ul class="dropdown">
<li><a href="#">About</a>
<ul class="dropdown">
<li><a href="page-about1.html">About Style1</a></li>
<li><a href="page-about2.html">About Style2</a></li>
</ul>
</li>
<li><a href="#">Services</a>
<ul class="dropdown">
<li><a href="page-services-style1.html">Services Style1</a></li>
<li><a href="page-services-style2.html">Services Style2</a></li>
<li><a href="page-services-details.html">Services Details</a></li>
</ul>
</li>
<li><a href="#">Experts</a>
<ul class="dropdown">
<li><a href="page-hair-expert-style1.html">3 Columns</a></li>
<li><a href="page-hair-expert-style2.html">4 Columns</a></li>
<li><a href="page-hair-expert-details.html">Expert Details</a></li>
</ul>
</li>
<li><a href="#">Pricing</a>
<ul class="dropdown">
<li><a href="page-pricing1.html">Pricing Style1</a></li>
<li><a href="page-pricing2.html">Pricing Style2</a></li>
</ul>
</li>
<li><a href="#">Contact</a>
<ul class="dropdown">
<li><a href="page-contact1.html">Contact style 1</a></li>
<li><a href="page-contact2.html">Contact style 2</a></li>
<li><a href="page-contact3.html">Contact style 3</a></li>
<li><a href="page-contact4.html">Contact style 4</a></li>
</ul>
</li>
<li><a href="#">Gallery</a>
<ul class="dropdown">
<li><a href="page-gallery-3col.html">3 Columns</a></li>
<li><a href="page-gallery-4col.html">4 Columns</a></li>
</ul>
</li>
<li><a href="#">Calender</a>
<ul class="dropdown">
<li><a href="page-calender1.html">Calender Style1</a></li>
<li><a href="page-calender2.html">Calender Style2</a></li>
</ul>
</li>
<li><a href="page-offers.html">Page Offers</a></li>
<li><a href="page-404.html">Page 404</a></li>
<li><a href="page-under-construction.html">Page Under Construction</a></li>
<li><a href="page-coming-soon.html">Page Coming Soon</a></li>
</ul>
</li>
<li><a href="#">Portfolio</a>
<ul class="dropdown">
<li><a href="#">Boxed</a>
<ul class="dropdown">
<li><a href="#">Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-boxed-gutter-1-col.html">1 Column</a></li>
<li><a href="portfolio-boxed-gutter-2-col.html">2 Columns</a></li>
<li><a href="portfolio-boxed-gutter-3-col.html">3 Columns</a></li>
<li><a href="portfolio-boxed-gutter-4-col.html">4 Columns</a></li>
<li><a href="portfolio-boxed-gutter-5-col.html">5 Columns</a></li>
<li><a href="portfolio-boxed-gutter-6-col.html">6 Columns</a></li>
<li><a href="portfolio-boxed-gutter-7-col.html">7 Columns</a></li>
<li><a href="portfolio-boxed-gutter-8-col.html">8 Columns</a></li>
<li><a href="portfolio-boxed-gutter-9-col.html">9 Columns</a></li>
<li><a href="portfolio-boxed-gutter-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-boxed-1-col.html">1 Column</a></li>
<li><a href="portfolio-boxed-2-col.html">2 Columns</a></li>
<li><a href="portfolio-boxed-3-col.html">3 Columns</a></li>
<li><a href="portfolio-boxed-4-col.html">4 Columns</a></li>
<li><a href="portfolio-boxed-5-col.html">5 Columns</a></li>
<li><a href="portfolio-boxed-6-col.html">6 Columns</a></li>
<li><a href="portfolio-boxed-7-col.html">7 Columns</a></li>
<li><a href="portfolio-boxed-8-col.html">8 Columns</a></li>
<li><a href="portfolio-boxed-9-col.html">9 Columns</a></li>
<li><a href="portfolio-boxed-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-boxed-title-gutter-1-col.html">1 Column</a></li>
<li><a href="portfolio-boxed-title-gutter-2-col.html">2 Columns</a></li>
<li><a href="portfolio-boxed-title-gutter-3-col.html">3 Columns</a></li>
<li><a href="portfolio-boxed-title-gutter-4-col.html">4 Columns</a></li>
<li><a href="portfolio-boxed-title-gutter-5-col.html">5 Columns</a></li>
<li><a href="portfolio-boxed-title-gutter-6-col.html">6 Columns</a></li>
<li><a href="portfolio-boxed-title-gutter-7-col.html">7 Columns</a></li>
<li><a href="portfolio-boxed-title-gutter-8-col.html">8 Columns</a></li>
<li><a href="portfolio-boxed-title-gutter-9-col.html">9 Columns</a></li>
<li><a href="portfolio-boxed-title-gutter-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-boxed-title-1-col.html">1 Column</a></li>
<li><a href="portfolio-boxed-title-2-col.html">2 Columns</a></li>
<li><a href="portfolio-boxed-title-3-col.html">3 Columns</a></li>
<li><a href="portfolio-boxed-title-4-col.html">4 Columns</a></li>
<li><a href="portfolio-boxed-title-5-col.html">5 Columns</a></li>
<li><a href="portfolio-boxed-title-6-col.html">6 Columns</a></li>
<li><a href="portfolio-boxed-title-7-col.html">7 Columns</a></li>
<li><a href="portfolio-boxed-title-8-col.html">8 Columns</a></li>
<li><a href="portfolio-boxed-title-9-col.html">9 Columns</a></li>
<li><a href="portfolio-boxed-title-10-col.html">10 Columns</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Wide</a>
<ul class="dropdown">
<li><a href="#">Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-wide-gutter-1-col.html">1 Column</a></li>
<li><a href="portfolio-wide-gutter-2-col.html">2 Columns</a></li>
<li><a href="portfolio-wide-gutter-3-col.html">3 Columns</a></li>
<li><a href="portfolio-wide-gutter-4-col.html">4 Columns</a></li>
<li><a href="portfolio-wide-gutter-5-col.html">5 Columns</a></li>
<li><a href="portfolio-wide-gutter-6-col.html">6 Columns</a></li>
<li><a href="portfolio-wide-gutter-7-col.html">7 Columns</a></li>
<li><a href="portfolio-wide-gutter-8-col.html">8 Columns</a></li>
<li><a href="portfolio-wide-gutter-9-col.html">9 Columns</a></li>
<li><a href="portfolio-wide-gutter-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-wide-1-col.html">1 Column</a></li>
<li><a href="portfolio-wide-2-col.html">2 Columns</a></li>
<li><a href="portfolio-wide-3-col.html">3 Columns</a></li>
<li><a href="portfolio-wide-4-col.html">4 Columns</a></li>
<li><a href="portfolio-wide-5-col.html">5 Columns</a></li>
<li><a href="portfolio-wide-6-col.html">6 Columns</a></li>
<li><a href="portfolio-wide-7-col.html">7 Columns</a></li>
<li><a href="portfolio-wide-8-col.html">8 Columns</a></li>
<li><a href="portfolio-wide-9-col.html">9 Columns</a></li>
<li><a href="portfolio-wide-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-wide-title-gutter-1-col.html">1 Column</a></li>
<li><a href="portfolio-wide-title-gutter-2-col.html">2 Columns</a></li>
<li><a href="portfolio-wide-title-gutter-3-col.html">3 Columns</a></li>
<li><a href="portfolio-wide-title-gutter-4-col.html">4 Columns</a></li>
<li><a href="portfolio-wide-title-gutter-5-col.html">5 Columns</a></li>
<li><a href="portfolio-wide-title-gutter-6-col.html">6 Columns</a></li>
<li><a href="portfolio-wide-title-gutter-7-col.html">7 Columns</a></li>
<li><a href="portfolio-wide-title-gutter-8-col.html">8 Columns</a></li>
<li><a href="portfolio-wide-title-gutter-9-col.html">9 Columns</a></li>
<li><a href="portfolio-wide-title-gutter-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-wide-title-1-col.html">1 Column</a></li>
<li><a href="portfolio-wide-title-2-col.html">2 Columns</a></li>
<li><a href="portfolio-wide-title-3-col.html">3 Columns</a></li>
<li><a href="portfolio-wide-title-4-col.html">4 Columns</a></li>
<li><a href="portfolio-wide-title-5-col.html">5 Columns</a></li>
<li><a href="portfolio-wide-title-6-col.html">6 Columns</a></li>
<li><a href="portfolio-wide-title-7-col.html">7 Columns</a></li>
<li><a href="portfolio-wide-title-8-col.html">8 Columns</a></li>
<li><a href="portfolio-wide-title-9-col.html">9 Columns</a></li>
<li><a href="portfolio-wide-title-10-col.html">10 Columns</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Masonry Boxed</a>
<ul class="dropdown">
<li><a href="#">Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-masonry-boxed-gutter-2-col.html">2 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-3-col.html">3 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-4-col.html">4 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-5-col.html">5 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-6-col.html">6 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-7-col.html">7 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-8-col.html">8 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-9-col.html">9 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-masonry-boxed-2-col.html">2 Columns</a></li>
<li><a href="portfolio-masonry-boxed-3-col.html">3 Columns</a></li>
<li><a href="portfolio-masonry-boxed-4-col.html">4 Columns</a></li>
<li><a href="portfolio-masonry-boxed-5-col.html">5 Columns</a></li>
<li><a href="portfolio-masonry-boxed-6-col.html">6 Columns</a></li>
<li><a href="portfolio-masonry-boxed-7-col.html">7 Columns</a></li>
<li><a href="portfolio-masonry-boxed-8-col.html">8 Columns</a></li>
<li><a href="portfolio-masonry-boxed-9-col.html">9 Columns</a></li>
<li><a href="portfolio-masonry-boxed-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-masonry-boxed-gutter-title-2-col.html">2 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-title-3-col.html">3 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-title-4-col.html">4 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-title-5-col.html">5 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-title-6-col.html">6 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-title-7-col.html">7 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-title-8-col.html">8 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-title-9-col.html">9 Columns</a></li>
<li><a href="portfolio-masonry-boxed-gutter-title-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-masonry-boxed-title-2-col.html">2 Columns</a></li>
<li><a href="portfolio-masonry-boxed-title-3-col.html">3 Columns</a></li>
<li><a href="portfolio-masonry-boxed-title-4-col.html">4 Columns</a></li>
<li><a href="portfolio-masonry-boxed-title-5-col.html">5 Columns</a></li>
<li><a href="portfolio-masonry-boxed-title-6-col.html">6 Columns</a></li>
<li><a href="portfolio-masonry-boxed-title-7-col.html">7 Columns</a></li>
<li><a href="portfolio-masonry-boxed-title-8-col.html">8 Columns</a></li>
<li><a href="portfolio-masonry-boxed-title-9-col.html">9 Columns</a></li>
<li><a href="portfolio-masonry-boxed-title-10-col.html">10 Columns</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Masonry Wide</a>
<ul class="dropdown">
<li><a href="#">Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-masonry-wide-gutter-2-col.html">2 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-3-col.html">3 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-4-col.html">4 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-5-col.html">5 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-6-col.html">6 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-7-col.html">7 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-8-col.html">8 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-9-col.html">9 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-masonry-wide-2-col.html">2 Columns</a></li>
<li><a href="portfolio-masonry-wide-3-col.html">3 Columns</a></li>
<li><a href="portfolio-masonry-wide-4-col.html">4 Columns</a></li>
<li><a href="portfolio-masonry-wide-5-col.html">5 Columns</a></li>
<li><a href="portfolio-masonry-wide-6-col.html">6 Columns</a></li>
<li><a href="portfolio-masonry-wide-7-col.html">7 Columns</a></li>
<li><a href="portfolio-masonry-wide-8-col.html">8 Columns</a></li>
<li><a href="portfolio-masonry-wide-9-col.html">9 Columns</a></li>
<li><a href="portfolio-masonry-wide-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Title - Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-masonry-wide-gutter-title-2-col.html">2 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-title-3-col.html">3 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-title-4-col.html">4 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-title-5-col.html">5 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-title-6-col.html">6 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-title-7-col.html">7 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-title-8-col.html">8 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-title-9-col.html">9 Columns</a></li>
<li><a href="portfolio-masonry-wide-gutter-title-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Title - Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-masonry-wide-title-2-col.html">2 Columns</a></li>
<li><a href="portfolio-masonry-wide-title-3-col.html">3 Columns</a></li>
<li><a href="portfolio-masonry-wide-title-4-col.html">4 Columns</a></li>
<li><a href="portfolio-masonry-wide-title-5-col.html">5 Columns</a></li>
<li><a href="portfolio-masonry-wide-title-6-col.html">6 Columns</a></li>
<li><a href="portfolio-masonry-wide-title-7-col.html">7 Columns</a></li>
<li><a href="portfolio-masonry-wide-title-8-col.html">8 Columns</a></li>
<li><a href="portfolio-masonry-wide-title-9-col.html">9 Columns</a></li>
<li><a href="portfolio-masonry-wide-title-10-col.html">10 Columns</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Tiles Boxed</a>
<ul class="dropdown">
<li><a href="#">Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-tiles-boxed-gutter-2-col.html">2 Columns</a></li>
<li><a href="portfolio-tiles-boxed-gutter-3-col.html">3 Columns</a></li>
<li><a href="portfolio-tiles-boxed-gutter-4-col.html">4 Columns</a></li>
<li><a href="portfolio-tiles-boxed-gutter-5-col.html">5 Columns</a></li>
<li><a href="portfolio-tiles-boxed-gutter-6-col.html">6 Columns</a></li>
<li><a href="portfolio-tiles-boxed-gutter-7-col.html">7 Columns</a></li>
<li><a href="portfolio-tiles-boxed-gutter-8-col.html">8 Columns</a></li>
<li><a href="portfolio-tiles-boxed-gutter-9-col.html">9 Columns</a></li>
<li><a href="portfolio-tiles-boxed-gutter-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-tiles-boxed-2-col.html">2 Columns</a></li>
<li><a href="portfolio-tiles-boxed-3-col.html">3 Columns</a></li>
<li><a href="portfolio-tiles-boxed-4-col.html">4 Columns</a></li>
<li><a href="portfolio-tiles-boxed-5-col.html">5 Columns</a></li>
<li><a href="portfolio-tiles-boxed-6-col.html">6 Columns</a></li>
<li><a href="portfolio-tiles-boxed-7-col.html">7 Columns</a></li>
<li><a href="portfolio-tiles-boxed-8-col.html">8 Columns</a></li>
<li><a href="portfolio-tiles-boxed-9-col.html">9 Columns</a></li>
<li><a href="portfolio-tiles-boxed-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-tiles-boxed-title-gutter-2-col.html">2 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-gutter-3-col.html">3 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-gutter-4-col.html">4 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-gutter-5-col.html">5 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-gutter-6-col.html">6 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-gutter-7-col.html">7 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-gutter-8-col.html">8 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-gutter-9-col.html">9 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-gutter-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-tiles-boxed-title-2-col.html">2 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-3-col.html">3 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-4-col.html">4 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-5-col.html">5 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-6-col.html">6 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-7-col.html">7 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-8-col.html">8 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-9-col.html">9 Columns</a></li>
<li><a href="portfolio-tiles-boxed-title-10-col.html">10 Columns</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Tiles Wide</a>
<ul class="dropdown">
<li><a href="#">Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-tiles-wide-gutter-2-col.html">2 Columns</a></li>
<li><a href="portfolio-tiles-wide-gutter-3-col.html">3 Columns</a></li>
<li><a href="portfolio-tiles-wide-gutter-4-col.html">4 Columns</a></li>
<li><a href="portfolio-tiles-wide-gutter-5-col.html">5 Columns</a></li>
<li><a href="portfolio-tiles-wide-gutter-6-col.html">6 Columns</a></li>
<li><a href="portfolio-tiles-wide-gutter-7-col.html">7 Columns</a></li>
<li><a href="portfolio-tiles-wide-gutter-8-col.html">8 Columns</a></li>
<li><a href="portfolio-tiles-wide-gutter-9-col.html">9 Columns</a></li>
<li><a href="portfolio-tiles-wide-gutter-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-tiles-wide-2-col.html">2 Columns</a></li>
<li><a href="portfolio-tiles-wide-3-col.html">3 Columns</a></li>
<li><a href="portfolio-tiles-wide-4-col.html">4 Columns</a></li>
<li><a href="portfolio-tiles-wide-5-col.html">5 Columns</a></li>
<li><a href="portfolio-tiles-wide-6-col.html">6 Columns</a></li>
<li><a href="portfolio-tiles-wide-7-col.html">7 Columns</a></li>
<li><a href="portfolio-tiles-wide-8-col.html">8 Columns</a></li>
<li><a href="portfolio-tiles-wide-9-col.html">9 Columns</a></li>
<li><a href="portfolio-tiles-wide-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Gutter</a>
<ul class="dropdown">
<li><a href="portfolio-tiles-wide-title-gutter-2-col.html">2 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-gutter-3-col.html">3 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-gutter-4-col.html">4 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-gutter-5-col.html">5 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-gutter-6-col.html">6 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-gutter-7-col.html">7 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-gutter-8-col.html">8 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-gutter-9-col.html">9 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-gutter-10-col.html">10 Columns</a></li>
</ul>
</li>
<li><a href="#">Title - Gutter Less</a>
<ul class="dropdown">
<li><a href="portfolio-tiles-wide-title-2-col.html">2 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-3-col.html">3 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-4-col.html">4 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-5-col.html">5 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-6-col.html">6 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-7-col.html">7 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-8-col.html">8 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-9-col.html">9 Columns</a></li>
<li><a href="portfolio-tiles-wide-title-10-col.html">10 Columns</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Loading Styles</a>
<ul class="dropdown">
<li><a href="portfolio-extra-infinity-scroll.html">Infinity Scroll</a></li>
<li><a href="portfolio-extra-infinity-scroll-lazyload.html">Infinity Scroll Lazyload</a></li>
<li><a href="portfolio-extra-pagination.html">Pagination</a></li>
<li><a href="portfolio-extra-jquery-pagination.html">Pagination Jquery</a></li>
</ul>
</li>
<li><a href="#">Single</a>
<ul class="dropdown">
<li><a href="portfolio-details-image.html">With - Image</a></li>
<li><a href="portfolio-details-image-gallery.html">With - Image Gallery</a></li>
<li><a href="portfolio-details-video-gallery.html">With - Video Gallery</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Shop</a>
<ul class="dropdown">
<li><a href="shop-category.html">Category</a></li>
<li><a href="shop-category-sidebar.html">Category Sidebar</a></li>
<li><a href="shop-product-details.html">Product Details</a></li>
<li><a href="shop-cart.html">Cart</a></li>
<li><a href="shop-checkout.html">Checkout</a></li>
</ul>
</li>
<li><a href="#">Blog</a>
<ul class="dropdown">
<li><a href="#">Blog Classic</a>
<ul class="dropdown">
<li><a href="blog-classic-no-sidebar.html">Blog Classic No Sidebar</a></li>
<li><a href="blog-classic-left-sidebar.html">Blog Classic Left Sidebar</a></li>
<li><a href="blog-classic-right-sidebar.html">Blog Classic Right Sidebar</a></li>
<li><a href="blog-classic-both-sidebar.html">Blog Classic Both Sidebar</a></li>
</ul>
</li>
<li><a href="#">Blog Grid</a>
<ul class="dropdown">
<li><a href="blog-grid-2-column.html">Blog Grid 2 Column</a></li>
<li><a href="blog-grid-3-column.html">Blog Grid 3 Column</a></li>
<li><a href="blog-grid-4-column.html">Blog Grid 4 Column</a></li>
</ul>
</li>
<li><a href="#">Blog Single</a>
<ul class="dropdown">
<li><a href="blog-single-no-sidebar.html">Blog Single No Sidebar</a></li>
<li><a href="blog-single-left-sidebar.html">Blog Single Left Sidebar</a></li>
<li><a href="blog-single-right-sidebar.html">Blog Single Right Sidebar</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="javascript:void(0)">Shortcodes</a>
<div class="megamenu">
<div class="megamenu-row">
<div class="col3">
<ul class="list-unstyled list-dashed">
<li><a href="shortcode-accordion.html"><i class="fa fa-list-ul"></i> Accordion</a></li>
<li><a href="shortcode-alerts.html"><i class="fa fa-exclamation-circle"></i> Alerts</a></li>
<li><a href="shortcode-animations.html"><i class="fa fa-magic"></i> Animations</a></li>
<li><a href="shortcode-blockquotes.html"><i class="fa fa-quote-right"></i> Blockquotes</a></li>
<li><a href="shortcode-button-groups-and-dropdowns.html"><i class="fa fa-link"></i> Button Groups</a></li>
<li><a href="shortcode-button-hover-effect.html"><i class="fa fa-flag-o"></i> Button Hover Effect</a></li>
<li><a href="shortcode-buttons.html"><i class="fa fa-external-link"></i> Buttons</a></li>
<li><a href="shortcode-call-to-actions.html"><i class="fa fa-plus-square"></i> Call To Actions</a></li>
<li><a href="shortcode-charts.html"><i class="fa fa-pie-chart"></i> Charts</a></li>
<li><a href="shortcode-columns-grids.html"><i class="fa fa-columns"></i> Columns Grids</a></li>
<li><a href="shortcode-countdown-timer.html"><i class="fa fa-clock-o"></i> Countdown Timer</a></li>
<li><a href="shortcode-datetime-datepicker.html"><i class="fa fa-calendar"></i> Date Picker</a></li>
<li><a href="shortcode-datetime-timepicker.html"><i class="fa fa-calendar"></i> Time Picker</a></li>
<li><a href="shortcode-datetime-datetimepicker.html"><i class="fa fa-calendar"></i> Bootstrap Date-Time Picker</a></li>
<li><a href="shortcode-datetime-datepair.html"><i class="fa fa-calendar"></i> Date Pair</a></li>
<li><a href="shortcode-divider.html"><i class="fa fa-indent"></i> Divider</a></li>
</ul>
</div>
<div class="col3">
<ul class="list-unstyled list-dashed">
<li><a href="shortcode-dropcaps.html"><i class="fa fa-bold"></i> Dropcaps</a></li>
<li><a href="shortcode-flex-sliders.html"><i class="fa fa-sliders"></i> Flex Sliders</a></li>
<li><a href="shortcode-flickr-feed.html"><i class="fa fa-sliders"></i> Flickr Feed</a></li>
<li><a href="shortcode-flipbox.html"><i class="fa fa-square"></i> Flipbox</a></li>
<li><a href="shortcode-forms.html"><i class="fa fa-align-justify"></i> Forms</a></li>
<li><a href="shortcode-funfacts.html"><i class="fa fa-eye-slash"></i> Funfacts</a></li>
<li><a href="shortcode-background-html5-video.html"><i class="fa fa-video-camera"></i> HTML5 Background Video</a></li>
<li><a href="shortcode-iconbox.html"><i class="fa fa-unsorted"></i> Icon Box</a></li>
<li><a href="shortcode-icon-7stroke.html"><i class="fa fa-circle-o"></i> Icons 7stroke</a></li>
<li><a href="shortcode-icon-elegant-icons.html"><i class="fa fa-eye-slash"></i> Icons Elegant</a></li>
<li><a href="shortcode-icon-flat-color-icons.html"><i class="fa fa-i-cursor"></i> Icons Flat Color</a></li>
<li><a href="shortcode-icon-fontawesome.html"><i class="fa fa-fort-awesome"></i> Icons FontAwesome</a></li>
<li><a href="shortcode-icon-fontawesome-tutorial.html"><i class="fa fa-fonticons"></i> Icons FontAwesome Tutorial</a></li>
<li><a href="shortcode-icon-strokegap.html"><span class="strokegap-icon strokegap-icon-WorldWide"></span> Icons Strokegap</a></li>
<li><a href="shortcode-image-box.html"><i class="fa fa-file-image-o"></i> Image Box</a></li>
<li><a href="shortcode-instagram.html"><i class="fa fa-instagram"></i> Instagram Feed</a></li>
</ul>
</div>
<div class="col3">
<ul class="list-unstyled list-dashed">
<li><a href="shortcode-labels-badges.html"><i class="fa fa-check-square-o"></i> Labels Badges</a></li>
<li><a href="shortcode-listgroup-panels.html"><i class="fa fa-th-list"></i> Listgroup Panels</a></li>
<li><a href="shortcode-lists.html"><i class="fa fa-list"></i> Lists</a></li>
<li><a href="shortcode-maps.html"><i class="fa fa-map-o"></i> Maps</a></li>
<li><a href="shortcode-media-embed.html"><i class="fa fa-play-circle-o"></i> Media Embed</a></li>
<li><a href="shortcode-modal-bootstrap.html"><i class="fa fa-search-plus"></i> Modal</a></li>
<li><a href="shortcode-modal-lightbox.html"><i class="fa fa-expand"></i> Lightbox</a></li>
<li><a href="shortcode-navigation.html"><i class="fa fa-navicon"></i> Navigation</a></li>
<li><a href="shortcode-owl-carousel.html"><i class="fa fa-sliders"></i> Owl Carousel</a></li>
<li><a href="shortcode-pagination.html"><i class="fa fa-arrow-circle-o-right"></i> Pagination</a></li>
<li><a href="shortcode-progressbar.html"><i class="fa fa-tasks"></i> Progress Bars</a></li>
<li><a href="shortcode-responsive.html"><i class="fa fa-tablet"></i> Responsive</a></li>
<li><a href="shortcode-separator.html"><i class="fa fa-minus-square-o"></i> Separator</a></li>
<li><a href="shortcode-sitemap.html"><i class="fa fa-sitemap"></i> Sitemap</a></li>
<li><a href="shortcode-sliders.html"><i class="fa fa-sliders"></i> Sliders</a></li>
<li><a href="shortcode-smoothscrolling.html"><i class="fa fa-binoculars"></i> Smoothscrolling</a></li>
</ul>
</div>
<div class="col3">
<ul class="list-unstyled list-dashed">
<li><a href="shortcode-styled-icons.html"><i class="fa fa-facebook-square"></i> Styled Icons</a></li>
<li><a href="shortcode-subscribe.html"><i class="fa fa-user-plus"></i> Subscribe</a></li>
<li><a href="shortcode-tables.html"><i class="fa fa-table"></i> Tables</a></li>
<li><a href="shortcode-tabs.html"><i class="fa fa-indent"></i> Tabs</a></li>
<li><a href="shortcode-textblock.html"><i class="fa fa-bold"></i> Textblock</a></li>
<li><a href="shortcode-thumbnails-carousels.html"><i class="fa fa-sliders"></i> Thumbnails/carousels</a></li>
<li><a href="shortcode-title.html"><i class="fa fa-text-height"></i> Title</a></li>
<li><a href="shortcode-timer-final-countdown.html"><i class="fa fa-text-height"></i> Timer Final Countdown</a></li>
<li><a href="shortcode-timer-flipclock.html"><i class="fa fa-text-height"></i> Timer Flipclock</a></li>
<li><a href="shortcode-timer-slick-circular.html"><i class="fa fa-text-height"></i> Timer Slick Circular</a></li>
<li><a href="shortcode-twitter.html"><i class="fa fa-twitter-square"></i> Twitter Feed</a></li>
<li><a href="shortcode-typography.html"><i class="fa fa-font"></i> Typography</a></li>
<li><a href="shortcode-vertical-timeline.html"><i class="fa fa-arrows-v"></i> Vertical Timeline</a></li>
<li><a href="shortcode-widgets.html"><i class="fa fa-gift"></i> Widgets</a></li>
<li><a href="shortcode-working-process.html"><i class="fa fa-exchange"></i> Working Process</a></li>
</ul>
</div>
</div>
</div>
</li>
</ul>
</nav>
</div>
</div>
</div>
</header>
<!-- Start main-content -->
<div class="main-content">
<!-- Section: inner-header -->
<section class="inner-header divider parallax layer-overlay overlay-dark-5" data-bg-img="http://placehold.it/1920x1280">
<div class="container pt-90 pb-50">
<!-- Section Content -->
<div class="section-content pt-100">
<div class="row">
<div class="col-md-12">
<h3 class="title text-white">Portfolio 4 Box Title</h2>
</div>
</div>
</div>
</div>
</section>
<section>
<div class="container">
<div class="row">
<div class="col-md-12">
<!-- Works Filter -->
<div class="portfolio-filter font-alt align-center">
<a href="#" class="active" data-filter="*">All</a>
<a href="#branding" class="" data-filter=".branding">Branding</a>
<a href="#design" class="" data-filter=".design">Design</a>
<a href="#photography" class="" data-filter=".photography">Photography</a>
</div>
<!-- End Works Filter -->
<!-- Portfolio Gallery Grid -->
<div id="grid" class="gallery-isotope grid-4 clearfix">
<!-- Portfolio Item Start -->
<div class="gallery-item photography">
<div class="thumb">
<img class="img-fullwidth" src="http://placehold.it/450x250" alt="project">
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a data-lightbox="image" href="http://placehold.it/450x250"><i class="fa fa-plus"></i></a>
<a href="#"><i class="fa fa-link"></i></a>
</div>
</div>
</div>
<a class="hover-link" data-lightbox="image" href="http://placehold.it/450x250">View more</a>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item branding">
<div class="thumb">
<img class="img-fullwidth" src="http://placehold.it/450x250" alt="project">
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a href="#"><i class="fa fa-link"></i></a>
<a href="#"><i class="fa fa-heart-o"></i></a>
</div>
</div>
</div>
<a class="hover-link" data-lightbox="image" href="http://placehold.it/450x250">View more</a>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item design">
<div class="thumb">
<img class="img-fullwidth" src="http://placehold.it/450x250" alt="project">
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a href="#"><i class="fa fa-link"></i></a>
</div>
</div>
</div>
<a class="hover-link" data-lightbox="image" href="http://placehold.it/450x250">View more</a>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item photography">
<div class="thumb">
<img class="img-fullwidth" src="http://placehold.it/450x250" alt="project">
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a class="popup-youtube" href="http://www.youtube.com/watch?v=0O2aH4XLbto"><i class="fa fa-youtube-play"></i></a>
</div>
</div>
</div>
<a class="hover-link" data-lightbox="image" href="http://placehold.it/450x250">View more</a>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item branding">
<div class="thumb">
<img class="img-fullwidth" src="http://placehold.it/450x250" alt="project">
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a class="popup-vimeo" href="https://vimeo.com/45830194"><i class="fa fa-play"></i></a>
</div>
</div>
</div>
<a class="hover-link" data-lightbox="image" href="http://placehold.it/450x250">View more</a>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item design">
<div class="thumb">
<div class="flexslider-wrapper">
<div class="flexslider">
<ul class="slides">
<li><a href="http://placehold.it/450x250" title="Portfolio Gallery - Photo 1"><img src="http://placehold.it/450x250" alt=""></a></li>
<li><a href="http://placehold.it/450x250" title="Portfolio Gallery - Photo 2"><img src="http://placehold.it/450x250" alt=""></a></li>
<li><a href="http://placehold.it/450x250" title="Portfolio Gallery - Photo 3"><img src="http://placehold.it/450x250" alt=""></a></li>
</ul>
</div>
</div>
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a href="#"><i class="fa fa-picture-o"></i></a>
</div>
</div>
</div>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item photography">
<div class="thumb">
<img class="img-fullwidth" src="http://placehold.it/450x250" alt="project">
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a data-lightbox="image" href="http://placehold.it/450x250"><i class="fa fa-plus"></i></a>
<a href="#"><i class="fa fa-link"></i></a>
</div>
</div>
</div>
<a class="hover-link" data-lightbox="image" href="http://placehold.it/450x250">View more</a>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item design">
<div class="thumb">
<div class="flexslider-wrapper" data-direction="vertical">
<div class="flexslider">
<ul class="slides">
<li><a href="http://placehold.it/450x250" title="Portfolio Gallery - Photo 1"><img src="http://placehold.it/450x250" alt=""></a></li>
<li><a href="http://placehold.it/450x250" title="Portfolio Gallery - Photo 2"><img src="http://placehold.it/450x250" alt=""></a></li>
<li><a href="http://placehold.it/450x250" title="Portfolio Gallery - Photo 3"><img src="http://placehold.it/450x250" alt=""></a></li>
</ul>
</div>
</div>
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a href="#"><i class="fa fa-picture-o"></i></a>
</div>
</div>
</div>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item photography design">
<div class="thumb">
<img class="img-fullwidth" src="http://placehold.it/450x250" alt="project">
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a data-lightbox="image" href="http://placehold.it/450x250"><i class="fa fa-plus"></i></a>
</div>
</div>
</div>
<a class="hover-link" data-lightbox="image" href="http://placehold.it/450x250">View more</a>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item photography branding">
<div class="thumb">
<img class="img-fullwidth" src="http://placehold.it/450x250" alt="project">
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a data-lightbox="image" href="http://placehold.it/450x250"><i class="fa fa-plus"></i></a>
</div>
</div>
</div>
<a class="hover-link" data-lightbox="image" href="http://placehold.it/450x250">View more</a>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item photography">
<div class="thumb">
<img class="img-fullwidth" src="http://placehold.it/450x250" alt="project">
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a data-lightbox="image" href="http://placehold.it/450x250"><i class="fa fa-plus"></i></a>
</div>
</div>
</div>
<a class="hover-link" data-lightbox="image" href="http://placehold.it/450x250">View more</a>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
<!-- Portfolio Item Start -->
<div class="gallery-item photography">
<div class="thumb">
<img class="img-fullwidth" src="http://placehold.it/450x250" alt="project">
<div class="overlay-shade"></div>
<div class="icons-holder">
<div class="icons-holder-inner">
<div class="styled-icons icon-sm icon-dark icon-circled icon-theme-colored">
<a data-lightbox="image" href="http://placehold.it/450x250"><i class="fa fa-plus"></i></a>
</div>
</div>
</div>
<a class="hover-link" data-lightbox="image" href="http://placehold.it/450x250">View more</a>
</div>
<div class="portfolio-description">
<h5 class="title"><a href="#">Sample Portfolio Title</a></h5>
<span class="category"><span>Category Art</span></span>
</div>
</div>
<!-- Portfolio Item End -->
</div>
<!-- End Portfolio Gallery Grid -->
</div>
</div>
</div>
</section>
</div>
<!-- end main-content -->
<!-- Footer -->
<footer id="footer" class="footer divider parallax layer-overlay overlay-dark-9" data-bg-img="http://placehold.it/1920x1280" data-parallax-ratio="0.7">
<div class="container pt-70 pb-40">
<div class="row border-bottom-black">
<div class="col-sm-6 col-md-3">
<div class="widget dark">
<img class="mt-10 mb-20" alt="" src="http://placehold.it/178x55">
<p>203, Envato Labs, Behind Alis Steet, Melbourne, Australia.</p>
<ul class="list-inline mt-5">
<li class="m-0 pl-10 pr-10"> <i class="fa fa-phone text-theme-colored mr-5"></i> <a class="text-gray" href="#">123-456-789</a> </li>
<li class="m-0 pl-10 pr-10"> <i class="fa fa-envelope-o text-theme-colored mr-5"></i> <a class="text-gray" href="#">contact@yourdomain.com</a> </li>
<li class="m-0 pl-10 pr-10"> <i class="fa fa-globe text-theme-colored mr-5"></i> <a class="text-gray" href="#">www.yourdomain.com</a> </li>
</ul>
</div>
</div>
<div class="col-sm-6 col-md-3">
<div class="widget dark">
<h5 class="widget-title line-bottom">Useful Links</h5>
<ul class="list angle-double-right list-border">
<li><a href="#">Body Building</a></li>
<li><a href="#">Fitness Classes</a></li>
<li><a href="#">Weight lifting</a></li>
<li><a href="#">Yoga Courses</a></li>
<li><a href="#">Training</a></li>
</ul>
</div>
</div>
<div class="col-sm-6 col-md-3">
<div class="widget dark">
<h5 class="widget-title line-bottom">Twitter Feed</h5>
<div class="twitter-feed list-border clearfix" data-username="Envato"></div>
</div>
</div>
<div class="col-sm-6 col-md-3">
<div class="widget dark">
<h5 class="widget-title line-bottom">Opening Hours</h5>
<div class="opening-hours">
<ul class="list-border">
<li class="clearfix"> <span> Mon - Tues : </span>
<div class="value pull-right"> 6.00 am - 10.00 pm </div>
</li>
<li class="clearfix"> <span> Wednes - Thurs :</span>
<div class="value pull-right"> 8.00 am - 6.00 pm </div>
</li>
<li class="clearfix"> <span> Fri : </span>
<div class="value pull-right"> 3.00 pm - 8.00 pm </div>
</li>
<li class="clearfix"> <span> Sun : </span>
<div class="value pull-right"> Colosed </div>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="row mt-30">
<div class="col-md-5">
<div class="widget dark">
<h5 class="widget-title mb-10">Subscribe Us</h5>
<!-- Mailchimp Subscription Form Starts Here -->
<form id="mailchimp-subscription-form-footer" class="newsletter-form">
<div class="input-group">
<input type="email" value="" name="EMAIL" placeholder="Your Email" class="form-control input-lg font-16" data-height="45px" id="mce-EMAIL-footer" style="height: 45px;">
<span class="input-group-btn">
<button data-height="45px" class="btn btn-colored btn-theme-colored btn-xs m-0 font-14" type="submit">Subscribe</button>
</span>
</div>
</form>
<!-- Mailchimp Subscription Form Validation-->
<script type="text/javascript">
$('#mailchimp-subscription-form-footer').ajaxChimp({
callback: mailChimpCallBack,
url: '//thememascot.us9.list-manage.com/subscribe/post?u=a01f440178e35febc8cf4e51f&id=49d6d30e1e'
});
function mailChimpCallBack(resp) {
// Hide any previous response text
var $mailchimpform = $('#mailchimp-subscription-form-footer'),
$response = '';
$mailchimpform.children(".alert").remove();
console.log(resp);
if (resp.result === 'success') {
$response = '<div class="alert alert-success"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>' + resp.msg + '</div>';
} else if (resp.result === 'error') {
$response = '<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>' + resp.msg + '</div>';
}
$mailchimpform.prepend($response);
}
</script>
<!-- Mailchimp Subscription Form Ends Here -->
</div>
</div>
<div class="col-md-3 col-md-offset-1">
<div class="widget dark">
<h5 class="widget-title mb-10">Call Us Now</h5>
<div class="text-gray">
+61 3 1234 5678 <br>
+12 3 1234 5678
</div>
</div>
</div>
<div class="col-md-3">
<div class="widget dark">
<h5 class="widget-title mb-10">Connect With Us</h5>
<ul class="styled-icons icon-dark icon-circled icon-sm">
<li><a href="#"><i class="fa fa-facebook"></i></a></li>
<li><a href="#"><i class="fa fa-twitter"></i></a></li>
<li><a href="#"><i class="fa fa-skype"></i></a></li>
<li><a href="#"><i class="fa fa-youtube"></i></a></li>
<li><a href="#"><i class="fa fa-instagram"></i></a></li>
<li><a href="#"><i class="fa fa-pinterest"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="footer-bottom bg-black-333">
<div class="container pt-20 pb-20">
<div class="row">
<div class="col-md-6">
<p class="font-11 text-black-777 m-0">Copyright ©2015 ThemeMascot. All Rights Reserved</p>
</div>
<div class="col-md-6 text-right">
<div class="widget no-border m-0">
<ul class="list-inline sm-text-center mt-5 font-12">
<li>
<a href="#">FAQ</a>
</li>
<li>|</li>
<li>
<a href="#">Help Desk</a>
</li>
<li>|</li>
<li>
<a href="#">Support</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</footer>
<a class="scrollToTop" href="#"><i class="fa fa-angle-up"></i></a> </div>
<!-- end wrapper -->
<!-- Footer Scripts -->
<!-- JS | Custom script for all pages -->
<script src="js/custom.js"></script>
</body>
</html>
|
brandonccy/SmartNano
|
templates/Original/haircare-client-html/portfolio-boxed-title-4-col.html
|
HTML
|
gpl-3.0
| 85,209
|
<div class="header"><h1 class="slidetitle">Mantingueu-vos connectat</h1></div>
<div class="main">
<div class="text">
<div>
<p>L'indicador de missatges de l'Ubuntu us proporciona una vista ràpida dels
missatges entrants de totes les aplicacions i xarxes socials. Vegeu d'un cop
d'ull on hi ha alguna cosa per llegir nova, independentment d'on provingui.</p>
</div>
<div class="featured">
<h2 class="subtitle">Serveis compatibles</h2>
<ul>
<li>
<img class="icon" src="icons/twitter.png" />
<p class="caption">Twitter</p>
</li>
<li>
<img class="icon" src="icons/facebook.png" />
<p class="caption">Facebook</p>
</li>
<li>
<img class="icon" src="icons/identica.png" />
<p class="caption">Identi.ca</p>
</li>
</ul>
</div>
</div>
<img class="screenshot" src="screenshots/social.jpeg" />
</div>
|
Alberto-Beralix/Beralix
|
i386-squashfs-root/usr/share/ubiquity-slideshow/slides/loc.ca/social.html
|
HTML
|
gpl-3.0
| 808
|
from util import A, B, B_reversed, C, D, E, F, G, H, instr, spec, spec_reversed
_mark = set(dir()) ; _mark.add('_mark')
@A
def jmp(address):
'''
1001 010k kkkk 110k
kkkk kkkk kkkk kkkk
'''
def cli():
return 16, 0b1001010011111000
@B
def ldi(register, immediate):
'''
1110 KKKK dddd KKKK
'''
@C
def out(io_port, register):
'''
1011 1AAr rrrr AAAA
'''
@A
def rcall(address):
'''
1101 kkkk kkkk kkkk
'''
@B_reversed
def sts(address, register):
'''
1001 001d dddd 0000
kkkk kkkk kkkk kkkk
'''
@D
def mov(Rd, Rr):
'''
0010 11rd dddd rrrr
'''
def sei():
return 16, 0b1001010001111000
def ret():
return 16, 0b1001010100001000
@A
def rjmp(address):
'''
1100 kkkk kkkk kkkk
'''
@B
def lds(register, address):
'''
1001 000d dddd 0000
kkkk kkkk kkkk kkkk
'''
@E
def sbrs(register, bit):
'''
1111 111r rrrr 0bbb
'''
def dw(values, data):
return -1, data
def db(values, data):
return -1, data
@F
def st_post_incr_Y(Rr):
'''
1001 001r rrrr 1001
'''
@F
def st_post_incr_Z(Rr):
'''
1001 001r rrrr 0001
'''
@G
def ld_pre_decr_Y(Rd):
'''
1001 000d dddd 1010
'''
@G
def ld_post_incr_X(Rd):
'''
1001 000d dddd 1101
'''
@G
def ld_post_incr_Z(Rd):
'''
1001 000d dddd 0001
'''
@G
def ld_pre_decr_Z(Rd):
'''
1001 000d dddd 0010
'''
@G
def lpm(Rd):
'''
1001 000d dddd 0100
'''
@G
def lpm_post_incr_Z(Rd):
'''
1001 000d dddd 0101
'''
@B
def cpi(register, immediate):
'''
0011 KKKK dddd KKKK
'''
@A
def brne(address):
'''
1111 01kk kkkk k001
'''
@A
def breq(address):
'''
1111 00kk kkkk k001
'''
@A
def brlo(address):
'''
1111 00kk kkkk k000
'''
@G
def lsr(Rd):
'''
1001 010d dddd 0110
'''
@G
def lsl(Rd):
'''
0000 11dd dddd dddd
'''
@D
def add(Rd, Rr):
'''
0000 11rd dddd rrrr
'''
@A
def brcc(address):
'''
1111 01kk kkkk k000
'''
@G
def inc(Rd):
'''
1001 010d dddd 0011
'''
@G
def dec(Rd):
'''
1001 010d dddd 1010
'''
def ijmp():
return 16, 0b1001010000001001
@D
def cp(Rd, Rr):
'''
0001 01rd dddd rrrr
'''
@D
def cpse(Rd, Rr):
'''
0001 00rd dddd rrrr
'''
@D
def cpc(Rd, Rr):
'''
0000 01rd dddd rrrr
'''
@A
def brsh(address):
'''
1111 01kk kkkk k000
'''
@D
def movw(Rd, Rr):
'''
0000 0001 dddd rrrr
'''
@B
def andi(register, immediate):
'''
0111 KKKK dddd KKKK
'''
@H
def sbis(register, bit):
'''
1001 1011 AAAA Abbb
'''
@G
def clr(Rd):
'''
0010 01dd dddd dddd
'''
@F
def push(Rr):
'''
1001 001r rrrr 1111
'''
@G
def pop(Rd):
'''
1001 000d dddd 1111
'''
@D
def or_(Rd, Rr):
'''
0010 10rd dddd rrrr
'''
@G
def swap(Rd):
'''
1001 010d dddd 0010
'''
@B
def adiw(register, immediate):
'''
1001 0110 KKdd KKKK
'''
@B
def sbiw(register, immediate):
'''
1001 0111 KKdd KKKK
'''
@B
def subi(register, immediate):
'''
0101 KKKK dddd KKKK
'''
@D
def mul(Rd, Rr):
'''
1001 11rd dddd rrrr
'''
ops = dict(
(name, func)
for name, func in locals().iteritems()
if name not in _mark
)
class InstructionsMixin(object):
@instr
def jmp(self, address):
self.here += 2
return address
@instr
def rjmp(self, address):
return address
@instr
def rcall(self, address):
return address
@instr
def cli(self):
pass
@instr
def sei(self):
pass
@instr
def ret(self):
pass
@instr
def ldi(self, target, address):
if isinstance(address, str):
assert len(address) == 1, repr(address)
address = ord(address)
return target, address << 1
@instr
def out(self, target, address):
return target, address
@instr
def sts(self, address, register):
self.here += 2
return address << 1, register
@instr
def mov(self, target, source):
return target, source
@instr
def lds(self, target, address):
self.here += 2
return target, address << 1
@instr
def sbrs(self, target, address):
return target, address
@spec
def st_post_incr(self, ptr, register):
pass
@spec_reversed
def ld_post_incr(self, register, ptr):
pass
@spec_reversed
def ld_pre_decr(self, register, ptr):
pass
@spec_reversed
def lpm_post_incr(self, register, ptr):
pass
@instr
def cpi(self, register, immediate):
if isinstance(immediate, str):
assert len(immediate) == 1, repr(immediate)
immediate = ord(immediate)
return register, immediate << 1
@instr
def brne(self, address):
return address
@instr
def breq(self, address):
return address
@instr
def inc(self, address):
return address
@instr
def mul(self, target, source):
return target, source
@instr
def brlo(self, address):
return address
@instr
def subi(self, target, source):
return target, source
@instr
def add(self, target, source):
return target, source
@instr
def dec(self, address):
return address
@instr
def clr(self, address):
return address
@instr
def lsl(self, address):
return address
@instr
def brcc(self, address):
return address
@instr
def or_(self, target, source):
return target, source
@instr
def push(self, address):
return address
@instr
def swap(self, address):
return address
@instr
def pop(self, address):
return address
@instr
def movw(self, target, source):
return target, source
@instr
def andi(self, target, source):
return target, source
@instr
def adiw(self, target, source):
return target, source
def lpm(self, target, source):
assert source == 30, repr(source) # Must be Z
self._one('lpm', target)
@instr
def cp(self, target, source):
return target, source
@instr
def cpc(self, target, source):
return target, source
@instr
def brsh(self, address):
return address
@instr
def cpse(self, target, source):
return target, source
@instr
def sbiw(self, target, source):
return target, source
@instr
def lsr(self, address):
return address
@instr
def ijmp(self):
pass
def _one(self, op, address):
name, address = self._name_or_addr(address)
addr = self._get_here()
print 'assembling %s instruction at %s to %s' % (op, addr, name)
self.data[addr] = (op, address)
self.here += 2
def _instruction_namespace(self):
for n in dir(InstructionsMixin):
if n.startswith('_'):
continue
yield n, getattr(self, n)
if __name__ == '__main__':
import pprint
pprint.pprint(ops)
pprint.pprint(dict(InstructionsMixin()._instruction_namespace()))
|
calroc/AVRV
|
instructions.py
|
Python
|
gpl-3.0
| 6,667
|
#include "audiencequestioncountresponse.h"
AudienceQuestionCountResponse::AudienceQuestionCountResponse ( int read, int unread, int total )
: _read ( read ),
_unread ( unread ),
_total ( total ) {}
int AudienceQuestionCountResponse::read() {
return this->_read;
}
int AudienceQuestionCountResponse::unread() {
return this->_unread;
}
int AudienceQuestionCountResponse::total() {
return this->_total;
}
|
thm-projects/arsnova-overlay
|
src/audiencequestioncountresponse.cpp
|
C++
|
gpl-3.0
| 434
|
"use strict";
const dbHelper = require('../utils/dbhelper.js');
const Stacks = function () {
};
/**
* Get all the stack
* @param done function to call with the results
*/
Stacks.getAll = function( done ) {
dbHelper.getAllFromTable("STACKS" , done );
};
/**
* Add a new stack
* @param name Name of the stack to add
* @param description
* @param done Function to call when we have a result
* @done function to call with the result
*/
Stacks.add = function ( name, description, done) {
const sql = "INSERT INTO stacks ( name, description ) values ( $1 , $2 ) returning id";
const params = [ name, description ];
dbHelper.insert( sql, params ,
function( result ) {
done( result.rows[0].id );
},
function(error) {
console.log(error);
done(null , error );
} );
};
/**
* Delete a set of stacks using their ID numbers
* @param ids
* @param done
*/
Stacks.delete = function (ids, done) {
dbHelper.deleteByIds( "STACKS" , ids , done );
};
module.exports = Stacks;
|
gpimblott/TechRadar
|
dao/stacks.js
|
JavaScript
|
gpl-3.0
| 1,062
|
#include <iostream>
namespace Exercise
{
int i = 0;
double d = 0;
const int limit = 1000;
}
int i = 0;
void fun()
{
using namespace Exercise;
double d = 3.1416;
int i2 = limit + 1;
//++i; //error: reference to ‘i’ is ambiguous
++::i;
std::cout << "Exercise:: i = " << Exercise::i << ", d = " << Exercise::d << ", limit = "
<< Exercise::limit << '\n';
std::cout << "Global:: i = " << ::i << '\n';
std::cout << "Local:: d = " << d << ", i2 = " << i2 << '\n';
}
int main()
{
fun();
}
/*
Exercise:: i = 0, d = 0, limit = 1000
Global:: i = 1
Local:: d = 3.1416, i2 = 1001
*/
|
gaoxiangnumber1/Cpp-Primer-5th-Edition-Exercise-Solutions
|
CH18/18-17-4.cpp
|
C++
|
gpl-3.0
| 598
|
/*
===========================================================================
Doom 3 GPL Source Code
Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
This file is part of the Doom 3 GPL Source Code ("Doom 3 Source Code").
Doom 3 Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Doom 3 Source Code is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
#include "../idlib/precompiled.h"
#pragma hdrstop
#include "tr_local.h"
/*
==========================================================================================
GUI SHADERS
==========================================================================================
*/
/*
================
R_SurfaceToTextureAxis
Calculates two axis for the surface sutch that a point dotted against
the axis will give a 0.0 to 1.0 range in S and T when inside the gui surface
================
*/
void R_SurfaceToTextureAxis( const srfTriangles_t *tri, idVec3 &origin, idVec3 axis[3] ) {
float area, inva;
float d0[5], d1[5];
idDrawVert *a, *b, *c;
float bounds[2][2];
float boundsOrg[2];
int i, j;
float v;
// find the bounds of the texture
bounds[0][0] = bounds[0][1] = 999999;
bounds[1][0] = bounds[1][1] = -999999;
for ( i = 0 ; i < tri->numVerts ; i++ ) {
for ( j = 0 ; j < 2 ; j++ ) {
v = tri->verts[i].st[j];
if ( v < bounds[0][j] ) {
bounds[0][j] = v;
}
if ( v > bounds[1][j] ) {
bounds[1][j] = v;
}
}
}
// use the floor of the midpoint as the origin of the
// surface, which will prevent a slight misalignment
// from throwing it an entire cycle off
boundsOrg[0] = floor( ( bounds[0][0] + bounds[1][0] ) * 0.5 );
boundsOrg[1] = floor( ( bounds[0][1] + bounds[1][1] ) * 0.5 );
// determine the world S and T vectors from the first drawSurf triangle
a = tri->verts + tri->indexes[0];
b = tri->verts + tri->indexes[1];
c = tri->verts + tri->indexes[2];
VectorSubtract( b->xyz, a->xyz, d0 );
d0[3] = b->st[0] - a->st[0];
d0[4] = b->st[1] - a->st[1];
VectorSubtract( c->xyz, a->xyz, d1 );
d1[3] = c->st[0] - a->st[0];
d1[4] = c->st[1] - a->st[1];
area = d0[3] * d1[4] - d0[4] * d1[3];
if ( area == 0.0 ) {
axis[0].Zero();
axis[1].Zero();
axis[2].Zero();
return; // degenerate
}
inva = 1.0 / area;
axis[0][0] = (d0[0] * d1[4] - d0[4] * d1[0]) * inva;
axis[0][1] = (d0[1] * d1[4] - d0[4] * d1[1]) * inva;
axis[0][2] = (d0[2] * d1[4] - d0[4] * d1[2]) * inva;
axis[1][0] = (d0[3] * d1[0] - d0[0] * d1[3]) * inva;
axis[1][1] = (d0[3] * d1[1] - d0[1] * d1[3]) * inva;
axis[1][2] = (d0[3] * d1[2] - d0[2] * d1[3]) * inva;
idPlane plane;
plane.FromPoints( a->xyz, b->xyz, c->xyz );
axis[2][0] = plane[0];
axis[2][1] = plane[1];
axis[2][2] = plane[2];
// take point 0 and project the vectors to the texture origin
VectorMA( a->xyz, boundsOrg[0] - a->st[0], axis[0], origin );
VectorMA( origin, boundsOrg[1] - a->st[1], axis[1], origin );
}
/*
=================
R_RenderGuiSurf
Create a texture space on the given surface and
call the GUI generator to create quads for it.
=================
*/
void R_RenderGuiSurf( idUserInterface *gui, drawSurf_t *drawSurf ) {
idVec3 origin, axis[3];
// for testing the performance hit
if ( r_skipGuiShaders.GetInteger() == 1 ) {
return;
}
// don't allow an infinite recursion loop
if ( tr.guiRecursionLevel == 4 ) {
return;
}
tr.pc.c_guiSurfs++;
// create the new matrix to draw on this surface
R_SurfaceToTextureAxis( drawSurf->geo, origin, axis );
float guiModelMatrix[16];
float modelMatrix[16];
guiModelMatrix[0] = axis[0][0] / 640.0;
guiModelMatrix[4] = axis[1][0] / 480.0;
guiModelMatrix[8] = axis[2][0];
guiModelMatrix[12] = origin[0];
guiModelMatrix[1] = axis[0][1] / 640.0;
guiModelMatrix[5] = axis[1][1] / 480.0;
guiModelMatrix[9] = axis[2][1];
guiModelMatrix[13] = origin[1];
guiModelMatrix[2] = axis[0][2] / 640.0;
guiModelMatrix[6] = axis[1][2] / 480.0;
guiModelMatrix[10] = axis[2][2];
guiModelMatrix[14] = origin[2];
guiModelMatrix[3] = 0;
guiModelMatrix[7] = 0;
guiModelMatrix[11] = 0;
guiModelMatrix[15] = 1;
myGlMultMatrix( guiModelMatrix, drawSurf->space->modelMatrix,
modelMatrix );
tr.guiRecursionLevel++;
// call the gui, which will call the 2D drawing functions
tr.guiModel->Clear();
gui->Redraw( tr.viewDef->renderView.time );
tr.guiModel->EmitToCurrentView( modelMatrix, drawSurf->space->weaponDepthHack );
tr.guiModel->Clear();
tr.guiRecursionLevel--;
}
/*
================,
R_ReloadGuis_f
Reloads any guis that have had their file timestamps changed.
An optional "all" parameter will cause all models to reload, even
if they are not out of date.
Should we also reload the map models?
================
*/
void R_ReloadGuis_f( const idCmdArgs &args ) {
bool all;
if ( !idStr::Icmp( args.Argv(1), "all" ) ) {
all = true;
common->Printf( "Reloading all gui files...\n" );
} else {
all = false;
common->Printf( "Checking for changed gui files...\n" );
}
uiManager->Reload( all );
}
/*
================,
R_ListGuis_f
================
*/
void R_ListGuis_f( const idCmdArgs &args ) {
uiManager->ListGuis();
}
|
iodoom-gitorious/windowshasyous-dhewg-iodoom3
|
neo/renderer/tr_guisurf.cpp
|
C++
|
gpl-3.0
| 6,219
|
<?php
class Usuario {
private $idusuario;
private $deslogin;
private $dessenha;
private $dtcadastro;
public function getIdusuario(){
return $this->idusuario;
}
public function setIdusuario($value){
$this->idusuario = $value;
}
public function getDeslogin(){
return $this->deslogin;
}
public function setDeslogin($value){
$this->deslogin = $value;
}
public function getDessenha(){
return $this->dessenha;
}
public function setDessenha($value){
$this->dessenha = $value;
}
public function getDtcadastro(){
return $this->dtcadastro;
}
public function setDtcadastro($value){
$this->dtcadastro = $value;
}
public function loadById($id) {
$sql = new Sql();
$results = $sql->select("SELECT * FROM tb_usuarios WHERE idusuario = :ID", array(
":ID"=>$id
));
if (count($results) > 0) {
$row = $results[0];
$this->setIdusuario($row['idusuario']);
$this->setDeslogin($row['deslogin']);
$this->setDessenha($row['dessenha']);
$this->setDtcadastro(new DateTime($row['dtcadastro']));
}
}
public function __toString() {
return json_encode(array(
"idusuario"=>$this->getIdusuario(),
"deslogin"=>$this->getDeslogin(),
"dessenha"=>$this->getDessenha(),
"dtcadastro"=>$this->getDtcadastro()->format("d/m/Y H:i:s")
));
}
}
|
abrandao/lab
|
crud/dao/class/Usuario.php
|
PHP
|
gpl-3.0
| 1,346
|
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2015 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.sarius.multiplayer_pd.items.wands;
import com.sarius.multiplayer_pd.Assets;
import com.sarius.multiplayer_pd.Dungeon;
import com.sarius.multiplayer_pd.DungeonTilemap;
import com.sarius.multiplayer_pd.ResultDescriptions;
import com.sarius.multiplayer_pd.actors.Actor;
import com.sarius.multiplayer_pd.actors.Char;
import com.sarius.multiplayer_pd.actors.buffs.Paralysis;
import com.sarius.multiplayer_pd.actors.mobs.Golem;
import com.sarius.multiplayer_pd.actors.mobs.King;
import com.sarius.multiplayer_pd.actors.mobs.Yog;
import com.sarius.multiplayer_pd.effects.Effects;
import com.sarius.multiplayer_pd.effects.MagicMissile;
import com.sarius.multiplayer_pd.effects.Pushing;
import com.sarius.multiplayer_pd.items.weapon.melee.MagesStaff;
import com.sarius.multiplayer_pd.levels.Level;
import com.sarius.multiplayer_pd.mechanics.Ballistica;
import com.sarius.multiplayer_pd.sprites.ItemSpriteSheet;
import com.sarius.multiplayer_pd.utils.GLog;
import com.sarius.multiplayer_pd.utils.Utils;
import com.watabou.noosa.Game;
import com.watabou.noosa.Group;
import com.watabou.noosa.Image;
import com.watabou.noosa.audio.Sample;
import com.watabou.utils.Callback;
import com.watabou.utils.PointF;
import com.watabou.utils.Random;
public class WandOfBlastWave extends Wand {
{
name = "Wand of Blast Wave";
image = ItemSpriteSheet.WAND_BLAST_WAVE;
collisionProperties = Ballistica.PROJECTILE;
}
@Override
protected void onZap(Ballistica bolt) {
Sample.INSTANCE.play( Assets.SND_BLAST );
BlastWave.blast(bolt.collisionPos);
int damage = Random.NormalIntRange(1, 6+(int)(level*level/4f));
//presses all tiles in the AOE first
for (int i : Level.NEIGHBOURS9){
Dungeon.level.press(bolt.collisionPos+i, Actor.findChar(bolt.collisionPos+i));
}
//throws other chars around the center.
for (int i : Level.NEIGHBOURS8){
Char ch = Actor.findChar(bolt.collisionPos + i);
if (ch != null){
ch.damage(damage, this);
if (ch.isAlive()) {
Ballistica trajectory = new Ballistica(ch.pos, ch.pos + i, Ballistica.MAGIC_BOLT);
int strength = 1 + ((level + 1) / 3);
throwChar(ch, trajectory, strength);
}
}
}
//throws the char at the center of the blast
Char ch = Actor.findChar(bolt.collisionPos);
if (ch != null){
ch.damage(damage, this);
if (ch.isAlive() && bolt.path.size() > bolt.dist+1) {
Ballistica trajectory = new Ballistica(ch.pos, bolt.path.get(bolt.dist + 1), Ballistica.MAGIC_BOLT);
int strength = level + 3;
throwChar(ch, trajectory, strength);
}
}
if (!curUser.isAlive()) {
Dungeon.fail( Utils.format(ResultDescriptions.ITEM, name) );
GLog.n("You killed yourself with your own Wand of Blast Wave...");
}
}
private void throwChar(final Char ch, final Ballistica trajectory, int power){
int dist = Math.min(trajectory.dist, power);
//FIXME: sloppy
if ((ch instanceof King) || (ch instanceof Golem) || (ch instanceof Yog.RottingFist))
dist /= 2;
if (dist == 0 || ch instanceof Yog) return;
if (Actor.findChar(trajectory.path.get(dist)) != null){
dist--;
}
final int newPos = trajectory.path.get(dist);
if (newPos == ch.pos) return;
final int finalDist = dist;
Actor.addDelayed(new Pushing(ch, ch.pos, newPos, new Callback() {
public void call() {
ch.pos = newPos;
if (ch.pos == trajectory.collisionPos) {
ch.damage(Random.NormalIntRange((finalDist + 1) / 2, finalDist), this);
Paralysis.prolong(ch, Paralysis.class, Random.NormalIntRange((finalDist + 1) / 2, finalDist));
}
Dungeon.level.press(ch.pos, ch);
}
}), -1);
}
@Override
//a weaker knockback, not dissimilar to the glyph of bounce, but a fair bit stronger.
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
int level = Math.max(0, staff.level);
// lvl 0 - 25%
// lvl 1 - 40%
// lvl 2 - 50%
if (Random.Int( level + 4 ) >= 3){
int oppositeHero = defender.pos + (defender.pos - attacker.pos);
Ballistica trajectory = new Ballistica(defender.pos, oppositeHero, Ballistica.MAGIC_BOLT);
throwChar(defender, trajectory, 2);
}
}
@Override
protected void fx(Ballistica bolt, Callback callback) {
MagicMissile.slowness(curUser.sprite.parent, bolt.sourcePos, bolt.collisionPos, callback);
Sample.INSTANCE.play(Assets.SND_ZAP);
}
@Override
public void staffFx(MagesStaff.StaffParticle particle) {
particle.color( 0x664422 ); particle.am = 0.6f;
particle.setLifespan(2f);
particle.speed.polar(Random.Float(PointF.PI2), 0.3f);
particle.setSize( 1f, 2f);
particle.radiateXY(3f);
}
public static class BlastWave extends Image {
private static final float TIME_TO_FADE = 0.2f;
private float time;
public BlastWave(){
super(Effects.get(Effects.Type.RIPPLE));
origin.set(width / 2, height / 2);
}
public void reset(int pos) {
revive();
x = (pos % Level.WIDTH) * DungeonTilemap.SIZE + (DungeonTilemap.SIZE - width) / 2;
y = (pos / Level.WIDTH) * DungeonTilemap.SIZE + (DungeonTilemap.SIZE - height) / 2;
time = TIME_TO_FADE;
}
@Override
public void update() {
super.update();
if ((time -= Game.elapsed) <= 0) {
kill();
} else {
float p = time / TIME_TO_FADE;
alpha(p);
scale.y = scale.x = (1-p)*3;
}
}
public static void blast(int pos) {
Group parent = Dungeon.hero.sprite.parent;
BlastWave b = (BlastWave) parent.recycle(BlastWave.class);
parent.bringToFront(b);
b.reset(pos);
}
}
@Override
public String desc() {
return "This wand is made of a sort of marbled stone, with gold trim and a round black gem at the tip. " +
"It feels very weighty in your hand.\n" +
"\n" +
"This wand shoots a bolt which violently detonates at a target location. There is no smoke and fire, " +
"but the force of this blast is enough to knock even the biggest of foes around.";
}
}
|
Sarius997/Multiplayer-PD
|
src/com/sarius/multiplayer_pd/items/wands/WandOfBlastWave.java
|
Java
|
gpl-3.0
| 6,666
|
/*estilos del anuario, práctica correspondiente al curso "Introducción al software de control de versiones GIT"*/
html { background: radial-gradient(ellipse at center, rgba(143,178,153,1) 0%, rgba(143,178,153,0.62) 34%, rgba(143,178,153,0.28) 64%, rgba(143,178,153,0.28) 100%);
}
.imagen_flotante
{
display: inline-block;
box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);
margin-left: 15px;
width: 200px;
height: 200px;
cursor: pointer;
}
.imagen_flotante img
{
width: 95%;
height: 95%;
}
.centerDiv
{
text-align:center;
}
a
{
text-decoration:none;
}
span
{
visibility:hidden;
padding-left:15px;
padding-right:15px;
}
div span
{
font-size:12px;
font-family:Verdana,Helvetica;
font-weight:bold;
color:white;
background:#638cb5;
border:0px;
width:95%;
height:30px;
margin-left: 20%;
border-radius: 5px 5px 5px 5px;
box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);
}
h1
{
text-align: center;
}
button
{
text-align: center;
font-size:20px;
font-family:Verdana,Helvetica;
font-weight:bold;
color:white;
background:#638cb5;
border:0px;
width:80%;
height:40px;
cursor: pointer;
}
.bottom-info-section
{
background-color:#a8bfd6;
width: 100%;
position:fixed;
bottom:0px;
left:0px;
height:40px;
z-index:1;
}
.w3c-pic
{
z-index: 5;
text-align: center;
width: 100%;
margin: 5px;
}
/***** Efecto flip ******/
.cube
{
width: 200px;
text-align: center;
margin: 0 auto;
height: 200px;
transition: transform .33s;
transform-style: preserve-3d;
display: inline-block;
margin-right: 15px;
}
.cube .flip, .cube .flop
{
border:1px solid #cdcdcd;
text-align:center;
color:#fff;
height: 200px;
}
.cube .flip
{
transform: translateZ(50px);
}
.cube .flop
{
transform: rotateX(-90deg) translateZ(-50px) translateX(8%);
overflow-y: scroll;
text-align: left;
font-size: 14px;
padding-left: 1px;
background-color:rgba(143,178,153, 1);
box-shadow: 10px 10px 5px 0px rgba(0,0,0,0.75);
}
.cube:hover
{
transform: rotateX(89deg);cursor:pointer;
}
|
evilgom/repoAnuario
|
css/style.css
|
CSS
|
gpl-3.0
| 2,218
|
// $Id: $
//==========================================================================
// AIDA Detector description implementation for LCD
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
// All rights reserved.
//
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
//
// Author : M.Frank
//
//==========================================================================
// Framework include files
#include "DD4hep/Primitives.h"
#include "DD4hep/Exceptions.h"
#include "DD4hep/Printout.h"
// C/C++ include files
#include <stdexcept>
#include <cstring>
#include <map>
#if defined(__linux) || defined(__APPLE__)
#include <cxxabi.h>
#ifndef __APPLE__
typedef abi::__class_type_info class_t;
using abi::__dynamic_cast;
#endif
#endif
long int DD4hep::makeTime(int year, int month, int day,
int hour, int minutes, int seconds)
{
struct tm tm_init;
::memset(&tm_init,0,sizeof(tm_init));
tm_init.tm_year = year > 1900 ? year-1900 : year;
tm_init.tm_mon = month;
tm_init.tm_mday = day;
tm_init.tm_hour = hour;
tm_init.tm_min = minutes;
tm_init.tm_sec = seconds;
tm_init.tm_isdst = -1;
long int ti = ::mktime(&tm_init);
if ( ti >= 0 ) return ti;
except("DD4hep","Invalid time data given for conversion to epoch: %d-%d-%d %02d:%02d:%02d",
year, month, day, hour, minutes, seconds);
return ti;
}
/// Convert date into epoch time (seconds since 1970)
long int DD4hep::makeTime(const std::string& date, const char* fmt) {
struct tm tm;
char* c = ::strptime(date.c_str(),fmt,&tm);
if ( 0 == c ) {
except("DD4hep",
"Invalid time format given for update:%s should be: %s",
date.c_str(), fmt);
}
long ti = ::mktime(&tm);
if ( ti >= 0 ) return ti;
except("DD4hep",
"Invalid time string given for conversion to epoch: %s (fmt='%s')",
date.c_str(), fmt);
return ti;
}
static const std::string __typeinfoName(const std::type_info& tinfo) {
const char* class_name = tinfo.name();
std::string result;
#ifdef WIN32
std::size_t off = 0;
if ( ::strncmp(class_name, "class ", 6) == 0 ) {
// The returned name is prefixed with "class "
off = 6;
}
if ( ::strncmp(class_name, "struct ", 7) == 0 ) {
// The returned name is prefixed with "struct "
off = 7;
}
if ( off != std::string::npos ) {
std::string tmp = class_name + off;
size_t loc = 0;
while( (loc = tmp.find("class ")) != std::string::npos ) {
tmp.erase(loc, 6);
}
loc = 0;
while( (loc = tmp.find("struct ")) != std::string::npos ) {
tmp.erase(loc, 7);
}
result = tmp;
}
else {
result = class_name;
}
// Change any " *" to "*"
while ( (off=result.find(" *")) != std::string::npos ) {
result.replace(off, 2, "*");
}
// Change any " &" to "&"
while ( (off=result.find(" &")) != std::string::npos ) {
result.replace(off, 2, "&");
}
#elif defined(sun)
result = class_name;
#elif !defined(__ICC)
if (::strlen(class_name) == 1) {
// See http://www.realitydiluted.com/mirrors/reality.sgi.com/dehnert_engr/cxx/abi.pdf
// for details
switch (class_name[0]) {
case 'v':
result = "void";
break;
case 'w':
result = "wchar_t";
break;
case 'b':
result = "bool";
break;
case 'c':
result = "char";
break;
case 'h':
result = "unsigned char";
break;
case 's':
result = "short";
break;
case 't':
result = "unsigned short";
break;
case 'i':
result = "int";
break;
case 'j':
result = "unsigned int";
break;
case 'l':
result = "long";
break;
case 'm':
result = "unsigned long";
break;
case 'x':
result = "long long";
break;
case 'y':
result = "unsigned long long";
break;
case 'n':
result = "__int128";
break;
case 'o':
result = "unsigned __int128";
break;
case 'f':
result = "float";
break;
case 'd':
result = "double";
break;
case 'e':
result = "long double";
break;
case 'g':
result = "__float128";
break;
case 'z':
result = "ellipsis";
break;
}
}
else {
char buff[16 * 1024];
std::size_t len = sizeof(buff);
int status = 0;
result = __cxxabiv1::__cxa_demangle(class_name, buff, &len, &status);
}
#else
result = class_name;
throw std::runtime_error("CXXABI is missing for ICC!");
#endif
return result;
}
std::string DD4hep::typeName(const std::type_info& typ) {
return __typeinfoName(typ);
}
/// Default destructor of specialized exception
DD4hep::invalid_handle_exception::~invalid_handle_exception() {
}
void DD4hep::invalidHandleError(const std::type_info& type)
{
throw invalid_handle_exception("Attempt to access invalid object of type "+typeName(type)+" [Invalid Handle]");
}
void DD4hep::invalidHandleAssignmentError(const std::type_info& from,
const std::type_info& to)
{
std::string msg = "Wrong assingment from ";
msg += typeName(from);
msg += " to ";
msg += typeName(to);
msg += " not possible!!";
throw invalid_handle_exception(msg);
}
/// Throw exception when handles are check for validity
void DD4hep::notImplemented(const std::string& msg)
{
std::string m = "The requested feature " + msg + " is not implemented!";
throw std::runtime_error(m);
}
void DD4hep::typeinfoCheck(const std::type_info& typ1, const std::type_info& typ2, const std::string& text)
{
if (typ1 != typ2) {
throw unrelated_type_error(typ1, typ2, text);
}
}
namespace DD4hep {
template<> const char* Primitive<bool>::default_format() { return "%d"; }
template<> const char* Primitive<char>::default_format() { return "%c"; }
template<> const char* Primitive<unsigned char>::default_format() { return "%02X"; }
template<> const char* Primitive<short>::default_format() { return "%d"; }
template<> const char* Primitive<unsigned short>::default_format() { return "%04X"; }
template<> const char* Primitive<int>::default_format() { return "%d"; }
template<> const char* Primitive<unsigned int>::default_format() { return "%08X"; }
template<> const char* Primitive<long>::default_format() { return "%ld"; }
template<> const char* Primitive<unsigned long>::default_format() { return "%016X"; }
template<> const char* Primitive<float>::default_format() { return "%f"; }
template<> const char* Primitive<double>::default_format() { return "%g"; }
template<> const char* Primitive<char*>::default_format() { return "%s"; }
template<> const char* Primitive<const char*>::default_format() { return "%s"; }
template<> const char* Primitive<std::string>::default_format() { return "%s"; }
/// Generic function to convert to string
template <typename T> std::string Primitive<T>::toString(T value) {
char text[1024];
::snprintf(text,sizeof(text),default_format(),value);
return text;
}
/// Convert string to string
template <> std::string Primitive<const char*>::toString(const char* value) {
if ( value ) {
return value;
}
throw std::runtime_error("Failed to convert (char*)NULL to std::string!");
}
/// Convert string to string
template <> std::string Primitive<char*>::toString(char* value) {
if ( value ) {
return value;
}
throw std::runtime_error("Failed to convert (char*)NULL to std::string!");
}
/// Convert string to string
template <> std::string Primitive<std::string>::toString(std::string value) {
return value;
}
template std::string Primitive<bool>::toString(bool value);
template std::string Primitive<char>::toString(char value);
template std::string Primitive<unsigned char>::toString(unsigned char value);
template std::string Primitive<short>::toString(short value);
template std::string Primitive<unsigned short>::toString(unsigned short value);
template std::string Primitive<int>::toString(int value);
template std::string Primitive<unsigned int>::toString(unsigned int value);
template std::string Primitive<long>::toString(long value);
template std::string Primitive<unsigned long>::toString(unsigned long value);
template std::string Primitive<float>::toString(float value);
template std::string Primitive<double>::toString(double value);
}
/// Initializing Constructor
DD4hep::ComponentCast::ComponentCast(const std::type_info& t, destroy_t d, cast_t c)
: type(t), destroy(d), cast(c) {
#ifdef __APPLE__
abi_class = 0;
#else
abi_class = dynamic_cast<const class_t*>(&type);
if (!abi_class) {
throw std::runtime_error("Class type " + typeName(type) + " is not an abi object type!");
}
#endif
}
/// Defautl destructor
DD4hep::ComponentCast::~ComponentCast() {
}
#if 0
// Dynamic cast runtime.
// src2dst has the following possible values
// >-1: src_type is a unique public non-virtual base of dst_type
// dst_ptr + src2dst == src_ptr
// -1: unspecified relationship
// -2: src_type is not a public base of dst_type
// -3: src_type is a multiple public non-virtual base of dst_type
extern "C" void*
__dynamic_cast(const void* __src_ptr,// Starting object.
const abi::__class_type_info* __src_type,// Static type of object.
const abi::__class_type_info* __dst_type,// Desired target type.
ptrdiff_t __src2dst);// How src and dst are related.
#endif
#ifndef __APPLE__
static inline void* cast_wrap(const void* p,
const abi::__class_type_info* src,
const abi::__class_type_info* dst,
ptrdiff_t src2dst)
{
return abi::__dynamic_cast(p,src,dst,src2dst);
}
#endif
/// Apply cast using typeinfo instead of dynamic_cast
void* DD4hep::ComponentCast::apply_dynCast(const ComponentCast& to, const void* ptr) const
{
if (&to == this) {
return (void*) ptr;
}
#ifdef __APPLE__
// First try down cast
void *r = (*to.cast)(ptr);
if (r)
return r;
// Now try the up-cast
r = (*cast)(ptr);
if (r) return r;
throw unrelated_type_error(type, to.type, "Failed to apply abi dynamic cast operation!");
#else
void* r = (void*)ptr;
if ( to.abi_class ) {
bool cast_worked = type.__do_upcast((const class_t*)to.abi_class,&r);
if ( cast_worked ) return r;
r = (void*)ptr;
cast_worked = to.type.__do_upcast((const class_t*)abi_class,&r);
if ( cast_worked ) return r;
#if 0
const class_t* src_type = (const class_t*)to.abi_class;
if (src_type) {
// First try down cast
void *r = cast_wrap(ptr, src_type, (const class_t*) abi_class, -1);
if ( r ) return r;
// Now try the up-cast
r = cast_wrap(ptr, (const class_t*) abi_class, src_type, -1);
if (r) return r;
}
#endif
throw unrelated_type_error(type, to.type, "Failed to apply abi dynamic cast operation!");
}
throw unrelated_type_error(type, to.type, "Target type is not an abi class type!");
#endif
}
/// Apply cast using typeinfo instead of dynamic_cast
void* DD4hep::ComponentCast::apply_upCast(const ComponentCast& to, const void* ptr) const
{
if (&to == this) {
return (void*) ptr;
}
return apply_dynCast(to, ptr);
}
/// Apply cast using typeinfo instead of dynamic_cast
void* DD4hep::ComponentCast::apply_downCast(const ComponentCast& to, const void* ptr) const
{
if (&to == this) {
return (void*) ptr;
}
#ifdef __APPLE__
void *r = (*to.cast)(ptr);
if (r) return r;
throw unrelated_type_error(type, to.type, "Failed to apply abi dynamic cast operation!");
#else
if ( to.abi_class ) {
// Since we have to cast a 'to' pointer up to the real pointer
// no virtual inheritance can be supported!
void* r = (void*)ptr;
bool cast_worked = type.__do_upcast((const class_t*)to.abi_class,&r);
if ( cast_worked ) return r;
#if 0
void *r = cast_wrap(ptr, src_type, (const class_t*)abi_class, -1);
if (r) return r;
#endif
throw unrelated_type_error(type, to.type, "Failed to apply abi dynamic cast operation!");
}
throw unrelated_type_error(type, to.type, "Target type is not an abi class type!");
#endif
}
|
vvolkl/DD4hep
|
DDCore/src/Primitives.cpp
|
C++
|
gpl-3.0
| 12,465
|
package org.cleverframe.sys.vo.request;
import org.cleverframe.common.vo.request.BaseRequestVo;
import org.hibernate.validator.constraints.NotBlank;
/**
* 作者:LiZW <br/>
* 创建时间:2016/11/14 22:14 <br/>
*/
public class SessionGetVo extends BaseRequestVo {
private static final long serialVersionUID = 1L;
/**
* Shiro Session ID
*/
@NotBlank(message = "Shiro Session ID不能为空")
private String sessionId;
/*--------------------------------------------------------------
* getter、setter
* -------------------------------------------------------------*/
public String getSessionId() {
return sessionId;
}
public void setSessionId(String sessionId) {
this.sessionId = sessionId;
}
}
|
Lzw2016/cleverframe
|
clever-sys/src/main/java/org/cleverframe/sys/vo/request/SessionGetVo.java
|
Java
|
gpl-3.0
| 788
|
#!/usr/bin/env python
import sugar_stats_consolidation
from sugar_stats_consolidation.db import *
from sugar_stats_consolidation.rrd_files import *
from sugar_stats_consolidation.consolidation import *
db = DB_Stats('statistics', 'root', 'gustavo')
db.create();
con = Consolidation('/var/lib/sugar-stats/rrd', db)
con.process_rrds()
|
activitycentral/statistics-consolidation
|
test/test_cons.py
|
Python
|
gpl-3.0
| 337
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>markdown.css Example File | Qt WebEngine 5.7</title>
<link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
<script type="text/javascript">
window.onload = function(){document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");};
</script>
</head>
<body>
<div class="header" id="qtdocheader">
<div class="main">
<div class="main-rounded">
<div class="navigationbar">
<table><tr>
<td ><a href="../qtdoc/supported-platforms-and-configurations.html#qt-5-7">Qt 5.7</a></td><td ><a href="qtwebengine-index.html">Qt WebEngine</a></td><td ><a href="qtwebengine-webenginewidgets-markdowneditor-example.html">WebEngine Markdown Editor Example</a></td><td >markdown.css Example File</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right">Qt 5.7.0 Reference Documentation</td>
</tr></table>
</div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar"><div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">markdown.css Example File</h1>
<span class="subtitle">webenginewidgets/markdowneditor/resources/markdown.css</span>
<!-- $$$webenginewidgets/markdowneditor/resources/markdown.css-description -->
<div class="descr"> <a name="details"></a>
<pre class="cpp">
body{
margin: 0 auto;
font-family: Georgia, Palatino, serif;
color: #444444;
line-height: 1;
max-width: 960px;
padding: 30px;
}
h1, h2, h3, h4 {
color: #111111;
font-weight: 400;
}
h1, h2, h3, h4, h5, p {
margin-bottom: 24px;
padding: 0;
}
h1 {
font-size: 48px;
}
h2 {
font-size: 36px;
/* The bottom margin is small. It's designed to be used with gray meta text
* below a post title. */
margin: 24px 0 6px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 21px;
}
h5 {
font-size: 18px;
}
a {
color: #0099ff;
margin: 0;
padding: 0;
vertical-align: baseline;
}
a:hover {
text-decoration: none;
color: #ff6600;
}
a:visited {
color: purple;
}
ul, ol {
padding: 0;
margin: 0;
}
li {
line-height: 24px;
}
li ul, li ul {
margin-left: 24px;
}
p, ul, ol {
font-size: 16px;
line-height: 24px;
max-width: 540px;
}
pre {
padding: 0px 24px;
max-width: 800px;
white-space: pre-wrap;
}
code {
font-family: Consolas, Monaco, Andale Mono, monospace;
line-height: 1.5;
font-size: 13px;
}
aside {
display: block;
float: right;
width: 390px;
}
blockquote {
border-left:.5em solid #eee;
padding: 0 2em;
margin-left:0;
max-width: 476px;
}
blockquote cite {
font-size:14px;
line-height:20px;
color:#bfbfbf;
}
blockquote cite:before {
content: '\2014 \00A0';
}
blockquote p {
color: #666;
max-width: 460px;
}
hr {
width: 540px;
text-align: left;
margin: 0 auto 0 0;
color: #999;
}
/* Code below this line is copyright Twitter Inc. */
button,
input,
select,
textarea {
font-size: 100%;
margin: 0;
vertical-align: baseline;
*vertical-align: middle;
}
button, input {
line-height: normal;
*overflow: visible;
}
button::-moz-focus-inner, input::-moz-focus-inner {
border: 0;
padding: 0;
}
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
cursor: pointer;
-webkit-appearance: button;
}
input[type=checkbox], input[type=radio] {
cursor: pointer;
}
/* override default chrome & firefox settings */
input:not([type="image"]), textarea {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"] {
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
label,
input,
select,
textarea {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
font-weight: normal;
line-height: normal;
margin-bottom: 18px;
}
input[type=checkbox], input[type=radio] {
cursor: pointer;
margin-bottom: 0;
}
input[type=text],
input[type=password],
textarea,
select {
display: inline-block;
width: 210px;
padding: 4px;
font-size: 13px;
font-weight: normal;
line-height: 18px;
height: 18px;
color: #808080;
border: 1px solid #ccc;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
select, input[type=file] {
height: 27px;
line-height: 27px;
}
textarea {
height: auto;
}
/* grey out placeholders */
:-moz-placeholder {
color: #bfbfbf;
}
::-webkit-input-placeholder {
color: #bfbfbf;
}
input[type=text],
input[type=password],
select,
textarea {
-webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
-moz-transition: border linear 0.2s, box-shadow linear 0.2s;
transition: border linear 0.2s, box-shadow linear 0.2s;
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}
input[type=text]:focus, input[type=password]:focus, textarea:focus {
outline: none;
border-color: rgba(82, 168, 236, 0.8);
-webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
-moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
}
/* buttons */
button {
display: inline-block;
padding: 4px 14px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
line-height: 18px;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);
background-color: #0064cd;
background-repeat: repeat-x;
background-image: -khtml-gradient(linear, left top, left bottom, from(#049cdb), to(#0064cd));
background-image: -moz-linear-gradient(top, #049cdb, #0064cd);
background-image: -ms-linear-gradient(top, #049cdb, #0064cd);
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #049cdb), color-stop(100%, #0064cd));
background-image: -webkit-linear-gradient(top, #049cdb, #0064cd);
background-image: -o-linear-gradient(top, #049cdb, #0064cd);
background-image: linear-gradient(top, #049cdb, #0064cd);
color: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
border: 1px solid #004b9a;
border-bottom-color: #003f81;
-webkit-transition: 0.1s linear all;
-moz-transition: 0.1s linear all;
transition: 0.1s linear all;
border-color: #0064cd #0064cd #003f81;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
}
button:hover {
color: #fff;
background-position: 0 -15px;
text-decoration: none;
}
button:active {
-webkit-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
-moz-box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
box-shadow: inset 0 3px 7px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);
}
button::-moz-focus-inner {
padding: 0;
border: 0;
}
</pre>
</div>
<!-- @@@webenginewidgets/markdowneditor/resources/markdown.css -->
</div>
</div>
</div>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2016 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. </p>
</div>
</body>
</html>
|
angeloprudentino/QtNets
|
Doc/qtwebengine/qtwebengine-webenginewidgets-markdowneditor-resources-markdown-css.html
|
HTML
|
gpl-3.0
| 8,874
|
/* ============================================================================
* This software is part of Frog, a chemo informatics class able to build
* 3D coordinates for small compounds
* Copyright (C) 2006-2007 P. Tuffery, B.O. Villoutreix, Th. Bohme Leite, D. Gomes, M. Miteva, J. Chomilier
*
* Frog2 (C) 2009-2010 by P. Tuffery, M. Miteva, F. Guyon
*
* Using this software, please cite:
* Frog2: Efficient 3D conformation ensemble generator for small compounds.
* Miteva MA, Guyon F, Tuffery P.
* Nucleic Acids Res. 2010 Jul;38(Web Server issue):W622-7. Epub 2010 May 5.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ==========================================================================
*/
/* ###############################################################################
# #
# mol2clusterize.c #
# #
# authors P. Tuffery, F Guyon 2010 #
# #
# - input a mol2 that is a series of conformations of ONE compound #
# atoms in the same order #
# - perform clustering based on RMSd: not one output conformation #
# should be close than RMSD threshold from another one #
# - output filtered mol2 file (only diverse conformations) #
# #
# #
############################################################################### */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <limits.h>
#include "Types.h"
#include "argstr.h"
#include "TxtFile.h"
#include "Mol2.h"
#include "Zuker.h"
#include "RMSd.h"
/* ===============================================================
* ---------- Main -----------------------------------------------
* =============================================================== */
int main(int argc, char *argv[]) {
FILE *oFd;
int i, j, jj, k, kk, l, c, flag, posInVal=0, nbValRead, extremitesRead, numDiedreToRot, nbPasMC;
char ligne[1025], val[1025];
char buff[BUFSIZ], at0n[6],at1n[6],at2n[6],at3n[6];
char confName[BUFSIZ];
// double ***coordsConfs; // coordonnees et energies
// DtPoint3 **coordsConfs;
double nrjTreshold;
double nrjInitTreshold = 300.;
DtStructConf *coordsConfs;
DtMatrix4x4 M;
DtPoint3 *newCoords;
DtPoint3 *c1, *c2;
int verbose = 0;
double **rmsdVals;
double drmsd;
double ormsd;
DtMolArray *pMa;
int *flushp;
int *refs;
int aMol, aMol2;
int refMol;
int aAtom;
int keepOn;
int NOK;
int nOut;
srand(time(NULL));
parseargstr(argc, argv);
verbose = gVerbose;
if (verbose)
argstrPrmtrsSummary(argc, argv);
if (IMol2FichName[0] != '\0') {
pMa = lectMol2(IMol2FichName, INT_MAX, verbose);
}
if (verbose) {
fprintf(stderr,"Mol2Input done ... found %d mols\n", pMa->nMol);
}
/* Init RMSdARRAY */
flushp = calloc(pMa->nMol, sizeof(int));
refs = calloc(pMa->nMol, sizeof(int));
rmsdVals = calloc(pMa->nMol, sizeof(double *));
for (aMol = 0; aMol < pMa->nMol; aMol++) {
rmsdVals[aMol] = calloc(pMa->nMol, sizeof(double));
}
/* Init workspace */
c1 = calloc(pMa->pM[0].nAtoms, sizeof(DtPoint3));
c2 = calloc(pMa->pM[0].nAtoms, sizeof(DtPoint3));
if (verbose) {
fprintf(stderr,"Memory allocation done ...\n");
}
#if 0
for (aMol = 1; aMol < pMa->nMol; aMol++) {
for (aAtom = 0; aAtom < pMa->pM[aMol].nAtoms; aAtom++) {
fprintf(stderr,"mol %d: %.3lf %.3lf %.3lf\n", aMol,
pMa->pM[aMol].atomDetails[aAtom].x,
pMa->pM[aMol].atomDetails[aAtom].y,
pMa->pM[aMol].atomDetails[aAtom].z);
}
}
#endif
for (aMol = 0; aMol < pMa->nMol; aMol++) {
/* fill c1 */
for (aAtom = 0; aAtom < pMa->pM[aMol].nAtoms; aAtom++) {
#if 0
memcpy(c1[aAtom], (DtPoint3 * ) &pMa->pM[aMol].atomDetails[aAtom].x, sizeof(DtPoint3));
#else
c1[aAtom][0] = pMa->pM[aMol].atomDetails[aAtom].x;
c1[aAtom][1] = pMa->pM[aMol].atomDetails[aAtom].y;
c1[aAtom][2] = pMa->pM[aMol].atomDetails[aAtom].z;
#endif
// fprintf(stderr,"mol1 (%d): %.3lf %.3lf %.3lf\n", aMol, c1[aAtom][0], c1[aAtom][1], c1[aAtom][2]);
}
// fprintf(stderr,"mol1 (%d): done ... \n", aMol);
for (aMol2 = aMol+1; aMol2 < pMa->nMol; aMol2++) {
/* fill c2 */
// fprintf(stderr,"mol2 (%d %d atoms): \n", aMol2, pMa->pM[aMol2].nAtoms);
for (aAtom = 0; aAtom < pMa->pM[aMol2].nAtoms; aAtom++) {
#if 0
memcpy(c2[aAtom], (DtPoint3 * ) &pMa->pM[aMol2].atomDetails[aAtom].x, sizeof(DtPoint3));
#else
c2[aAtom][0] = pMa->pM[aMol2].atomDetails[aAtom].x;
c2[aAtom][1] = pMa->pM[aMol2].atomDetails[aAtom].y;
c2[aAtom][2] = pMa->pM[aMol2].atomDetails[aAtom].z;
#endif
// fprintf(stderr,"mol2 (%d) %.3lf %.3lf %.3lf\n", aMol2, c2[aAtom][0], c2[aAtom][1], c2[aAtom][2]);
}
/* fast RMSd ZUKER RETURNS SQUARED VALUES */
frmsd(c1,c2, pMa->pM[aMol].nAtoms, &ormsd);
drmsd = zuker_superpose(c1, c2, pMa->pM[aMol].nAtoms, M);
rmsdVals[aMol][aMol2] = drmsd;
rmsdVals[aMol2][aMol] = rmsdVals[aMol][aMol2];
if (verbose)
fprintf(stderr, "%.3lf (%.3lf)", rmsdVals[aMol][aMol2], ormsd*ormsd);
}
if (verbose)
fprintf(stderr, "\n");
}
/* clustering */
for (aMol = 0; aMol < pMa->nMol; aMol++) {
refs[aMol] = -1;
}
gRMSdTreshold *= gRMSdTreshold; // Since ZUKER RETURNS DRMSd, not RMSd
refMol = 0;
keepOn = 0;
do {
refs[refMol] = refMol;
if (verbose)
fprintf(stderr,"refMol %d\n", refMol);
for (aMol = 0; aMol < pMa->nMol; aMol++) {
if (aMol == refMol) continue;
if (flushp[aMol]) continue;
if (rmsdVals[refMol][aMol] < gRMSdTreshold) {
if (verbose)
fprintf(stderr,"%d tooClose from %d (%.3lf)\n",aMol, refMol, rmsdVals[refMol][aMol]);
flushp[aMol] = 1;
refs[aMol] = refMol;
}
}
keepOn = 0;
aMol2 = -1;
for (aMol = 0; aMol < pMa->nMol; aMol++) {
if (refs[aMol] != -1) continue;
keepOn = 1;
if (aMol2 < 0)
aMol2 = aMol;
else {
if (rmsdVals[refMol][aMol2] < rmsdVals[refMol][aMol])
aMol2 = aMol;
}
}
refMol = aMol2;
} while (keepOn);
/* output */
if (OMol2FichName[0] == '\000')
oFd = stdout;
else {
oFd = fopen(OMol2FichName,"a");
if (oFd == NULL) {
if (verbose)
fprintf(stderr,"Could not open %s\nReverting to stdout\n",OMol2FichName);
oFd = stdout;
}
}
for (aMol = 0; aMol < pMa->nMol; aMol++) {
if (refs[aMol] == aMol) {
if (verbose)
fprintf(stderr,"%d is OK\n", aMol);
outMol2(oFd,&pMa->pM[aMol], NULL, 1000000000., 1000000000., 0);
}
}
#if 0
confNum = 0;
// fprintf(stderr,"Will output %s\n", gId);
while (confTmp != NULL) {
if (confTmp->energie < bestConf->energie + nrjTreshold) {
sprintf(confName,"%s_%d", gId, ++confNum);
setupCoords(pMa->pM, confTmp->coords);
outMol2(oFd,pMa->pM, confName, confTmp->energie, 1);
confTmp = confTmp->nextConf;
} else { break; }
}
fprintf(stdout,"%d %lf", confNum, bestConf->energie);
if (verbose) fprintf(stderr, "%s: %d conformations generated\n", gId, confNum);
// fprintf(stderr,"Memory cleanup 1\n");
#endif
/* =============================================================
* Memory cleanup
* =============================================================
*/
// fprintf(stderr,"Memory cleanup 2\n");
if (verbose)
fprintf(stderr,"Memory cleanup\n");
free(rmsdVals);
free(c1);
free(c2);
free(pMa->pM);
free(pMa);
return 0;
}
|
tuffery/Frog2
|
iMolecule/code_c/mol2clusterize.c
|
C
|
gpl-3.0
| 8,703
|
#ifndef __HOPE__MEMORY_BARRIER__
#define __HOPE__MEMORY_BARRIER__
#include <utils/Platform.hpp>
#include <scene/FrameGraphNode.hpp>
namespace Hope {
class IFrameGraphVisitor ;
/**
* Defines a barrier ordering memory transactions.
*/
class MemoryBarrierNode final : public FrameGraphNode {
private:
/**
* Bits of memory barriers to apply when rendering the current
* framegraph branch.
*/
uint32_t m_bits ;
public:
/**
* Create a new MemoryBarrierNode node.
*/
exported MemoryBarrierNode(
const uint32_t bits,
Hope::FrameGraphNode* parent = nullptr
) ;
/**
* Bits of the memory barrier.
*/
exported uint32_t bits() const {
return m_bits ;
}
protected:
/**
* Accept the visitor.
*/
exported void specificAccept(IFrameGraphVisitor* visitor) override ;
} ;
}
#endif
|
dcarlus/hARMful
|
Libraries/HOPEful/include/scene/framegraph/MemoryBarrierNode.hpp
|
C++
|
gpl-3.0
| 1,105
|
<!DOCTYPE html>
<!--********************************************-->
<!--* Generated from PreTeXt source *-->
<!--* on 2021-03-10T19:24:36-08:00 *-->
<!--* A recent stable commit (2020-08-09): *-->
<!--* 98f21740783f166a773df4dc83cab5293ab63a4a *-->
<!--* *-->
<!--* https://pretextbook.org *-->
<!--* *-->
<!--********************************************-->
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta name="Keywords" content="Authored in PreTeXt">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script xmlns:svg="http://www.w3.org/2000/svg" src="https://pretextbook.org/js/lib/jquery.min.js"></script><script xmlns:svg="http://www.w3.org/2000/svg" src="https://pretextbook.org/js/lib/jquery.sticky.js"></script><script xmlns:svg="http://www.w3.org/2000/svg" src="https://pretextbook.org/js/lib/jquery.espy.min.js"></script><script xmlns:svg="http://www.w3.org/2000/svg" src="https://pretextbook.org/js/0.13/pretext.js"></script><script xmlns:svg="http://www.w3.org/2000/svg" src="https://pretextbook.org/js/0.13/pretext_add_on.js"></script><script xmlns:svg="http://www.w3.org/2000/svg" src="https://pretextbook.org/js/lib/knowl.js"></script><!--knowl.js code controls Sage Cells within knowls--><script xmlns:svg="http://www.w3.org/2000/svg">sagecellEvalName='Evaluate (Sage)';
</script><link xmlns:svg="http://www.w3.org/2000/svg" href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,600italic" rel="stylesheet" type="text/css">
<link xmlns:svg="http://www.w3.org/2000/svg" href="https://fonts.googleapis.com/css?family=Inconsolata:400,700&subset=latin,latin-ext" rel="stylesheet" type="text/css">
<link xmlns:svg="http://www.w3.org/2000/svg" href="https://pretextbook.org/css/0.31/pretext.css" rel="stylesheet" type="text/css">
<link xmlns:svg="http://www.w3.org/2000/svg" href="https://pretextbook.org/css/0.31/pretext_add_on.css" rel="stylesheet" type="text/css">
<link xmlns:svg="http://www.w3.org/2000/svg" href="https://pretextbook.org/css/0.31/banner_default.css" rel="stylesheet" type="text/css">
<link xmlns:svg="http://www.w3.org/2000/svg" href="https://pretextbook.org/css/0.31/toc_default.css" rel="stylesheet" type="text/css">
<link xmlns:svg="http://www.w3.org/2000/svg" href="https://pretextbook.org/css/0.31/knowls_default.css" rel="stylesheet" type="text/css">
<link xmlns:svg="http://www.w3.org/2000/svg" href="https://pretextbook.org/css/0.31/style_default.css" rel="stylesheet" type="text/css">
<link xmlns:svg="http://www.w3.org/2000/svg" href="https://pretextbook.org/css/0.31/colors_default.css" rel="stylesheet" type="text/css">
<link xmlns:svg="http://www.w3.org/2000/svg" href="https://pretextbook.org/css/0.31/setcolors.css" rel="stylesheet" type="text/css">
<!-- 2019-10-12: Temporary - CSS file for experiments with styling --><link xmlns:svg="http://www.w3.org/2000/svg" href="developer.css" rel="stylesheet" type="text/css">
</head>
<body class="mathbook-book">
<a class="assistive" href="#content">Skip to main content</a><div xmlns:svg="http://www.w3.org/2000/svg" class="hidden-content" style="display:none">\(
\newcommand{\lt}{<}
\newcommand{\gt}{>}
\newcommand{\amp}{&}
\)</div>
<header id="masthead" class="smallbuttons"><div class="banner"><div class="container">
<a id="logo-link" href=""></a><div class="title-container">
<h1 class="heading"><a href="MusicTheory.html"><span class="title">Music Theory for the 21st-Century Classroom</span></a></h1>
<p class="byline">Robert Hutchinson</p>
</div>
</div></div></header><div class="page"><main class="main"><div id="content" class="pretext-content" style="max-width: 1600px">
<div style="text-align: center;">Reloading this page will reset a start location</div>
<div class="video-box" style="width: 100%;padding-top: 56.25%;"><iframe id="video-361" class="video" allowfullscreen="" src="https://www.youtube-nocookie.com/embed/jrHP6Fp1yUY?&modestbranding=1&rel=0&start=248&end=252&autoplay=1"></iframe></div>
</div></main></div>
<!--Start: Google Global Site Tag code--><!--*** DO NOT COPY ANOTHER PROJECT'S MAGIC NUMBERS/ID ***--><!--*** GET YOUR OWN FROM GOOGLE ***-->
<script async="" src="https://www.googletagmanager.com/gtag/js?id=UA-166054952-1"></script><script> window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-166054952-1');
</script><!--End: Google Global Site Tag code-->
</body>
</html>
|
rhutchinson20/mt21c
|
images/unit5/video-361.html
|
HTML
|
gpl-3.0
| 4,679
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkAccelLabel</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.0">
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
<link rel="up" href="DisplayWidgets.html" title="Display Widgets">
<link rel="prev" href="DisplayWidgets.html" title="Display Widgets">
<link rel="next" href="GtkImage.html" title="GtkImage">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="DisplayWidgets.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="DisplayWidgets.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
<td><a accesskey="n" href="GtkImage.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GtkAccelLabel.synopsis" class="shortcut">Top</a>
|
<a href="#GtkAccelLabel.description" class="shortcut">Description</a>
|
<a href="#GtkAccelLabel.object-hierarchy" class="shortcut">Object Hierarchy</a>
|
<a href="#GtkAccelLabel.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
|
<a href="#GtkAccelLabel.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry">
<a name="GtkAccelLabel"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GtkAccelLabel.top_of_page"></a>GtkAccelLabel</span></h2>
<p>GtkAccelLabel — A label which displays an accelerator key on the right of the text</p>
</td>
<td valign="top" align="right"><img src="accel-label.png"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GtkAccelLabel.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include <gtk/gtk.h>
struct <a class="link" href="GtkAccelLabel.html#GtkAccelLabel-struct" title="struct GtkAccelLabel">GtkAccelLabel</a>;
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="GtkAccelLabel.html#gtk-accel-label-new" title="gtk_accel_label_new ()">gtk_accel_label_new</a> (<em class="parameter"><code>const <span class="type">gchar</span> *string</code></em>);
<span class="returnvalue">void</span> <a class="link" href="GtkAccelLabel.html#gtk-accel-label-set-accel-closure" title="gtk_accel_label_set_accel_closure ()">gtk_accel_label_set_accel_closure</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>,
<em class="parameter"><code><span class="type">GClosure</span> *accel_closure</code></em>);
<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="GtkAccelLabel.html#gtk-accel-label-get-accel-widget" title="gtk_accel_label_get_accel_widget ()">gtk_accel_label_get_accel_widget</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);
<span class="returnvalue">void</span> <a class="link" href="GtkAccelLabel.html#gtk-accel-label-set-accel-widget" title="gtk_accel_label_set_accel_widget ()">gtk_accel_label_set_accel_widget</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *accel_widget</code></em>);
<span class="returnvalue">guint</span> <a class="link" href="GtkAccelLabel.html#gtk-accel-label-get-accel-width" title="gtk_accel_label_get_accel_width ()">gtk_accel_label_get_accel_width</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);
<span class="returnvalue">gboolean</span> <a class="link" href="GtkAccelLabel.html#gtk-accel-label-refetch" title="gtk_accel_label_refetch ()">gtk_accel_label_refetch</a> (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="GtkAccelLabel.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
GObject
+----GInitiallyUnowned
+----<a class="link" href="GtkObject.html" title="GtkObject">GtkObject</a>
+----<a class="link" href="GtkWidget.html" title="GtkWidget">GtkWidget</a>
+----<a class="link" href="GtkMisc.html" title="GtkMisc">GtkMisc</a>
+----<a class="link" href="GtkLabel.html" title="GtkLabel">GtkLabel</a>
+----GtkAccelLabel
</pre>
</div>
<div class="refsect1">
<a name="GtkAccelLabel.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
GtkAccelLabel implements
AtkImplementorIface and <a class="link" href="GtkBuildable.html" title="GtkBuildable">GtkBuildable</a>.</p>
</div>
<div class="refsect1">
<a name="GtkAccelLabel.properties"></a><h2>Properties</h2>
<pre class="synopsis">
"<a class="link" href="GtkAccelLabel.html#GtkAccelLabel--accel-closure" title='The "accel-closure" property'>accel-closure</a>" <span class="type">GClosure</span>* : Read / Write
"<a class="link" href="GtkAccelLabel.html#GtkAccelLabel--accel-widget" title='The "accel-widget" property'>accel-widget</a>" <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a>* : Read / Write
</pre>
</div>
<div class="refsect1">
<a name="GtkAccelLabel.description"></a><h2>Description</h2>
<p>
The <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> widget is a subclass of <a class="link" href="GtkLabel.html" title="GtkLabel"><span class="type">GtkLabel</span></a> that also displays an
accelerator key on the right of the label text, e.g. 'Ctl+S'.
It is commonly used in menus to show the keyboard short-cuts for commands.
</p>
<p>
The accelerator key to display is not set explicitly.
Instead, the <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> displays the accelerators which have been added to
a particular widget. This widget is set by calling
<a class="link" href="GtkAccelLabel.html#gtk-accel-label-set-accel-widget" title="gtk_accel_label_set_accel_widget ()"><code class="function">gtk_accel_label_set_accel_widget()</code></a>.
</p>
<p>
For example, a <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> widget may have an accelerator added to emit the
"activate" signal when the 'Ctl+S' key combination is pressed.
A <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> is created and added to the <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a>, and
<a class="link" href="GtkAccelLabel.html#gtk-accel-label-set-accel-widget" title="gtk_accel_label_set_accel_widget ()"><code class="function">gtk_accel_label_set_accel_widget()</code></a> is called with the <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> as the
second argument. The <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> will now display 'Ctl+S' after its label.
</p>
<p>
Note that creating a <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> with <a class="link" href="GtkMenuItem.html#gtk-menu-item-new-with-label" title="gtk_menu_item_new_with_label ()"><code class="function">gtk_menu_item_new_with_label()</code></a> (or
one of the similar functions for <a class="link" href="gtk2-gtkcheckmenuitem.html#GtkCheckMenuItem"><span class="type">GtkCheckMenuItem</span></a> and <a class="link" href="GtkRadioMenuItem.html" title="GtkRadioMenuItem"><span class="type">GtkRadioMenuItem</span></a>)
automatically adds a <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> to the <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> and calls
<a class="link" href="GtkAccelLabel.html#gtk-accel-label-set-accel-widget" title="gtk_accel_label_set_accel_widget ()"><code class="function">gtk_accel_label_set_accel_widget()</code></a> to set it up for you.
</p>
<p>
A <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> will only display accelerators which have <code class="literal">GTK_ACCEL_VISIBLE</code>
set (see <a class="link" href="gtk2-Standard-Enumerations.html#GtkAccelFlags" title="enum GtkAccelFlags"><span class="type">GtkAccelFlags</span></a>).
A <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> can display multiple accelerators and even signal names,
though it is almost always used to display just one accelerator key.
</p>
<div class="example">
<a name="idm140406284621344"></a><p class="title"><b>Example 11. Creating a simple menu item with an accelerator key.</b></p>
<div class="example-contents">
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18</pre></td>
<td class="listing_code"><pre class="programlisting"><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">save_item</span><span class="symbol">;</span>
<span class="usertype">GtkAccelGroup</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">accel_group</span><span class="symbol">;</span>
<span class="comment">/* Create a GtkAccelGroup and add it to the window. */</span>
<span class="normal">accel_group </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="gtk2-Keyboard-Accelerators.html#gtk-accel-group-new">gtk_accel_group_new</a></span><span class="normal"> </span><span class="symbol">();</span>
<span class="function"><a href="GtkWindow.html#gtk-window-add-accel-group">gtk_window_add_accel_group</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_WINDOW</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">window</span><span class="symbol">),</span><span class="normal"> accel_group</span><span class="symbol">);</span>
<span class="comment">/* Create the menu item using the convenience function. */</span>
<span class="normal">save_item </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkMenuItem.html#gtk-menu-item-new-with-label">gtk_menu_item_new_with_label</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Save"</span><span class="symbol">);</span>
<span class="function"><a href="GtkWidget.html#gtk-widget-show">gtk_widget_show</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">save_item</span><span class="symbol">);</span>
<span class="function"><a href="GtkContainer.html#gtk-container-add">gtk_container_add</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">menu</span><span class="symbol">),</span><span class="normal"> save_item</span><span class="symbol">);</span>
<span class="comment">/* Now add the accelerator to the GtkMenuItem. Note that since we called</span>
<span class="comment"> gtk_menu_item_new_with_label() to create the GtkMenuItem the</span>
<span class="comment"> GtkAccelLabel is automatically set up to display the GtkMenuItem</span>
<span class="comment"> accelerators. We just need to make sure we use GTK_ACCEL_VISIBLE here. */</span>
<span class="function"><a href="GtkWidget.html#gtk-widget-add-accelerator">gtk_widget_add_accelerator</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">save_item</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"activate"</span><span class="symbol">,</span><span class="normal"> accel_group</span><span class="symbol">,</span>
<span class="normal"> GDK_s</span><span class="symbol">,</span><span class="normal"> <a href="../gdk2/gdk2-Windows.html#GDK-CONTROL-MASK:CAPS">GDK_CONTROL_MASK</a></span><span class="symbol">,</span><span class="normal"> GTK_ACCEL_VISIBLE</span><span class="symbol">);</span></pre></td>
</tr>
</tbody>
</table>
</div>
</div>
<p><br class="example-break">
</p>
</div>
<div class="refsect1">
<a name="GtkAccelLabel.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkAccelLabel-struct"></a><h3>struct GtkAccelLabel</h3>
<pre class="programlisting">struct GtkAccelLabel;</pre>
<p>
The <a class="link" href="GtkAccelLabel.html#GtkAccelLabel-struct" title="struct GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> struct contains private data only, and
should be accessed using the functions below.
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-label-new"></a><h3>gtk_accel_label_new ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_accel_label_new (<em class="parameter"><code>const <span class="type">gchar</span> *string</code></em>);</pre>
<p>
Creates a new <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>string</code></em> :</span></p></td>
<td>the label string. Must be non-<a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-label-set-accel-closure"></a><h3>gtk_accel_label_set_accel_closure ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gtk_accel_label_set_accel_closure (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>,
<em class="parameter"><code><span class="type">GClosure</span> *accel_closure</code></em>);</pre>
<p>
Sets the closure to be monitored by this accelerator label. The closure
must be connected to an accelerator group; see <a class="link" href="gtk2-Keyboard-Accelerators.html#gtk-accel-group-connect" title="gtk_accel_group_connect ()"><code class="function">gtk_accel_group_connect()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_label</code></em> :</span></p></td>
<td>a <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_closure</code></em> :</span></p></td>
<td>the closure to monitor for accelerator changes.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-label-get-accel-widget"></a><h3>gtk_accel_label_get_accel_widget ()</h3>
<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_accel_label_get_accel_widget (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);</pre>
<p>
Fetches the widget monitored by this accelerator label. See
<a class="link" href="GtkAccelLabel.html#gtk-accel-label-set-accel-widget" title="gtk_accel_label_set_accel_widget ()"><code class="function">gtk_accel_label_set_accel_widget()</code></a>.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_label</code></em> :</span></p></td>
<td>a <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the object monitored by the accelerator label, or <a href="/usr/share/gtk-doc/html/liboil/liboil-liboiljunk.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-label-set-accel-widget"></a><h3>gtk_accel_label_set_accel_widget ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span> gtk_accel_label_set_accel_widget (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>,
<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *accel_widget</code></em>);</pre>
<p>
Sets the widget to be monitored by this accelerator label.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_label</code></em> :</span></p></td>
<td>a <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_widget</code></em> :</span></p></td>
<td>the widget to be monitored.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-label-get-accel-width"></a><h3>gtk_accel_label_get_accel_width ()</h3>
<pre class="programlisting"><span class="returnvalue">guint</span> gtk_accel_label_get_accel_width (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);</pre>
<p>
Returns the width needed to display the accelerator key(s).
This is used by menus to align all of the <a class="link" href="GtkMenuItem.html" title="GtkMenuItem"><span class="type">GtkMenuItem</span></a> widgets, and shouldn't
be needed by applications.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_label</code></em> :</span></p></td>
<td>a <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the width needed to display the accelerator key(s).</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-accel-label-refetch"></a><h3>gtk_accel_label_refetch ()</h3>
<pre class="programlisting"><span class="returnvalue">gboolean</span> gtk_accel_label_refetch (<em class="parameter"><code><a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a> *accel_label</code></em>);</pre>
<p>
Recreates the string representing the accelerator keys.
This should not be needed since the string is automatically updated whenever
accelerators are added or removed from the associated widget.
</p>
<div class="variablelist"><table border="0" class="variablelist">
<colgroup>
<col align="left" valign="top">
<col>
</colgroup>
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>accel_label</code></em> :</span></p></td>
<td>a <a class="link" href="GtkAccelLabel.html" title="GtkAccelLabel"><span class="type">GtkAccelLabel</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>always returns <code class="literal">FALSE</code>.</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="GtkAccelLabel.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="GtkAccelLabel--accel-closure"></a><h3>The <code class="literal">"accel-closure"</code> property</h3>
<pre class="programlisting"> "accel-closure" <span class="type">GClosure</span>* : Read / Write</pre>
<p>The closure to be monitored for accelerator changes.</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkAccelLabel--accel-widget"></a><h3>The <code class="literal">"accel-widget"</code> property</h3>
<pre class="programlisting"> "accel-widget" <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a>* : Read / Write</pre>
<p>The widget to be monitored for accelerator changes.</p>
</div>
</div>
<div class="refsect1">
<a name="GtkAccelLabel.see-also"></a><h2>See Also</h2>
<a class="link" href="GtkItemFactory.html" title="GtkItemFactory"><span class="type">GtkItemFactory</span></a>, <a class="link" href="gtk2-Keyboard-Accelerators.html#GtkAccelGroup"><span class="type">GtkAccelGroup</span></a>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.18</div>
</body>
</html>
|
chriskmanx/qmole
|
QMOLEDEV/gtk+-2.24.17/docs/reference/gtk/html/GtkAccelLabel.html
|
HTML
|
gpl-3.0
| 23,449
|
package com.alonsoruibal.chess.epdtest;
import com.alonsoruibal.chess.Config;
import com.alonsoruibal.chess.Move;
import com.alonsoruibal.chess.TestColors;
import com.alonsoruibal.chess.log.Logger;
import com.alonsoruibal.chess.search.SearchEngine;
import com.alonsoruibal.chess.search.SearchObserver;
import com.alonsoruibal.chess.search.SearchParameters;
import com.alonsoruibal.chess.search.SearchStatusInfo;
import com.alonsoruibal.chess.util.StringUtils;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
/**
* Estimate ELO with BS2850, BT2450, BT2630 test suites:
* <p/>
* Think 15 minutes in each position, if best move is found, time is the first time best move is seen
* If best move is changed during thinking time, and then newly found, the time to figure is the last
* one.
* <p/>
* If best move is not found, time for the test is 15 minutes.
* <p/>
* ELO is calculated with Total Time (TT) in minutes
* <p/>
* ELO = 2830 - (TT / 1.5) - (TT * TT) / (22 * 22)
* <p/>
* 2450/2630
* Each test suite contain 30 positions. Select each position think for 15 minutes (900 seconds).
* If a position is solved, write down its solution time in seconds. It doesn't count as a solution if finds
* the move and then changes its mind. If after finding a move, then changing its mind, then finding it again,
* you should use the last time found. Any solution that is not found, score as 900 seconds.
* add up all the times, divide by 30 and subtract the result from either 2630 or 2450.
*
* @author rui
*/
public class EpdTest implements SearchObserver {
private static final Logger logger = Logger.getLogger("EpdTest");
SearchEngine search;
int solved;
int fails;
int total;
int totalTime;
long totalNodes;
int lctPoints;
int avoidMoves[];
int bestMoves[];
boolean solutionFound;
int bestMove;
int solutionTime;
long solutionNodes;
ArrayList<Integer> allSolutionTimes;
ArrayList<Long> allSolutionNodes;
public int getSolved() {
return solved;
}
public int getLctPoints() {
return lctPoints;
}
long processEpdFile(InputStream is, int timeLimit) {
Config config = new Config();
return processEpdFile(config, is, timeLimit);
}
long processEpdFile(Config config, InputStream is, int timeLimit) {
logger.debug(config);
search = new SearchEngine(config);
search.debug = true;
search.setObserver(this);
allSolutionTimes = new ArrayList<>();
allSolutionNodes = new ArrayList<>();
totalTime = 0;
totalNodes = 0;
lctPoints = 0;
solved = 0;
total = 0;
StringBuilder notSolved = new StringBuilder();
// goes through all positions
BufferedReader br = new BufferedReader(new InputStreamReader(is));
try {
String line;
while ((line = br.readLine()) != null) {
logger.debug("Test = " + line);
// TODO use strtok
String avoidMovesString = null;
int i0 = line.indexOf(" am ");
if (i0 >= 0) {
int i2 = line.indexOf(";", i0 + 4);
avoidMovesString = line.substring(i0 + 4, i2);
}
String bestMovesString = null;
int i1 = line.indexOf(" bm ");
if (i1 >= 0) {
int i2 = line.indexOf(";", i1 + 4);
bestMovesString = line.substring(i1 + 4, i2);
}
int timeSolved = testPosition(line.substring(0, (i0 != -1 ? i0 : i1)), avoidMovesString, bestMovesString, timeLimit);
totalTime += timeSolved;
/*
* * 30 points, if solution is found between 0 and 9 seconds
* * 25 points, if solution is found between 10 and 29 seconds
* * 20 points, if solution is found between 30 and 89 seconds
* * 15 points, if solution is found between 90 and 209 seconds
* * 10 points, if solution is found between 210 and 389 seconds
* * 5 points, if solution is found between 390 and 600 seconds
* * 0 points, if not found with in 10 minutes
*/
if (timeSolved < timeLimit) {
if (0 <= timeSolved && timeSolved < 10000) {
lctPoints += 30;
} else if (10000 <= timeSolved && timeSolved < 30000) {
lctPoints += 25;
} else if (30000 <= timeSolved && timeSolved < 90000) {
lctPoints += 20;
} else if (90000 <= timeSolved && timeSolved < 210000) {
lctPoints += 15;
} else if (210000 <= timeSolved && timeSolved < 390000) {
lctPoints += 10;
} else if (390000 <= timeSolved && timeSolved < 600000) {
lctPoints += 5;
}
} else {
notSolved.append(line);
notSolved.append("\n");
}
total++;
if (timeSolved < timeLimit) {
solved++;
}
logger.debug("Status: " + solved + " positions solved of " + total + " in " + totalTime + "Ms and " + totalNodes + " nodes (lctPoints=" + lctPoints + ")");
logger.debug("");
}
} catch (Exception e) {
e.printStackTrace();
}
fails = total - solved;
logger.debug("TEST TIME NODES");
for (int i = 0; i < allSolutionTimes.size(); i++) {
logger.debug(StringUtils.padRight(String.valueOf(i + 1), 4) + StringUtils.padLeft(String.valueOf(allSolutionTimes.get(i)), 8) + StringUtils.padLeft(String.valueOf(allSolutionNodes.get(i)), 12));
}
logger.debug("***** Positions not Solved:");
logger.debug(notSolved.toString());
logger.debug("***** Result:" + solved + " positions solved of " + total + " in " + totalTime + "Ms and " + totalNodes + " nodes (" + fails + " fails)");
return totalTime;
}
private int[] parseMoves(String movesString) {
if (movesString == null) {
return new int[0];
}
String movesStringArray[] = movesString.split(" ");
int moves[] = new int[movesStringArray.length];
for (int i = 0; i < moves.length; i++) {
moves[i] = Move.getFromString(search.getBoard(), movesStringArray[i], true);
}
return moves;
}
private int testPosition(String fen, String avoidMovesString, String bestMovesString, int timeLimit) {
bestMove = 0;
solutionFound = false;
search.clear();
search.getBoard().setFen(fen);
avoidMoves = parseMoves(avoidMovesString);
if (avoidMovesString != null) {
logger.debug("Lets see if " + avoidMovesString + (avoidMoves.length > 1 ? " are " : " is ") + "avoided");
}
bestMoves = parseMoves(bestMovesString);
if (bestMovesString != null) {
logger.debug("Lets see if " + bestMovesString + (bestMoves.length > 1 ? " are " : " is ") + "found");
}
search.go(SearchParameters.get(timeLimit));
if (solutionFound) {
logger.debug("Solution found in " + solutionTime + "Ms and " + solutionNodes + " nodes :D " + Move.toStringExt(bestMove));
totalNodes += solutionNodes;
allSolutionNodes.add(solutionNodes);
allSolutionTimes.add(solutionTime);
return solutionTime;
} else {
logger.debug("Solution not found, instead played: " + Move.toStringExt(search.getBestMove()));
allSolutionNodes.add(search.getNodeCount());
allSolutionTimes.add(timeLimit);
return timeLimit;
}
}
@Override
public void info(SearchStatusInfo info) {
if (bestMove != search.getBestMove()) {
bestMove = search.getBestMove();
solutionTime = (int) info.getTime();
solutionNodes = info.getNodes();
}
boolean found = bestMoves.length <= 0;
for (int move : bestMoves) {
if (move == search.getBestMove()) {
found = true;
break;
}
}
for (int move : avoidMoves) {
if (move == search.getBestMove()) {
found = false;
break;
}
}
solutionFound = found;
if (found) {
logger.debug(TestColors.ANSI_GREEN + info.toString() + TestColors.ANSI_RESET);
} else {
logger.debug(TestColors.ANSI_RED + info.toString() + TestColors.ANSI_RESET);
}
}
@Override
public void bestMove(int bestMove, int ponder) {
}
}
|
albertoruibal/carballo
|
jse/src/test/java/com/alonsoruibal/chess/epdtest/EpdTest.java
|
Java
|
gpl-3.0
| 7,660
|
<?php
include("../patches.php");
$patch = new Patch(23);
if (!$patch->exists()) {
$sql = "ALTER table oauth_token ADD KEY `token` (`token`)";
db()->execute($sql);
$patch->finish("Adding MySQL keys");
}
|
Hoektronics/BotQueue
|
upgrade/patches/v05p11.php
|
PHP
|
gpl-3.0
| 208
|
<!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>QtNets: OUT/Release/Include/Smile/SmileXML Directory Reference</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="projectlogo"><img alt="Logo" src="logo_polito.jpg"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">QtNets
 <span id="projectnumber">Version 1.0</span>
</div>
<div id="projectbrief">An open-source library to manage complex networks</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 Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li class="current"><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>File 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="dir_294d474add52441dd76f96e1b5b68ea1.html">OUT</a></li><li class="navelem"><a class="el" href="dir_bbf18488c80d10e10ab496f30e668e75.html">Release</a></li><li class="navelem"><a class="el" href="dir_48f7afe8cd6ee0e9f4de3f589d2422e4.html">Include</a></li><li class="navelem"><a class="el" href="dir_149b498cecb5c878193deb878700de2b.html">Smile</a></li><li class="navelem"><a class="el" href="dir_4e381d1da7721c9ef6e1d0fe9f82c733.html">SmileXML</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">SmileXML Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a>
Files</h2></td></tr>
<tr class="memitem:_o_u_t_2_release_2_include_2_smile_2_smile_x_m_l_2smilexmlconst_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="_o_u_t_2_release_2_include_2_smile_2_smile_x_m_l_2smilexmlconst_8h.html">smilexmlconst.h</a> <a href="_o_u_t_2_release_2_include_2_smile_2_smile_x_m_l_2smilexmlconst_8h_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:_o_u_t_2_release_2_include_2_smile_2_smile_x_m_l_2smilexmlparser_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="_o_u_t_2_release_2_include_2_smile_2_smile_x_m_l_2smilexmlparser_8h.html">smilexmlparser.h</a> <a href="_o_u_t_2_release_2_include_2_smile_2_smile_x_m_l_2smilexmlparser_8h_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:_o_u_t_2_release_2_include_2_smile_2_smile_x_m_l_2smilexmlwriter_8h"><td class="memItemLeft" align="right" valign="top">file  </td><td class="memItemRight" valign="bottom"><a class="el" href="_o_u_t_2_release_2_include_2_smile_2_smile_x_m_l_2smilexmlwriter_8h.html">smilexmlwriter.h</a> <a href="_o_u_t_2_release_2_include_2_smile_2_smile_x_m_l_2smilexmlwriter_8h_source.html">[code]</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
|
angeloprudentino/QtNets
|
Doc/html/dir_4e381d1da7721c9ef6e1d0fe9f82c733.html
|
HTML
|
gpl-3.0
| 6,144
|
/*
* LIXUZ content management system
* Copyright (C) Utrop A/S Portu media & Communications 2008-2011
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* LIXUZ functions for drag+drop
*
* Requires: asyncHelper.js
*
* Copyright (C) Portu media & communications
* All Rights Reserved
*/
var lixuz_DD_LastOrder;
var lixuz_DD_URL;
var lixuz_DD_FolderType = 'single';
var lixuz_DD_DialogBox;
var folderLimit_override;
var lixuz_DD_myDragDrop;
/*
* Called whenever the ordering of the folder tree is changed
*/
function lixuz_DD_OrderChangeEvent ()
{
// We're being run as a method on the dragdrop object, so we can
// access it as this.
// The actual ordering is alphabetical, so we don't care about simple
// reordering the user is doing. Therefore we do our own sorting here
// so that results are predictable, and to avoid sending useless
// empty requests.
var order;
try
{
order = this.getNodeOrders().split(",").sort().join(",");
}
catch (n)
{
lzException(n);
return;
}
if(order == lixuz_DD_LastOrder)
{
return;
}
lixuz_DD_LastOrder = order;
$.get(lixuz_DD_URL+'?orderChange='+order,lixuz_DD_OrderReply);
}
/*
* The reply from the server concerning the order change
*/
function lixuz_DD_OrderReply (text)
{
text = text.split("\n");
var reply = text.shift();
if(! reply.match(/^OK/))
{
userMessage('An error occurred while saving the changes, press OK to refresh the list to the server copy.'+"\n\n(error: "+reply+")");
showPI(i18n.get('Refreshing...'));
lixuz_DD_RefreshList();
}
}
/*
* Sends a request for a new folder tree list
*/
function lixuz_DD_RefreshList ()
{
$.get(lixuz_DD_URL+'?request=HTML_LIST',lixuz_DD_RefreshListReply);
}
/*
* New folder tree recieved, rebuild using the new data
*/
function lixuz_DD_RefreshListReply (text)
{
text = text.split("\n");
var reply = text.shift();
destroyPI();
if(! reply.match(/^OK/))
{
userMessage("Error during fetching of new XHTML:\n"+reply);
return;
}
$('#treeview').html(text.join("\n"));
buildLXTreeView();
}
/*
* Hide an item that has just been dropped
*/
function lixuz_DD_ItemHide(item,parentItem)
{
parentItem.style.display = 'none';
item.style.display = 'none';
item.style.visibility = 'hidden';
parentItem.style.visibility = 'hidden';
// Handles hiding mouseOver elements from files/mouseOver.js if they
// are present. We catch and ignore errors because if they're not, we don't care.
try
{
if (mouseOverOut && ( $('#'+item.id+'_mouseOver').length || $('#'+parentItem.id+'_mouseOver').length))
{
mouseOverOut(item.id);
mouseOverOut(parentItem.id);
}
}
catch(e) {}
}
/*
* Handle an item being dropped somewhere using d+d functions
*/
function lixuz_DD_ItemDropped(sourceId, targetId, mouseX, mouseY)
{
var sourceObj = document.getElementById(sourceId);
lixuz_DD_ItemHide(sourceObj,sourceObj.parentNode);
var source = sourceObj.getAttribute('uid');
targetId = targetId.replace(/^nodeATag/,'node');
var targetObj = document.getElementById(targetId);
if (!targetObj)
{
alert('Internal error: targetObj was false');
return;
}
var target = targetObj.getAttribute('uid');
if (target == null)
{
alert('target var was null, failed to fetch uid of targetObj. targetObj id='+targetObj.id);
return;
}
$.get(lixuz_DD_URL+'?moveToFolder='+target+'&item='+source,lixuz_DD_ItemDropReply);
return true;
}
/*
* The reply from the server concerning the drop
*/
function lixuz_DD_ItemDropReply(text)
{
text = text.split("\n");
var reply = text.shift();
if(! reply.match(/^OK/))
{
userMessage('An error occurred while saving the changes, please reload the page to update the state information of all entries.'+"\n\n(error: "+reply+")");
}
}
// Prepare entities for dragdrop
function lixuz_DD_CreateDragDropEntities()
{
var sources = [];
var targets = [];
var foundEntities = false;
var foundSources = false;
var foundTargets = false;
var lastFound = true;
for (var n = 0; n != null; n != null && n++)
{
var obj = document.getElementById('dragDropEntry'+n);
if(obj)
{
foundEntities = true;
foundSources = true;
lastFound = true;
sources.push(obj.id);
}
else
{
if (!lastFound)
{
n = null;
}
else
{
lastFound = false;
}
}
}
lastFound = true;
for (var n = 0; n != null; n != null && n++)
{
var obj = document.getElementById('nodeATag'+n);
if(obj)
{
foundTargets = true;
foundEntities = true;
lastFound = true;
targets.push(obj.id);
}
else
{
if (!lastFound)
{
n = null;
}
else
{
lastFound = false;
}
}
}
if (!foundEntities || !foundTargets || !foundSources)
{
return;
}
else
{
try
{
var dragdrop = new dragDrop_dragDrop();
for(var i = 0; i < sources.length; i++)
{
dragdrop.addSource(sources[i],true);
}
for(var i = 0; i < targets.length; i++)
{
dragdrop.addTarget(targets[i],'lixuz_DD_ItemDropped');
}
dragdrop.init();
lixuz_DD_myDragDrop = dragdrop;
}
catch(e)
{
lzException(e);
}
}
}
/*
* Limit our view to items that are in a specified folder
*/
function folderLimit (uid)
{
if(folderLimit_override)
{
folderLimit_override(uid);
return;
}
var uri = location.href;
uri = uri.replace(/folder=[^\&]+/,'');
uri = uri.replace(/#/,'');
if (uri.indexOf('?') == -1)
{
uri = uri + '?';
}
uri = uri + '&';
uri = uri.replace(/&+/,'&');
if(uid == 'root')
{
uri = uri.replace(/\?\&$/,'');
}
else
{
uri = uri + 'folder='+uid;
}
location.href = uri;
return false;
}
/*
* ***
* Create a new folder
* ***
*/
/*
* Fetches folder data and prepares for folder creation
*/
function lixuz_DD_NewItem(junk,parentObj)
{
showPI(i18n.get('Loading folder data ...'));
var myparent = 'root';
if(parentObj != 'root')
{
parentObj = parentObj.parentNode;
myparent = parentObj.getAttribute('uid');
if (!myparent)
{
return;
}
}
XHR.GET('/admin/services/folderList?showRoot=true&selected='+encodeURIComponent(myparent),lixuz_DD_NewFolderItem,null);
return false;
}
/*
* Shows the 'new folder' dialog
*/
function lixuz_DD_NewFolderItem(form)
{
destroyPI();
var html = '<b>'+i18n.get('Parent folder')+': <select id="newFolder_parent" name="newFolder_parent" style="width:470px;">';
html = html+form.tree;
html = html+'</select><br /><br />';
html = html + '<b>'+i18n.get('Folder name')+': <input id="newFolder_name" name="name" size="45" type="text" value="" /><br />';
var buttons = {};
buttons[i18n.get('Create')] = function ()
{
lixuz_DD_CreateNewFolder();
lixuz_DD_DialogBox.destroy();
};
try
{
if(lixuz_DD_DialogBox && lixuz_DD_DialogBox.hide)
{
lixuz_DD_DialogBox.hide();
}
lixuz_DD_DialogBox = new dialogBox(html,{title: i18n.get('New folder'), buttons: buttons, minWidth: 500});
}
catch(e)
{
lzException(e);
}
}
/*
* Sends the new folder data to the server
*/
function lixuz_DD_CreateNewFolder()
{
var name;
var myparent;
try
{
var name = $('#newFolder_name').val();
if(name == null || name.length <= 0)
{
userMessage(i18n.get('You have to enter a name for the folder'));
return;
}
myparent = $('#newFolder_parent').val();
}
catch (e)
{
lzException(e);
return;
}
lixuz_DD_DialogBox.hide();
showPI(i18n.get('Creating folder...')); // Show progress indicator
XHR.GET(lixuz_DD_URL+'?parent='+encodeURIComponent(myparent)+'&addName='+encodeURIComponent(name), lixuz_DD_NewItemSuccess, lixuz_DD_NewItemFailure);
}
/*
* All good, new folder created, so we kick off a refresh of the data
*/
function lixuz_DD_NewItemSuccess (reply)
{
lixuz_DD_RefreshList();
}
/*
* Something went wrong
*/
function lixuz_DD_NewItemFailure (reply)
{
//var error = LZ_JSON_GetErrorInfo(reply,false);
LZ_SaveFailure(reply, i18n.get('Failed to create a new folder'));
}
|
portu/lixuz
|
root/source-js/dragdrop/lixuzdd.js
|
JavaScript
|
gpl-3.0
| 9,574
|
using System;
using System.Collections.Generic;
using System.Xml.Serialization;
namespace SFLibs.Core.IO
{
public class XmlSerializerUtil
{
private static Dictionary<Type, XmlSerializer> dic = new Dictionary<Type, XmlSerializer>();
public static XmlSerializer GetSerializer(Type type)
{
if (!dic.TryGetValue(type, out var s))
{
s = new XmlSerializer(type);
dic.Add(type, s);
}
return s;
}
}
}
|
Freeesia/EarlyPusher
|
SFLibs/SFCore/IO/XmlSerializerUtil.cs
|
C#
|
gpl-3.0
| 430
|
window.addEvent('domready', function()
{
// Add effect on all the menu boxes, and the ajax request
$('test-button').addEvents(
{
'click': function(event)
{
//prevent the page from changing (i.e. following the link)
event.stop();
$('test').set('send', {onSuccess: function(responseText, responseXML) {$('result').set('text', responseText);},});
$('test').send();
}
});
$('release-button').addEvents(
{
'click': function(event)
{
//prevent the page from changing (i.e. following the link)
event.stop();
$('release').set('send', {onSuccess: function(responseText, responseXML) {$('result').set('text', responseText);},});
$('release').send();
}
});
});
|
fbianco/webraptor
|
admin.js
|
JavaScript
|
gpl-3.0
| 895
|
#include "MasterSessionAdapter.h"
namespace Automatak { namespace DNP3 { namespace Adapter {
MasterSessionAdapter::MasterSessionAdapter(std::shared_ptr<asiodnp3::IMasterSession> proxy) :
MasterOperationsAdapter(proxy.get()),
proxy(new std::shared_ptr<asiodnp3::IMasterSession>(proxy))
{
}
void MasterSessionAdapter::BeginShutdown()
{
(*proxy)->BeginShutdown();
}
Interface::IStackStatistics^ MasterSessionAdapter::GetStackStatistics()
{
return Conversions::ConvertStackStats((*proxy)->GetStackStatistics());
}
}}}
|
thiagoralves/OpenPLC_v2
|
dnp3/dotnet/bindings/CLRAdapter/src/MasterSessionAdapter.cpp
|
C++
|
gpl-3.0
| 527
|
mailman
=======
Semi-unofficial mirror of GNU Mailman 3
|
warsaw/mailman
|
README.md
|
Markdown
|
gpl-3.0
| 57
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_55) on Tue May 27 14:29:21 CEST 2014 -->
<title>Uses of Class gui.layers.AssociatedNodeLayer</title>
<meta name="date" content="2014-05-27">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class gui.layers.AssociatedNodeLayer";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../gui/layers/AssociatedNodeLayer.html" title="class in gui.layers">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?gui/layers/class-use/AssociatedNodeLayer.html" target="_top">Frames</a></li>
<li><a href="AssociatedNodeLayer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class gui.layers.AssociatedNodeLayer" class="title">Uses of Class<br>gui.layers.AssociatedNodeLayer</h2>
</div>
<div class="classUseContainer">
<ul class="blockList">
<li class="blockList">
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing packages, and an explanation">
<caption><span>Packages that use <a href="../../../gui/layers/AssociatedNodeLayer.html" title="class in gui.layers">AssociatedNodeLayer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="#gui.components">gui.components</a></td>
<td class="colLast"> </td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<ul class="blockList">
<li class="blockList"><a name="gui.components">
<!-- -->
</a>
<h3>Uses of <a href="../../../gui/layers/AssociatedNodeLayer.html" title="class in gui.layers">AssociatedNodeLayer</a> in <a href="../../../gui/components/package-summary.html">gui.components</a></h3>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../gui/components/package-summary.html">gui.components</a> that return <a href="../../../gui/layers/AssociatedNodeLayer.html" title="class in gui.layers">AssociatedNodeLayer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../gui/layers/AssociatedNodeLayer.html" title="class in gui.layers">AssociatedNodeLayer</a></code></td>
<td class="colLast"><span class="strong">OVComponent.</span><code><strong><a href="../../../gui/components/OVComponent.html#getActiveLayer()">getActiveLayer</a></strong>()</code> </td>
</tr>
</tbody>
</table>
<table border="0" cellpadding="3" cellspacing="0" summary="Use table, listing methods, and an explanation">
<caption><span>Methods in <a href="../../../gui/components/package-summary.html">gui.components</a> that return types with arguments of type <a href="../../../gui/layers/AssociatedNodeLayer.html" title="class in gui.layers">AssociatedNodeLayer</a></span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><code>java.util.ArrayList<<a href="../../../gui/layers/AssociatedNodeLayer.html" title="class in gui.layers">AssociatedNodeLayer</a>></code></td>
<td class="colLast"><span class="strong">OVComponent.</span><code><strong><a href="../../../gui/components/OVComponent.html#getNodeLayers()">getNodeLayers</a></strong>()</code> </td>
</tr>
</tbody>
</table>
</li>
</ul>
</li>
</ul>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../gui/layers/AssociatedNodeLayer.html" title="class in gui.layers">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?gui/layers/class-use/AssociatedNodeLayer.html" target="_top">Frames</a></li>
<li><a href="AssociatedNodeLayer.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
Mandarancio/OpenView
|
OpenView/doc/gui/layers/class-use/AssociatedNodeLayer.html
|
HTML
|
gpl-3.0
| 6,739
|
'''
testing speedup of code
Created on Sep 17, 2016
@author: jonaswallin
'''
from Mixture.density import mNIG
from Mixture.density.purepython import mNIG as pmNIG
from Mixture import mixOneDims
import numpy as np
import numpy.random as npr
import timeit
# most speed here is used startup (iteration = 500, n = 1000)
# Cython:
# 2000 0.152 0.000 0.268 0.000 NIG.py:82(EV)
# 2000 0.098 0.000 0.145 0.000 NIG.py:39(dens)
# 2000 0.051 0.000 0.051 0.000 {Mixture.util.cython_Bessel.Bessel0approx}
# 2000 0.037 0.000 0.037 0.000 {Mixture.util.cython_Bessel.Bessel1approx}
# Pure Python:
# 2000 1.201 0.001 1.264 0.001 NIG.py:208(EV)
# 2000 1.195 0.001 1.201 0.001 NIG.py:248(dens)
# Pure Python, no precompute:
# 2000 2.322 0.001 2.387 0.001 NIG.py:208(EV)
# 2000 1.205 0.001 1.211 0.001 NIG.py:248(dens)
npr.seed(10)
def speed_python(pure_python=False, precompute = True):
K = 2
d = 2
iteration = 500
mixObj = mixOneDims(K=K, d=d)
if pure_python:
mixObj.set_densites([pmNIG(d=d) for k in range(K)]) # @UnusedVariable
else:
mixObj.set_densites([mNIG(d=d) for k in range(K)]) # @UnusedVariable
paramMat_true = [np.array([[1.1, 1.12, 0.1, 0],
[-1, 0,2 , -4] ]),
np.array([[-2, 0, 0.3, 0],
[1, 0, 2 , -4] ])]
alpha_true = [0]
mixObj.set_paramMat(alpha = alpha_true,paramMat = paramMat_true)
Y = mixObj.sample(n = 1000)
mixObj.set_data(Y)
paramMat = [npr.randn(2,4),npr.randn(2,4)]
paramMat[0][0,0] = 1.1
paramMat[1][0,0] = -2
alpha = np.array(alpha_true)
for i in range(iteration): # @UnusedVariable
p, alpha, paramMat = mixObj.EMstep(alpha = alpha, paramMat = paramMat , precompute = precompute) # @UnusedVariable
if __name__ == "__main__":
|
JonasWallin/Mixture
|
test/speed_checks/speed_mixture.py
|
Python
|
gpl-3.0
| 1,989
|
/*
* Copyright (c) 2008 VMware, Inc.
* Copyright (c) 2009 John Pritchard, JBXML Project Group
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package lxl;
/**
* Interface representing a set of key/value pairs.
*
* @author gbrown
* @author jdp
*/
public interface Dictionary<K extends Comparable, V>
extends Cloneable
{
/**
* Retrieves the value for the given key.
*
* @param key
* The key whose value is to be returned.
*
* @return
* The value corresponding to <tt>key</tt>, or null if the key does not
* exist. Will also return null if the key refers to a null value.
* Use <tt>containsKey()</tt> to distinguish between these two cases.
*/
public V get(Object key);
/**
* Sets the value of the given key, creating a new entry or replacing the
* existing value.
*
* @param key
* The key whose value is to be set.
*
* @param value
* The value to be associated with the given key.
*/
public V put(K key, V value);
/**
* Removes a key/value pair from the map. This method should
* throw an instance of {@link PropertyNotFoundException} if it is
* unable to perform the requested operation due to an
* unrecognized name.
*
* @param key
* The key whose mapping is to be removed.
*
* @return
* The value that was removed.
*/
public V remove(Object key);
/**
* Tests the existence of a key in the dictionary.
*
* @param key
* The key whose presence in the dictionary is to be tested.
*
* @return
* <tt>true</tt> if the key exists in the dictionary; <tt>false</tt>,
* otherwise.
*/
public boolean containsKey(Object key);
/**
* Tests the emptiness of the dictionary.
*
* @return
* <tt>true</tt> if the dictionary contains no keys; <tt>false</tt>,
* otherwise.
*/
public boolean isEmpty();
public java.util.Iterator<K> iteratorKeys();
public Set<K> keySet();
public java.util.Iterator<V> iteratorValues();
public Iterable<K> keys();
public Dictionary<K,V> cloneDictionary();
}
|
ccdlvc/lxl
|
src/lxl/Dictionary.java
|
Java
|
gpl-3.0
| 2,690
|
package com.lyra.mod.def;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.stereotype.Component;
import static com.lyra.util.internal.Comparer.equal;
import static com.lyra.util.internal.Comparer.hash;
/**
* @author Lang
* @package com.lyra.mod.def
* @name IndexSchema
* @class com.lyra.mod.def.IndexSchema
* @date Nov 24, 2014 9:52:01 PM
* @see
*/
@Component
public final class IndexSchema {
// ~ Instance Fields =====================================
/**
* Index name for current table *
*/
@JsonProperty("name")
private String name;
/**
* Index category for current table SQL Server: CI, NCI
*/
@JsonProperty("category")
private String category;
/**
* Indexed column name of database table. *
*/
@JsonProperty("column")
private String column;
// ~ Constructors ========================================
/**
* Public constructor. *
*/
public IndexSchema() {
// For Jackson serialization
}
/**
* @param name
* @param category
* @param column
*/
public IndexSchema(final String name, final String category,
final String column) {
this.name = name;
this.category = category;
this.column = column;
}
// ~ Methods =============================================
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name
* the name to set
*/
public void setName(final String name) {
this.name = name;
}
/**
* @return the category
*/
public String getCategory() {
return category;
}
/**
* @param category
* the category to set
*/
public void setCategory(final String category) {
this.category = category;
}
/**
* @return the column
*/
public String getColumn() {
return column;
}
/**
* @param column
* the column to set
*/
public void setColumn(final String column) {
this.column = column;
}
// ~ hashCode,equals,toString ============================
/**
*
*/
@Override
public int hashCode() {
int result = hash(1, this.name);
result = hash(result, this.category);
result = hash(result, this.column);
return result;
}
/**
*
*/
@Override
public boolean equals(final Object obj) {
boolean ret = true & equal(this, obj, getClass(), true);
if (ret) {
final IndexSchema that = (IndexSchema) obj;
ret &= equal(this.name, that.name);
ret &= equal(this.category, that.category);
ret &= equal(this.column, that.column);
}
return ret;
}
}
|
silentbalanceyh/lyra
|
lyra-bus/meta-milieu/src/main/java/com/lyra/mod/def/IndexSchema.java
|
Java
|
gpl-3.0
| 2,640
|
/*
* Darmix-Core Copyright (C) 2013 Deremix
* Integrated Files: CREDITS.md and LICENSE.md
*/
#ifdef WIN32
#ifndef _WIN32_SERVICE_
#define _WIN32_SERVICE_
bool WinServiceInstall();
bool WinServiceUninstall();
bool WinServiceRun();
#endif // _WIN32_SERVICE_
#endif // WIN32
|
deremix/darmixcore
|
src/shared/ServiceWin32.h
|
C
|
gpl-3.0
| 386
|
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::SinglePhaseMixture
Description
Templated parcel single phase, multi-component class
SourceFiles
SinglePhaseMixture.C
\*---------------------------------------------------------------------------*/
#ifndef SinglePhaseMixture_H
#define SinglePhaseMixture_H
#include "CompositionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class SinglePhaseMixture Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class SinglePhaseMixture
:
public CompositionModel<CloudType>
{
// Private Data
// Indices of the phases - only 1 will be set
//- Gas
label idGas_;
//- Liquid
label idLiquid_;
//- Solid
label idSolid_;
// Private Member Functions
//- Construct the indices and check correct specification of
// 1 gas or 1 liquid or 1 solid
void constructIds();
public:
//- Runtime type information
TypeName("singlePhaseMixture");
// Constructors
//- Construct from dictionary
SinglePhaseMixture(const dictionary& dict, CloudType& owner);
//- Construct copy
SinglePhaseMixture(const SinglePhaseMixture<CloudType>& cm);
//- Construct and return a clone
virtual autoPtr<CompositionModel<CloudType>> clone() const
{
return autoPtr<CompositionModel<CloudType>>
(
new SinglePhaseMixture<CloudType>(*this)
);
}
//- Destructor
virtual ~SinglePhaseMixture();
// Member Functions
// Access
// Mixture properties
//- Return the list of mixture mass fractions
virtual const scalarField& YMixture0() const;
// Indices of gas, liquid and solid phases in phase properties
// list
//- Gas id
virtual label idGas() const;
//- Liquid id
virtual label idLiquid() const;
//- Solid id
virtual label idSolid() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
#include "SinglePhaseMixture.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
|
OpenFOAM/OpenFOAM-dev
|
src/lagrangian/parcel/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.H
|
C++
|
gpl-3.0
| 3,857
|
// child.c (part of mintty)
// Copyright 2008-11 Andy Koppe
// Licensed under the terms of the GNU General Public License v3 or later.
#include "child.h"
#include "term.h"
#include "charset.h"
#include "win.h" /* win_prefix_title */
#include <pwd.h>
#include <fcntl.h>
#include <utmp.h>
#include <dirent.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <sys/cygwin.h>
#if CYGWIN_VERSION_API_MINOR >= 93
#include <pty.h>
#else
int forkpty(int *, char *, struct termios *, struct winsize *);
#endif
#include <winbase.h>
#if CYGWIN_VERSION_DLL_MAJOR < 1007
#include <winnls.h>
#include <wincon.h>
#include <wingdi.h>
#include <winuser.h>
#endif
bool clone_size_token = true;
string child_dir = null;
static pid_t pid;
static bool killed;
static int pty_fd = -1, log_fd = -1, win_fd;
static void
childerror(char * action, bool from_fork)
{
char * msg;
char * err = strerror(errno);
if (from_fork && errno == ENOENT)
err = "There are no available terminals";
int len = asprintf(&msg, "\033[30;%dm\033[KError: %s: %s.\033[0m\r\n", from_fork ? 41 : 43, action, err);
if (len > 0) {
term_write(msg, len);
free(msg);
}
}
static void
sigexit(int sig)
{
if (pid)
kill(-pid, SIGHUP);
signal(sig, SIG_DFL);
report_pos();
kill(getpid(), sig);
}
void
child_create(char *argv[], struct winsize *winp)
{
string lang = cs_lang();
// xterm and urxvt ignore SIGHUP, so let's do the same.
signal(SIGHUP, SIG_IGN);
signal(SIGINT, sigexit);
signal(SIGTERM, sigexit);
signal(SIGQUIT, sigexit);
// Create the child process and pseudo terminal.
pid = forkpty(&pty_fd, 0, 0, winp);
if (pid < 0) {
pid = 0;
bool rebase_prompt = (errno == EAGAIN);
//ENOENT There are no available terminals.
//EAGAIN Cannot allocate sufficient memory to allocate a task structure.
//EAGAIN Not possible to create a new process; RLIMIT_NPROC limit.
//ENOMEM Memory is tight.
childerror("could not fork child process", true);
if (rebase_prompt) {
static const char msg[] =
"\033[30;43m\033[KDLL rebasing may be required. See 'rebaseall / rebase --help'.\033[0m\r\n";
term_write(msg, sizeof msg - 1);
}
term_hide_cursor();
}
else if (!pid) { // Child process.
#if CYGWIN_VERSION_DLL_MAJOR < 1007
// Some native console programs require a console to be attached to the
// process, otherwise they pop one up themselves, which is rather annoying.
// Cygwin's exec function from 1.5 onwards automatically allocates a console
// on an invisible window station if necessary. Unfortunately that trick no
// longer works on Windows 7, which is why Cygwin 1.7 contains a new hack
// for creating the invisible console.
// On Cygwin versions before 1.5 and on Cygwin 1.5 running on Windows 7,
// we need to create the invisible console ourselves. The hack here is not
// as clever as Cygwin's, with the console briefly flashing up on startup,
// but it'll do.
#if CYGWIN_VERSION_DLL_MAJOR == 1005
DWORD win_version = GetVersion();
win_version = ((win_version & 0xff) << 8) | ((win_version >> 8) & 0xff);
if (win_version >= 0x0601) // Windows 7 is NT 6.1.
#endif
if (AllocConsole()) {
HMODULE kernel = GetModuleHandle("kernel32");
HWND (WINAPI *pGetConsoleWindow)(void) =
(void *)GetProcAddress(kernel, "GetConsoleWindow");
ShowWindowAsync(pGetConsoleWindow(), SW_HIDE);
}
#endif
// Reset signals
signal(SIGHUP, SIG_DFL);
signal(SIGINT, SIG_DFL);
signal(SIGQUIT, SIG_DFL);
signal(SIGTERM, SIG_DFL);
signal(SIGCHLD, SIG_DFL);
// Mimick login's behavior by disabling the job control signals
signal(SIGTSTP, SIG_IGN);
signal(SIGTTIN, SIG_IGN);
signal(SIGTTOU, SIG_IGN);
setenv("TERM", cfg.term, true);
if (lang) {
unsetenv("LC_ALL");
unsetenv("LC_COLLATE");
unsetenv("LC_CTYPE");
unsetenv("LC_MONETARY");
unsetenv("LC_NUMERIC");
unsetenv("LC_TIME");
unsetenv("LC_MESSAGES");
setenv("LANG", lang, true);
}
// Terminal line settings
struct termios attr;
tcgetattr(0, &attr);
attr.c_cc[VERASE] = cfg.backspace_sends_bs ? CTRL('H') : CDEL;
attr.c_iflag |= IXANY | IMAXBEL;
attr.c_lflag |= ECHOE | ECHOK | ECHOCTL | ECHOKE;
tcsetattr(0, TCSANOW, &attr);
// Invoke command
execvp(cmd, argv);
// If we get here, exec failed.
fprintf(stderr, "\033[30;41m\033[KFailed to run %s: %s\r\n", cmd, strerror(errno));
#if CYGWIN_VERSION_DLL_MAJOR < 1005
// Before Cygwin 1.5, the message above doesn't appear if we exit
// immediately. So have a little nap first.
usleep(200000);
#endif
exit(255);
}
else { // Parent process.
fcntl(pty_fd, F_SETFL, O_NONBLOCK);
if (cfg.utmp) {
char *dev = ptsname(pty_fd);
if (dev) {
struct utmp ut;
memset(&ut, 0, sizeof ut);
if (!strncmp(dev, "/dev/", 5))
dev += 5;
strlcpy(ut.ut_line, dev, sizeof ut.ut_line);
if (dev[1] == 't' && dev[2] == 'y')
dev += 3;
else if (!strncmp(dev, "pts/", 4))
dev += 4;
strncpy(ut.ut_id, dev, sizeof ut.ut_id);
ut.ut_type = USER_PROCESS;
ut.ut_pid = pid;
ut.ut_time = time(0);
strlcpy(ut.ut_user, getlogin() ?: "?", sizeof ut.ut_user);
gethostname(ut.ut_host, sizeof ut.ut_host);
login(&ut);
}
}
}
win_fd = open("/dev/windows", O_RDONLY);
// Open log file if any
if (*cfg.log) {
// use cygwin conversion function to escape unencoded characters
// and thus avoid the locale trick (2.2.3)
if (!wcscmp(cfg.log, L"-"))
log_fd = fileno(stdout);
else {
char * log = path_win_w_to_posix(cfg.log);
char * format = strchr(log, '%');
if (format && * ++ format == 'd' && !strchr(format, '%')) {
char * logf = newn(char, strlen(log) + 20);
sprintf(logf, log, getpid());
free(log);
log = logf;
}
else if (format) {
struct timeval now;
gettimeofday (& now, 0);
char * logf = newn(char, MAX_PATH + 1);
strftime (logf, MAX_PATH, log, localtime (& now.tv_sec));
free(log);
log = logf;
}
log_fd = open(log, O_WRONLY | O_CREAT | O_EXCL, 0600);
if (log_fd < 0) {
// report message and filename:
childerror("could not open log file", false);
childerror(log, false);
}
free(log);
}
}
}
char *
child_tty(void)
{
return ptsname(pty_fd);
}
#define patch_319
void
child_proc(void)
{
for (;;) {
if (term.paste_buffer)
term_send_paste();
struct timeval timeout = {0, 100000}, *timeout_p = 0;
fd_set fds;
FD_ZERO(&fds);
FD_SET(win_fd, &fds);
if (pty_fd >= 0)
FD_SET(pty_fd, &fds);
#ifndef patch_319
else
#endif
if (pid) {
int status;
if (waitpid(pid, &status, WNOHANG) == pid) {
pid = 0;
// Decide whether we want to exit now or later
if (killed || cfg.hold == HOLD_NEVER)
exit_mintty();
else if (cfg.hold == HOLD_START) {
if (WIFSIGNALED(status) || WEXITSTATUS(status) != 255)
exit_mintty();
}
else if (cfg.hold == HOLD_ERROR) {
if (WIFEXITED(status)) {
if (WEXITSTATUS(status) == 0)
exit_mintty();
}
else {
const int error_sigs =
1<<SIGILL | 1<<SIGTRAP | 1<<SIGABRT | 1<<SIGFPE |
1<<SIGBUS | 1<<SIGSEGV | 1<<SIGPIPE | 1<<SIGSYS;
if (!(error_sigs & 1<<WTERMSIG(status)))
exit_mintty();
}
}
int l = 0;
char *s = 0;
bool err = true;
if (WIFEXITED(status)) {
int code = WEXITSTATUS(status);
if (code == 0)
err = false;
if ((code || cfg.exit_write) && cfg.hold != HOLD_START)
l = asprintf(&s, "%s: Exit %i", cmd, code);
}
else if (WIFSIGNALED(status))
l = asprintf(&s, "%s: %s", cmd, strsignal(WTERMSIG(status)));
if (!s && cfg.exit_write) {
s = "TERMINATED";
l = strlen(s);
}
if (s) {
if (err)
term_write("\033[30;41m\033[K", 11);
else
term_write("\033[30;42m\033[K", 11);
term_write(s, l);
}
if (cfg.exit_title && *cfg.exit_title)
win_prefix_title (cfg.exit_title);
}
#ifdef patch_319
if (pid != 0 && pty_fd < 0) // Pty gone, but process still there: keep checking
#else
else // Pty gone, but process still there: keep checking
#endif
timeout_p = &timeout;
}
if (select(win_fd + 1, &fds, 0, 0, timeout_p) > 0) {
if (pty_fd >= 0 && FD_ISSET(pty_fd, &fds)) {
#if CYGWIN_VERSION_DLL_MAJOR >= 1005
static char buf[4096];
int len = read(pty_fd, buf, sizeof buf);
#else
// Pty devices on old Cygwin version deliver only 4 bytes at a time,
// so call read() repeatedly until we have a worthwhile haul.
static char buf[512];
uint len = 0;
do {
int ret = read(pty_fd, buf + len, sizeof buf - len);
if (ret > 0)
len += ret;
else
break;
} while (len < sizeof buf);
#endif
if (len > 0) {
term_write(buf, len);
if (log_fd >= 0)
write(log_fd, buf, len);
}
else {
pty_fd = -1;
term_hide_cursor();
}
}
if (FD_ISSET(win_fd, &fds))
return;
}
}
}
void
child_kill(bool point_blank)
{
if (!pid ||
kill(-pid, point_blank ? SIGKILL : SIGHUP) < 0 ||
point_blank)
exit_mintty();
killed = true;
}
bool
child_is_alive(void)
{
return pid;
}
bool
child_is_parent(void)
{
if (!pid)
return false;
DIR *d = opendir("/proc");
if (!d)
return false;
bool res = false;
struct dirent *e;
char fn[18] = "/proc/";
while ((e = readdir(d))) {
char *pn = e->d_name;
if (isdigit((uchar)*pn) && strlen(pn) <= 6) {
snprintf(fn + 6, 12, "%s/ppid", pn);
FILE *f = fopen(fn, "r");
if (!f)
continue;
pid_t ppid = 0;
fscanf(f, "%u", &ppid);
fclose(f);
if (ppid == pid) {
res = true;
break;
}
}
}
closedir(d);
return res;
}
void
child_write(const char *buf, uint len)
{
if (pty_fd >= 0)
write(pty_fd, buf, len);
}
void
child_printf(const char *fmt, ...)
{
if (pty_fd >= 0) {
va_list va;
va_start(va, fmt);
char *s;
int len = vasprintf(&s, fmt, va);
va_end(va);
if (len >= 0)
write(pty_fd, s, len);
free(s);
}
}
void
child_send(const char *buf, uint len)
{
term_reset_screen();
if (term.echoing)
term_write(buf, len);
child_write(buf, len);
}
void
child_sendw(const wchar *ws, uint wlen)
{
char s[wlen * cs_cur_max];
int len = cs_wcntombn(s, ws, sizeof s, wlen);
if (len > 0)
child_send(s, len);
}
void
child_resize(struct winsize *winp)
{
if (pty_fd >= 0)
ioctl(pty_fd, TIOCSWINSZ, winp);
}
wstring
child_conv_path(wstring wpath)
{
int wlen = wcslen(wpath);
int len = wlen * cs_cur_max;
char path[len];
len = cs_wcntombn(path, wpath, len, wlen);
path[len] = 0;
char *exp_path; // expanded path
if (*path == '~') {
// Tilde expansion
char *name = path + 1;
char *rest = strchr(path, '/');
if (rest)
*rest++ = 0;
else
rest = "";
char *base;
if (!*name)
base = home;
else {
#if CYGWIN_VERSION_DLL_MAJOR >= 1005
// Find named user's home directory
struct passwd *pw = getpwnam(name);
base = (pw ? pw->pw_dir : 0) ?: "";
#else
// Pre-1.5 Cygwin simply copies HOME into pw_dir, which is no use here.
base = "";
#endif
}
exp_path = asform("%s/%s", base, rest);
}
else if (*path != '/') {
#if CYGWIN_VERSION_DLL_MAJOR >= 1005
// Handle relative paths. Finding the foreground process working directory
// requires the /proc filesystem, which isn't available before Cygwin 1.5.
// Find pty's foreground process, if any. Fall back to child process.
int fg_pid = (pty_fd >= 0) ? tcgetpgrp(pty_fd) : 0;
if (fg_pid <= 0)
fg_pid = pid;
char *cwd = 0;
if (fg_pid > 0) {
char proc_cwd[32];
sprintf(proc_cwd, "/proc/%u/cwd", fg_pid);
cwd = realpath(proc_cwd, 0);
}
exp_path = asform("%s/%s", cwd ?: home, path);
free(cwd);
#else
// If we're lucky, the path is relative to the home directory.
exp_path = asform("%s/%s", home, path);
#endif
}
else
exp_path = path;
# if CYGWIN_VERSION_API_MINOR >= 222
// CW_INT_SETLOCALE was introduced in API 0.222
cygwin_internal(CW_INT_SETLOCALE);
# endif
wchar *win_wpath = path_posix_to_win_w(exp_path);
// Drop long path prefix if possible,
// because some programs have trouble with them.
if (win_wpath && wcslen(win_wpath) < MAX_PATH) {
wchar *old_win_wpath = win_wpath;
if (wcsncmp(win_wpath, L"\\\\?\\UNC\\", 8) == 0) {
win_wpath = wcsdup(win_wpath + 6);
win_wpath[0] = '\\'; // Replace "\\?\UNC\" prefix with "\\"
free(old_win_wpath);
}
else if (wcsncmp(win_wpath, L"\\\\?\\", 4) == 0) {
win_wpath = wcsdup(win_wpath + 4); // Drop "\\?\" prefix
free(old_win_wpath);
}
}
if (exp_path != path)
free(exp_path);
return win_wpath;
}
void
child_set_fork_dir(char * dir)
{
strset(&child_dir, dir);
}
void
child_fork(int argc, char *argv[], int moni)
{
pid_t clone = fork();
if (cfg.daemonize) {
if (clone < 0) {
childerror("could not fork child daemon", true);
return; // assume next fork will fail too
}
if (clone > 0) { // parent waits for intermediate child
int status;
waitpid(clone, &status, 0);
return;
}
clone = fork();
if (clone < 0) {
exit(255);
}
if (clone > 0) { // new parent / previous child
exit(0); // exit and make the grandchild a daemon
}
}
if (clone == 0) { // prepare child process to spawn new terminal
if (pty_fd >= 0)
close(pty_fd);
if (log_fd >= 0)
close(log_fd);
close(win_fd);
if (child_dir && *child_dir)
chdir(child_dir);
#ifdef add_child_parameters
// add child parameters
int newparams = 0;
char * * newargv = malloc((argc + newparams + 1) * sizeof(char *));
int i = 0, j = 0;
bool addnew = true;
while (1) {
if (addnew && (! argv[i] || strcmp(argv[i], "-e") == 0 || strcmp(argv[i], "-") == 0)) {
addnew = false;
// insert additional parameters here
newargv[j++] = "-o";
static char parbuf1[28]; // static to prevent #530
sprintf(parbuf1, "Rows=%d", term.rows);
newargv[j++] = parbuf1;
newargv[j++] = "-o";
static char parbuf2[31]; // static to prevent #530
sprintf(parbuf2, "Columns=%d", term.cols);
newargv[j++] = parbuf2;
}
newargv[j] = argv[i];
if (! argv[i])
break;
i++;
j++;
}
argv = newargv;
#else
(void) argc;
#endif
void setenvi(char * env, int val) {
static char valbuf[22]; // static to prevent #530
sprintf(valbuf, "%d", val);
setenv(env, valbuf, true);
}
// provide environment to clone size
if (clone_size_token) {
setenvi("MINTTY_ROWS", term.rows);
setenvi("MINTTY_COLS", term.cols);
}
else
clone_size_token = true;
// provide environment to select monitor
if (moni > 0)
setenvi("MINTTY_MONITOR", moni);
// propagate shortcut-inherited icon
if (icon_is_from_shortcut)
setenv("MINTTY_ICON", cs__wcstoutf(cfg.icon), true);
#if CYGWIN_VERSION_DLL_MAJOR >= 1005
execv("/proc/self/exe", argv);
#else
// /proc/self/exe isn't available before Cygwin 1.5, so use argv[0] instead.
// Strip enclosing quotes if present.
char *path = argv[0];
int len = strlen(path);
if (path[0] == '"' && path[len - 1] == '"') {
path = strdup(path + 1);
path[len - 2] = 0;
}
execvp(path, argv);
#endif
exit(255);
}
}
|
jdmansour/mintty
|
src/child.c
|
C
|
gpl-3.0
| 16,288
|
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file allows you to add a note for a user
*
* @copyright 1999 Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package user
*/
require_once("../config.php");
require_once($CFG->dirroot .'/notes/lib.php');
$id = required_param('id', PARAM_INT); // course id
$users = optional_param_array('userid', array(), PARAM_INT); // array of user id
$contents = optional_param_array('contents', array(), PARAM_RAW); // array of user notes
$states = optional_param_array('states', array(), PARAM_ALPHA); // array of notes states
$PAGE->set_url('/user/addnote.php', array('id'=>$id));
if (! $course = $DB->get_record('course', array('id'=>$id))) {
print_error('invalidcourseid');
}
$context = get_context_instance(CONTEXT_COURSE, $id);
require_login($course);
// to create notes the current user needs a capability
require_capability('moodle/notes:manage', $context);
if (empty($CFG->enablenotes)) {
print_error('notesdisabled', 'notes');
}
if (!empty($users) && confirm_sesskey()) {
if (count($users) != count($contents) || count($users) != count($states)) {
print_error('invalidformdata', '', $CFG->wwwroot.'/user/index.php?id='.$id);
}
$note = new stdClass();
$note->courseid = $id;
$note->format = FORMAT_PLAIN;
foreach ($users as $k => $v) {
if (!$user = $DB->get_record('user', array('id'=>$v)) || empty($contents[$k])) {
continue;
}
$note->id = 0;
$note->content = $contents[$k];
$note->publishstate = $states[$k];
$note->userid = $v;
if (note_save($note)) {
add_to_log($note->courseid, 'notes', 'add', 'index.php?course='.$note->courseid.'&user='.$note->userid . '#note-' . $note->id , 'add note');
}
}
redirect("$CFG->wwwroot/user/index.php?id=$id");
}
/// Print headers
$straddnote = get_string('addnewnote', 'notes');
$PAGE->navbar->add($straddnote);
$PAGE->set_title("$course->shortname: ".get_string('extendenrol'));
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
// this will contain all available the based On select options, but we'll disable some on them on a per user basis
echo $OUTPUT->heading($straddnote);
echo '<form method="post" action="addnote.php">';
echo '<fieldset class="invisiblefieldset">';
echo '<input type="hidden" name="id" value="'.$course->id.'" />';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '</fieldset>';
$table = new html_table();
$table->head = array (get_string('fullnameuser'),
get_string('content', 'notes'),
get_string('publishstate', 'notes') . $OUTPUT->help_icon('publishstate', 'notes'),
);
$table->align = array ('left', 'center', 'center');
$state_names = note_get_state_names();
if(!has_capability('moodle/notes:manage', get_context_instance(CONTEXT_SYSTEM))) { // ecastro ULPGC to prevent site notes by unauthorized users
unset($state_names[NOTES_STATE_SITE]);
}
// the first time list hack
if (empty($users) and $post = data_submitted()) {
foreach ($post as $k => $v) {
if (preg_match('/^user(\d+)$/',$k,$m)) {
$users[] = $m[1];
}
}
}
foreach ($users as $k => $v) {
if(!$user = $DB->get_record('user', array('id'=>$v))) {
continue;
}
$checkbox = html_writer::label(get_string('selectnotestate', 'notes'), 'menustates', false, array('class' => 'accesshide'));
$checkbox .= html_writer::select($state_names, 'states[' . $k . ']', empty($states[$k]) ? NOTES_STATE_PUBLIC : $states[$k], false, array('id' => 'menustates'));
$table->data[] = array(
'<input type="hidden" name="userid['.$k.']" value="'.$v.'" />'. fullname($user, true),
'<textarea name="contents['. $k . ']" rows="2" cols="40">' . strip_tags(@$contents[$k]) . '</textarea>',
$checkbox
);
}
echo html_writer::table($table);
echo '<div style="width:100%;text-align:center;"><input type="submit" value="' . get_string('savechanges'). '" /></div></form>';
echo $OUTPUT->footer();
|
ecastro/moodle23ulpgc
|
user/addnote.php
|
PHP
|
gpl-3.0
| 4,776
|
/*
* Main header file for the ALSA sequencer
* Copyright (c) 1998-1999 by Frank van de Pol <fvdpol@coil.demon.nl>
* (c) 1998-1999 by Jaroslav Kysela <perex@suse.cz>
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef __SOUND_ASEQUENCER_H
#define __SOUND_ASEQUENCER_H
#ifndef __KERNEL__
#include <linux/ioctl.h>
#endif
#include <sound/asound.h>
/** version of the sequencer */
#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION (1, 0, 1)
#ifdef __KERNEL__
/**
* definition of sequencer event types
*/
/** system messages
* event data type = #sndrv_seq_result_t
*/
#define SNDRV_SEQ_EVENT_SYSTEM 0
#define SNDRV_SEQ_EVENT_RESULT 1
/** note messages (channel specific)
* event data type = #sndrv_seq_ev_note
*/
#define SNDRV_SEQ_EVENT_NOTE 5
#define SNDRV_SEQ_EVENT_NOTEON 6
#define SNDRV_SEQ_EVENT_NOTEOFF 7
#define SNDRV_SEQ_EVENT_KEYPRESS 8
/** control messages (channel specific)
* event data type = #sndrv_seq_ev_ctrl
*/
#define SNDRV_SEQ_EVENT_CONTROLLER 10
#define SNDRV_SEQ_EVENT_PGMCHANGE 11
#define SNDRV_SEQ_EVENT_CHANPRESS 12
#define SNDRV_SEQ_EVENT_PITCHBEND 13 /**< from -8192 to 8191 */
#define SNDRV_SEQ_EVENT_CONTROL14 14 /**< 14 bit controller value */
#define SNDRV_SEQ_EVENT_NONREGPARAM 15 /**< 14 bit NRPN address + 14 bit unsigned value */
#define SNDRV_SEQ_EVENT_REGPARAM 16 /**< 14 bit RPN address + 14 bit unsigned value */
/** synchronisation messages
* event data type = #sndrv_seq_ev_ctrl
*/
#define SNDRV_SEQ_EVENT_SONGPOS 20 /* Song Position Pointer with LSB and MSB values */
#define SNDRV_SEQ_EVENT_SONGSEL 21 /* Song Select with song ID number */
#define SNDRV_SEQ_EVENT_QFRAME 22 /* midi time code quarter frame */
#define SNDRV_SEQ_EVENT_TIMESIGN 23 /* SMF Time Signature event */
#define SNDRV_SEQ_EVENT_KEYSIGN 24 /* SMF Key Signature event */
/** timer messages
* event data type = sndrv_seq_ev_queue_control_t
*/
#define SNDRV_SEQ_EVENT_START 30 /* midi Real Time Start message */
#define SNDRV_SEQ_EVENT_CONTINUE 31 /* midi Real Time Continue message */
#define SNDRV_SEQ_EVENT_STOP 32 /* midi Real Time Stop message */
#define SNDRV_SEQ_EVENT_SETPOS_TICK 33 /* set tick queue position */
#define SNDRV_SEQ_EVENT_SETPOS_TIME 34 /* set realtime queue position */
#define SNDRV_SEQ_EVENT_TEMPO 35 /* (SMF) Tempo event */
#define SNDRV_SEQ_EVENT_CLOCK 36 /* midi Real Time Clock message */
#define SNDRV_SEQ_EVENT_TICK 37 /* midi Real Time Tick message */
#define SNDRV_SEQ_EVENT_QUEUE_SKEW 38 /* skew queue tempo */
/** others
* event data type = none
*/
#define SNDRV_SEQ_EVENT_TUNE_REQUEST 40 /* tune request */
#define SNDRV_SEQ_EVENT_RESET 41 /* reset to power-on state */
#define SNDRV_SEQ_EVENT_SENSING 42 /* "active sensing" event */
/** echo back, kernel private messages
* event data type = any type
*/
#define SNDRV_SEQ_EVENT_ECHO 50 /* echo event */
#define SNDRV_SEQ_EVENT_OSS 51 /* OSS raw event */
/** system status messages (broadcast for subscribers)
* event data type = sndrv_seq_addr_t
*/
#define SNDRV_SEQ_EVENT_CLIENT_START 60 /* new client has connected */
#define SNDRV_SEQ_EVENT_CLIENT_EXIT 61 /* client has left the system */
#define SNDRV_SEQ_EVENT_CLIENT_CHANGE 62 /* client status/info has changed */
#define SNDRV_SEQ_EVENT_PORT_START 63 /* new port was created */
#define SNDRV_SEQ_EVENT_PORT_EXIT 64 /* port was deleted from system */
#define SNDRV_SEQ_EVENT_PORT_CHANGE 65 /* port status/info has changed */
/** port connection changes
* event data type = sndrv_seq_connect_t
*/
#define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */
#define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */
/** synthesizer events
* event data type = sndrv_seq_eve_sample_control_t
*/
#define SNDRV_SEQ_EVENT_SAMPLE 70 /* sample select */
#define SNDRV_SEQ_EVENT_SAMPLE_CLUSTER 71 /* sample cluster select */
#define SNDRV_SEQ_EVENT_SAMPLE_START 72 /* voice start */
#define SNDRV_SEQ_EVENT_SAMPLE_STOP 73 /* voice stop */
#define SNDRV_SEQ_EVENT_SAMPLE_FREQ 74 /* playback frequency */
#define SNDRV_SEQ_EVENT_SAMPLE_VOLUME 75 /* volume and balance */
#define SNDRV_SEQ_EVENT_SAMPLE_LOOP 76 /* sample loop */
#define SNDRV_SEQ_EVENT_SAMPLE_POSITION 77 /* sample position */
#define SNDRV_SEQ_EVENT_SAMPLE_PRIVATE1 78 /* private (hardware dependent) event */
/** user-defined events with fixed length
* event data type = any
*/
#define SNDRV_SEQ_EVENT_USR0 90
#define SNDRV_SEQ_EVENT_USR1 91
#define SNDRV_SEQ_EVENT_USR2 92
#define SNDRV_SEQ_EVENT_USR3 93
#define SNDRV_SEQ_EVENT_USR4 94
#define SNDRV_SEQ_EVENT_USR5 95
#define SNDRV_SEQ_EVENT_USR6 96
#define SNDRV_SEQ_EVENT_USR7 97
#define SNDRV_SEQ_EVENT_USR8 98
#define SNDRV_SEQ_EVENT_USR9 99
/** instrument layer
* variable length data can be passed directly to the driver
*/
#define SNDRV_SEQ_EVENT_INSTR_BEGIN 100 /* begin of instrument management */
#define SNDRV_SEQ_EVENT_INSTR_END 101 /* end of instrument management */
#define SNDRV_SEQ_EVENT_INSTR_INFO 102 /* instrument interface info */
#define SNDRV_SEQ_EVENT_INSTR_INFO_RESULT 103 /* result */
#define SNDRV_SEQ_EVENT_INSTR_FINFO 104 /* get format info */
#define SNDRV_SEQ_EVENT_INSTR_FINFO_RESULT 105 /* get format info */
#define SNDRV_SEQ_EVENT_INSTR_RESET 106 /* reset instrument memory */
#define SNDRV_SEQ_EVENT_INSTR_STATUS 107 /* instrument interface status */
#define SNDRV_SEQ_EVENT_INSTR_STATUS_RESULT 108 /* result */
#define SNDRV_SEQ_EVENT_INSTR_PUT 109 /* put instrument to port */
#define SNDRV_SEQ_EVENT_INSTR_GET 110 /* get instrument from port */
#define SNDRV_SEQ_EVENT_INSTR_GET_RESULT 111 /* result */
#define SNDRV_SEQ_EVENT_INSTR_FREE 112 /* free instrument(s) */
#define SNDRV_SEQ_EVENT_INSTR_LIST 113 /* instrument list */
#define SNDRV_SEQ_EVENT_INSTR_LIST_RESULT 114 /* result */
#define SNDRV_SEQ_EVENT_INSTR_CLUSTER 115 /* cluster parameters */
#define SNDRV_SEQ_EVENT_INSTR_CLUSTER_GET 116 /* get cluster parameters */
#define SNDRV_SEQ_EVENT_INSTR_CLUSTER_RESULT 117 /* result */
#define SNDRV_SEQ_EVENT_INSTR_CHANGE 118 /* instrument change */
/* 119-129: reserved */
/* 130-139: variable length events
* event data type = sndrv_seq_ev_ext
* (SNDRV_SEQ_EVENT_LENGTH_VARIABLE must be set)
*/
#define SNDRV_SEQ_EVENT_SYSEX 130 /* system exclusive data (variable length) */
#define SNDRV_SEQ_EVENT_BOUNCE 131 /* error event */
/* 132-134: reserved */
#define SNDRV_SEQ_EVENT_USR_VAR0 135
#define SNDRV_SEQ_EVENT_USR_VAR1 136
#define SNDRV_SEQ_EVENT_USR_VAR2 137
#define SNDRV_SEQ_EVENT_USR_VAR3 138
#define SNDRV_SEQ_EVENT_USR_VAR4 139
/* 150-151: kernel events with quote - DO NOT use in user clients */
#define SNDRV_SEQ_EVENT_KERNEL_ERROR 150
#define SNDRV_SEQ_EVENT_KERNEL_QUOTE 151 /* obsolete */
/* 152-191: reserved */
/* 192-254: hardware specific events */
/* 255: special event */
#define SNDRV_SEQ_EVENT_NONE 255
typedef unsigned char sndrv_seq_event_type_t;
/** event address */
struct sndrv_seq_addr {
unsigned char client; /**< Client number: 0..255, 255 = broadcast to all clients */
unsigned char port; /**< Port within client: 0..255, 255 = broadcast to all ports */
};
/** port connection */
struct sndrv_seq_connect {
struct sndrv_seq_addr sender;
struct sndrv_seq_addr dest;
};
#define SNDRV_SEQ_ADDRESS_UNKNOWN 253 /* unknown source */
#define SNDRV_SEQ_ADDRESS_SUBSCRIBERS 254 /* send event to all subscribed ports */
#define SNDRV_SEQ_ADDRESS_BROADCAST 255 /* send event to all queues/clients/ports/channels */
#define SNDRV_SEQ_QUEUE_DIRECT 253 /* direct dispatch */
/* event mode flag - NOTE: only 8 bits available! */
#define SNDRV_SEQ_TIME_STAMP_TICK (0<<0) /* timestamp in clock ticks */
#define SNDRV_SEQ_TIME_STAMP_REAL (1<<0) /* timestamp in real time */
#define SNDRV_SEQ_TIME_STAMP_MASK (1<<0)
#define SNDRV_SEQ_TIME_MODE_ABS (0<<1) /* absolute timestamp */
#define SNDRV_SEQ_TIME_MODE_REL (1<<1) /* relative to current time */
#define SNDRV_SEQ_TIME_MODE_MASK (1<<1)
#define SNDRV_SEQ_EVENT_LENGTH_FIXED (0<<2) /* fixed event size */
#define SNDRV_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /* variable event size */
#define SNDRV_SEQ_EVENT_LENGTH_VARUSR (2<<2) /* variable event size - user memory space */
#define SNDRV_SEQ_EVENT_LENGTH_MASK (3<<2)
#define SNDRV_SEQ_PRIORITY_NORMAL (0<<4) /* normal priority */
#define SNDRV_SEQ_PRIORITY_HIGH (1<<4) /* event should be processed before others */
#define SNDRV_SEQ_PRIORITY_MASK (1<<4)
/* note event */
struct sndrv_seq_ev_note {
unsigned char channel;
unsigned char note;
unsigned char velocity;
unsigned char off_velocity; /* only for SNDRV_SEQ_EVENT_NOTE */
unsigned int duration; /* only for SNDRV_SEQ_EVENT_NOTE */
};
/* controller event */
struct sndrv_seq_ev_ctrl {
unsigned char channel;
unsigned char unused1, unused2, unused3; /* pad */
unsigned int param;
signed int value;
};
/* generic set of bytes (12x8 bit) */
struct sndrv_seq_ev_raw8 {
unsigned char d[12]; /* 8 bit value */
};
/* generic set of integers (3x32 bit) */
struct sndrv_seq_ev_raw32 {
unsigned int d[3]; /* 32 bit value */
};
/* external stored data */
struct sndrv_seq_ev_ext {
unsigned int len; /* length of data */
void *ptr; /* pointer to data (note: maybe 64-bit) */
} __attribute__((packed));
/* Instrument cluster type */
typedef unsigned int sndrv_seq_instr_cluster_t;
/* Instrument type */
struct sndrv_seq_instr {
sndrv_seq_instr_cluster_t cluster;
unsigned int std; /* the upper byte means a private instrument (owner - client #) */
unsigned short bank;
unsigned short prg;
};
/* sample number */
struct sndrv_seq_ev_sample {
unsigned int std;
unsigned short bank;
unsigned short prg;
};
/* sample cluster */
struct sndrv_seq_ev_cluster {
sndrv_seq_instr_cluster_t cluster;
};
/* sample position */
typedef unsigned int sndrv_seq_position_t; /* playback position (in samples) * 16 */
/* sample stop mode */
enum sndrv_seq_stop_mode {
SAMPLE_STOP_IMMEDIATELY = 0, /* terminate playing immediately */
SAMPLE_STOP_VENVELOPE = 1, /* finish volume envelope */
SAMPLE_STOP_LOOP = 2 /* terminate loop and finish wave */
};
/* sample frequency */
typedef int sndrv_seq_frequency_t; /* playback frequency in HZ * 16 */
/* sample volume control; if any value is set to -1 == do not change */
struct sndrv_seq_ev_volume {
signed short volume; /* range: 0-16383 */
signed short lr; /* left-right balance; range: 0-16383 */
signed short fr; /* front-rear balance; range: 0-16383 */
signed short du; /* down-up balance; range: 0-16383 */
};
/* simple loop redefinition */
struct sndrv_seq_ev_loop {
unsigned int start; /* loop start (in samples) * 16 */
unsigned int end; /* loop end (in samples) * 16 */
};
struct sndrv_seq_ev_sample_control {
unsigned char channel;
unsigned char unused1, unused2, unused3; /* pad */
union {
struct sndrv_seq_ev_sample sample;
struct sndrv_seq_ev_cluster cluster;
sndrv_seq_position_t position;
int stop_mode;
sndrv_seq_frequency_t frequency;
struct sndrv_seq_ev_volume volume;
struct sndrv_seq_ev_loop loop;
unsigned char raw8[8];
} param;
};
/* INSTR_BEGIN event */
struct sndrv_seq_ev_instr_begin {
int timeout; /* zero = forever, otherwise timeout in ms */
};
struct sndrv_seq_result {
int event; /* processed event type */
int result;
};
struct sndrv_seq_real_time {
unsigned int tv_sec; /* seconds */
unsigned int tv_nsec; /* nanoseconds */
};
typedef unsigned int sndrv_seq_tick_time_t; /* midi ticks */
union sndrv_seq_timestamp {
sndrv_seq_tick_time_t tick;
struct sndrv_seq_real_time time;
};
struct sndrv_seq_queue_skew {
unsigned int value;
unsigned int base;
};
/* queue timer control */
struct sndrv_seq_ev_queue_control {
unsigned char queue; /* affected queue */
unsigned char pad[3]; /* reserved */
union {
signed int value; /* affected value (e.g. tempo) */
union sndrv_seq_timestamp time; /* time */
unsigned int position; /* sync position */
struct sndrv_seq_queue_skew skew;
unsigned int d32[2];
unsigned char d8[8];
} param;
};
/* quoted event - inside the kernel only */
struct sndrv_seq_ev_quote {
struct sndrv_seq_addr origin; /* original sender */
unsigned short value; /* optional data */
struct sndrv_seq_event *event; /* quoted event */
} __attribute__((packed));
/* sequencer event */
struct sndrv_seq_event {
sndrv_seq_event_type_t type; /* event type */
unsigned char flags; /* event flags */
char tag;
unsigned char queue; /* schedule queue */
union sndrv_seq_timestamp time; /* schedule time */
struct sndrv_seq_addr source; /* source address */
struct sndrv_seq_addr dest; /* destination address */
union { /* event data... */
struct sndrv_seq_ev_note note;
struct sndrv_seq_ev_ctrl control;
struct sndrv_seq_ev_raw8 raw8;
struct sndrv_seq_ev_raw32 raw32;
struct sndrv_seq_ev_ext ext;
struct sndrv_seq_ev_queue_control queue;
union sndrv_seq_timestamp time;
struct sndrv_seq_addr addr;
struct sndrv_seq_connect connect;
struct sndrv_seq_result result;
struct sndrv_seq_ev_instr_begin instr_begin;
struct sndrv_seq_ev_sample_control sample;
struct sndrv_seq_ev_quote quote;
} data;
};
/*
* bounce event - stored as variable size data
*/
struct sndrv_seq_event_bounce {
int err;
struct sndrv_seq_event event;
/* external data follows here. */
};
#define sndrv_seq_event_bounce_ext_data(ev) ((void*)((char *)(ev)->data.ext.ptr + sizeof(sndrv_seq_event_bounce_t)))
/*
* type check macros
*/
/* result events: 0-4 */
#define sndrv_seq_ev_is_result_type(ev) ((ev)->type < 5)
/* channel specific events: 5-19 */
#define sndrv_seq_ev_is_channel_type(ev) ((ev)->type >= 5 && (ev)->type < 20)
/* note events: 5-9 */
#define sndrv_seq_ev_is_note_type(ev) ((ev)->type >= 5 && (ev)->type < 10)
/* control events: 10-19 */
#define sndrv_seq_ev_is_control_type(ev) ((ev)->type >= 10 && (ev)->type < 20)
/* queue control events: 30-39 */
#define sndrv_seq_ev_is_queue_type(ev) ((ev)->type >= 30 && (ev)->type < 40)
/* system status messages */
#define sndrv_seq_ev_is_message_type(ev) ((ev)->type >= 60 && (ev)->type < 69)
/* sample messages */
#define sndrv_seq_ev_is_sample_type(ev) ((ev)->type >= 70 && (ev)->type < 79)
/* user-defined messages */
#define sndrv_seq_ev_is_user_type(ev) ((ev)->type >= 90 && (ev)->type < 99)
/* fixed length events: 0-99 */
#define sndrv_seq_ev_is_fixed_type(ev) ((ev)->type < 100)
/* instrument layer events: 100-129 */
#define sndrv_seq_ev_is_instr_type(ev) ((ev)->type >= 100 && (ev)->type < 130)
/* variable length events: 130-139 */
#define sndrv_seq_ev_is_variable_type(ev) ((ev)->type >= 130 && (ev)->type < 140)
/* reserved for kernel */
#define sndrv_seq_ev_is_reserved(ev) ((ev)->type >= 150)
/* direct dispatched events */
#define sndrv_seq_ev_is_direct(ev) ((ev)->queue == SNDRV_SEQ_QUEUE_DIRECT)
/*
* macros to check event flags
*/
/* prior events */
#define sndrv_seq_ev_is_prior(ev) (((ev)->flags & SNDRV_SEQ_PRIORITY_MASK) == SNDRV_SEQ_PRIORITY_HIGH)
/* event length type */
#define sndrv_seq_ev_length_type(ev) ((ev)->flags & SNDRV_SEQ_EVENT_LENGTH_MASK)
#define sndrv_seq_ev_is_fixed(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_FIXED)
#define sndrv_seq_ev_is_variable(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE)
#define sndrv_seq_ev_is_varusr(ev) (sndrv_seq_ev_length_type(ev) == SNDRV_SEQ_EVENT_LENGTH_VARUSR)
/* time-stamp type */
#define sndrv_seq_ev_timestamp_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_STAMP_MASK)
#define sndrv_seq_ev_is_tick(ev) (sndrv_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_TICK)
#define sndrv_seq_ev_is_real(ev) (sndrv_seq_ev_timestamp_type(ev) == SNDRV_SEQ_TIME_STAMP_REAL)
/* time-mode type */
#define sndrv_seq_ev_timemode_type(ev) ((ev)->flags & SNDRV_SEQ_TIME_MODE_MASK)
#define sndrv_seq_ev_is_abstime(ev) (sndrv_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_ABS)
#define sndrv_seq_ev_is_reltime(ev) (sndrv_seq_ev_timemode_type(ev) == SNDRV_SEQ_TIME_MODE_REL)
/* queue sync port */
#define sndrv_seq_queue_sync_port(q) ((q) + 16)
#endif /* __KERNEL__ */
/* system information */
struct sndrv_seq_system_info {
int queues; /* maximum queues count */
int clients; /* maximum clients count */
int ports; /* maximum ports per client */
int channels; /* maximum channels per port */
int cur_clients; /* current clients */
int cur_queues; /* current queues */
char reserved[24];
};
/* system running information */
struct sndrv_seq_running_info {
unsigned char client; /* client id */
unsigned char big_endian; /* 1 = big-endian */
unsigned char cpu_mode; /* 4 = 32bit, 8 = 64bit */
unsigned char pad; /* reserved */
unsigned char reserved[12];
};
/* known client numbers */
#define SNDRV_SEQ_CLIENT_SYSTEM 0
/* internal client numbers */
#define SNDRV_SEQ_CLIENT_DUMMY 14 /* midi through */
#define SNDRV_SEQ_CLIENT_OSS 15 /* oss sequencer emulator */
/* client types */
enum sndrv_seq_client_type {
NO_CLIENT = 0,
USER_CLIENT = 1,
KERNEL_CLIENT = 2
};
/* event filter flags */
#define SNDRV_SEQ_FILTER_BROADCAST (1<<0) /* accept broadcast messages */
#define SNDRV_SEQ_FILTER_MULTICAST (1<<1) /* accept multicast messages */
#define SNDRV_SEQ_FILTER_BOUNCE (1<<2) /* accept bounce event in error */
#define SNDRV_SEQ_FILTER_USE_EVENT (1<<31) /* use event filter */
struct sndrv_seq_client_info {
int client; /* client number to inquire */
int type; /* client type */
char name[64]; /* client name */
unsigned int filter; /* filter flags */
unsigned char multicast_filter[8]; /* multicast filter bitmap */
unsigned char event_filter[32]; /* event filter bitmap */
int num_ports; /* RO: number of ports */
int event_lost; /* number of lost events */
char reserved[64]; /* for future use */
};
/* client pool size */
struct sndrv_seq_client_pool {
int client; /* client number to inquire */
int output_pool; /* outgoing (write) pool size */
int input_pool; /* incoming (read) pool size */
int output_room; /* minimum free pool size for select/blocking mode */
int output_free; /* unused size */
int input_free; /* unused size */
char reserved[64];
};
/* Remove events by specified criteria */
#define SNDRV_SEQ_REMOVE_INPUT (1<<0) /* Flush input queues */
#define SNDRV_SEQ_REMOVE_OUTPUT (1<<1) /* Flush output queues */
#define SNDRV_SEQ_REMOVE_DEST (1<<2) /* Restrict by destination q:client:port */
#define SNDRV_SEQ_REMOVE_DEST_CHANNEL (1<<3) /* Restrict by channel */
#define SNDRV_SEQ_REMOVE_TIME_BEFORE (1<<4) /* Restrict to before time */
#define SNDRV_SEQ_REMOVE_TIME_AFTER (1<<5) /* Restrict to time or after */
#define SNDRV_SEQ_REMOVE_TIME_TICK (1<<6) /* Time is in ticks */
#define SNDRV_SEQ_REMOVE_EVENT_TYPE (1<<7) /* Restrict to event type */
#define SNDRV_SEQ_REMOVE_IGNORE_OFF (1<<8) /* Do not flush off events */
#define SNDRV_SEQ_REMOVE_TAG_MATCH (1<<9) /* Restrict to events with given tag */
struct sndrv_seq_remove_events {
unsigned int remove_mode; /* Flags that determine what gets removed */
union sndrv_seq_timestamp time;
unsigned char queue; /* Queue for REMOVE_DEST */
struct sndrv_seq_addr dest; /* Address for REMOVE_DEST */
unsigned char channel; /* Channel for REMOVE_DEST */
int type; /* For REMOVE_EVENT_TYPE */
char tag; /* Tag for REMOVE_TAG */
int reserved[10]; /* To allow for future binary compatibility */
};
/* known port numbers */
#define SNDRV_SEQ_PORT_SYSTEM_TIMER 0
#define SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE 1
/* port capabilities (32 bits) */
#define SNDRV_SEQ_PORT_CAP_READ (1<<0) /* readable from this port */
#define SNDRV_SEQ_PORT_CAP_WRITE (1<<1) /* writable to this port */
#define SNDRV_SEQ_PORT_CAP_SYNC_READ (1<<2)
#define SNDRV_SEQ_PORT_CAP_SYNC_WRITE (1<<3)
#define SNDRV_SEQ_PORT_CAP_DUPLEX (1<<4)
#define SNDRV_SEQ_PORT_CAP_SUBS_READ (1<<5) /* allow read subscription */
#define SNDRV_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /* allow write subscription */
#define SNDRV_SEQ_PORT_CAP_NO_EXPORT (1<<7) /* routing not allowed */
/* port type */
#define SNDRV_SEQ_PORT_TYPE_SPECIFIC (1<<0) /* hardware specific */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /* generic MIDI device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM (1<<2) /* General MIDI compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GS (1<<3) /* GS compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_XG (1<<4) /* XG compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /* MT-32 compatible device */
#define SNDRV_SEQ_PORT_TYPE_MIDI_GM2 (1<<6) /* General MIDI 2 compatible device */
/* other standards...*/
#define SNDRV_SEQ_PORT_TYPE_SYNTH (1<<10) /* Synth device (no MIDI compatible - direct wavetable) */
#define SNDRV_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /* Sampling device (support sample download) */
#define SNDRV_SEQ_PORT_TYPE_SAMPLE (1<<12) /* Sampling device (sample can be downloaded at any time) */
/*...*/
#define SNDRV_SEQ_PORT_TYPE_HARDWARE (1<<16) /* driver for a hardware device */
#define SNDRV_SEQ_PORT_TYPE_SOFTWARE (1<<17) /* implemented in software */
#define SNDRV_SEQ_PORT_TYPE_SYNTHESIZER (1<<18) /* generates sound */
#define SNDRV_SEQ_PORT_TYPE_PORT (1<<19) /* connects to other device(s) */
#define SNDRV_SEQ_PORT_TYPE_APPLICATION (1<<20) /* application (sequencer/editor) */
/* misc. conditioning flags */
#define SNDRV_SEQ_PORT_FLG_GIVEN_PORT (1<<0)
#define SNDRV_SEQ_PORT_FLG_TIMESTAMP (1<<1)
#define SNDRV_SEQ_PORT_FLG_TIME_REAL (1<<2)
struct sndrv_seq_port_info {
struct sndrv_seq_addr addr; /* client/port numbers */
char name[64]; /* port name */
unsigned int capability; /* port capability bits */
unsigned int type; /* port type bits */
int midi_channels; /* channels per MIDI port */
int midi_voices; /* voices per MIDI port */
int synth_voices; /* voices per SYNTH port */
int read_use; /* R/O: subscribers for output (from this port) */
int write_use; /* R/O: subscribers for input (to this port) */
void *kernel; /* reserved for kernel use (must be NULL) */
unsigned int flags; /* misc. conditioning */
unsigned char time_queue; /* queue # for timestamping */
char reserved[59]; /* for future use */
};
/* queue flags */
#define SNDRV_SEQ_QUEUE_FLG_SYNC (1<<0) /* sync enabled */
/* queue information */
struct sndrv_seq_queue_info {
int queue; /* queue id */
/*
* security settings, only owner of this queue can start/stop timer
* etc. if the queue is locked for other clients
*/
int owner; /* client id for owner of the queue */
int locked:1; /* timing queue locked for other queues */
char name[64]; /* name of this queue */
unsigned int flags; /* flags */
char reserved[60]; /* for future use */
};
/* queue info/status */
struct sndrv_seq_queue_status {
int queue; /* queue id */
int events; /* read-only - queue size */
sndrv_seq_tick_time_t tick; /* current tick */
struct sndrv_seq_real_time time; /* current time */
int running; /* running state of queue */
int flags; /* various flags */
char reserved[64]; /* for the future */
};
/* queue tempo */
struct sndrv_seq_queue_tempo {
int queue; /* sequencer queue */
unsigned int tempo; /* current tempo, us/tick */
int ppq; /* time resolution, ticks/quarter */
unsigned int skew_value; /* queue skew */
unsigned int skew_base; /* queue skew base */
char reserved[24]; /* for the future */
};
/* sequencer timer sources */
#define SNDRV_SEQ_TIMER_ALSA 0 /* ALSA timer */
#define SNDRV_SEQ_TIMER_MIDI_CLOCK 1 /* Midi Clock (CLOCK event) */
#define SNDRV_SEQ_TIMER_MIDI_TICK 2 /* Midi Timer Tick (TICK event) */
/* queue timer info */
struct sndrv_seq_queue_timer {
int queue; /* sequencer queue */
int type; /* source timer type */
union {
struct {
struct sndrv_timer_id id; /* ALSA's timer ID */
unsigned int resolution; /* resolution in Hz */
} alsa;
} u;
char reserved[64]; /* for the future use */
};
struct sndrv_seq_queue_client {
int queue; /* sequencer queue */
int client; /* sequencer client */
int used; /* queue is used with this client
(must be set for accepting events) */
/* per client watermarks */
char reserved[64]; /* for future use */
};
#define SNDRV_SEQ_PORT_SUBS_EXCLUSIVE (1<<0) /* exclusive connection */
#define SNDRV_SEQ_PORT_SUBS_TIMESTAMP (1<<1)
#define SNDRV_SEQ_PORT_SUBS_TIME_REAL (1<<2)
struct sndrv_seq_port_subscribe {
struct sndrv_seq_addr sender; /* sender address */
struct sndrv_seq_addr dest; /* destination address */
unsigned int voices; /* number of voices to be allocated (0 = don't care) */
unsigned int flags; /* modes */
unsigned char queue; /* input time-stamp queue (optional) */
unsigned char pad[3]; /* reserved */
char reserved[64];
};
/* type of query subscription */
#define SNDRV_SEQ_QUERY_SUBS_READ 0
#define SNDRV_SEQ_QUERY_SUBS_WRITE 1
struct sndrv_seq_query_subs {
struct sndrv_seq_addr root; /* client/port id to be searched */
int type; /* READ or WRITE */
int index; /* 0..N-1 */
int num_subs; /* R/O: number of subscriptions on this port */
struct sndrv_seq_addr addr; /* R/O: result */
unsigned char queue; /* R/O: result */
unsigned int flags; /* R/O: result */
char reserved[64]; /* for future use */
};
/*
* Instrument abstraction layer
* - based on events
*/
/* instrument types */
#define SNDRV_SEQ_INSTR_ATYPE_DATA 0 /* instrument data */
#define SNDRV_SEQ_INSTR_ATYPE_ALIAS 1 /* instrument alias */
/* instrument ASCII identifiers */
#define SNDRV_SEQ_INSTR_ID_DLS1 "DLS1"
#define SNDRV_SEQ_INSTR_ID_DLS2 "DLS2"
#define SNDRV_SEQ_INSTR_ID_SIMPLE "Simple Wave"
#define SNDRV_SEQ_INSTR_ID_SOUNDFONT "SoundFont"
#define SNDRV_SEQ_INSTR_ID_GUS_PATCH "GUS Patch"
#define SNDRV_SEQ_INSTR_ID_INTERWAVE "InterWave FFFF"
#define SNDRV_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM"
#define SNDRV_SEQ_INSTR_ID_OPL4 "OPL4"
/* instrument types */
#define SNDRV_SEQ_INSTR_TYPE0_DLS1 (1<<0) /* MIDI DLS v1 */
#define SNDRV_SEQ_INSTR_TYPE0_DLS2 (1<<1) /* MIDI DLS v2 */
#define SNDRV_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /* Simple Wave */
#define SNDRV_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /* EMU SoundFont */
#define SNDRV_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /* Gravis UltraSound Patch */
#define SNDRV_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /* InterWave FFFF */
#define SNDRV_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /* Yamaha OPL2/3 FM */
#define SNDRV_SEQ_INSTR_TYPE2_OPL4 (1<<1) /* Yamaha OPL4 */
/* put commands */
#define SNDRV_SEQ_INSTR_PUT_CMD_CREATE 0
#define SNDRV_SEQ_INSTR_PUT_CMD_REPLACE 1
#define SNDRV_SEQ_INSTR_PUT_CMD_MODIFY 2
#define SNDRV_SEQ_INSTR_PUT_CMD_ADD 3
#define SNDRV_SEQ_INSTR_PUT_CMD_REMOVE 4
/* get commands */
#define SNDRV_SEQ_INSTR_GET_CMD_FULL 0
#define SNDRV_SEQ_INSTR_GET_CMD_PARTIAL 1
/* query flags */
#define SNDRV_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0)
/* free commands */
#define SNDRV_SEQ_INSTR_FREE_CMD_ALL 0
#define SNDRV_SEQ_INSTR_FREE_CMD_PRIVATE 1
#define SNDRV_SEQ_INSTR_FREE_CMD_CLUSTER 2
#define SNDRV_SEQ_INSTR_FREE_CMD_SINGLE 3
/* size of ROM/RAM */
typedef unsigned int sndrv_seq_instr_size_t;
/* INSTR_INFO */
struct sndrv_seq_instr_info {
int result; /* operation result */
unsigned int formats[8]; /* bitmap of supported formats */
int ram_count; /* count of RAM banks */
sndrv_seq_instr_size_t ram_sizes[16]; /* size of RAM banks */
int rom_count; /* count of ROM banks */
sndrv_seq_instr_size_t rom_sizes[8]; /* size of ROM banks */
char reserved[128];
};
/* INSTR_STATUS */
struct sndrv_seq_instr_status {
int result; /* operation result */
sndrv_seq_instr_size_t free_ram[16]; /* free RAM in banks */
int instrument_count; /* count of downloaded instruments */
char reserved[128];
};
/* INSTR_FORMAT_INFO */
struct sndrv_seq_instr_format_info {
char format[16]; /* format identifier - SNDRV_SEQ_INSTR_ID_* */
unsigned int len; /* max data length (without this structure) */
};
struct sndrv_seq_instr_format_info_result {
int result; /* operation result */
char format[16]; /* format identifier */
unsigned int len; /* filled data length (without this structure) */
};
/* instrument data */
struct sndrv_seq_instr_data {
char name[32]; /* instrument name */
char reserved[16]; /* for the future use */
int type; /* instrument type */
union {
char format[16]; /* format identifier */
struct sndrv_seq_instr alias;
} data;
};
/* INSTR_PUT/GET, data are stored in one block (extended), header + data */
struct sndrv_seq_instr_header {
union {
struct sndrv_seq_instr instr;
sndrv_seq_instr_cluster_t cluster;
} id; /* instrument identifier */
unsigned int cmd; /* get/put/free command */
unsigned int flags; /* query flags (only for get) */
unsigned int len; /* real instrument data length (without header) */
int result; /* operation result */
char reserved[16]; /* for the future */
struct sndrv_seq_instr_data data; /* instrument data (for put/get result) */
};
/* INSTR_CLUSTER_SET */
struct sndrv_seq_instr_cluster_set {
sndrv_seq_instr_cluster_t cluster; /* cluster identifier */
char name[32]; /* cluster name */
int priority; /* cluster priority */
char reserved[64]; /* for the future use */
};
/* INSTR_CLUSTER_GET */
struct sndrv_seq_instr_cluster_get {
sndrv_seq_instr_cluster_t cluster; /* cluster identifier */
char name[32]; /* cluster name */
int priority; /* cluster priority */
char reserved[64]; /* for the future use */
};
/*
* IOCTL commands
*/
#define SNDRV_SEQ_IOCTL_PVERSION _IOR ('S', 0x00, int)
#define SNDRV_SEQ_IOCTL_CLIENT_ID _IOR ('S', 0x01, int)
#define SNDRV_SEQ_IOCTL_SYSTEM_INFO _IOWR('S', 0x02, struct sndrv_seq_system_info)
#define SNDRV_SEQ_IOCTL_RUNNING_MODE _IOWR('S', 0x03, struct sndrv_seq_running_info)
#define SNDRV_SEQ_IOCTL_GET_CLIENT_INFO _IOWR('S', 0x10, struct sndrv_seq_client_info)
#define SNDRV_SEQ_IOCTL_SET_CLIENT_INFO _IOW ('S', 0x11, struct sndrv_seq_client_info)
#define SNDRV_SEQ_IOCTL_CREATE_PORT _IOWR('S', 0x20, struct sndrv_seq_port_info)
#define SNDRV_SEQ_IOCTL_DELETE_PORT _IOW ('S', 0x21, struct sndrv_seq_port_info)
#define SNDRV_SEQ_IOCTL_GET_PORT_INFO _IOWR('S', 0x22, struct sndrv_seq_port_info)
#define SNDRV_SEQ_IOCTL_SET_PORT_INFO _IOW ('S', 0x23, struct sndrv_seq_port_info)
#define SNDRV_SEQ_IOCTL_SUBSCRIBE_PORT _IOW ('S', 0x30, struct sndrv_seq_port_subscribe)
#define SNDRV_SEQ_IOCTL_UNSUBSCRIBE_PORT _IOW ('S', 0x31, struct sndrv_seq_port_subscribe)
#define SNDRV_SEQ_IOCTL_CREATE_QUEUE _IOWR('S', 0x32, struct sndrv_seq_queue_info)
#define SNDRV_SEQ_IOCTL_DELETE_QUEUE _IOW ('S', 0x33, struct sndrv_seq_queue_info)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_INFO _IOWR('S', 0x34, struct sndrv_seq_queue_info)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_INFO _IOWR('S', 0x35, struct sndrv_seq_queue_info)
#define SNDRV_SEQ_IOCTL_GET_NAMED_QUEUE _IOWR('S', 0x36, struct sndrv_seq_queue_info)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_STATUS _IOWR('S', 0x40, struct sndrv_seq_queue_status)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_TEMPO _IOWR('S', 0x41, struct sndrv_seq_queue_tempo)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_TEMPO _IOW ('S', 0x42, struct sndrv_seq_queue_tempo)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_OWNER _IOWR('S', 0x43, struct sndrv_seq_queue_owner)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_OWNER _IOW ('S', 0x44, struct sndrv_seq_queue_owner)
#define SNDRV_SEQ_IOCTL_GET_QUEUE_TIMER _IOWR('S', 0x45, struct sndrv_seq_queue_timer)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_TIMER _IOW ('S', 0x46, struct sndrv_seq_queue_timer)
/* XXX
#define SNDRV_SEQ_IOCTL_GET_QUEUE_SYNC _IOWR('S', 0x53, struct sndrv_seq_queue_sync)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_SYNC _IOW ('S', 0x54, struct sndrv_seq_queue_sync)
*/
#define SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT _IOWR('S', 0x49, struct sndrv_seq_queue_client)
#define SNDRV_SEQ_IOCTL_SET_QUEUE_CLIENT _IOW ('S', 0x4a, struct sndrv_seq_queue_client)
#define SNDRV_SEQ_IOCTL_GET_CLIENT_POOL _IOWR('S', 0x4b, struct sndrv_seq_client_pool)
#define SNDRV_SEQ_IOCTL_SET_CLIENT_POOL _IOW ('S', 0x4c, struct sndrv_seq_client_pool)
#define SNDRV_SEQ_IOCTL_REMOVE_EVENTS _IOW ('S', 0x4e, struct sndrv_seq_remove_events)
#define SNDRV_SEQ_IOCTL_QUERY_SUBS _IOWR('S', 0x4f, struct sndrv_seq_query_subs)
#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct sndrv_seq_port_subscribe)
#define SNDRV_SEQ_IOCTL_QUERY_NEXT_CLIENT _IOWR('S', 0x51, struct sndrv_seq_client_info)
#define SNDRV_SEQ_IOCTL_QUERY_NEXT_PORT _IOWR('S', 0x52, struct sndrv_seq_port_info)
#endif /* __SOUND_ASEQUENCER_H */
|
stevezuoli/OriginApp
|
inc/TTS/alsa/alsa/sound/asequencer.h
|
C
|
gpl-3.0
| 37,071
|
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\item\Tool;
class PackedIce extends Solid{
protected $id = self::PACKED_ICE;
public function __construct(){
}
public function getName(){
return "Packed Ice";
}
public function getHardness(){
return 0.5;
}
public function getToolType(){
return Tool::TYPE_PICKAXE;
}
}
|
GamingTrend/PocketMine-MP
|
src/block/PackedIce.php
|
PHP
|
gpl-3.0
| 1,062
|
nibobee-programs
================
This repository contains the solutions to the NIBObee programming tutorial and
also some extras like the programs ‘calibration’ and ‘first’.
However, a few programs are missing.
- [English version](en)
- [German version](de)
|
christianheinrichs/nibobee-programs
|
README.md
|
Markdown
|
gpl-3.0
| 270
|
---
title: "सपा सरकार कराएगी अजमेर और पुष्कर की निःशुल्क तीर्थ यात्रा"
layout: item
category: lucknow
date: 2015-06-24T13:11:25.000Z
image: 8ee6ab3ce91f3d05e22921b18f3fdb4a.jpg
---
<p style="text-align: justify;">लखनऊ: उत्तर प्रदेश सरकार ने प्रदेश में स्थायी रूप से निवास करने वाले वरिष्ठ नागरिकों को भारतीय रेलवे के उपक्रम-इण्डियन रेलवे कैटरिंग एण्ड टूरिज्म कारपोरेशन (आई0आर0सी0टी0सी0) लि0- के सहयोग से अजमेर शरीफ एवं पुष्कर (राजस्थान) की निःशुल्क तीर्थ यात्रा, शासकीय व्यय पर, करवाने का निर्णय लिया है।</p>
<p style="text-align: justify;">यह जानकारी आज यहां देते हुए प्रमुख सचिव धर्मार्थ कार्य नवनीत सहगल ने बताया कि यह यात्रा राज्य के वरिष्ठ एवं मूल निवासियों के लिए उपलब्ध होगी तथा इसे आई0आर0सी0टी0सी0 के माध्यम से सम्पन्न कराया जाएगा। इस यात्रा के लिए चयनित किए गए यात्रियों को एक विशेष रेलगाड़ी द्वारा, जिसे आई0आर0सी0टी0सी0 द्वारा रेलवे से चार्टर किया जाएगा, लखनऊ से अजमेर एवं पुष्कर (राजस्थान) तक की यात्रा करायी जाएगी। यात्रियों को सामान्य श्रेणी की ही सुविधाएं दी जाएंगी। उन्हें यात्रा के दौरान ट्रैवेल किट उपलब्ध करायी जाएगी। </p>
<p style="text-align: justify;">श्री सहगल ने बताया कि यात्रियों को उनके गृह जनपद से लखनऊ तक आने जाने की व्यवस्था उ0प्र0 राज्य सड़क परिवहन निगम द्वारा करायी जाएगी। यात्रियों को निर्धारित मेन्यू, जिसमें सूबह की चाय, सूबह का नाश्ता दोपहर का खाना, शाम की चाय एवं रात का खाना सम्मिलित है, उपलबध कराया जाएगा। यात्रा के दौरान उन्हें सिर्फ शाकाहारी भोजन ही उपलब्ध कराया जाएगा। गाड़ी के प्रत्येक कोच में एक टूर सहचर की व्यवस्था रहेगी जो यात्रियों की देखभाल, उनकी समस्याओं का तुरन्त निस्तारण, सूचना एवं अन्य व्यवस्थायें सुनिश्चित करने हेतु उपलब्ध रहेंगे।</p>
<p style="text-align: justify;">प्रमुख सचिव ने कहा कि प्रत्येक कोच में एक निःशस्त्र सुरक्षा गार्ड की व्यवस्था रहेगी। स्टेशन पर एवं ट्रेन में किसी सुरक्षा सम्बन्धी समस्या होने पर रेलवे सुरक्षा बल (आर0पी0एफ0) व राजकीय रेलवे पुलिस की मदद ली जा सकती है। साथ ही, पूरी ट्रेन की साफ-सफाई, विशेष रूप से टाॅयलेट की सफाई हेतु उपयुक्त संख्या में सफाई कर्मचारी, सफाई सामग्री के साथ उपलब्ध रहेंगे। यात्रा के दौरान ट्रेन में समय-समय पर उद्घोषणा हेतु लोक उद्घोषणा प्रणाली (पी0ए0 सिस्टम) की व्यवस्था की जाएगी।</p>
<p style="text-align: justify;">श्री सहगल ने बताया कि ट्रेन में कुल 1044 यात्रियों के लिए बर्थ आरक्षित रहेगी। प्रत्येक स्लीपर कोच में एक बर्थ सुरक्षा कर्मी एवं एक बर्थ टूर सहचर के लिए निर्धारित की जाएगी। एक केबिन (6 बर्थ) आई0आर0सी0टी0सी0 स्टाफ हेतु आरक्षित होगा। यात्रा के दौरान आई0आर0सी0टी0सी0 द्वारा प्रत्येक यात्री का यात्रा दुर्घटना बीमा कराया जाएगा। </p>
<p style="text-align: justify;">प्रमुख सचिव ने कहा कि अजमेर शरीफ एवं पुष्कर (राजस्थान) यात्रा की सम्भावित तिथि 23 जुलाई, 2015 है। यात्रा हेतु इच्छुक यात्री वेबसाइट http://samajwadishravanyatra.upgov.info पर अपना आवेदन सभी सम्बन्धित/वांछित अभिलेखों सहित अपलोड कर 07 जुलाई, 2015 तक प्रस्तुत कर सकते हंै। अन्य इच्छुक यात्री अपना आवेदन, मूल रूप में सभी सम्बन्धित/वांछित अभिलेखो सहित, अपने जिले के अधिकारी को विलम्बतम दिनांक 10 जुलाई, 2015 तक उपलब्ध करा सकते है। आवेदन पत्र के साथ, आवेदन द्वारा, समक्ष अधिकारी द्वारा प्रदत्त निवास प्रमाण पत्र या पहचान पत्र, जन्म तिथि प्रमाण पत्र एवं यात्रा की उपयुक्तता हेतु यात्री द्वारा स्वयं की शारीरिक दक्षता के सम्बन्ध में अपने जनपद के चिकित्सा अधिकारी द्वारा प्रदत्त स्वस्थता प्रमाण पत्र तथा दो पासपोर्ट आकार के फोटो अनिवार्य रूप से मूल रूप में प्रस्तुत किया जाना होगा।</p>
<p style="text-align: justify;">श्री नवनीत सहगल ने बताया कि समस्त जिलों के जिला अधिकारी, आफ लाइन प्राप्त होने वाले आवेदन पत्रों पर, उनके प्राप्त होने की तिथि तथा समय अंकित कराया जाएगा। तदुपरान्त सम्बन्धित जिला अधिकारी द्वारा अपने जिले से प्राप्त होने वाले आवेदन पत्रों को तत्काल वेबसाइट ीhttp://samajwadishravanyatra.upgov.info पर फीड कराया जाएगा। इस प्रकार तैयार की गई सूची में से यात्रा हेतु यात्रियों का चयन उनकी जन्मतिथि के मद्देनजर वरिष्ठता के आधार पर तथा ‘पहले आओ पहले पाओ’ के सिद्धान्त पर इसी वेबसाइट पर किया जाएगा। सम्बन्धित जिला अधिकारी द्वारा इस प्रकार चयनित यात्रियों की सूची के अतिरिक्त शेष बचे यात्रियों की प्रतीक्षा सूची भी तैयार करायी जाएगी। प्रतीक्षा सूची के यात्रियों को आगामी प्रस्तावित यात्रा में अवसर प्रदान किया जाएगा। इस कार्य को करने के लिए समस्त जिलाधिकारियों को वेबसाइट/यू0आर0एल0 हेतु यूजर नेम एवं पासवर्ड उपलब्ध कराया जाएगा। इस सम्बन्ध में किसी तकनीकी कठिनाई के समाधान के लिए मो0नं0 9454419661 पर सम्पर्क किया जा सकता है।</p>
<p style="text-align: justify;">प्रमुख सचिव ने कहा कि यात्रा हेतु इच्छुक यात्रियों से यह अपेक्षा की जाती है कि वे अपना मोबाइल नं0 आवेदन पत्र में अवश्य अंकित करेंगे, जिससे उन्हें यात्रा से सम्बन्धित जानकारियां ज्म्ग्ज् ैTEXT SMS/VOICE SMS के माध्यम से भी प्रदान की जा सके। प्रत्येक जनपद से अधिकतम 10 यात्रियों की सूची शासन को उपलब्ध करायी जाएगी। शेष यात्रियों का चयन शासन स्तर से किया जाएगा। यात्रा के दौरान दो चिकित्सक व चार नर्स चिकित्सा विभाग द्वारा उपलब्ध करायी जाएंगी, जिनके लिए कुल 06 बर्थ आरक्षित होंगे। शेष सीटंे धर्मार्थ कार्य विभाग के अधिकारियों/कर्मचारियों हेतु आरक्षित होंगी। </p>
<p style="text-align: justify;">श्री सहगल ने कहा कि जिलाधिकारी का यह भी दायित्व होगा कि वे चयनित यात्रियों के आवेदन पत्र मूलरूप में शासन को उपलब्ध करायेंगे। चयनित यात्रियों को उनके चयन एवं सम्बन्धित सूचनाएं जिलाधिकारयिों द्वारा उपलब्ध कराई जाएंगी। यात्रियों की सुविधाओं के लिए दो हेल्पलाइन नम्बर यथा 0522-2992932, 9196042365 उपलब्ध होंगी। यात्रा हेतु स्थानीय मौसम के दृष्टिगत यात्रियों को परामर्श दिया जाता है कि आवश्यक वस्त्रादि को साथ रखना स्वयं सुनिश्चित करें।</p>
<p style="text-align: justify;">प्रमुख सचिव ने कहा कि मुख्यमंत्री श्री अखिलेश यादव के निर्देश पर प्रदेश सरकार द्वारा शुरू की गई समाजवादी श्रवण यात्रा को समाज के प्रत्येक वर्ग ने सराहा है। इसीलिए राज्य सरकार द्वारा अजमेर शरीफ एवं पुष्कर (राजस्थान) की निःशुल्क तीर्थ यात्रा का निर्णय लिया गया है। ज्ञातव्य है कि समाजवादी श्रवण यात्रा 2015 के अन्तर्गत पूर्व में श्रद्धालुओं को उत्तराखण्ड राज्य स्थित हरिद्वार एवं ऋषिकेश के धार्मिक स्थलों का दर्शन करवाया जा चुका है।</p>
|
InstantKhabar/_source
|
_source/news/23266-lucknow.html
|
HTML
|
gpl-3.0
| 13,952
|
# ABSTRACT: Perl module of Thrift
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
package Thrift;
our $VERSION = '0.6.1_01';
require 5.6.0;
use strict;
use warnings;
#
# Data types that can be sent via Thrift
#
package TType;
use constant STOP => 0;
use constant VOID => 1;
use constant BOOL => 2;
use constant BYTE => 3;
use constant I08 => 3;
use constant DOUBLE => 4;
use constant I16 => 6;
use constant I32 => 8;
use constant I64 => 10;
use constant STRING => 11;
use constant UTF7 => 11;
use constant STRUCT => 12;
use constant MAP => 13;
use constant SET => 14;
use constant LIST => 15;
use constant UTF8 => 16;
use constant UTF16 => 17;
1;
#
# Message types for RPC
#
package TMessageType;
use constant CALL => 1;
use constant REPLY => 2;
use constant EXCEPTION => 3;
use constant ONEWAY => 4;
1;
package Thrift::TException;
sub new {
my $classname = shift;
my $self = {message => shift, code => shift || 0};
return bless($self,$classname);
}
1;
package TApplicationException;
use base('Thrift::TException');
use constant UNKNOWN => 0;
use constant UNKNOWN_METHOD => 1;
use constant INVALID_MESSAGE_TYPE => 2;
use constant WRONG_METHOD_NAME => 3;
use constant BAD_SEQUENCE_ID => 4;
use constant MISSING_RESULT => 5;
sub new {
my $classname = shift;
my $self = $classname->SUPER::new();
return bless($self,$classname);
}
sub read {
my $self = shift;
my $input = shift;
my $xfer = 0;
my $fname = undef;
my $ftype = 0;
my $fid = 0;
$xfer += $input->readStructBegin(\$fname);
while (1)
{
$xfer += $input->readFieldBegin(\$fname, \$ftype, \$fid);
if ($ftype == TType::STOP) {
last; next;
}
SWITCH: for($fid)
{
/1/ && do{
if ($ftype == TType::STRING) {
$xfer += $input->readString(\$self->{message});
} else {
$xfer += $input->skip($ftype);
}
last;
};
/2/ && do{
if ($ftype == TType::I32) {
$xfer += $input->readI32(\$self->{code});
} else {
$xfer += $input->skip($ftype);
}
last;
};
$xfer += $input->skip($ftype);
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
sub write {
my $self = shift;
my $output = shift;
my $xfer = 0;
$xfer += $output->writeStructBegin('TApplicationException');
if ($self->getMessage()) {
$xfer += $output->writeFieldBegin('message', TType::STRING, 1);
$xfer += $output->writeString($self->getMessage());
$xfer += $output->writeFieldEnd();
}
if ($self->getCode()) {
$xfer += $output->writeFieldBegin('type', TType::I32, 2);
$xfer += $output->writeI32($self->getCode());
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
sub getMessage
{
my $self = shift;
return $self->{message};
}
sub getCode
{
my $self = shift;
return $self->{code};
}
1;
|
sashahilton00/spotify-connect-resources
|
Powernode Firmware/rootfs/usr/lib/perl5/site_perl/5.14.2/Thrift.pm
|
Perl
|
gpl-3.0
| 4,014
|
---
title: "अमरीका में शाहरुख से एयरपोर्ट पर फिर पूछताछ"
layout: item
category: ["entertainment"]
date: 2016-08-12T05:32:48.879Z
image: 1470979968878entertainment.jpg
---
<h2>किंग खान ने ट्विटर पर जताई नाराजगी</h2>
<p>नई दिल्ली: बॉलीवुड अभिनेता शाहरुख खान को अमेरिका के लॉस एंजिलिस एयरपोर्ट पर आव्रजन अधिकारियों ने हिरासत में लेकर पूछताछ की. शाहरुख ने ट्वीट कर इस बारे में जानकारी दी.
हालांकि यह कोई पहला मौका नहीं जब उनसे एयरपोर्ट पर पूछताछ की गई हो, लेकिन इस बार हुई इस पूछताछ को लेकर उन्होंने ट्विटर पर अपने गुस्से का इजहार किया. उन्होंने ट्वीट किया- दुनिया में आज जो हालात हैं, उसे देखते हुए सुरक्षा के मुद्दे को मैं पूरी तरह समझता और सम्मान करता हूं, लेकिन हर बार अमेरिकी आव्रजन विभाग द्वारा हिरासत में लिया जाना सच में बुरा लगता है.
गौरतलब है कि इससे पहले अप्रैल 2012 में भी शाहरुख को न्यूयॉर्क एयरपोर्ट पर आव्रजन विभाग ने हिरासत में लिया था। वहां दो घंटों तक पूछताछ किए जाने के बाद उन्हें छोड़ा गया. हालांकि शाहरुख ने कुछ समय पहले कहा था कि वह उस घटना को भूल चुके हैं, लेकिन लगता है कि इस नई घटना ने उनके जख्म ताजा कर दिए हैं.</p>
|
InstantKhabar/_source
|
_source/news/2016-08-12-entertainment.html
|
HTML
|
gpl-3.0
| 2,440
|
---
layout: post
title: How my app was rejected two times.
date: '2014-10-20T21:30:59+01:00'
tags: []
tumblr_url: http://borisy.net/post/100524859080/how-my-app-was-rejected-two-times
---
<p>When I submitted <a href="https://www.cocoa.productions/altershot">Altershot</a> for the first time I was confident about Apple approving it. I was wrong.</p>
<p>I already had experience releasing very simple app <a href="https://cocoaswitch.com/123Trim">NumPick.</a> But Altershot is much more complicated. In someway it mimics iOS system interface, to be precise — status bar. I didn’t thought about it. Apple gave me a very short explanation.</p>
<blockquote>
<p>You can’t use any misleading elements in your application bundle or metadata.</p>
</blockquote>
<p>It doesn’t sound like exactly like this. Unfortunately I didn’t saved original text. But these was how I remember it. </p>
<p>I blamed iTunes connect metadata. Precisely, screenshots. My iTunes Connect screenshots showed some apps from the App Store. So I swapped them with system apps, improved my code and submitted new 1.0. In a week review team rejected it again. This time I saved ther comments. </p>
<blockquote>
<p>22.2: Apps that contain false, fraudulent or misleading representations or use names or icons similar to other Apps will be rejected.
We found that your app, and/or its metadata, contains content that could be misleading to users, which is not in compliance with the App Store Review Guidelines.
Specifically, it would be appropriate to revise your app name and app icon.</p>
</blockquote>
<p>Wasn’t enough for me. I asked for further explanations and recieved quick response.</p>
<blockquote>
<p>We found that the metadata could mislead users to believe that this app can alter the system wide status bar UI.</p>
<p>Specifically:</p>
<ul><li><p>The app name claims to “AlterStatus”, which implies that this app can alter the status bar</p></li>
<li><p>We found the screenshots provided show how the status bar will look before and after using this app. Once again, which implies that this app has features that could alter the status bar</p></li>
</ul><p>Next, we found that the binary contains an issue with 8.3:</p>
<p>We found that your app includes a feature, or features, that mimic an iOS interface or behavior, which is not in compliance with the App Store Review Guidelines.</p>
<p>Specifically we found that the app contains a “Preview” of the status bar, which mimics the iOS status bar.</p>
</blockquote>
<p>I rolled up my sleeves and started to work. Instead of be angry I took this as an opportunity. One month after I got <a href="{{site.url}}/2014/10/16/how-to-pick-a-name-for-ios-app/">the new name,</a> new icon, improved UI, performance, refactored MVC code and even new pricing model.</p>
<p>Here what I did.</p>
<ol><li>Changed app UI. Now in editor screenshot is always scaled down, so it can’t be confused with real status bar. I also putted it in <code>UIScrollView</code>. User can scroll and be sure that this is just a photo.</li>
<li>Changed app name from <em>AlterStatusy</em> to <em>Altershot</em>.</li>
<li>Replaced screenshots. Each of them has <em>screenshot</em> word.</li>
<li>New price model. I will post about it after app is released.</li>
<li>Added app preview.</li>
</ol><p>This is the second blog post about Altershot development. The first is <a href="{{site.url}}/2014/10/16/how-to-pick-a-name-for-ios-app/">here.</a></p>
|
borisyurkevich/borisyurkevich.github.io
|
_posts/2014-10-20-how-my-app-was-rejected-two-times.html
|
HTML
|
gpl-3.0
| 3,479
|
# -*- coding: utf-8 -*-
#------------------------------------------------------------
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
if PY3:
import urllib.parse as urlparse # Es muy lento en PY2. En PY3 es nativo
else:
import urlparse # Usamos el nativo de PY2 que es más rápido
import re
from platformcode import config, logger
from core import scrapertools
from core.item import Item
from core import servertools
from core import httptools
host = 'https://frprn.com'
def mainlist(item):
logger.info()
itemlist = []
itemlist.append(item.clone(title="Nuevas" , action="lista", url=host))
itemlist.append(item.clone(title="Mejor valorada" , action="lista", url=host + "/top-rated/"))
itemlist.append(item.clone(title="Mas largo" , action="lista", url=host + "/longest/"))
itemlist.append(item.clone(title="Modelos" , action="categorias", url=host + "/models/most-popular/"))
itemlist.append(item.clone(title="Categorias" , action="categorias", url=host + "/categories/"))
itemlist.append(item.clone(title="Buscar", action="search"))
return itemlist
def search(item, texto):
logger.info()
texto = texto.replace(" ", "%20")
item.url = "%s/search/%s/?mode=async&action=get_block&block_id=list_videos_videos&from2=%s&fromStart=1&fromEnd=%s" % (host, texto,1,1)
try:
return lista(item)
except:
import sys
for line in sys.exc_info():
logger.error("%s" % line)
return []
def categorias(item):
logger.info()
itemlist = []
data = httptools.downloadpage(item.url).data
data = re.sub(r"\n|\r|\t| |<br>", "", data)
patron = '<li class="thumb thumb-\w+">.*?'
patron += '<a href="([^"]+)">.*?'
patron += '<img class="lazy" data-original="([^"]+)".*?'
patron += '<div class="title">(.*?)</a>'
matches = re.compile(patron,re.DOTALL).findall(data)
for scrapedurl,scrapedthumbnail,scrapedtitle in matches:
scrapedplot = ""
title = scrapertools.find_single_match(scrapedtitle,'<div class="text">([^<]+)<')
if "/categories/" in item.url:
cantidad = scrapertools.find_single_match(scrapedtitle,'<div class="count">(\d+)</div>')
scrapedtitle = scrapertools.find_single_match(scrapedtitle,'<div class="name">([^<]+)</div>')
title = "%s (%s)" %(scrapedtitle, cantidad)
scrapedurl = urlparse.urljoin(item.url,scrapedurl)
itemlist.append(item.clone(action="lista", title=title, url=scrapedurl,
fanart=scrapedthumbnail, thumbnail=scrapedthumbnail, plot=scrapedplot) )
next_page = scrapertools.find_single_match(data,'<li class="pagination-next"><a href="([^"]+)">')
if next_page!="":
next_page = urlparse.urljoin(item.url,next_page)
itemlist.append(item.clone(action="categorias", title="[COLOR blue]Página Siguiente >>[/COLOR]", url=next_page) )
return itemlist
def lista(item):
logger.info()
itemlist = []
data = httptools.downloadpage(item.url).data
data = re.sub(r"\n|\r|\t| |<br>", "", data)
patron = '<div class="thumb">.*?'
patron += '<a href="([^"]+)".*?'
patron += '<img class="lazy" data-original="([^"]+)" alt="([^"]+)".*?'
matches = re.compile(patron,re.DOTALL).findall(data)
for scrapedurl,scrapedthumbnail,scrapedtitle in matches:
url = urlparse.urljoin(item.url,scrapedurl)
duracion = ""
title = "[COLOR yellow]%s[/COLOR] %s" % (duracion, scrapedtitle)
contentTitle = title
thumbnail = scrapedthumbnail
plot = ""
year = ""
action = "play"
if logger.info() == False:
action = "findvideos"
itemlist.append(item.clone(action=action, title=title, url=url, thumbnail=thumbnail,
fanart=thumbnail, plot=plot, contentTitle = contentTitle))
patron = 'data-from="([^"]+)" data-id="([^"]+)" data-total="([^"]+)" data-page="([^"]+)" data-url="([^"]+)"'
matches = re.compile(patron,re.DOTALL).findall(data)
for dfrom,id,total,page,purl in matches:
page = int(page)
page += page
next_page = "%s?action=get_block&block_id=%s&%s=%s" %(purl, id, dfrom, page)
itemlist.append(item.clone(action="lista", title="[COLOR blue]Página Siguiente >>[/COLOR]", url=next_page) )
return itemlist
def findvideos(item):
logger.info()
itemlist = []
itemlist.append(item.clone(action="play", title= "%s", contentTitle = item.title, url=item.url))
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
return itemlist
def play(item):
logger.info()
itemlist = []
itemlist.append(item.clone(action="play", title= "%s", contentTitle = item.title, url=item.url))
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
return itemlist
|
alfa-addon/addon
|
plugin.video.alfa/channels/freeporn.py
|
Python
|
gpl-3.0
| 5,059
|
#!/bin/bash
echocol() { echo -e "\033[32m*** $@...\033[0m " >&2; }
if [ ! -d ./test/bats ]; then
echocol "Installing bats..."
(cd test && git clone --depth 1 https://github.com/mapio/bats.git)
fi
if [ ! -r ./release/sf ]; then
echocol "Compiling sf..."
./bin/mkdist
fi
export PATH="$PATH:$(pwd)/release/"
export FIXTURES="$(pwd)/test/fixtures"
echocol "Running tests..."
./test/bats/bin/bats test
|
mapio/sim-fun-i
|
test/run.sh
|
Shell
|
gpl-3.0
| 421
|
// Generated by APIGenerator 1.0
// DO NOT EDIT!!!
#include "foundgif.h"
FoundGif::FoundGif(QObject* parent) : TelegramObject(parent)
{
this->_w = 0;
this->_h = 0;
this->_photo = NULL;
this->_document = NULL;
}
void FoundGif::read(MTProtoStream* mtstream)
{
this->_constructorid = mtstream->readTLConstructor();
Q_ASSERT((this->_constructorid == FoundGif::CtorFoundGif) ||
(this->_constructorid == FoundGif::CtorFoundGifCached));
if(this->_constructorid == FoundGif::CtorFoundGif)
{
this->_url = mtstream->readTLString();
this->_thumb_url = mtstream->readTLString();
this->_content_url = mtstream->readTLString();
this->_content_type = mtstream->readTLString();
this->_w = mtstream->readTLInt();
this->_h = mtstream->readTLInt();
}
else if(this->_constructorid == FoundGif::CtorFoundGifCached)
{
this->_url = mtstream->readTLString();
TLInt photo_ctor = mtstream->peekTLConstructor();
if(photo_ctor != TLTypes::Null)
{
this->resetTLType<Photo>(&this->_photo);
this->_photo->read(mtstream);
}
else
{
this->nullTLType<Photo>(&this->_photo);
mtstream->readTLConstructor(); // Skip Null
}
TLInt document_ctor = mtstream->peekTLConstructor();
if(document_ctor != TLTypes::Null)
{
this->resetTLType<Document>(&this->_document);
this->_document->read(mtstream);
}
else
{
this->nullTLType<Document>(&this->_document);
mtstream->readTLConstructor(); // Skip Null
}
}
}
void FoundGif::write(MTProtoStream* mtstream)
{
Q_ASSERT((this->_constructorid == FoundGif::CtorFoundGif) ||
(this->_constructorid == FoundGif::CtorFoundGifCached));
this->compileFlags();
mtstream->writeTLConstructor(this->_constructorid);
if(this->_constructorid == FoundGif::CtorFoundGif)
{
mtstream->writeTLString(this->_url);
mtstream->writeTLString(this->_thumb_url);
mtstream->writeTLString(this->_content_url);
mtstream->writeTLString(this->_content_type);
mtstream->writeTLInt(this->_w);
mtstream->writeTLInt(this->_h);
}
else if(this->_constructorid == FoundGif::CtorFoundGifCached)
{
mtstream->writeTLString(this->_url);
if(this->_photo != NULL)
this->_photo->write(mtstream);
else
mtstream->writeTLConstructor(TLTypes::Null);
if(this->_document != NULL)
this->_document->write(mtstream);
else
mtstream->writeTLConstructor(TLTypes::Null);
}
}
void FoundGif::compileFlags()
{
}
TLString FoundGif::url() const
{
return this->_url;
}
void FoundGif::setUrl(TLString url)
{
if(this->_url == url)
return;
this->_url = url;
emit urlChanged();
}
TLString FoundGif::thumbUrl() const
{
return this->_thumb_url;
}
void FoundGif::setThumbUrl(TLString thumb_url)
{
if(this->_thumb_url == thumb_url)
return;
this->_thumb_url = thumb_url;
emit thumbUrlChanged();
}
TLString FoundGif::contentUrl() const
{
return this->_content_url;
}
void FoundGif::setContentUrl(TLString content_url)
{
if(this->_content_url == content_url)
return;
this->_content_url = content_url;
emit contentUrlChanged();
}
TLString FoundGif::contentType() const
{
return this->_content_type;
}
void FoundGif::setContentType(TLString content_type)
{
if(this->_content_type == content_type)
return;
this->_content_type = content_type;
emit contentTypeChanged();
}
TLInt FoundGif::w() const
{
return this->_w;
}
void FoundGif::setW(TLInt w)
{
if(this->_w == w)
return;
this->_w = w;
emit wChanged();
}
TLInt FoundGif::h() const
{
return this->_h;
}
void FoundGif::setH(TLInt h)
{
if(this->_h == h)
return;
this->_h = h;
emit hChanged();
}
Photo* FoundGif::photo() const
{
return this->_photo;
}
void FoundGif::setPhoto(Photo* photo)
{
if(this->_photo == photo)
return;
this->deleteChild(this->_photo);
this->_photo = photo;
if(this->_photo)
this->_photo->setParent(this);
emit photoChanged();
}
Document* FoundGif::document() const
{
return this->_document;
}
void FoundGif::setDocument(Document* document)
{
if(this->_document == document)
return;
this->deleteChild(this->_document);
this->_document = document;
if(this->_document)
this->_document->setParent(this);
emit documentChanged();
}
|
QtGram/LibQTelegram
|
autogenerated/types/foundgif.cpp
|
C++
|
gpl-3.0
| 4,168
|
angular.module('MODULE.SUBMODULE').factory(
'FACTORY_SERVICE',
function FACTORY_SERVICEProvider(
$log,
otherService
) {
'use strict';
var constructor;
constructor = function constructor (spec) {
var initialize,
instanceVar1,
instanceVar2,
private1,
private2,
public1,
public2;
// -----
// PRIVATE
// ----------
initialize = function initialize(spec) {
// Constructor-like function.
instanceVar1 = 42;
instanceVar2 = 'foo';
};
private1 = function private1(spec) {
// body...
};
private2 = function private2(spec) {
// body...
};
// -----
// PUBLIC
// ----------
public1 = function public1(spec) {
// body...
};
public2 = function public2(spec) {
// body...
};
destroy = function destroy () {
// body...
}
// -----
// EXECUTE
// ----------
initialize(spec);
return {
public1: public1,
public2: public2,
destroy: destroy
};
}
return constructor
}
);
// Usage
angular.module('MODULE.SUBMODULE').contoller(
'CONTROLLER',
function SERVICEProvider(
FACTORY_SERVICE
) {
if (currentObject) {
currentObject.destroy();
currentObject = undefined;
}
currentObject = FACTORY_SERVICE(spec);
}
);
|
dctr/boilerplates
|
JavaScript/AngularJS/angularFactoryService.js
|
JavaScript
|
gpl-3.0
| 1,818
|
<?php
namespace Lens;
use _Lens\Lens\Tests\Agent;
function filesize($filename)
{
return eval(Agent::call(null, __FUNCTION__, func_get_args()));
}
|
Spencer-Mortensen/lens
|
files/functions/mock/filesize.php
|
PHP
|
gpl-3.0
| 150
|
/**
* stratum-proxy is a proxy supporting the crypto-currency stratum pool mining
* protocol.
* Copyright (C) 2014-2015 Stratehm (stratehm@hotmail.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with multipool-stats-backend. If not, see <http://www.gnu.org/licenses/>.
*/
package strat.mining.stratum.proxy.json;
import java.util.ArrayList;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public class MiningSubscribeResponse extends JsonRpcResponse {
@JsonIgnore
private List<Object> subscriptionDetails;
@JsonIgnore
private String extranonce1;
@JsonIgnore
private Integer extranonce2Size;
public MiningSubscribeResponse() {
super();
}
public MiningSubscribeResponse(JsonRpcResponse response) {
super(response);
}
public List<Object> getSubscriptionDetails() {
return subscriptionDetails;
}
public void setSubscriptionDetails(List<Object> subscriptionDetails) {
this.subscriptionDetails = subscriptionDetails;
}
public String getExtranonce1() {
return extranonce1;
}
public void setExtranonce1(String extranonce1) {
this.extranonce1 = extranonce1;
}
public Integer getExtranonce2Size() {
return extranonce2Size;
}
public void setExtranonce2Size(Integer extranonce2Size) {
this.extranonce2Size = extranonce2Size;
}
@Override
public Object getResult() {
if (super.getResult() == null) {
List<Object> result = new ArrayList<Object>();
super.setResult(result);
result.add(subscriptionDetails);
result.add(extranonce1);
result.add(extranonce2Size);
}
return super.getResult();
}
@Override
public void setResult(Object result) {
super.setResult(result);
if (result != null) {
subscriptionDetails = getResultObjectAtIndex(0);
extranonce1 = getResultObjectAtIndex(1);
extranonce2Size = getResultObjectAtIndex(2);
}
}
}
|
Stratehm/stratum-proxy
|
src/main/java/strat/mining/stratum/proxy/json/MiningSubscribeResponse.java
|
Java
|
gpl-3.0
| 2,486
|
/* ------------------------------------------------------------------------ *
* XSquare is free software: you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation version 3 of the Licence, or *
* (at your option) any later version. *
* *
* XSquare is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* You should have received copies of the GNU General Public License and *
* the GNU Lesser General Public License along with this program. If *
* not, see http://www.gnu.org/licenses/. *
* ------------------------------------------------------------------------- */
#ifndef XS_CORE_STATEPROPS__
#define XS_CORE_STATEPROPS__
#include "stateops_T.hpp"
#include "../utils/clamp.hpp"
namespace xs_core {
template <typename NUM, class T>
class state_switch_T: public stateops_T<NUM, T> {
/* Basic state machine switch
* Note NUM must be a form of int eg. unsigned, long, etc.
*/
protected:
NUM min, max;
public:
virtual ~state_switch_T();
const NUM get(void) const {return this->state;}
NUM get(void) {return this->state;}
inline int set(const NUM state) {
// returns 1 if changed, -1 out of bounds, 0 if no change
if (this->state == state) return 0; // no change
else if (this->min <= state || state <= this->max)
this->state = state;
return 1; // changed
return -1; // out of bounds -- no change
}
inline int set_clamped(const NUM state) {
// returns 1 if changed, otherwise 0
if (state == this->state) return 0; // no change
else this->state = clamped(state, this->min, this->max);
return 1; // changed
}
inline void operator++(void) {
if (this->state < this->max) this->state++;
}
inline void operator--(void) {
if (this->state > this->min) this->state--;
}
};
template <typename NUM, class T>
class looping_state_switch_T: public state_switch_T<NUM, T> {
/*
* Note NUM must be a form of int eg. unsigned, long, etc.
*/
protected:
NUM min, max;
public:
virtual ~looping_state_switch_T();
inline void operator++(void) {
(this->state == this->max) ? this->state = this->min : this->state++;
}
inline void operator--(void) {
(this->state == this->min) ? this->state = this->max : this->state--;
}
};
template <typename NUM>
class _state_switch_with_default_mixin {
// Mixin class to add a default state to state_switch classes
protected:
NUM _default_state;
public:
inline NUM &default_state(void) {return this->_default_state;}
inline bool is_default(void) {return this->_default_state == this->state;}
inline void clear(void) {this->state = this->_default_state;}
};
// Supplimentary Classes with default
template <typename NUM, class T>
class state_switch_with_default_T:
public _state_switch_with_default_mixin<NUM> {
};
template <typename NUM, class T>
class looping_state_switch_with_default_T:
public _state_switch_with_default_mixin<NUM> {
};
} // xs_core
#endif // XS_CORE_STATEPROPS__
|
XSquareOrg/XS-core
|
src/rstate/stateprop.hpp
|
C++
|
gpl-3.0
| 3,664
|
--[[
Random news generator
--]]
-- News files to include
include("dat/news/news_generic.lua")
include("dat/news/news_empire.lua")
include("dat/news/news_dvaered.lua")
include("dat/news/news_goddard.lua")
include("dat/news/news_pirate.lua")
include("dat/news/news_sirius.lua")
function news( n )
-- Get the table and greeting
local greet, rawtable = news_genTable()
-- Case list is smaller
if #rawtable < n then
return greet, rawtable
end
-- Now get the n elements
ntable = {}
while #ntable < n do
i = rnd.rnd(1, #rawtable)
table.insert( ntable, rawtable[i] )
table.remove( rawtable, i )
end
return greet, ntable
end
--[[
Generates the greeting and table.
--]]
function news_genTable ()
-- Get current planet.
local curp, curs = planet.cur()
f = curp:faction()
-- Planets with no faction have no news.
if f == nil then
return
end
rawtable = {}
-- Empire news
if f:name() == "Empire" then
greet = news_greetEmpire()
news_addGeneric( rawtable )
news_addEmpire( rawtable )
-- Dvaered news
elseif f:name() == "Dvaered" then
greet = news_greetDvaered()
news_addGeneric( rawtable )
news_addEmpire( rawtable )
news_addDvaered( rawtable )
-- Goddard news
elseif f:name() == "Goddard" then
greet = news_greetGoddard()
news_addGeneric( rawtable )
news_addEmpire( rawtable )
news_addGoddard( rawtable )
-- Pirate news
elseif f:name() == "Pirate" then
greet = news_greetPirate()
news_addGeneric( rawtable )
news_addPirate( rawtable )
-- Sirius news
elseif f:name() == "Sirius" then
greet = news_greetSirius()
news_addGeneric( rawtable )
news_addEmpire( rawtable )
news_addSirius( rawtable )
-- Generic news
else
greet = news_greetGeneric()
news_addGeneric( rawtable )
end
-- Send output.
return greet, rawtable
end
|
cjp39/naev
|
dat/news.lua
|
Lua
|
gpl-3.0
| 1,977
|
Joomla 1.5.23 = 9828ab260a60ea25a88b7657c937f666
|
gohdan/DFC
|
known_files/hashes/plugins/editors/tinymce/jscripts/tiny_mce/plugins/table/langs/en_dlg.js
|
JavaScript
|
gpl-3.0
| 49
|
import json
import re
packageJson = '../../../package.json'
with open(packageJson) as data_file:
data = json.load(data_file)
config = '../../pkjs/config.js'
with open(config) as conf_file:
s = conf_file.readline()
keys = []
while (s):
suggestKey = re.search(r"messageKey\"\:(.[^,]*)", s)
if suggestKey:
keys.append(suggestKey.group(1).strip('" ,'))
s = conf_file.readline()
def func(item):
return item.split('[',1)[0]
knownKeys = list(map(func, data["pebble"]["messageKeys"]))
for key in keys:
#print('processing ', key);
if key not in knownKeys:
print('unknow key', key)
|
UnnamedHero/pebble-watchface-time-and-calendar
|
src/c/test/testMessageKeys.py
|
Python
|
gpl-3.0
| 661
|
<?php
/**
* Tests for OrganizationsTable
*
* @category Test
* @package Website
* @author Raphael St-Arnaud <am21830@ens.etsmtl.ca>
* @license http://www.gnu.org/licenses/gpl-3.0.en.html GPL v3
* @link https://github.com/MaisonLogicielLibre/Site
*/
namespace App\Test\TestCase\Model\Table;
use App\Model\Table\OrganizationsTable;
use Cake\ORM\TableRegistry;
use Cake\TestSuite\TestCase;
use Cake\Validation\Validator;
/**
* Tests for OrganizationsTable
*
* @category Test
* @package Website
* @author Raphael St-Arnaud <am21830@ens.etsmtl.ca>
* @license http://www.gnu.org/licenses/gpl-3.0.en.html GPL v3
* @link https://github.com/MaisonLogicielLibre/Site
*/
class OrganizationsTableTest extends TestCase
{
/**
* Fixtures
*
* @var array
*/
public $fixtures = [
'app.type_users_users',
'app.organizations',
'app.organizations_Projects',
'app.organizations_Owners',
'app.organizations_Members',
'app.users',
'app.type_users',
'app.svn_users',
'app.svns',
'app.universities',
'app.projects',
'app.projects_contributors',
'app.projects_mentors',
'app.missions'
];
/**
* SetUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
$config = TableRegistry::exists('Organizations') ? [] : ['className' => 'App\Model\Table\OrganizationsTable'];
$this->Organizations = TableRegistry::get('Organizations', $config);
}
/**
* Test getId
*
* @return void
*/
public function testGetId()
{
$id = 1;
$expected = 1;
$org = $this->Organizations->get($id);
$result = $org->getId();
$this->assertEquals($expected, $result);
}
/**
* Test getName
*
* @return void
*/
public function testGetName()
{
$id = 1;
$expected = 'MLL';
$org = $this->Organizations->get($id);
$result = $org->getName();
$this->assertEquals($expected, $result);
}
/**
* Test getWebsite
*
* @return void
*/
public function testGetWebsite()
{
$id = 1;
$expected = 'www.website.com';
$org = $this->Organizations->get($id);
$result = $org->getWebsite();
$this->assertEquals($expected, $result);
}
/**
* Test getKLogo
*
* @return void
*/
public function testGetLogo()
{
$id = 1;
$expected = '/img/logo.jpg';
$org = $this->Organizations->get($id);
$result = $org->getLogo();
$this->assertEquals($expected, $result);
}
/**
* Test getDescription
*
* @return void
*/
public function testGetDescription()
{
$id = 1;
$expected = 'Awesome';
$org = $this->Organizations->get($id);
$result = $org->getDescription();
$this->assertEquals($expected, $result);
}
/**
* Test getIsValidated
*
* @return void
*/
public function testGetIsValidated()
{
$id = 1;
$expected = 0;
$org = $this->Organizations->get($id);
$result = $org->getIsValidated();
$this->assertEquals($expected, $result);
}
/**
* Test getIsRejected
*
* @return void
*/
public function testGetIsRejected()
{
$id = 1;
$expected = 0;
$org = $this->Organizations->get($id);
$result = $org->getIsRejected();
$this->assertEquals($expected, $result);
}
/**
* Test getIsRejectedTrue
*
* @return void
*/
public function testGetIsRejectedTrue()
{
$id = 3;
$expected = 1;
$org = $this->Organizations->get($id);
$result = $org->getIsRejected();
$this->assertEquals($expected, $result);
}
/**
* Test editName
*
* @return void
*/
public function testSetName()
{
$id = 1;
$expected = 'ML2';
$org = $this->Organizations->get($id);
$result = $org->editName($expected);
$this->assertEquals($expected, $result);
}
/**
* Test editWebsite
*
* @return void
*/
public function testSetWebsite()
{
$id = 1;
$expected = 'www.website.com';
$org = $this->Organizations->get($id);
$result = $org->editWebsite($expected);
$this->assertEquals($expected, $result);
}
/**
* Test editLogo
*
* @return void
*/
public function testSetlogo()
{
$id = 1;
$expected = '/img/logo.png';
$org = $this->Organizations->get($id);
$result = $org->editLogo($expected);
$this->assertEquals($expected, $result);
}
/**
* Test editDescription
*
* @return void
*/
public function testSetDescription()
{
$id = 1;
$expected = 'Even more awesome';
$org = $this->Organizations->get($id);
$result = $org->editDescription($expected);
$this->assertEquals($expected, $result);
}
/**
* Test editIsValidated
*
* @return void
*/
public function testSetIsValidated()
{
$id = 1;
$expected = 1;
$org = $this->Organizations->get($id);
$result = $org->editIsValidated($expected);
$this->assertEquals($expected, $result);
}
/**
* Test editIsRejected
*
* @return void
*/
public function testSetIsRejected()
{
$id = 1;
$expected = 1;
$org = $this->Organizations->get($id);
$result = $org->editIsRejected($expected);
$this->assertEquals($expected, $result);
}
/**
* Test validation
*
* @return void
*/
public function testValidation()
{
$validator = new Validator();
$expected = $validator;
$result = $this->Organizations->validationDefault($validator);
$this->assertEquals($validator, $result);
}
/**
* Test validation Website Rules
*
* @return void
*/
public function testValidationWebsite()
{
$id = 1;
$org = $this->Organizations->get($id);
$this->Organizations->patchEntity($org, ['website' => 'www.website.com']);
$result = $this->Organizations->save($org);
if ($result != false) {
$result = true;
}
$this->assertFalse($result);
}
/**
* Test validation Website Rules
*
* @return void
*/
public function testAddMember()
{
$id = 2;
$org = $this->Organizations->get($id, ['contain' => ['Members', 'Owners']]);
$this->assertEquals(1, count($org['members']));
$org->addMember(3);
$this->assertEquals(2, count($org['members']));
$this->assertEquals(3, $org['members'][1]['id']);
}
/**
* Test validation Website Rules
*
* @return void
*/
public function testGetMembersId()
{
$id = 2;
$expected = [$id];
$org = $this->Organizations->get($id, ['contain' => ['Members', 'Owners']]);
$membersId = $org->getMembersId();
$this->assertEquals($expected, $membersId);
}
}
|
fxleblanc/Website
|
tests/TestCase/Model/Table/OrganizationsTableTest.php
|
PHP
|
gpl-3.0
| 7,351
|
package net.osmand.aidl.maplayer;
import android.os.Parcel;
import android.os.Parcelable;
public class AddMapLayerParams implements Parcelable {
private AMapLayer layer;
public AddMapLayerParams(AMapLayer layer) {
this.layer = layer;
}
public AddMapLayerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddMapLayerParams> CREATOR = new
Creator<AddMapLayerParams>() {
public AddMapLayerParams createFromParcel(Parcel in) {
return new AddMapLayerParams(in);
}
public AddMapLayerParams[] newArray(int size) {
return new AddMapLayerParams[size];
}
};
public AMapLayer getLayer() {
return layer;
}
public void writeToParcel(Parcel out, int flags) {
out.writeParcelable(layer, flags);
}
private void readFromParcel(Parcel in) {
layer = in.readParcelable(AMapLayer.class.getClassLoader());
}
public int describeContents() {
return 0;
}
}
|
OpenStreetMap-Monitoring/OsMoDroid
|
app/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.java
|
Java
|
gpl-3.0
| 920
|
package quic
import (
"sync"
"github.com/lucas-clemente/quic-go/internal/protocol"
)
type packetBuffer struct {
Data []byte
// refCount counts how many packets Data is used in.
// It doesn't support concurrent use.
// It is > 1 when used for coalesced packet.
refCount int
}
// Split increases the refCount.
// It must be called when a packet buffer is used for more than one packet,
// e.g. when splitting coalesced packets.
func (b *packetBuffer) Split() {
b.refCount++
}
// Decrement decrements the reference counter.
// It doesn't put the buffer back into the pool.
func (b *packetBuffer) Decrement() {
b.refCount--
if b.refCount < 0 {
panic("negative packetBuffer refCount")
}
}
// MaybeRelease puts the packet buffer back into the pool,
// if the reference counter already reached 0.
func (b *packetBuffer) MaybeRelease() {
// only put the packetBuffer back if it's not used any more
if b.refCount == 0 {
b.putBack()
}
}
// Release puts back the packet buffer into the pool.
// It should be called when processing is definitely finished.
func (b *packetBuffer) Release() {
b.Decrement()
if b.refCount != 0 {
panic("packetBuffer refCount not zero")
}
b.putBack()
}
// Len returns the length of Data
func (b *packetBuffer) Len() protocol.ByteCount {
return protocol.ByteCount(len(b.Data))
}
func (b *packetBuffer) putBack() {
if cap(b.Data) != int(protocol.MaxReceivePacketSize) {
panic("putPacketBuffer called with packet of wrong size!")
}
bufferPool.Put(b)
}
var bufferPool sync.Pool
func getPacketBuffer() *packetBuffer {
buf := bufferPool.Get().(*packetBuffer)
buf.refCount = 1
buf.Data = buf.Data[:0]
return buf
}
func init() {
bufferPool.New = func() interface{} {
return &packetBuffer{
Data: make([]byte, 0, protocol.MaxReceivePacketSize),
}
}
}
|
AdguardTeam/AdguardDNS
|
vendor/github.com/lucas-clemente/quic-go/buffer_pool.go
|
GO
|
gpl-3.0
| 1,814
|
<!--
Copyleft (c) 2014, "The BeardTeam" - https://github.com/BeardTeam/
This file (index.html) is part of ipc-d3,
and developed by Massimiliano Leone
<maximilianus@gmail.com> - http://plus.google.com/+MassimilianoLeone
as part of https://github.com/BeardTeam/opendata-experiments
index.html is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
index.html is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with . If not, see <http://www.gnu.org/licenses/>.
-->
<html>
<head>
<!-- to be included always - start -->
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.4.2/pure-min.css"></link>
<link rel="stylesheet" href="css/side-menu.css"></link>
<!-- to be included always - end -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<style>
#intro {
height: 100%;
}
#intro_h2 {
margin: 10% 0 0 0%;
width: 110%;
}
#intro_h3 {
width: 110%;
}
#tip, #disclaimer {
font-style: italic;
font-size: small;
margin-top: 1em;
float: left;
clear: both;
text-align: center;
}
#tip {
margin-left: 4em;
}
#github {
margin: 2em;
}
#github,#data,#browsertip,#presentation,#disclaimer {
float: left;
clear: both;
}
#github_text {
margin-top: 15px;
}
.github,.data_img {
float: left;
clear: none;
}
#data_label: {
font-weight: bold;
}
</style>
</head>
<body>
<!-- to be included always - start -->
<div id="layout">
<div id="menu">
<a href="#menu" id="menuLink" class="menu-link"><span></span></a>
<div class="pure-menu pure-menu-open">
<a class="pure-menu-heading" href="index.html">O.D.E.</a>
<ul>
<li><a href="index.html">Home</a></li>
<li><a id="about" href="about.html"></a></li>
<li id="menu_li" class="menu-item-divided pure-menu-selected"></li>
</ul>
</div>
</div>
<div id="main">
<div class="header">
<h1>OpenDataExperiment</h1>
<h3 id="header_h3"></h3>
<h4 id="header_h4"></h4>
<h5 id="header_h5"></h5>
</div>
<div id="content" class="content"></div>
</div>
</div>
<!-- to be included always - end -->
<div id="core">
<div id="intro">
<h2 id="intro_h2"></h2>
<h3 id="intro_h3"></h3>
<div id="data">
<div id="data_label"></div>
<div id="palermo" class="data_img">
<a href="http://www.comune.palermo.it/opendata.php"><img src="hdr_opendata.jpg" width="240" height="60"/></a>
</div>
<div id="istat" class="data_img" style="margin-left:1em;">
<a href="http://www.istat.it/it/istituto-nazionale-di-statistica/attività/open-data"><img src="istat.png"/></a>
</div>
</div>
<div id="github">
<a class="github" href='https://github.com/BeardTeam/opendata-experiments'><img width=120 height=80 src='Octocat.jpg' /></a>
<div id="github_text" class="github">
<div id="github_label"></div>
<a id="github_a" href='https://github.com/BeardTeam/opendata-experiments'>https://github.com/BeardTeam/opendata-experiments</a>
</div>
</div>
<div style="margin-top: 20px;" id="presentation"></div>
<div style="margin-top: 20px;" id="disclaimer"></div>
<div style="margin-top: 20px;" id="browsertip"></div>
</div>
<a href="https://github.com/BeardTeam/opendata-experiments"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
</div>
<!-- to be included always - start -->
<script src="js/core.js"></script>
<script src="js/ui.js"></script>
<!-- to be included always - end -->
<!-- localization labels map - start -->
<script type="text/javascript">
var labelsMap = {
it : {
"header_h3" : "",
"header_h4" : "",
"intro_h2" : "<p>Qualche esperimento con D3, RickShaw e Google Charts.<p/><p></p>",
"intro_h3" : "<p>Sarà illustrato come da dati grezzi si possa ottenere una visualizzazione ricca,<br/>"
+ "che permetta un'analisi più intuitiva (e leggibile) dell'usuale forma a tabella.</p>",
"data_label" : "<b>I dati usati provengono da: </b>",
"github_label" : "Il codice sorgente è disponibile presso github<br/>",
"presentation" : "Una presentazione sulla teoria e tecniche di manipolazione dei dati è disponibile qui: <a href='https://prezi.com/j6hgcjtcghcn/raccolta-manipolazione-e-rappresentazione-dei-dati'>https://prezi.com/j6hgcjtcghcn/raccolta-manipolazione-e-rappresentazione-dei-dati</a>",
"disclaimer": "<i>Il presente software è fornito senza alcuna garanzia;<br/>dove non diversamente dichiarato, il codice sorgente è rilasciato con licenza GPLv3.</i>",
"browsertip": "<i>È consigliabile l'utilizzo del browser Chrome/Chromium per una migliore fruizione dei contenuti</i>"
},
'default' : {
"header_h3" : "",
"header_h4" : "",
"intro_h2" : "<p>Some experiments using D3.js, RickShaw and Google Charts</p>",
"intro_h3" : "<p>We'll show as raw data can give you a powerful visualization,<br/>"
+ "allowing a more intuitive analysis than (unreadeable) table form.</p>"
+ "<p>Choice any link from side panel and have fun!</p>",
"data_label" : "<b>Data used come from: </b>",
"github_label" : "You can easily browse code at github<br/>",
"presentation": "A presentation about theory and data manipulation techniques is available here (in italian): <a href='https://prezi.com/j6hgcjtcghcn/raccolta-manipolazione-e-rappresentazione-dei-dati'>https://prezi.com/j6hgcjtcghcn/raccolta-manipolazione-e-rappresentazione-dei-dati</a>",
"disclaimer": "<i>This work is provided without any warranty;<br/>where not otherwise declared, all source codes are released under GPLv3 license.</i>",
"browsertip": "<i>We recommend Chrome/Chromium browser for better navigation</i>"
}
}
setTranslateLabels(getLanguage(), labelsMap);
</script>
<!-- localization labels map - end -->
</body>
</html>
|
BeardTeam/opendata-experiments
|
index.html
|
HTML
|
gpl-3.0
| 6,547
|
package org.smap.sdal.model;
/*
* ODK Form definition
*/
public class ODKForm {
public String formID;
public String name;
public String majorMinorVersion;
public String version;
public String hash;
public String downloadUrl;
public String manifestUrl;
public ODKForm() {
super();
}
}
|
smap-consulting/smapserver
|
sdDAL/src/org/smap/sdal/model/ODKForm.java
|
Java
|
gpl-3.0
| 303
|
/*
* WANDORA
* Knowledge Extraction, Management, and Publishing Application
* http://wandora.org
*
* Copyright (C) 2004-2015 Wandora Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* FixTimeApellations.java
*
* Created on August 17, 2004, 7:12 PM
*/
package org.wandora.application.tools.fng;
import org.wandora.application.tools.AbstractWandoraTool;
import gnu.regexp.*;
import java.util.*;
import java.io.*;
import java.net.*;
import javax.swing.*;
import org.wandora.topicmap.*;
import org.wandora.application.*;
import org.wandora.application.contexts.*;
/**
*
* @author akivela
*/
public class FixTimeApellations extends AbstractWandoraTool implements WandoraTool {
public void execute(Wandora admin, Context context) {
try {
TopicMap topicMap = admin.getTopicMap();
int answer = JOptionPane.showConfirmDialog(admin,"You are about to fix time apellations!\nAre you sure?","Fix time apellations?", JOptionPane.YES_NO_OPTION);
if(answer == JOptionPane.YES_OPTION) {
FixTimeApellations.process(topicMap);
}
}
catch(Exception e) {
e.printStackTrace();
}
}
@Override
public String getName() {
return "Fix time apellations";
}
public static String trimExtraSpaces(String string) {
return trimEndingSpaces(trimStartingSpaces(string));
}
public static String chop(String text) {
return trimEndingSpaces(text);
}
public static String trimEndingSpaces(String string) {
if (string != null) {
int i = string.length()-1;
while(i > 0 && Character.isWhitespace(string.charAt(i))) i--;
string = string.substring(0, i+1);
}
return string;
}
public static String trimStartingSpaces(String string) {
if (string != null) {
int i = 0;
while(i < string.length() && Character.isWhitespace(string.charAt(i))) i++;
string = string.substring(i);
}
return string;
}
public static String fixTime(String oldTime) {
RE re = null;
try {
// 1990 - 92
re = new RE("([1-2][0-9]{3}) *\\- *([0-9][0-9])", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year1 = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
String year2 = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
year2 = year1.substring(0,2) + year2;
return year1 + " - " + year2;
}
// 1990 - 1992
re = new RE("([1-2][0-9]{3}) *\\- *([1-2][0-9]{3})", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year1 = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
String year2 = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
return year1 + " - " + year2;
}
// 90-luku
re = new RE("([0-9]{2}) *\\-luku", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
return "19" + year + "-luku";
}
// 1990-luku
re = new RE("([1-2][0-9]{3}) *\\-luku", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
return year + "-luku";
}
// 13.-15.6.2001
re = new RE("([0-9][0-9]?)\\.\\-([0-9][0-9]?) *\\. *([0-9][0-9]?) *\\. *([1-2][0-9][0-9][0-9])", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(4), match.getEndIndex(4));
String month = oldTime.substring(match.getStartIndex(3), match.getEndIndex(3));
String day1 = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
String day2 = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
if(month.length() == 1) month = "0" + month;
if(day1.length() == 1) day1 = "0" + day1;
if(day2.length() == 1) day2 = "0" + day2;
return year + "-" + month + "-" + day1 + " - " + year + "-" + month + "-" + day2;
}
// 13.6.2001
re = new RE("([0-9][0-9]?) *\\. *([0-9][0-9]?) *\\. *([1-2][0-9][0-9][0-9])\\,*", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(3), match.getEndIndex(3));
String month = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
String day = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
if(month.length() == 1) month = "0" + month;
if(day.length() == 1) day = "0" + day;
return year + "-" + month + "-" + day;
}
// 2001.6.16.
re = new RE("([1-2][0-9][0-9][0-9]) *\\. *([0-9][0-9]?) *\\. *([0-9][0-9]) *\\.?", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
String month = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
String day = oldTime.substring(match.getStartIndex(3), match.getEndIndex(3));
if(month.length() == 1) month = "0" + month;
if(day.length() == 1) day = "0" + day;
return year + "-" + month + "-" + day;
}
// .6.2001
re = new RE("\\. *([0-9][0-9]?) *\\. *([1-2][0-9][0-9][0-9])", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
String month = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
if(month.length() == 1) month = "0" + month;
return year + "-" + month;
}
// .6/4.2001
re = new RE("\\. *([0-9][0-9]?) *\\/ *([0-9][0-9]?) *\\. *([1-2][0-9][0-9][0-9])", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(3), match.getEndIndex(3));
String month1 = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
String month2 = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
if(month1.length() == 1) month1 = "0" + month1;
if(month2.length() == 1) month2 = "0" + month2;
return year + "-" + month1 + " - " + year + "-" + month2;
}
// 13.6.01
re = new RE("([0-9][0-9]?) *\\. *([0-9][0-9]?) *\\. *([0-9][0-9])", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(3), match.getEndIndex(3));
String month = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
String day = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
if(month.length() == 1) month = "0" + month;
if(day.length() == 1) day = "0" + day;
if(Integer.parseInt(year) > 4) year = "19" + year;
else year = "20" + year;
return year + "-" + month + "-" + day;
}
// 6.2001
re = new RE("([0-9]+) *\\. *([1-2][0-9][0-9][0-9])", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
String month = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
if(month.length() == 1) month = "0" + month;
return year + "-" + month;
}
// 6/2001
re = new RE("([0-9][0-9]?) *\\/ *([1-2][0-9][0-9][0-9])", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
String month = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
if(month.length() == 1) month = "0" + month;
return year + "-" + month;
}
// tammikuu 2001
re = new RE("(tammi|helmi|maalis|huhti|touko|kes.|hein.|elo|syys|loka|marras|joulu)kuu +([1-2][0-9][0-9][0-9])", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
REMatch match = re.getMatch(oldTime);
String year = oldTime.substring(match.getStartIndex(2), match.getEndIndex(2));
String month = oldTime.substring(match.getStartIndex(1), match.getEndIndex(1));
if("tammi".equalsIgnoreCase(month)) month = "01";
if("helmi".equalsIgnoreCase(month)) month = "02";
if("maalis".equalsIgnoreCase(month)) month = "03";
if("huhti".equalsIgnoreCase(month)) month = "04";
if("touko".equalsIgnoreCase(month)) month = "05";
if("kesä".equalsIgnoreCase(month)) month = "06";
if("heinä".equalsIgnoreCase(month)) month = "07";
if("elo".equalsIgnoreCase(month)) month = "08";
if("syys".equalsIgnoreCase(month)) month = "09";
if("loka".equalsIgnoreCase(month)) month = "10";
if("marras".equalsIgnoreCase(month)) month = "11";
if("joulu".equalsIgnoreCase(month)) month = "12";
return year + "-" + month;
}
// 2001-06-01
re = new RE("[1-2][0-9]{3}\\-[0-9]+\\-[0-9]+", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
return oldTime;
}
// 2001
re = new RE("[1-2][0-9]{3}", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
return oldTime;
}
// n. 2001
re = new RE("n\\. [1-2][0-9]{3}", RE.REG_ICASE);
if(re.isMatch(oldTime)) {
return oldTime;
}
}
catch(Exception e) {
e.printStackTrace();
}
return null;
}
public static void setDisplayName(Topic t, String lang, String name) throws TopicMapException {
String langsi=XTMPSI.getLang(lang);
Topic langT=t.getTopicMap().getTopic(langsi);
String dispsi=XTMPSI.DISPLAY;
Topic dispT=t.getTopicMap().getTopic(dispsi);
HashSet scope=new HashSet();
if(langT!=null) scope.add(langT);
if(dispT!=null) scope.add(dispT);
t.setVariant(scope, name);
}
public static void createRelated(TopicMap tm, Topic t, String fn) throws TopicMapException {
RE re = null;
REMatch match = null;
try {
// 1997-06-22
re = new RE("([1-2][0-9]{3})\\-([0-9]+)\\-([0-9]+)", RE.REG_ICASE);
match = re.getMatch(fn);
if(match != null) {
String year = fn.substring(match.getStartIndex(1), match.getEndIndex(1));
String month = fn.substring(match.getStartIndex(2), match.getEndIndex(2));
String day = fn.substring(match.getStartIndex(3), match.getEndIndex(3));
addDecadeTopic(tm, t, year);
addCenturyTopic(tm, t, year);
addYearTopic(tm, t, year);
addMonthTopic(tm, t, month);
return;
}
// 1992-04
re = new RE("([1-2][0-9]{3})\\-([0-9]+)", RE.REG_ICASE);
match = re.getMatch(fn);
if(match != null) {
String year = fn.substring(match.getStartIndex(1), match.getEndIndex(1));
String month = fn.substring(match.getStartIndex(2), match.getEndIndex(2));
addDecadeTopic(tm, t, year);
addCenturyTopic(tm, t, year);
addMonthTopic(tm, t, month);
return;
}
// 1992 - 1995
re = new RE("([1-2][0-9]{3}) \\- ([1-2][0-9]{3})", RE.REG_ICASE);
match = re.getMatch(fn);
if(match != null) {
String year1 = fn.substring(match.getStartIndex(1), match.getEndIndex(1));
String year2 = fn.substring(match.getStartIndex(2), match.getEndIndex(2));
int y1 = Integer.parseInt(year1);
int y2 = Integer.parseInt(year2);
for(int y=y1; y<=y2; y++) {
addDecadeTopic(tm, t, "" + y);
addCenturyTopic(tm, t, "" + y);
}
return;
}
// 1992
re = new RE("([1-2][0-9]{3})", RE.REG_ICASE);
match = re.getMatch(fn);
if(match != null) {
String year = fn.substring(match.getStartIndex(1), match.getEndIndex(1));
addDecadeTopic(tm, t, year);
addCenturyTopic(tm, t, year);
return;
}
// n. 1992
re = new RE("n\\. ([1-2][0-9]{3})", RE.REG_ICASE);
match = re.getMatch(fn);
if(match != null) {
String year = fn.substring(match.getStartIndex(1), match.getEndIndex(1));
addDecadeTopic(tm, t, year);
addCenturyTopic(tm, t, year);
return;
}
}
catch(Exception e) {
e.printStackTrace();
}
}
public static void createTopic(TopicMap tm, String si, String fname, String ename, String[] types) throws TopicMapException {
createTopic(tm, si, fname, fname, ename, types);
}
public static void createTopic(TopicMap tm, String si, String bname, String fname, String ename, String[] types) throws TopicMapException {
Topic topic = tm.getTopic(si);
if(topic == null) {
Topic t = tm.createTopic();
Locator siLocator = tm.createLocator(si);
t.addSubjectIdentifier(siLocator);
t.setBaseName(bname);
setDisplayName(t, "fi" , fname);
setDisplayName(t, "en" , ename);
for(int i=0; i<types.length; i++) {
Topic typeTopic = tm.getTopic(types[i]);
if(typeTopic != null) {
t.addType(typeTopic);
}
}
System.out.println(" topic created " + t.getBaseName());
}
}
public static void process(TopicMap tm) throws TopicMapException {
Vector v=new Vector();
createDateTopics(tm);
Topic timeApellationTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#kp-ajoitus");
System.out.println("Time type == " + timeApellationTopic.getBaseName());
Iterator iter=tm.getTopics();
while(iter.hasNext()) {
Topic t=(Topic)iter.next();
if(t.isOfType(timeApellationTopic)) {
v.add(t);
}
}
iter=v.iterator();
int c=0;
int unregocnized = 0;
while(iter.hasNext()){
Topic t=(Topic)iter.next();
if(t.isRemoved()) continue;
try {
//System.out.println("Fixing " + t.getBaseName());
c++;
// fix finnish name (base name and subject identifiers)
String fn = trimExtraSpaces(t.getDisplayName("fi"));
String fixedfn = fixTime(fn);
if(fixedfn != null) {
setDisplayName(t, "fi", fixedfn);
t.setBaseName(fixedfn);
Collection sis = t.getSubjectIdentifiers();
Vector ve = new Vector();
for(Iterator i=sis.iterator(); i.hasNext(); ) {
ve.add((Locator) i.next());
}
for(int i=0; i<ve.size(); i++) {
Locator oldLoc = (Locator) ve.elementAt(i);
//t.removeSubjectIdentifier(oldLoc);
}
Locator newSI = tm.createLocator("http://www.fng.fi/muusa/FNG_CIDOC_v3.4.dtd#" + URLEncoder.encode(fixedfn,"UTF-8") );
t.addSubjectIdentifier(newSI);
System.out.println(" Fixed base name: " + fixedfn);
createRelated(tm, t, fixedfn);
}
// fix english name
String en = trimExtraSpaces(t.getDisplayName("en"));
String fixeden = fixTime(en);
if(fixedfn != null) {
setDisplayName(t, "en", fixeden);
}
}
catch (Exception e) {
System.out.println("Can't fix " + t.getBaseName());
e.printStackTrace();
}
}
System.out.println("Total " + c + " topics fixed!");
System.out.println("Total unregocnized " + unregocnized + " topics!");
}
public static void createDateTopics(TopicMap tm) throws TopicMapException {
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi",
"kuukausi",
"month",
new String[] { });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#tammikuu",
"tammikuu",
"January",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#helmikuu",
"helmikuu",
"February",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#maaliskuu",
"maaliskuu",
"March",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#huhtikuu",
"huhtikuu",
"April",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#toukokuu",
"toukokuu",
"May",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#kesakuu",
"kesäkuu",
"Juni",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
try { createTopic(tm,
URLEncoder.encode("http://www.fng.fi/wandora/wandora-fng.xtm#kesäkuu", "UTF-8"),
"kesäkuu",
"Juni",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
} catch(Exception e) {}
try { createTopic(tm,
URLEncoder.encode("http://www.fng.fi/wandora/wandora-fng.xtm#heinakuu", "UTF-8"),
"heinäkuu",
"July",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
} catch(Exception e) {}
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#elokuu",
"elokuu",
"August",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#syyskuu",
"syyskuu",
"September",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#lokakuu",
"lokakuu",
"October",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#marraskuu",
"marraskuu",
"November",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#joulukuu",
"joulukuu",
"December",
new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kuukausi" });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#vuosikymmen",
"vuosikymmen",
"Decade",
new String[] { });
createTopic(tm,
"http://www.fng.fi/wandora/wandora-fng.xtm#vuosisata",
"vuosisata",
"Century",
new String[] { });
}
public static void addDecadeTopic(TopicMap tm, Topic t, String year) throws TopicMapException {
String decade = year.substring(0,3) + "0-luku";
String decadeENName = year.substring(0,3) + "0s";
String decadesi = "http://www.fng.fi/wandora/wandora-fng.xtm#" + decade;
Topic decadeTopic = tm.getTopic(decadesi);
if(decadeTopic == null) {
createTopic(tm, decadesi, decade, decade, decadeENName, new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#vuosikymmen", "http://www.fng.fi/wandora/wandora-fng.xtm#kp-ajoitus" });
decadeTopic = tm.getTopic(decadesi);
}
if(decadeTopic != null) {
Topic centuryTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#vuosisata");
if(decadeTopic.getTypes().contains(centuryTopic)) decadeTopic.removeType(centuryTopic);
decadeTopic.addType(tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#kp-ajoitus"));
decadeTopic.addType(tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#vuosikymmen"));
t.addType(decadeTopic);
if(decadeTopic.getTypes().contains(decadeTopic)) decadeTopic.removeType(decadeTopic);
System.out.println(" Added decade type: " + decadeTopic.getBaseName());
}
addCenturyTopic(tm, decadeTopic, decade);
}
public static void addCenturyTopic(TopicMap tm, Topic t, String year) throws TopicMapException {
String century = year.substring(0,2) + "00-luku";
String centuryENName = (Integer.parseInt(year.substring(0,2)) + 1) + "th century";
String centurysi = "http://www.fng.fi/wandora/wandora-fng.xtm#century_" + century;
Topic centuryTopic = tm.getTopic(centurysi);
if(centuryTopic == null) {
createTopic(tm, centurysi, century + " (vuosisata)", century, centuryENName, new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#vuosisata", "http://www.fng.fi/wandora/wandora-fng.xtm#kp-ajoitus" });
centuryTopic = tm.getTopic(centurysi);
}
if(centuryTopic != null) {
centuryTopic.addType(tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#vuosisata"));
centuryTopic.addType(tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#kp-ajoitus"));
t.addType(centuryTopic);
System.out.println(" Added century type: " + centuryTopic.getBaseName());
}
}
public static void addMonthTopic(TopicMap tm, Topic t, String month) throws TopicMapException {
Topic monthTopic = null;
if("01".equals(month)) monthTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#tammikuu");
else if("02".equals(month)) monthTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#helmikuu");
else if("03".equals(month)) monthTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#maaliskuu");
else if("04".equals(month)) monthTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#huhtikuu");
else if("05".equals(month)) monthTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#toukokuu");
else if("06".equals(month)) { try { monthTopic = tm.getTopic(URLEncoder.encode("http://www.fng.fi/wandora/wandora-fng.xtm#kesakuu", "UTF-8")); } catch (Exception e) {}}
else if("07".equals(month)) { try { monthTopic = tm.getTopic(URLEncoder.encode("http://www.fng.fi/wandora/wandora-fng.xtm#heinakuu", "UTF-8")); } catch (Exception e) {}}
else if("08".equals(month)) monthTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#elokuu");
else if("09".equals(month)) monthTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#syyskuu");
else if("10".equals(month)) monthTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#lokakuu");
else if("11".equals(month)) monthTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#marraskuu");
else if("12".equals(month)) monthTopic = tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#joulukuu");
if(monthTopic != null) {
t.addType(monthTopic);
System.out.println(" Added month type: " + monthTopic.getBaseName());
}
}
public static void addYearTopic(TopicMap tm, Topic t, String year) throws TopicMapException {
String yearsi = "http://www.fng.fi/wandora/wandora-fng.xtm#" + year;
Topic yearTopic = tm.getTopic(yearsi);
if(yearTopic == null) {
createTopic(tm, yearsi, year, year, new String[] { "http://www.fng.fi/wandora/wandora-fng.xtm#kp-ajoitus" });
yearTopic = tm.getTopic(yearsi);
}
if(yearTopic != null) {
yearTopic.addType(tm.getTopic("http://www.fng.fi/wandora/wandora-fng.xtm#kp-ajoitus"));
t.addType(yearTopic);
System.out.println(" Added year type: " + yearTopic.getBaseName());
}
addDecadeTopic(tm, yearTopic, year);
addCenturyTopic(tm, yearTopic, year);
}
// *************************************************************************
// *************************************************************************
// *************************************************************************
// simple way to get milliseconds of the specified time (use to set expiration)
public static void main(String args[]) throws Exception {
TopicMap tm=new org.wandora.topicmap.memory.TopicMapImpl();
InputStream in=new FileInputStream(args[0]);
tm.importXTM(in);
in.close();
FixTimeApellations.process(tm);
OutputStream out=new FileOutputStream(args[1]);
tm.exportXTM(out);
out.close();
}
}
|
Anisorf/ENCODE
|
encode/src/org/wandora/application/tools/fng/FixTimeApellations.java
|
Java
|
gpl-3.0
| 30,665
|
/*
* This file is part of rpgmapper.
* See the LICENSE file for the software license.
* (C) Copyright 2018-2019, Oliver Maurhart, dyle71@gmail.com
*/
#ifndef RPGMAPPER_MODEL_ATLAS_POINTER_HPP
#define RPGMAPPER_MODEL_ATLAS_POINTER_HPP
#include <QSharedPointer>
namespace rpgmapper::model {
// fwd
class Atlas;
/**
* A smart pointer to a single atlas.
*/
using AtlasPointer = QSharedPointer<Atlas>;
}
#endif
|
dyle/rpgmapper
|
include/rpgmapper/atlas_pointer.hpp
|
C++
|
gpl-3.0
| 424
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ"
crossorigin="anonymous">
<title>Elm App</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
</body>
</html>
|
jleahred/dwd
|
src/elm.bs/public/index.html
|
HTML
|
gpl-3.0
| 998
|
import plt, ipp
import os, string
print "Starting try-trace.py: dir() = %s" % dir()
# try-trace.py: test program for pypy plt
print "- - - - -"
print "NO_COMRESSION = %d" % plt.NO_COMPRESSION
#base = "/Users/jbro111" # OSX
base = "/home/nevil" # Ubuntu
#fn = "pypy/small-sample.erf"
#fn = "tcp-analyse/fdt-p5.pcap"
#fn = "pypy/small-sample.pcap"
fn = "pypy/1000packets.pcap.gz"
full_fn = base + '/' + fn
print "%s: isfile %s" % (full_fn, os.path.isfile(full_fn))
#try:
# with open(full_fn) as file:
# print "File opened OK"
# file.close()
#except IOError as e:
# print "Unable to open file" #Does not exist OR no read permissions
trace_format = "pcapfile"
#trace_format = "erf"
uri = trace_format + ':' + full_fn
print ">> uri = %s" % uri
t = plt.trace(uri)
t.start()
test_dict = {}
def print_first(s, n):
for x in range(n):
if x%8 == 0:
print "",
print "%02x" % ord(s[x]),
for n,pkt in enumerate(t):
ip = pkt.ip
print "--- n=%d ---" % n
print "pkt linktype %d, ethertype %04x, vlan_id %d" % (
pkt.linktype, pkt.ethertype, pkt.vlan_id)
print "ip.seconds = %.6f, ip.ts_sec = %d, ip.time = %s" % (
ip.seconds, ip.ts_sec, ip.time)
print "ip.erf_time = %s" % ip.erf_time
print "ip.wire_len = %s, ip.capture_len = %s, direction = %s" % (
ip.wire_len, ip.capture_len, ip.direction)
ba = ip.data
print "@@ 1 @@ ba = %s" % ba
print "IP.data:",
for b in ba:
print "%02x" % b, # ba[x],
print
sa = ip.src_prefix; da = ip.dst_prefix
print "*** %s -> %s" % (sa, da)
print "sa.addr = %s" % sa.addr[0:4]
for v in sa.addr:
print "%02x" % v,
print
print "- - - - -"
bsa = bytearray(sa.addr)
for v in bsa:
print "%02x" % v,
print
print "ba = %s" % plt.ipp.IPprefix(4, bsa)
# If we import plt, ipp above, we couild say ipp.IPprefix here
print "= = = = ="
#exit()
s = str(sa.addr) + '|' + str(da.addr) # Have to convert to str explicitly
print "*** %s -> %s %s" % (sa, da, s)
print_first(s, 9)
print " ident = %04x" % ip.ident
v = test_dict.get(s)
if not v:
test_dict[s] = 1
else:
test_dict[s] = v+1
if n == 0: # Zero-org
break
print "EOF - - -"
#exit()
def ca2str(cdata_array):
s = string.join(cdata_array, '')
n = string.find(s, '\x00')
return s[0:n]
keys = sorted(test_dict)
for k in keys:
print "%8d %s" % (test_dict[k], k)
ka = k.split('*')
for j in range(0,4):
print "%02x" % ord(ka[0][j]),
print
psa = ipp.IPprefix(4, bytearray(ka[0]))
print "psa = %s" % psa
print "%8d %s -> %s" % (test_dict[k],
ka[0], ka[1])
|
nevil-brownlee/pypy-libtrace
|
lib/natkit/try-dict.py
|
Python
|
gpl-3.0
| 2,776
|
#!/usr/bin/env node
//
// Written by Maarten Thibaut.
// Released under the GPL.
//
var
argv = require('optimist')
.usage('Usage: $0 -f file [-v var]')
.demand(['f'])
.argv,
fs = require('fs');
function parseCsvFile(fileName, callback_data, callback_close){
var stream = fs.createReadStream(fileName)
var iteration = 0, header = [], buffer = ""
// You may need to change the pattern to suit your needs
//var pattern = /(?:^|;)("(?:[^"]+)*"|[^;]*)/g
var pattern = /;/g;
stream.addListener('close', callback_close);
stream.addListener('data', function(data){
//console.log(data.toString());
// Ensure we can handle \r\n as well as \n returns in files
buffer+=data.toString().replace('\r\n','\n');
var parts = buffer.split('\n')
//console.log("parts: " + parts);
parts.forEach(function(d, i){
// Skip empty lines
if(d.length) {
//console.log("part nr " + i + ": " + d);
if(iteration++ == 0 && i == 0){
header = d.split(pattern)
}else{
callback_data(buildRecord(d))
}
}
})
buffer = parts[parts.length-1]
})
function buildRecord(str){
//console.log(str);
var record = {};
str.split(pattern).forEach(function(value, index){
if(header[index] != '')
record[header[index].toLowerCase()] = value.replace(/"/g, '')
})
return record
}
}
// Main program, implemented asynchronously
var line = 0;
var records = [];
parseCsvFile(argv.f,
function(data) {
// called when there is a row of data
records[line++] = data;
},
function() {
// called on close
var varname = "", semicolon = "";
if(argv.v) {
varname = argv.v + " = ";
semicolon = ";";
}
console.log(varname + JSON.stringify(records, null, 4) + semicolon);
}
);
|
mthibaut/csv2json
|
csv2json.js
|
JavaScript
|
gpl-3.0
| 1,822
|
img.svgbutton {
border: 1px solid silver;
background-color: #F0F0F0;
// border-color: black;
cursor: pointer;
border-radius: 2pt;
padding: 1pt;
margin: 0px;
width: 16pt;
}
img.svgbutton_s {
border: 1px solid silver;
background-color: #F0F0F0;
// border-color: black;
border-radius: 3px;
padding: 3px;
margin: 0px;
cursor: pointer;
width: 16px;
}
img.svgsubbutton {
border: 1px solid silver;
background-color: #F0F0F0;
// border-color: black;
border-radius: 5px;
padding: 0px 5px;
margin: 0px;
cursor: pointer;
width: 24px;
}
img.svgimg {
cursor: pointer;
width: 16pt;
padding: 0;
margin: 0;
}
img.svgimg_s {
cursor: pointer;
width: 12pt;
padding: 0;
}
button.plain {
border: 1px solid silver;
background-color: #F0F0F0;
cursor: pointer;
border-radius: 2pt;
padding: 0 2pt;
margin: 0;
//color: none;
//height: 24px;
}
button.plain_big {
border: 1px solid silver;
background-color: #F0F0F0;
cursor: pointer;
border-radius: 5pt;
padding: 10pt;
margin: 0;
//color: none;
//height: 24px;
}
button.plain_mid {
border: 1px solid silver;
background-color: #F0F0F0;
cursor: pointer;
border-radius: 2pt;
padding: 3pt 5pt;
margin: 0;
//color: none;
//height: 24px;
}
//path {
//width: 16pt;
//height: 16pt;
//fill: red;
//background-color: yellow;
//}
|
tieugene/kupa
|
static/css/svgbutton.css
|
CSS
|
gpl-3.0
| 1,307
|
/*
* Copyright (c) 2003-2006, University of Maryland
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided
* that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list of conditions
* and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions
* and the following disclaimer in the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of the University of Maryland nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Piccolo was written at the Human-Computer Interaction Laboratory www.cs.umd.edu/hcil by Jesse Grosjean
* and ported to C# by Aaron Clamage under the supervision of Ben Bederson. The Piccolo website is
* www.cs.umd.edu/hcil/piccolo.
*/
using System;
using System.Collections;
using UMD.HCIL.Piccolo;
namespace UMD.HCIL.Piccolo.Util {
/// <summary>
/// <b>PCameraList</b> is a typesafe list of PCamera objects.
/// </summary>
/// <remarks>
/// This class is used by <see cref="PLayer"/> to maintain a list of the
/// cameras viewing that layer. See <see cref="PLayer.CamerasReference">
/// PLayer.CamerasReference</see>.
/// </remarks>
[Serializable]
public class PCameraList : CollectionBase {
/// <summary>
/// Constructs a new PCameraList.
/// </summary>
public PCameraList() {
}
/// <summary>
/// Initializes a new instance of the PCameraList class that contains cameras copied
/// from the specified list and that has the same initial capacity as the number
/// of cameras copied.
/// </summary>
/// <param name="list">The list whose cameras are copied to the new list.</param>
public PCameraList(PCameraList list) {
foreach(PCamera camera in list) {
List.Add(camera);
}
}
/// <summary>
/// Determines whether the list contains a specific camera.
/// </summary>
/// <param name="camera">The camera to locate in the list.</param>
/// <returns>
/// True if the camera is found in the list; otherwise, false.
/// </returns>
public bool Contains(PCamera camera) {
return List.Contains(camera);
}
/// <summary>
/// Determines the index of a specific camera in the list.
/// </summary>
/// <param name="camera">The camera to locate in the list.</param>
/// <returns>
/// The index of the camera if found in the list; otherwise, -1.
/// </returns>
public int IndexOf(PCamera camera) {
return List.IndexOf(camera);
}
/// <summary>
/// Adds a camera to the list.
/// </summary>
/// <param name="camera">The camera to add.</param>
/// <returns>The position into which the new camera was inserted.</returns>
public int Add(PCamera camera) {
return List.Add(camera);
}
/// <summary>
/// Adds the cameras of the given list to the end of this list.
/// </summary>
/// <param name="list">
/// The list whose cameras should be added to the end of this list.
/// </param>
public void AddRange(PCameraList list) {
InnerList.AddRange(list);
}
/// <summary>
/// Removes a range of cameras from the list.
/// </summary>
/// <param name="index">
/// The zero-based starting index of the range of cameras to remove.
/// </param>
/// <param name="count">
/// The number of cameras to remove.
/// </param>
public void RemoveRange(int index, int count) {
InnerList.RemoveRange(index, count);
}
/// <summary>
/// Removes the first occurrence of a specific camera from the list.
/// </summary>
/// <param name="camera">The camera to remove from the list.</param>
public void Remove(PCamera camera) {
List.Remove(camera);
}
/// <summary>
/// Inserts a camera to the list at the specified position.
/// </summary>
/// <param name="index">
/// The zero-based index at which the camera should be inserted.
/// </param>
/// <param name="camera">The camera to insert into the list.</param>
public void Insert(int index, PCamera camera) {
List.Insert(index, camera);
}
/// <summary>
/// Sorts the cameras in the entire list using the specified comparer.
/// </summary>
/// <param name="comparer">
/// The IComparer implementation to use when comparing elements,
/// or a null reference to use the IComparable implementation of
/// each camera.
/// </param>
public void Sort(IComparer comparer) {
InnerList.Sort(comparer);
}
/// <summary>
/// Allows a PCameraList to be indexed directly to access it's children.
/// </summary>
public PCamera this[int index] {
get { return (PCamera)List[index]; }
set { List[index] = value; }
}
}
}
|
ME3Explorer/ME3Explorer
|
Piccolo/Piccolo/Util/PCameraList.cs
|
C#
|
gpl-3.0
| 5,626
|
package micdoodle8.mods.galacticraft.core.client.render.block;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
public class BlockRendererMeteor implements ISimpleBlockRenderingHandler
{
final int renderID;
public BlockRendererMeteor(int var1)
{
this.renderID = var1;
}
@Override
public boolean renderWorldBlock(IBlockAccess var1, int var2, int var3, int var4, Block var5, int var6, RenderBlocks var7)
{
this.renderBlockMeteor(var7, var5, var1, var2, var3, var4);
return true;
}
@Override
public boolean shouldRender3DInInventory(int modelId)
{
return true;
}
@Override
public int getRenderId()
{
return this.renderID;
}
public static void renderInvNormalBlock(RenderBlocks var0, Block var1, int var2)
{
var0.setRenderBounds(0.2F, 0.2F, 0.2F, 0.8F, 0.8F, 0.8F);
BlockRendererMeteor.renderStandardBlock(var0, var1, var2);
var0.setRenderBounds(0.52F, 0.85F, 0.4F, 0.68F, 0.88F, 0.6F);
BlockRendererMeteor.renderStandardBlock(var0, var1, var2);
var0.setRenderBounds(0.25F, 0.8F, 0.25F, 0.75F, 0.85F, 0.75F);
BlockRendererMeteor.renderStandardBlock(var0, var1, var2);
var0.setRenderBounds(0.25F, 0.15F, 0.25F, 0.75F, 0.2F, 0.75F);
BlockRendererMeteor.renderStandardBlock(var0, var1, var2);
var0.setRenderBounds(0.15F, 0.3F, 0.25F, 0.2F, 0.7F, 0.75F);
BlockRendererMeteor.renderStandardBlock(var0, var1, var2);
var0.setRenderBounds(0.8F, 0.3F, 0.25F, 0.85F, 0.7F, 0.75F);
BlockRendererMeteor.renderStandardBlock(var0, var1, var2);
var0.setRenderBounds(0.25F, 0.3F, 0.15F, 0.75F, 0.7F, 0.2F);
BlockRendererMeteor.renderStandardBlock(var0, var1, var2);
var0.setRenderBounds(0.25F, 0.3F, 0.8F, 0.75F, 0.7F, 0.85F);
BlockRendererMeteor.renderStandardBlock(var0, var1, var2);
var0.clearOverrideBlockTexture();
}
private static void renderStandardBlock(RenderBlocks var0, Block var1, int var2)
{
GL11.glPushMatrix();
final Tessellator var3 = Tessellator.instance;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
var3.startDrawingQuads();
var3.setNormal(0.0F, -1.0F, 0.0F);
var0.renderFaceYNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(0, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 1.0F, 0.0F);
var0.renderFaceYPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(1, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, -1.0F);
var0.renderFaceXPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(2, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(0.0F, 0.0F, 1.0F);
var0.renderFaceXNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(3, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(-1.0F, 0.0F, 0.0F);
var0.renderFaceZNeg(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(4, var2));
var3.draw();
var3.startDrawingQuads();
var3.setNormal(1.0F, 0.0F, 0.0F);
var0.renderFaceZPos(var1, 0.0D, 0.0D, 0.0D, var1.getIcon(5, var2));
var3.draw();
GL11.glPopMatrix();
}
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
{
BlockRendererMeteor.renderInvNormalBlock(renderer, block, metadata);
}
public void renderBlockMeteor(RenderBlocks renderBlocks, Block par1Block, IBlockAccess var1, int par2, int par3, int par4)
{
final int var5 = var1.getBlockMetadata(par2, par3, par4);
final int var6 = var5 & 3;
if (var6 == 0)
{
renderBlocks.uvRotateTop = 3;
}
else if (var6 == 3)
{
renderBlocks.uvRotateTop = 1;
}
else if (var6 == 1)
{
renderBlocks.uvRotateTop = 2;
}
renderBlocks.setRenderBounds(0.2F, 0.2F, 0.2F, 0.8F, 0.8F, 0.8F);
renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);
renderBlocks.setRenderBounds(0.52F, 0.85F, 0.4F, 0.68F, 0.88F, 0.6F);
renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);
renderBlocks.setRenderBounds(0.25F, 0.8F, 0.25F, 0.75F, 0.85F, 0.75F);
renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);
renderBlocks.setRenderBounds(0.25F, 0.15F, 0.25F, 0.75F, 0.2F, 0.75F);
renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);
renderBlocks.setRenderBounds(0.15F, 0.3F, 0.25F, 0.2F, 0.7F, 0.75F);
renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);
renderBlocks.setRenderBounds(0.8F, 0.3F, 0.25F, 0.85F, 0.7F, 0.75F);
renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);
renderBlocks.setRenderBounds(0.25F, 0.3F, 0.15F, 0.75F, 0.7F, 0.2F);
renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);
renderBlocks.setRenderBounds(0.25F, 0.3F, 0.8F, 0.75F, 0.7F, 0.85F);
renderBlocks.renderStandardBlock(par1Block, par2, par3, par4);
renderBlocks.setRenderBounds(0.12F, 0.12F, 0.12F, 0.88F, 0.88F, 0.88F);
renderBlocks.clearOverrideBlockTexture();
par1Block.setBlockBoundsForItemRender();
renderBlocks.uvRotateTop = 0;
}
}
|
4Space/4Space-5
|
src/main/java/micdoodle8/mods/galacticraft/core/client/render/block/BlockRendererMeteor.java
|
Java
|
gpl-3.0
| 5,665
|
<?php /* Smarty version Smarty-3.1.19, created on 2016-06-17 10:59:51
compiled from "C:\xampp\htdocs\joyeria\themes\default-bootstrap\modules\blockuserinfo\blockuserinfo.tpl" */ ?>
<?php /*%%SmartyHeaderCode:860857641e770aca77-94697267%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
'file_dependency' =>
array (
'b5deaf228af9b467faf0fe1e8a880cbefd47f32b' =>
array (
0 => 'C:\\xampp\\htdocs\\joyeria\\themes\\default-bootstrap\\modules\\blockuserinfo\\blockuserinfo.tpl',
1 => 1460131476,
2 => 'file',
),
),
'nocache_hash' => '860857641e770aca77-94697267',
'function' =>
array (
),
'has_nocache_code' => false,
'version' => 'Smarty-3.1.19',
'unifunc' => 'content_57641e770b08e1_19807177',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_57641e770b08e1_19807177')) {function content_57641e770b08e1_19807177($_smarty_tpl) {?><?php }} ?>
|
JeanMarsUltor/j
|
cache/smarty/compile/b5/de/af/b5deaf228af9b467faf0fe1e8a880cbefd47f32b.file.blockuserinfo.tpl.php
|
PHP
|
gpl-3.0
| 995
|
<!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>Zece la bac</title>
<script type="text/javascript" src="https://cmocanu.github.io/zecelabac//js/script.js">
</script>
<link rel="stylesheet" type="text/css" href="https://cmocanu.github.io/zecelabac//css/style.css">
</head>
<body>
<div id="leftbar">
<h1 id="title">Zece la bac</h1>
<nav>
<ul id="navbar">
<li><a href="https://cmocanu.github.io/zecelabac//index.html">Despre noi</a></li>
<li><a href="https://cmocanu.github.io/zecelabac//index.html">Lectii</a></li>
<li><a href="https://cmocanu.github.io/zecelabac//home/probleme_rezolvate">Probleme rezolvate</a></li>
<li><a href="https://cmocanu.github.io/zecelabac//index.html">Formule</a></li>
</ul>
</nav>
</div>
<div id="rightbar">
<br>
<div id="content">
<h1 id="ce-este-zece-la-bac">Ce este Zece la bac?</h1>
<p>Zece la bac este un site care isi propune sa devina o resursa valoroasa in pregatirea pentru examenul de bacalaureat la matematica. Este o lipsa acuta de materiale educative de calitate in mediul online pentru invatamantul romanesc ceea ce face foarte dificil pentru elevii care au ramas in urma, fie din cauza unui profesor slab, fie din lipsa de interes, sa recupereze si sa promoveze bacul cu o nota buna.</p>
<h2 id="cum">Cum?</h2>
<p>Prin intelegerea conceptelor fundamentale si aplicarea lor in probleme.</p>
<h2 id="cine">Cine?</h2>
<p>Siteul este facut de mine, Cristian Mocanu, dintr-o lipsa de ocupatie. Am luat nota $10$ la bac la matematica in $2012$.</p>
<p>Mi-as dori ca siteul sa devina un efort al comunitatii, mai ales celei de elevi de clasa a $12$a, pentru ca este nevoie de foarte mult continut.</p>
<h2 id="cum-contribui">Cum contribui?</h2>
<p>Continutul este scris intr-o combinatie de markdown si latex. Am scris un mic ghid (<a href="https://stackedit.io/editor#!provider=couchdb&id=jJbnPy6vquNmyZnOFrxksdlb">click me</a>) despre cum este scris un post.</p>
<p>Pentru contributii la site (cod sau continut) ma puteti contacta la mocanu.cristian93@gmail.com.</p>
</div>
</div>
</body>
</html>
|
cmocanu/zecelabac
|
public/home/despre/index.html
|
HTML
|
gpl-3.0
| 2,278
|
//
// Generated by the J2ObjC translator. DO NOT EDIT!
// source: ../pdfreporter-extensions/src/org/oss/pdfreporter/uses/org/oss/jshuntingyard/evaluator/interpreter/Evaluator.java
//
#include "J2ObjC_header.h"
#pragma push_macro("INCLUDE_ALL_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator")
#ifdef RESTRICT_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator
#define INCLUDE_ALL_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator 0
#else
#define INCLUDE_ALL_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator 1
#endif
#undef RESTRICT_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator
#if !defined (OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator_) && (INCLUDE_ALL_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator || defined(INCLUDE_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator))
#define OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator_
@protocol JavaUtilCollection;
@protocol OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorFunctionElement;
@protocol OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorFunctionElementArgument;
@protocol OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterVariable;
@interface OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator : NSObject
#pragma mark Public
- (instancetype)init;
- (instancetype)initWithNSString:(NSString *)evalExpression;
- (void)addFunctionWithOrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorFunctionElement:(id<OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorFunctionElement>)function;
- (void)addFunctionsWithJavaUtilCollection:(id<JavaUtilCollection>)functions;
- (void)bindVariableWithOrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterVariable:(id<OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterVariable>)variable;
- (id<OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorFunctionElementArgument>)evaluate;
- (void)parseWithNSString:(NSString *)evalExpression;
@end
J2OBJC_STATIC_INIT(OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator)
FOUNDATION_EXPORT void OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator_initWithNSString_(OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator *self, NSString *evalExpression);
FOUNDATION_EXPORT OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator *new_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator_initWithNSString_(NSString *evalExpression) NS_RETURNS_RETAINED;
FOUNDATION_EXPORT OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator *create_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator_initWithNSString_(NSString *evalExpression);
FOUNDATION_EXPORT void OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator_init(OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator *self);
FOUNDATION_EXPORT OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator *new_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator_init() NS_RETURNS_RETAINED;
FOUNDATION_EXPORT OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator *create_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator_init();
J2OBJC_TYPE_LITERAL_HEADER(OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator)
#endif
#pragma pop_macro("INCLUDE_ALL_OrgOssPdfreporterUsesOrgOssJshuntingyardEvaluatorInterpreterEvaluator")
|
OpenSoftwareSolutions/PDFReporterKit
|
PDFReporterKit/Sources/org/oss/pdfreporter/uses/org/oss/jshuntingyard/evaluator/interpreter/Evaluator.h
|
C
|
gpl-3.0
| 3,582
|
function print(...) --just to put a \n at the end :D
local ar = {...}
for _, v in ipairs(ar) do
if (type(v) == "string") then
io.write(v)
io.write(" ")
elseif (type(v) == "number" or type(v) == "boolean") then
io.write(tostring(v))
io.write(" ")
else
io.write(type(v))
io.write(" ")
end
end
io.write("\n")
end
methodsPath = "methods.lua"
function loadBot()
started = false
package.loaded = nil
crons = {}
print("Loading the bot...")
loadfile("shim.lua")()
_methods = loadfile(methodsPath)
if not io.open("bot/bot.lua") then
loadfile("bot/_bot.lua")()
else
loadfile("bot/bot.lua")()
end
print("Bot loaded!")
end
--Loading initial values
started = false
crons = {}
if os.execute("mediainfo -h") then
useMediaInfo = true
mediainfo = loadfile("mediainfo.lua")()
end
if not started then
print("Starting...")
loadBot()
end
|
giuseppeM99/madeline_lua_shim
|
start.lua
|
Lua
|
gpl-3.0
| 917
|
/***
* Cloudstreetmarket.com is a Spring MVC showcase application developed
* with the book Spring MVC Cookbook [PACKT] (2015).
* Copyright (C) 2015 Alex Bretet
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
**/
package org.springframework.social.yahoo.module;
import java.io.Serializable;
public enum ChartType implements Serializable{
INTRADAY("t"),
HISTO("z");
private String tag;
ChartType(String tag){
this.tag = tag;
}
public String getTag() {
return tag;
}
public void setTag(String tag) {
this.tag = tag;
}
}
|
alex-bretet/cloudstreetmarket.com
|
zipcloud-parent/zipcloud-core/src/main/java/org/springframework/social/yahoo/module/ChartType.java
|
Java
|
gpl-3.0
| 1,200
|
---
title: "ज्ञानपीठ पुरस्कार से सम्मानित लेखिका कृष्मा सोबती का निधन"
layout: item
category: ["india"]
date: 2019-01-25T06:51:02.378Z
image: 1548399062377krisna-sobti.jpg
---
<p>नई दिल्ली: हिंदी साहित्य की मशहूर लेखिका कृष्णा सोबती का निधन हो गया। कृष्णा सोबती 93 साल की थी। लंबी बीमारी के बाद शुक्रवार की सुबह एक निजी अस्पताल में निधन हो गया है। ज्ञानपीठ पुरस्कार से सम्मानित लेखिका कृष्मा सोबती का जन्म 18 फरवरी 1925 को वर्तमान पाकिस्तान के एक कस्बे में हुआ था।</p>
<p>कृष्णा सोबती के उपन्यास ऐ लड़की और मित्रो मरजानी को हिन्दी साहित्य की सर्वश्रेष्ठ रचनाओं में शुमार किया जाता है। </p>
<p>कृष्णा सोबती हिंदी की सुप्रसिद्ध लेखिकाओं में से एक हैं। उन्हें 1980 में साहित्य अकादमी पुरस्कार और 1996 में साहित्य अकादमी अध्येतावृत्ति से सम्मानित किया गया है। </p>
<p>साल 2017 में कृष्णा सोबती को साहित्य के क्षेत्र में दिया जाने वाला देश का सर्वोच्च सम्मान ज्ञानपीठ पुरस्कार से नवाजा गया। इसके अलावा, कृष्णा सोबती को उनके उपन्यास ‘जिंदगीनामा’ के लिए साल 1980 का साहित्य अकादमी पुरस्कार मिला था। उन्हें 1996 में अकादमी के उच्चतम सम्मान ‘साहित्य अकादमी फैलोशिप’ से नवाजा गया था। इसके अलावा कृष्णा सोबती को पद्मभूषण, व्यास सम्मान, शलाका सम्मान से भी नवाजा जा चुका है।</p>
|
InstantKhabar/_source
|
_source/news/2019-01-25-krisna-sobti.html
|
HTML
|
gpl-3.0
| 2,779
|
/*
* Copyright (C) 2003-2022 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
* WeeChat is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* WeeChat is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeeChat. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef WEECHAT_PLUGIN_XFER_INFO_H
#define WEECHAT_PLUGIN_XFER_INFO_H
extern void xfer_info_init ();
#endif /* WEECHAT_PLUGIN_XFER_INFO_H */
|
weechat/weechat
|
src/plugins/xfer/xfer-info.h
|
C
|
gpl-3.0
| 920
|
/*
* @author: jelathro
* @date: 10/24/13
*
* Singly linked list (as compared
* to a doubly linked or indexed
* list) that contains generic items
* called ListItem_t.
*/
#ifndef __LIST_H__
#define __LIST_H__
#include "ListItem.h"
typedef struct List_t{
ListItem_t * head;
} List_t;
/*
* Given list, Creates a new empty List_t and
* returns its reference.
*/
List_t list_initialize();
/*
* Given list, Creates a new ListItem_t and adds
* it to the end of the List_t. This
* returns an int accordingly if
* successful or not.
*/
int list_add_item(List_t *, ListItem_t *);
/*
* Given list, Creates a new ListItem_t and adds
* it after the index given. This returns
* an int accordingly if successful
* or not.
*/
int list_add_item_after(List_t *, int, ListItem_t *);
/*
* Given list, Creates a new ListItem_t and adds
* it before the index given. This returns
* an int accordingly if successful
* or not.
*/
int list_add_item_before(List_t *, int, ListItem_t *);
/*
* Given list, Free's and removes head from
* the List_t.
*/
int list_remove_item_head(List_t *, list_item_remove_callback_func);
/*
* Given list, Free's and removes tail from
* List_t.
*/
int list_remove_item_tail(List_t *, list_item_remove_callback_func);
/*
* Given list, Free's and removes ListItem_t
* and updates list "hole".
*/
int list_remove_item_at(List_t *, int, list_item_remove_callback_func);
/*
* Given list, Free's and removes list
* and returns int according to success.
*/
int list_remove(List_t *, list_item_remove_callback_func);
/*
* Given list and callback function, list
* will loop through all LitItem_t's and
* call the function for it.
*/
int list_for_each(List_t *, list_item_callback_func);
/*
* Given list and index to find and
* return ListItem_t data (void *).
*/
void * list_get_at(List_t *, int);
/*
* Given list and index to find and
* set ListItem_t data (void *),
* returns int on success accordingly.
*/
int list_set_at(List_t *, void *, int);
#endif
|
Eddyding/C
|
C-master/List/List.h
|
C
|
gpl-3.0
| 2,040
|
package com.android.toorcomp;
import java.io.File;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import org.osmdroid.util.GeoPoint;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Environment;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.android.toorcomp.mail.GMailSender;
import com.android.toorcomp.mail.MailObject;
//import com.android.toorcomp.Map.InnerLocationListener;
public class New_request extends Base_Activity {
private static int PICK_IMAGE = 0;
private LocationManager InnerLocationManager;
private LocationListener InnerLocationListener;
// ---- mail params
public boolean delete_Mail = false;
public String mail_param_Date;
public String mail_param_ShortDesc;
public String mail_param_Category;
public String mail_param_Description;
public String mail_param_TelNumber;
public String mail_param_ImageFile;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
getActionBar().show();
setContentView(R.layout.new_request);
@SuppressWarnings("unused")
final GPSTracker mGPS = new GPSTracker(this);
final TextView descText = (TextView) findViewById(R.id.editText2);
final TextView shortDes = (TextView) findViewById(R.id.editText1);
final TextView photoTextView = (TextView) findViewById(R.id.photo);
final Spinner forSelector = (Spinner) findViewById(R.id.spinner1);
// ------------- Clear description text -------------------
shortDes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
shortDes.setText("");
}
});
descText.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
descText.setText("");
}
});
Button button2 = (Button) findViewById(R.id.button2);
button2.setOnClickListener(new android.view.View.OnClickListener() {
public void onClick(View v) {
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
New_request.this);
// set title
alertDialogBuilder
.setTitle("ÈÝëåôå íá ÷ñçóéìïðïéçèåß ç ôñÝ÷ïõóá èÝóç óáò");
// set dialog message
alertDialogBuilder
.setMessage("ÅéóáãùãÞ ôñÝ÷ïõóáò èÝóçò")
.setCancelable(false)
.setPositiveButton("ÍÜé",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
// --------------------------GPS--------------------------------------
final GPSTracker mGPS = new GPSTracker(
New_request.this);
// If gps enabled
if (mGPS.canGetLocation) {
// if GPS is ready
if (mGPS.getLatitude() != 0) {
descText.append("\n ÈÝóç : http://www.google.com/maps/place/"
+ mGPS.getLatitude()
+ ","
+ mGPS.getLongitude()
+ "/@"
+ mGPS.getLatitude()
+ ","
+ mGPS.getLongitude()
+ "17z");
/*
* descText.append("Lat=" +
* mGPS.getLatitude() + "Lon=" +
* mGPS.getLongitude());
*/
} else {
LocationManager mlocManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
LocationListener mlocListener = new MyLocationListener(
New_request.this);
mlocManager
.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
0, 0,
mlocListener);
InnerLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
InnerLocationListener = new InnerLocationListener();
InnerLocationManager
.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
0, 0,
InnerLocationListener);
/*
* descText.append("Lat=" +
* mGPS.getLatitude() + "Lon=" +
* mGPS.getLongitude());
*/
}
} else
mGPS.showSettingsAlert();
}
})
.setNegativeButton("×Üñôçò",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,
int id) {
dialog.cancel();
Intent intent = new Intent(
getApplicationContext(),
Selector_map.class);
startActivityForResult(intent, 1);
// startActivity(intent);
}
});
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
});
Button button3 = (Button) findViewById(R.id.button3);
button3.setOnClickListener(new android.view.View.OnClickListener() {
public void onClick(View v) {
TextView shortDes = (TextView) findViewById(R.id.editText1);
shortDes.setText("");
TextView descText = (TextView) findViewById(R.id.editText2);
descText.setText("");
}
});
// --------------- send request -----------------------------------
Button button4 = (Button) findViewById(R.id.send);
button4.setOnClickListener(new android.view.View.OnClickListener() {
@SuppressLint("SimpleDateFormat")
public void onClick(View v) {
// --------- set email params
Context mAppContext = New_request.this.getApplicationContext();
TelephonyManager tMgr = (TelephonyManager) mAppContext
.getSystemService(Context.TELEPHONY_SERVICE);
String mPhoneNumber = tMgr.getLine1Number();
Calendar c = Calendar.getInstance();
SimpleDateFormat df = new SimpleDateFormat("dd-MMM-yyyy");
String fDate = df.format(c.getTime());
mail_param_Date = fDate;
mail_param_ShortDesc = shortDes.getText().toString();
mail_param_Category = forSelector.getSelectedItem().toString();
mail_param_Description = descText.getText().toString();
mail_param_TelNumber = mPhoneNumber;
mail_param_ImageFile = photoTextView.getText().toString();
if (isNetworkAvailable()) {
// ----- start async task to send email
mailSendingTask what = new mailSendingTask(null);
what.execute();
} else
{
// ------ if no internet connection
// ------ store request for future
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(
New_request.this);
// set title
alertDialogBuilder
.setTitle("ÄÝí õðÜñ÷åé óýíäåóç óôï Äéáäßêôõï.. ");
// set dialog message
alertDialogBuilder
.setMessage(
"ÈÝëåôå íá ãßíåé áðïèÞêåõóç ôçò áßôçóçò ãéá ìåëïíôéêÞ áðïóôïëÞ")
.setCancelable(false)
.setPositiveButton("Íáß",
new DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog, int id) {
Context mAppContext = New_request.this
.getApplicationContext();
MailObject sMail = new MailObject(
mail_param_ShortDesc,
mail_param_Category,
mail_param_Description,
mail_param_ImageFile,
mail_param_TelNumber);
if (sMail.Write_To_Sd()) {
Toast.makeText(mAppContext,
"¸ãéíå áðïèÞêåõóç",
Toast.LENGTH_LONG)
.show();
} else {
Toast.makeText(mAppContext,
"ÓöÜëìá áðïèÞêåõóçò",
Toast.LENGTH_LONG)
.show();
}
// TODO Implement
}
})
.setNegativeButton("Ï÷é",
new DialogInterface.OnClickListener() {
public void onClick(
DialogInterface dialog, int id) {
finish();
}
}
);
// create alert dialog
AlertDialog alertDialog = alertDialogBuilder.create();
// show it
alertDialog.show();
}
}
});
// ------------------ If tapped to load photo -----------------
PICK_IMAGE = 2;
photoTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(
Intent.createChooser(intent, "Select Picture"),
PICK_IMAGE);
}
});
}
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// ----------- pick image -------------------
if (requestCode == PICK_IMAGE && data != null && data.getData() != null) {
Uri _uri = data.getData();
// User had pick an image.
Cursor cursor = getContentResolver()
.query(_uri,
new String[] { android.provider.MediaStore.Images.ImageColumns.DATA },
null, null, null);
cursor.moveToFirst();
// Link to the image
final String imageFilePath = cursor.getString(0);
cursor.close();
final TextView photoTextView = (TextView) findViewById(R.id.photo);
photoTextView.setText(imageFilePath);
}
super.onActivityResult(requestCode, resultCode, data);
// ----------- pick image end ---------------
if (requestCode == 1) {
if (resultCode == RESULT_OK) {
@SuppressWarnings("unused")
String result = data.getStringExtra("result");
}
if (resultCode == RESULT_CANCELED) {
Globals.getInstance().getMap_Center();
final TextView descText = (TextView) findViewById(R.id.editText2);
descText.append("\n ÈÝóç : http://maps.google.com/maps?f=q&q="
+ Globals.getInstance().getMap_Center().getLatitudeE6()
/ 1E6
+ ","
+ Globals.getInstance().getMap_Center()
.getLongitudeE6() / 1E6 + "&z=16");
}
}
}
private class InnerLocationListener implements LocationListener {
public void onLocationChanged(Location argLocation) {
// TODO Auto-generated method stub
// super.onLocationChanged(location);
@SuppressWarnings("unused")
GeoPoint myGeoPoint = new GeoPoint(
(int) (argLocation.getLatitude() * 1000000),
(int) (argLocation.getLongitude() * 1000000));
final TextView descText = (TextView) findViewById(R.id.editText2);
descText.append(" Lat= " + argLocation.getLatitude() / 1E6
+ " Lon= " + argLocation.getLongitude());
// m_mapView.getController().setCenter(myGeoPoint);
// m_mapView.invalidate();
// ((IMapController) m_mapView).animateTo(myGeoPoint);
// CenterLocatio(myGeoPoint);
}
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
}
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
}
public void onStatusChanged(String provider, int status, Bundle extras) {
// TODO Auto-generated method stub
}
}
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
};
// ----- if file exists in mail folder
// ----- show send mail menu item
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
File root = new File(Environment.getExternalStorageDirectory(),
"osmdroid/mail/Mail.json");
if (root.exists()) {
MenuItem mail_send = menu.findItem(R.id.mail_send);
mail_send.setVisible(true);
}
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.opt:
startActivity(new Intent(getApplicationContext(), Options.class));
return true;
case R.id.mail_send:
MailObject sMail = new MailObject();
// TODO Check for wrong or corrupted data in file
mail_param_Date = sMail.Date;
mail_param_ShortDesc = sMail.Short_Desc;
mail_param_Category = sMail.Category;
mail_param_Description = sMail.Description;
mail_param_TelNumber = sMail.TelNumber;
mail_param_ImageFile = sMail.Image_File;
// --- set the flag that we send stored message
delete_Mail = true;
mailSendingTask what = new mailSendingTask(null);
what.execute();
return true;
}
return false;
}
ProgressDialog createSpinningDialog(String title) {
ProgressDialog pd = new ProgressDialog(this);
pd.setTitle(title);
pd.setMessage(getString(R.string.wait));
pd.setCancelable(false);
pd.setIndeterminate(true);
return pd;
}
class mailSendingTask extends AsyncTask<Object, Void, Boolean> {
boolean mOnCreate;
ProgressDialog mPD;
String mMessage;
mailSendingTask(String message) {
super();
mMessage = "Sending";
}
@Override
protected void onPreExecute() {
mPD = createSpinningDialog(mMessage);
mPD.show();
}
@Override
protected Boolean doInBackground(Object... params) {
if (isNetworkAvailable()) {
File imageFile = new File("");
try {
GMailSender sender = new GMailSender("aaa@gmail.com",
"aaaaa");
try {
imageFile = new File(mail_param_ImageFile);
} catch (Exception e) {
imageFile = new File("");
Log.e("imageFile", e.getMessage(), e);
}
sender.sendMail(mail_param_ShortDesc, " Date = "
+ mail_param_Date + " For = " + mail_param_Category
+ " Desc = " + mail_param_Description + " Phone= "
+ mail_param_TelNumber, imageFile,
"aaa@gmail.com", "aaa@gmail.com");
} catch (Exception e) {
Context mAppContext = New_request.this
.getApplicationContext();
Toast.makeText(mAppContext, "ÓöÜëìá áðïóôïëÞò",
Toast.LENGTH_LONG).show();
Log.e("SendMail", e.getMessage(), e);
}
} else {
Context mAppContext = New_request.this.getApplicationContext();
Toast.makeText(mAppContext, "ÓöÜëìá äéêôýïõ", Toast.LENGTH_LONG)
.show();
}
return true;
}
@Override
protected void onPostExecute(Boolean ok) {
if (delete_Mail) {
File root = new File(Environment.getExternalStorageDirectory(),
"osmdroid/mail/Mail.json");
if (root.exists())
root.delete();
delete_Mail = false;
}
mPD.dismiss();
Context mAppContext = New_request.this.getApplicationContext();
Toast.makeText(mAppContext, "¸ãéíå áðïóôïëÞ", Toast.LENGTH_LONG)
.show();
}
// -------------------------------------------
}
}
|
mrspyros/citizen-companion
|
ToorComp/src/com/android/toorcomp/New_request.java
|
Java
|
gpl-3.0
| 15,298
|
package persistence;
import static org.junit.Assert.assertNotNull;
import java.util.ArrayList;
import java.util.List;
import org.joda.time.DateTime;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;
import com.mrgss.web.persistence.model.ClientEntity;
import com.mrgss.web.persistence.model.DocTypeEntity;
import com.mrgss.web.persistence.model.PatientEntity;
import com.mrgss.web.persistence.model.RaceEntity;
import com.mrgss.web.persistence.model.SpeciesEntity;
import com.mrgss.web.persistence.repository.ClientRepository;
import com.mrgss.web.persistence.repository.DocTypeRepository;
import com.mrgss.web.persistence.repository.PatientRepository;
import com.mrgss.web.persistence.repository.RaceRepository;
import com.mrgss.web.persistence.repository.SpeciesRepository;
@RunWith(SpringJUnit4ClassRunner.class)
@Transactional
@ContextConfiguration("/spring-jpa-config.xml")
public class PatientRepositoryTest {
DocTypeEntity docType;
ClientEntity client;
RaceEntity race;
List<RaceEntity> listRace= new ArrayList<RaceEntity>();
@Autowired
ClientRepository repositoryClient;
@Autowired
DocTypeRepository repositoryDocType;
@Autowired
PatientRepository repositoryPatient;
@Autowired
RaceRepository repositoryRace;
@Autowired
SpeciesRepository repositorySpecies;
@Before
public void insertNewDocTypeAndClient() {
docType = new DocTypeEntity();
docType.setName("LC");
docType = repositoryDocType.save(docType);
assertNotNull(docType.getId());
client = new ClientEntity();
client.setFirstname("Nico");
client.setLastname("Nicolas");
client.setDoc(34574565L);
client.setDocType(docType);
client.setGender(true);
client.setMail("asdsadsa2@asdsadasd.com");
client.setPhone(3516536411L);
client.setStartDate(DateTime.now());
client = repositoryClient.save(client);
assertNotNull(client.getId());
race = new RaceEntity();
race.setName("Labrador");
race = repositoryRace.save(race);
listRace.add(race);
assertNotNull(race.getId());
SpeciesEntity species = new SpeciesEntity();
species.setName("CANINO");
species.setRaces(listRace);
species.setStartDate(DateTime.now());
species = repositorySpecies.save(species);
assertNotNull(species.getId());
}
@Test
public void insertNewPatient(){
PatientEntity patient = new PatientEntity();
patient.setClient(client);
patient.setBirthday(DateTime.now());
patient.setName("Manuel");
patient.setStartDate(DateTime.now());
patient.setRace(listRace.get(0));
}
}
|
nicoferre/vetsis
|
persistence/src/test/java/persistence/PatientRepositoryTest.java
|
Java
|
gpl-3.0
| 2,804
|
/*
The oSIP library implements the Session Initiation Protocol (SIP -rfc3261-)
Copyright (C) 2001-2012 Aymeric MOIZARD amoizard@antisip.com
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <osip2/internal.h>
#include <osip2/osip.h>
#include "fsm.h"
#include "xixt.h"
int
__osip_ict_init (osip_ict_t ** ict, osip_t * osip, osip_message_t * invite)
{
osip_route_t *route;
int i;
OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_INFO2, NULL, "allocating ICT context\n"));
*ict = (osip_ict_t *) osip_malloc (sizeof (osip_ict_t));
if (*ict == NULL)
return OSIP_NOMEM;
memset (*ict, 0, sizeof (osip_ict_t));
/* for INVITE retransmissions */
{
osip_via_t *via;
char *proto;
i = osip_message_get_via (invite, 0, &via); /* get top via */
if (i < 0) {
osip_free (*ict);
return i;
}
proto = via_get_protocol (via);
if (proto == NULL) {
osip_free (*ict);
return OSIP_SYNTAXERROR;
}
#ifdef USE_BLOCKINGSOCKET
if (osip_strcasecmp (proto, "TCP") != 0 && osip_strcasecmp (proto, "TLS") != 0 && osip_strcasecmp (proto, "SCTP") != 0) { /* for other reliable protocol than TCP, the timer
must be desactived by the external application */
(*ict)->timer_a_length = DEFAULT_T1;
if (64 * DEFAULT_T1 < 32000)
(*ict)->timer_d_length = 32000;
else
(*ict)->timer_d_length = 64 * DEFAULT_T1;
osip_gettimeofday (&(*ict)->timer_a_start, NULL);
add_gettimeofday (&(*ict)->timer_a_start, (*ict)->timer_a_length);
(*ict)->timer_d_start.tv_sec = -1; /* not started */
}
else { /* reliable protocol is used: */
(*ict)->timer_a_length = -1; /* A is not ACTIVE */
(*ict)->timer_d_length = 0; /* MUST do the transition immediatly */
(*ict)->timer_a_start.tv_sec = -1; /* not started */
(*ict)->timer_d_start.tv_sec = -1; /* not started */
}
}
#else
if (osip_strcasecmp (proto, "TCP") != 0 && osip_strcasecmp (proto, "TLS") != 0 && osip_strcasecmp (proto, "SCTP") != 0) { /* for other reliable protocol than TCP, the timer
must be desactived by the external application */
(*ict)->timer_a_length = DEFAULT_T1;
if (64 * DEFAULT_T1 < 32000)
(*ict)->timer_d_length = 32000;
else
(*ict)->timer_d_length = 64 * DEFAULT_T1;
osip_gettimeofday (&(*ict)->timer_a_start, NULL);
add_gettimeofday (&(*ict)->timer_a_start, (*ict)->timer_a_length);
(*ict)->timer_d_start.tv_sec = -1; /* not started */
}
else { /* reliable protocol is used: */
(*ict)->timer_a_length = DEFAULT_T1;
(*ict)->timer_d_length = 0; /* MUST do the transition immediatly */
osip_gettimeofday (&(*ict)->timer_a_start, NULL);
add_gettimeofday (&(*ict)->timer_a_start, (*ict)->timer_a_length);
(*ict)->timer_d_start.tv_sec = -1; /* not started */
}
}
#endif
/* for PROXY, the destination MUST be set by the application layer,
this one may not be correct. */
osip_message_get_route (invite, 0, &route);
if (route != NULL && route->url != NULL) {
osip_uri_param_t *lr_param;
osip_uri_uparam_get_byname (route->url, "lr", &lr_param);
if (lr_param == NULL) {
/* using uncompliant proxy: destination is the request-uri */
route = NULL;
}
}
if (route != NULL && route->url != NULL) {
int port = 5060;
if (route->url->port != NULL)
port = osip_atoi (route->url->port);
osip_ict_set_destination ((*ict), osip_strdup (route->url->host), port);
}
else {
int port = 5060;
/* search for maddr parameter */
osip_uri_param_t *maddr_param = NULL;
osip_uri_param_t *obr_param = NULL;
osip_uri_param_t *obp_param = NULL;
port = 5060;
if (invite->req_uri->port != NULL)
port = osip_atoi (invite->req_uri->port);
/* if ob was used in Contact, then exosip adds "x-obr" and "x-obp", thus, when
processing request, the ip/port destination are re-used here */
osip_uri_uparam_get_byname (invite->req_uri, "x-obr", &obr_param);
osip_uri_uparam_get_byname (invite->req_uri, "x-obp", &obp_param);
osip_uri_uparam_get_byname (invite->req_uri, "maddr", &maddr_param);
if (maddr_param != NULL && maddr_param->gvalue != NULL)
osip_ict_set_destination ((*ict), osip_strdup (maddr_param->gvalue), port);
else if (obr_param != NULL && obr_param->gvalue != NULL && obp_param != NULL && obp_param->gvalue != NULL)
osip_ict_set_destination ((*ict), osip_strdup (obr_param->gvalue), osip_atoi (obp_param->gvalue));
else
osip_ict_set_destination ((*ict), osip_strdup (invite->req_uri->host), port);
}
(*ict)->timer_b_length = 64 * DEFAULT_T1;
osip_gettimeofday (&(*ict)->timer_b_start, NULL);
add_gettimeofday (&(*ict)->timer_b_start, (*ict)->timer_b_length);
/* Oups! A bug! */
/* (*ict)->port = 5060; */
return OSIP_SUCCESS;
}
int
__osip_ict_free (osip_ict_t * ict)
{
if (ict == NULL)
return OSIP_SUCCESS;
OSIP_TRACE (osip_trace (__FILE__, __LINE__, OSIP_INFO2, NULL, "free ict resource\n"));
osip_free (ict->destination);
osip_free (ict);
return OSIP_SUCCESS;
}
int
osip_ict_set_destination (osip_ict_t * ict, char *destination, int port)
{
if (ict == NULL)
return OSIP_BADPARAMETER;
if (ict->destination != NULL)
osip_free (ict->destination);
ict->destination = destination;
ict->port = port;
return OSIP_SUCCESS;
}
osip_event_t *
__osip_ict_need_timer_a_event (osip_ict_t * ict, state_t state, int transactionid)
{
return __osip_transaction_need_timer_x_event (ict, &ict->timer_a_start, state == ICT_CALLING, transactionid, TIMEOUT_A);
}
osip_event_t *
__osip_ict_need_timer_b_event (osip_ict_t * ict, state_t state, int transactionid)
{
return __osip_transaction_need_timer_x_event (ict, &ict->timer_b_start, state == ICT_CALLING, transactionid, TIMEOUT_B);
}
osip_event_t *
__osip_ict_need_timer_d_event (osip_ict_t * ict, state_t state, int transactionid)
{
return __osip_transaction_need_timer_x_event (ict, &ict->timer_d_start, state == ICT_COMPLETED, transactionid, TIMEOUT_D);
}
|
tychosoft/sipwitchqt
|
vendor/libosip2/src/osip2/ict.c
|
C
|
gpl-3.0
| 7,127
|
#coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_O_IBK_WSYH_ECACCT').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
sc.setLogLevel('WARN')
if len(sys.argv) > 5:
if sys.argv[5] == "hive":
sqlContext = HiveContext(sc)
else:
sqlContext = SQLContext(sc)
hdfs = sys.argv[3]
dbname = sys.argv[4]
#处理需要使用的日期
etl_date = sys.argv[1]
#etl日期
V_DT = etl_date
#上一日日期
V_DT_LD = (date(int(etl_date[0:4]), int(etl_date[4:6]), int(etl_date[6:8])) + timedelta(-1)).strftime("%Y%m%d")
#月初日期
V_DT_FMD = date(int(etl_date[0:4]), int(etl_date[4:6]), 1).strftime("%Y%m%d")
#上月末日期
V_DT_LMD = (date(int(etl_date[0:4]), int(etl_date[4:6]), 1) + timedelta(-1)).strftime("%Y%m%d")
#10位日期
V_DT10 = (date(int(etl_date[0:4]), int(etl_date[4:6]), int(etl_date[6:8]))).strftime("%Y-%m-%d")
V_STEP = 0
O_CI_WSYH_ECACCT = sqlContext.read.parquet(hdfs+'/O_CI_WSYH_ECACCT/*')
O_CI_WSYH_ECACCT.registerTempTable("O_CI_WSYH_ECACCT")
#任务[12] 001-01::
V_STEP = V_STEP + 1
#先删除原表所有数据
ret = os.system("hdfs dfs -rm -r /"+dbname+"/F_CI_WSYH_ECACCT/*.parquet")
#从昨天备表复制一份全量过来
ret = os.system("hdfs dfs -cp -f /"+dbname+"/F_CI_WSYH_ECACCT_BK/"+V_DT_LD+".parquet /"+dbname+"/F_CI_WSYH_ECACCT/"+V_DT+".parquet")
F_CI_WSYH_ECACCT = sqlContext.read.parquet(hdfs+'/F_CI_WSYH_ECACCT/*')
F_CI_WSYH_ECACCT.registerTempTable("F_CI_WSYH_ECACCT")
sql = """
SELECT A.CIFSEQ AS CIFSEQ
,A.ACSEQ AS ACSEQ
,A.DEPTSEQ AS DEPTSEQ
,A.BANKACTYPE AS BANKACTYPE
,A.BANKACSUBTYPE AS BANKACSUBTYPE
,A.ACNO AS ACNO
,A.ACNAME AS ACNAME
,A.ACORDER AS ACORDER
,A.CURRENCY AS CURRENCY
,A.CRFLAG AS CRFLAG
,A.ASSOCIFSEQ AS ASSOCIFSEQ
,A.ASSOCIFACFLAG AS ASSOCIFACFLAG
,A.ASSOCIFLEVEL AS ASSOCIFLEVEL
,A.CORECIFNO AS CORECIFNO
,A.ACALIAS AS ACALIAS
,A.ACSTATE AS ACSTATE
,A.CREATEUSERSEQ AS CREATEUSERSEQ
,A.CREATEDEPTSEQ AS CREATEDEPTSEQ
,A.CREATETIME AS CREATETIME
,A.UPDATEUSERSEQ AS UPDATEUSERSEQ
,A.UPDATEDEPTSEQ AS UPDATEDEPTSEQ
,A.UPDATETIME AS UPDATETIME
,A.FR_ID AS FR_ID
,V_DT AS ODS_ST_DATE
,'IBK' AS ODS_SYS_ID
FROM O_CI_WSYH_ECACCT A --客户账户表
"""
sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)
F_CI_WSYH_ECACCT_INNTMP1 = sqlContext.sql(sql)
F_CI_WSYH_ECACCT_INNTMP1.registerTempTable("F_CI_WSYH_ECACCT_INNTMP1")
#F_CI_WSYH_ECACCT = sqlContext.read.parquet(hdfs+'/F_CI_WSYH_ECACCT/*')
#F_CI_WSYH_ECACCT.registerTempTable("F_CI_WSYH_ECACCT")
sql = """
SELECT DST.CIFSEQ --客户顺序号:src.CIFSEQ
,DST.ACSEQ --账号顺序号:src.ACSEQ
,DST.DEPTSEQ --账户开户机构:src.DEPTSEQ
,DST.BANKACTYPE --银行账户类型:src.BANKACTYPE
,DST.BANKACSUBTYPE --银行账户性质:src.BANKACSUBTYPE
,DST.ACNO --账号:src.ACNO
,DST.ACNAME --账户名称:src.ACNAME
,DST.ACORDER --显示顺序号:src.ACORDER
,DST.CURRENCY --币种:src.CURRENCY
,DST.CRFLAG --钞汇标志:src.CRFLAG
,DST.ASSOCIFSEQ --:src.ASSOCIFSEQ
,DST.ASSOCIFACFLAG --关联企业账号标志:src.ASSOCIFACFLAG
,DST.ASSOCIFLEVEL --关联企业级别:src.ASSOCIFLEVEL
,DST.CORECIFNO --帐号所属核心客户号:src.CORECIFNO
,DST.ACALIAS --账户别名:src.ACALIAS
,DST.ACSTATE --状态:src.ACSTATE
,DST.CREATEUSERSEQ --创建用户顺序号:src.CREATEUSERSEQ
,DST.CREATEDEPTSEQ --创建机构顺序号:src.CREATEDEPTSEQ
,DST.CREATETIME --创建时间:src.CREATETIME
,DST.UPDATEUSERSEQ --更新用户顺序号:src.UPDATEUSERSEQ
,DST.UPDATEDEPTSEQ --更新机构顺序号:src.UPDATEDEPTSEQ
,DST.UPDATETIME --更新时间:src.UPDATETIME
,DST.FR_ID --法人号:src.FR_ID
,DST.ODS_ST_DATE --系统日期:src.ODS_ST_DATE
,DST.ODS_SYS_ID --系统标志:src.ODS_SYS_ID
FROM F_CI_WSYH_ECACCT DST
LEFT JOIN F_CI_WSYH_ECACCT_INNTMP1 SRC
ON SRC.ACSEQ = DST.ACSEQ
WHERE SRC.ACSEQ IS NULL """
sql = re.sub(r"\bV_DT\b", "'"+V_DT10+"'", sql)
F_CI_WSYH_ECACCT_INNTMP2 = sqlContext.sql(sql)
dfn="F_CI_WSYH_ECACCT/"+V_DT+".parquet"
F_CI_WSYH_ECACCT_INNTMP2=F_CI_WSYH_ECACCT_INNTMP2.unionAll(F_CI_WSYH_ECACCT_INNTMP1)
F_CI_WSYH_ECACCT_INNTMP1.cache()
F_CI_WSYH_ECACCT_INNTMP2.cache()
nrowsi = F_CI_WSYH_ECACCT_INNTMP1.count()
nrowsa = F_CI_WSYH_ECACCT_INNTMP2.count()
F_CI_WSYH_ECACCT_INNTMP2.write.save(path = hdfs + '/' + dfn, mode='overwrite')
F_CI_WSYH_ECACCT_INNTMP1.unpersist()
F_CI_WSYH_ECACCT_INNTMP2.unpersist()
et = datetime.now()
print("Step %d start[%s] end[%s] use %d seconds, insert F_CI_WSYH_ECACCT lines %d, all lines %d") % (V_STEP, st.strftime("%H:%M:%S"), et.strftime("%H:%M:%S"), (et-st).seconds, nrowsi, nrowsa)
ret = os.system("hdfs dfs -mv /"+dbname+"/F_CI_WSYH_ECACCT/"+V_DT_LD+".parquet /"+dbname+"/F_CI_WSYH_ECACCT_BK/")
#先删除备表当天数据
ret = os.system("hdfs dfs -rm -r /"+dbname+"/F_CI_WSYH_ECACCT_BK/"+V_DT+".parquet")
#从当天原表复制一份全量到备表
ret = os.system("hdfs dfs -cp -f /"+dbname+"/F_CI_WSYH_ECACCT/"+V_DT+".parquet /"+dbname+"/F_CI_WSYH_ECACCT_BK/"+V_DT+".parquet")
|
cysuncn/python
|
spark/crm/PROC_O_IBK_WSYH_ECACCT.py
|
Python
|
gpl-3.0
| 6,823
|
/* Button Styles
---------------------------------------- */
.button {
display: inline-block;
padding: 3px 19px 7px 19px;
font-size: 16px;
font-weight: bold;
font-family: "Mason", "Droid Sans", Verdana, Arial, Helvetica;
line-height: 1.4;
text-align: center;
white-space: nowrap;
vertical-align: middle;
-ms-touch-action: manipulation;
touch-action: manipulation;
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
border: 1px solid transparent;
border-radius: 4px;
line-height: 1.5;
}
.button:focus,
.button:hover {
text-decoration: none;
outline: none;
}
.caret {
border-left: 1px solid;
position: relative;
right: -6px;
}
.caret i {
vertical-align: top;
}
/* Toogle Erungenschaften */
@media (max-width: 700px) {
.flairbox {
display: none;
}
}
button.flair-toggle {
padding: 8px;
font-weight: bold;
text-decoration: none;
color: #7a561c;
}
.flair-toggle::after {
display: inline-block;
color: #7a561c;
font-weight: normal;
font-style: normal;
font-variant: normal;
font-family: FontAwesome;
font-size: 14px;
line-height: 1;
position: relative;
top: 2px;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
content: '\f0d8';
padding-left: 2px;
}
.flair-toggle.closed::after {
content: '\f0d7';
}
/* Posting page styles
----------------------------------------*/
.button-search,
.button-search-end {
float: left;
border-radius: 0;
margin: 0;
padding: 2px 5px;
}
.button-search-end {
border-left-width: 0;
border-radius: 0 4px 4px 0;
}
.search-header .button-search,
.search-header .button-search-end {
border-top-width: 0;
border-bottom-width: 0;
padding: 3px 5px;
}
.search-header .button-search-end {
border-right-width: 0;
}
.button-icon-only {
padding-left: 3px;
padding-right: 3px;
}
/* Poster contact icons
----------------------------------------*/
.contact-icons.dropdown-contents {
min-width: 0;
padding: 0;
font-size: 0;
}
.contact-icon {
background-repeat: no-repeat;
display: block;
height: 16px;
width: 16px;
}
.contact-icons a {
border-bottom: 1px dotted;
border-right: 1px dotted;
display: block;
float: left;
padding: 8px;
}
.contact-icons .last-cell {
border-right: none;
}
.contact-icons div:last-child a {
border-bottom: none;
}
.contact-icons div {
clear: left;
}
/* Post control buttons
--------------------------------------------- */
.post-buttons {
float: right;
list-style: none;
margin-top: 6px;
}
.has-profile .post-buttons {
margin-bottom: 8px;
right: 0;
top: 5px;
}
.post-buttons > li {
float: left;
margin-right: 3px;
}
.post-buttons .button, .format-buttons .button {
padding-left: 3px;
padding-right: 3px;
}
.hastouch .post-buttons {
margin-right: 10px;
}
.post-buttons .button span {
font-size: 0;
}
/* Responsive buttons in post body */
.post-buttons .dropdown {
top: 18px;
}
.post-buttons .dropdown a {
display: block;
font-size: 1.2em;
text-align: right;
}
.hasjs .postbody .post-buttons {
max-width: 40%;
}
/* Browser-specific tweaks */
button::-moz-focus-inner {
padding: 0;
border: 0
}
/* Deprecated as of version 3.2
-------------------------------------------------*/
.small-icon {
background-position: 0 50%;
background-repeat: no-repeat;
background-image: none;
}
.dropdown .small-icon {
background-position: 5px 50%;
padding: 5px;
}
.small-icon > a {
padding: 0 0 0 18px;
}
ul.linklist.bulletin > li.small-icon:before {
display: none;
}
.dropdown .small-icon > a {
display: block;
}
.rtl .small-icon {
background-position: 100% 50%;
}
.rtl .small-icon > a {
padding-left: 0;
padding-right: 19px;
}
|
Kryptator/dsaforum
|
styles/dsaforum/theme/buttons.css
|
CSS
|
gpl-3.0
| 3,699
|
<?php
namespace Claroline\CoreBundle\Migrations\pdo_pgsql;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated migration based on mapping information: modify it with caution
*
* Generation date: 2014/10/07 04:13:10
*/
class Version20141007161307 extends AbstractMigration
{
public function up(Schema $schema)
{
$this->addSql("
CREATE TABLE claro_analytics_badge_mooc_stats (
id SERIAL NOT NULL,
workspace_id INT DEFAULT NULL,
badge_id INT DEFAULT NULL,
date DATE NOT NULL,
nbParticipations INT NOT NULL,
PRIMARY KEY(id)
)
");
$this->addSql("
CREATE INDEX IDX_B132BFD382D40A1F ON claro_analytics_badge_mooc_stats (workspace_id)
");
$this->addSql("
CREATE INDEX IDX_B132BFD3F7A2C2FC ON claro_analytics_badge_mooc_stats (badge_id)
");
$this->addSql("
ALTER TABLE claro_analytics_badge_mooc_stats
ADD CONSTRAINT FK_B132BFD382D40A1F FOREIGN KEY (workspace_id)
REFERENCES claro_workspace (id) NOT DEFERRABLE INITIALLY IMMEDIATE
");
$this->addSql("
ALTER TABLE claro_analytics_badge_mooc_stats
ADD CONSTRAINT FK_B132BFD3F7A2C2FC FOREIGN KEY (badge_id)
REFERENCES claro_badge (id) NOT DEFERRABLE INITIALLY IMMEDIATE
");
}
public function down(Schema $schema)
{
$this->addSql("
DROP TABLE claro_analytics_badge_mooc_stats
");
}
}
|
Solerni-R1-1/CoreBundle
|
Migrations/pdo_pgsql/Version20141007161307.php
|
PHP
|
gpl-3.0
| 1,635
|
var xhr, xmlDocumentConstructor;
module("responding", {
setup: function(){
xhr = new FakeXMLHttpRequest();
xmlDocumentConstructor = makeXMLDocument().constructor;
},
teardown: function(){
xhr = undefined;
xmlDocumentConstructor = undefined;
}
});
// Different browsers report different constructors for XML Documents.
// Chrome 45.0.2454 and Firefox 40.0.0 report `XMLDocument`,
// PhantomJS 1.9.8 reports `Document`.
// Make a dummy xml document to determine what constructor to
// compare against in the tests below.
// This function is taken from `parseXML` in the src/
function makeXMLDocument() {
var xmlDoc, text = "<some>xml</some>";
if (typeof DOMParser != "undefined") {
var parser = new DOMParser();
xmlDoc = parser.parseFromString(text, "text/xml");
} else {
xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async = "false";
xmlDoc.loadXML(text);
}
return xmlDoc;
}
test("defaults responseHeaders to {} if not passed", function(){
xhr.respond(200);
deepEqual(xhr.responseHeaders, {});
});
test("sets responseHeaders", function(){
xhr.respond(200, {"Content-Type":"application/json"});
deepEqual(xhr.responseHeaders, {"Content-Type":"application/json"});
});
test("sets body", function(){
xhr.respond(200, {"Content-Type":"application/json"}, JSON.stringify({a: 'key'}));
equal(xhr.responseText, '{"a":"key"}');
});
test("parses the body if it's XML and no content-type is set", function(){
xhr.respond(200, {}, "<key>value</key>");
equal(xhr.responseXML.constructor, xmlDocumentConstructor);
});
test("parses the body if it's XML and xml content type is set", function(){
xhr.respond(200, {'Content-Type':'application/xml'}, "<key>value</key>");
equal(xhr.responseXML.constructor, xmlDocumentConstructor);
});
test("does not parse the body if it's XML and another content type is set", function(){
xhr.respond(200, {'Content-Type':'application/json'}, "<key>value</key>");
equal(xhr.responseXML, undefined);
});
test("calls the onload callback once", function(){
var wasCalled = 0;
xhr.onload = function(ev){
wasCalled += 1;
};
xhr.respond(200, {}, "");
strictEqual(wasCalled, 1);
});
test("calls onreadystatechange for each state change", function() {
var states = [];
xhr.onreadystatechange = function() {
states.push(this.readyState);
};
xhr.open('get', '/some/url');
xhr.respond(200, {}, "");
var expectedStates = [
FakeXMLHttpRequest.OPENED,
FakeXMLHttpRequest.HEADERS_RECEIVED,
FakeXMLHttpRequest.LOADING,
FakeXMLHttpRequest.DONE
];
deepEqual(states, expectedStates);
});
test("passes event to onreadystatechange", function() {
var event = null;
xhr.onreadystatechange = function(e) {
event = e;
};
xhr.open('get', '/some/url');
xhr.respond(200, {}, "");
ok(event && event.type === 'readystatechange',
'passes event with type "readystatechange"');
});
test("overrideMimeType overrides content-type responseHeader", function(){
xhr.overrideMimeType('text/plain');
xhr.respond(200, {"Content-Type":"application/json"});
deepEqual(xhr.responseHeaders, {"Content-Type":"text/plain"});
});
test("parses the body if it's XML and overrideMimeType is set to xml", function(){
xhr.overrideMimeType('application/xml');
xhr.respond(200, {'Content-Type':'text/plain'}, "<key>value</key>");
equal(xhr.responseXML.constructor, xmlDocumentConstructor);
});
test("does not parse the body if it's XML and overrideMimeType is set to another content type", function(){
xhr.overrideMimeType('text/plain');
xhr.respond(200, {'Content-Type':'application/xml'}, "<key>value</key>");
equal(xhr.responseXML, undefined);
});
|
Elektro1776/latestEarthables
|
core/client/bower_components/FakeXMLHttpRequest/test/responding_test.js
|
JavaScript
|
gpl-3.0
| 3,711
|
#include <cstdlib>
#include <ftl/unittest.h>
#include <ftl/out_printer.h>
#include <signal.h>
#include <thread>
#include <try_catch/try_catch.h>
#include <unistd.h>
using namespace ftl;
int read_and_execute_command( size_t n, bool bcrash = false )
{
if ( bcrash )
{
outPrinter.println( "will crach" );
int *p = nullptr;
*p = 234;
}
else
{
int x = 3;
return x + n;
}
return 0;
}
void test_try( size_t N, bool bcrash = false )
{
auto tsStart = std::chrono::steady_clock::now();
for ( int i = 0; i < N; ++i )
{
// sleep(1);
// outPrinter.println(i, " will setjmp errno:", errno);
FTL_TRY1
{
read_and_execute_command( i, bcrash );
}
FTL_CATCH1
{
outPrinter.println( " recovered from interuption!" );
}
FTL_TRY_END1
}
auto tsStop = std::chrono::steady_clock::now();
std::cout << "- processing time(ns): " << ( tsStop - tsStart ).count() << ", latency(ns):" << ( tsStop - tsStart ).count() / N << std::endl;
}
ADD_TEST_CASE( try_catch_tests )
{
FTL_TRY_INSTALL1();
size_t N = 10000000;
test_try( 1, true );
test_try( 1, false );
std::thread th1( test_try, N, false );
// std::thread th2(test_try);
th1.join();
// th2.join();
}
|
adenzhang/ftl
|
test/try_catch_tests.cpp
|
C++
|
gpl-3.0
| 1,363
|
package org.mocraft.command.pex;
import org.bukkit.entity.Player;
public interface PexPlayerCommand {
Player getPlayer();
}
|
jackey8616/PerMession
|
src/org/mocraft/command/pex/PexPlayerCommand.java
|
Java
|
gpl-3.0
| 132
|
/**
* A package that holds other packages with shared
* <a href="http://junit.org/">JUnit</a> tests but itself is empty (as
* there are no classes that could be tested at the {@code org} level).
*/
package shared.junit.org;
|
optimizationBenchmarking/evaluator-base
|
src/test/java/shared/junit/org/package-info.java
|
Java
|
gpl-3.0
| 232
|
#include "G4toPMT.hh"
#include "PenelopeToPMT.hh"
#include "OutputManager.hh"
#include "PathUtils.hh"
#include "GraphicsUtils.hh"
#include "MC_Comparisons.hh"
#include <TROOT.h>
#include <TStyle.h>
#include <TLegend.h>
#include <iostream>
void mc_compare_plots(OutputManager& OM, Sim2PMT& SP1, Sim2PMT& SP2, double emax) {
// put two simulations in a list for easy iteration
sps.push_back(&SP1);
sps.push_back(&SP2);
// process each simulation to fill histograms
for(unsigned int i=0; i<sps.size(); i++) {
SP = sps[i];
// define histograms
for(EventType t=TYPE_0_EVENT; t <= TYPE_II_EVENT; ++t) {
hEvis[t].push_back(OM.registeredTH1F("hEvis_"+itos(t)+"_"+itos(i),
"Type "+itos(t)+" Energy Spectrum",
100,0,emax));
hEvisd[t].push_back(OM.registeredTH1F("hEvisd_"+itos(t)+"_"+itos(i),
"Type "+itos(t)+" Raw energy loss in scint. dead region",
100,0,emax));
hEquench[t].push_back(OM.registeredTH1F("hEquench_"+itos(t)+"_"+itos(i),
"Type "+itos(t)+" Quenched Energy Spectrum",
100,0,emax));
hEMWPC[t].push_back(OM.registeredTH1F("hEMWPC_"+itos(t)+"_"+itos(i),
"Type "+itos(t)+" Energy loss in MWPC gas",
100,0,150.0));
hEMWPCd[t].push_back(OM.registeredTH1F("hEMWPCd_"+itos(t)+"_"+itos(i),
"Type "+itos(t)+" Energy loss in MWPC gas dead regions",
100,0,100.0));
hEMylarf[t].push_back(OM.registeredTH1F("hEMylarf_"+itos(t)+"_"+itos(i),
"Type "+itos(t)+" Energy loss in front MWPC mylar",
100,0,150.0));
hEMylarb[t].push_back(OM.registeredTH1F("hEMylarb_"+itos(t)+"_"+itos(i),
"Type "+itos(t)+" Energy loss in back MWPC mylar",
100,0,150.0));
hEFoils[t].push_back(OM.registeredTH1F("hEFoils_"+itos(t)+"_"+itos(i),
"Type "+itos(t)+" Energy loss in decay tube endcap foils",
100,0,50));
hEWires[t].push_back(OM.registeredTH1F("hEWires_"+itos(t)+"_"+itos(i),
"Type "+itos(t)+" Energy deposited in wire planes",
25,0,50.0));
}
hCTScint.push_back(OM.registeredTH1F("hCTScint_"+itos(i),"cos(theta) entering scintillator",100,0.0,1.0));
hCTMWPC.push_back(OM.registeredTH1F("hCTMWPC_"+itos(i),"cos(theta) entering MWPC",100,0.0,1.0));
hPScintX.push_back(OM.registeredTH1F("hPScintX_"+itos(i),"scintillator trigger position (x)",100,-100.0,100.0));
hPMWPCX.push_back(OM.registeredTH1F("hPMWPCX_"+itos(i),"MWPC x-position",100,-80.0,80.0));
hPScintY.push_back(OM.registeredTH1F("hPScintY_"+itos(i),"scintillator trigger position (y)",100,-100.0,100.0));
hPMWPCY.push_back(OM.registeredTH1F("hPMWPCY_"+itos(i),"MWPC y-position",100,-80.0,80.0));
hCTMWPCo.push_back(OM.registeredTH1F("hCTMWPCo_"+itos(i),"cos(theta) exiting MWPC",100,0.0,1.0));
hCTFoil.push_back(OM.registeredTH1F("hCTFoil_"+itos(i),"cos(theta) entering decay trap foil",100,0.0,1.0));
// fill histograms
SP->startScan();
while(SP->nextPoint()) {
if(SP->fType == TYPE_III_EVENT) SP->fType = TYPE_II_EVENT; // merge Type II/III
if(SP->fPID != PID_BETA || SP->fSide != EAST) continue;
if(SP->fType <= TYPE_II_EVENT) {
hEvis[SP->fType].back()->Fill(SP->eDep[EAST]+SP->eDep[WEST],SP->physicsWeight);
hEvisd[SP->fType].back()->Fill(SP->edepDeadScint[EAST]+SP->edepDeadScint[WEST],SP->physicsWeight);
hEquench[SP->fType].back()->Fill(SP->eQ[EAST]+SP->eQ[WEST],SP->physicsWeight);
hEMWPC[SP->fType].back()->Fill(SP->eW[EAST]+SP->eW[WEST],SP->physicsWeight);
hEMWPCd[SP->fType].back()->Fill(SP->edepDeadMWPC[EAST]+SP->edepDeadMWPC[WEST],SP->physicsWeight);
hEMylarf[SP->fType].back()->Fill(SP->edepWinIn[EAST]+SP->edepWinIn[WEST],SP->physicsWeight);
hEMylarb[SP->fType].back()->Fill(SP->edepWinOut[EAST]+SP->edepWinOut[WEST],SP->physicsWeight);
hEFoils[SP->fType].back()->Fill(SP->edepFoils[EAST]+SP->edepFoils[WEST],SP->physicsWeight);
hEWires[SP->fType].back()->Fill(SP->edepWires[EAST]+SP->edepWires[WEST],SP->physicsWeight);
hPScintX.back()->Fill(SP->scintPos[EAST][X_DIRECTION],SP->physicsWeight);
hPMWPCX.back()->Fill(SP->mwpcPos[EAST][X_DIRECTION],SP->physicsWeight);
hPScintY.back()->Fill(SP->scintPos[EAST][Y_DIRECTION],SP->physicsWeight);
hPMWPCY.back()->Fill(SP->mwpcPos[EAST][Y_DIRECTION],SP->physicsWeight);
}
if(SP->fSide <= WEST) {
if(SP->cosThetaInScint[SP->fSide] != 0){
hCTScint.back()->Fill(SP->cosThetaInScint[SP->fSide],SP->physicsWeight);
}
if(SP->cosThetaInWinOut[SP->fSide] != 0){
hCTMWPCo.back()->Fill(SP->cosThetaInWinOut[SP->fSide],SP->physicsWeight);
}
if(SP->cosThetaInFoils[SP->fSide] != 0){
hCTFoil.back()->Fill(SP->cosThetaInFoils[SP->fSide],SP->physicsWeight);
}
if(SP->cosThetaInWinIn[SP->fSide] != 0){
hCTMWPC.back()->Fill(SP->cosThetaInWinIn[SP->fSide],SP->physicsWeight);
}
}
}
// record normalization counts
t0norm.push_back(hEvis[TYPE_0_EVENT].back()->Integral());
scintnorm.push_back(hCTScint.back()->Integral());
mwpcoutnorm.push_back(hCTMWPCo.back()->Integral());
mwpcnorm.push_back(hCTMWPC.back()->Integral());
foilnorm.push_back(hCTFoil.back()->Integral());
}
/////////////
// make plots, process data
/////////////
// normaliztion factors to Type 0 counts
for(unsigned int i=0; i<t0norm.size(); i++){
t0norm[i] = 1.0/t0norm[i];
mwpcnorm[i] = 1.0/mwpcnorm[i];
foilnorm[i] = 1.0/foilnorm[i];
mwpcoutnorm[i] = 1.0/mwpcoutnorm[i];
scintnorm[i] = 1.0/scintnorm[i];
}
std::vector<TH1*> hToPlot;
OM.defaultCanvas->cd();
//gPad->SetLogy();
for(EventType t=TYPE_0_EVENT; t <= TYPE_II_EVENT; ++t) {
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
Stringmap m;
m.insert("type",t);
m.insert("sim",i);
m.insert("mean",hEvis[t][i]->GetMean());
m.insert("rms",hEvis[t][i]->GetRMS());
m.insert("counts",hEvis[t][i]->Integral());
m.insert("normcounts",hEvis[t][i]->Integral()*t0norm[i]);
gPad->SetLogy(1);
hEvis[t][i]->GetXaxis()->SetTitle("E (keV)");
hEvis[t][i]->SetLineColor(2+2*i);
hEvis[t][i]->Scale(t0norm[i]/hEvis[t][i]->GetBinWidth(1));
hToPlot.push_back(hEvis[t][i]);
OM.qOut.insert("evis",m);
}
drawSimulHistos(hToPlot);
TLegend *evleg = new TLegend(0.13,0.82,0.4,0.9);
evleg->AddEntry(hEvis[t][0],"Geant4","l");
evleg->AddEntry(hEvis[t][1],"Penelope","l");
evleg->Draw();
OM.printCanvas("Evis_Type_"+itos(t));
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
Stringmap m;
m.insert("type",t);
m.insert("sim",i);
m.insert("mean",hEvisd[t][i]->GetMean());
m.insert("rms",hEvisd[t][i]->GetRMS());
m.insert("counts",hEvisd[t][i]->Integral());
m.insert("normcounts",hEvisd[t][i]->Integral()*t0norm[i]);
hEvisd[t][i]->GetXaxis()->SetTitle("E (keV)");
hEvisd[t][i]->SetLineColor(2+2*i);
hEvisd[t][i]->Scale(t0norm[i]/hEvisd[t][i]->GetBinWidth(1));
hToPlot.push_back(hEvisd[t][i]);
OM.qOut.insert("evisdead",m);
}
drawSimulHistos(hToPlot);
TLegend *evdleg = new TLegend(0.13,0.82,0.4,0.9);
evdleg->AddEntry(hEvisd[t][0],"Geant4","l");
evdleg->AddEntry(hEvisd[t][1],"Penelope","l");
evdleg->Draw();
OM.printCanvas("Evisdead_Type_"+itos(t));
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
Stringmap m;
m.insert("type",t);
m.insert("sim",i);
m.insert("mean",hEquench[t][i]->GetMean());
m.insert("rms",hEquench[t][i]->GetRMS());
m.insert("counts",hEquench[t][i]->Integral());
m.insert("normcounts",hEquench[t][i]->Integral()*t0norm[i]);
hEquench[t][i]->GetXaxis()->SetTitle("E (keV)");
hEquench[t][i]->SetLineColor(2+2*i);
hEquench[t][i]->Scale(t0norm[i]/hEquench[t][i]->GetBinWidth(1));
hToPlot.push_back(hEquench[t][i]);
OM.qOut.insert("equench",m);
}
drawSimulHistos(hToPlot);
TLegend *eqleg = new TLegend(0.13,0.82,0.4,0.9);
eqleg->AddEntry(hEquench[t][0],"Geant4","l");
eqleg->AddEntry(hEquench[t][1],"Penelope","l");
eqleg->Draw();
OM.printCanvas("Equench_Type_"+itos(t));
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
Stringmap m;
m.insert("type",t);
m.insert("sim",i);
m.insert("mean",hEMWPC[t][i]->GetMean());
m.insert("rms",hEMWPC[t][i]->GetRMS());
m.insert("counts",hEMWPC[t][i]->Integral());
m.insert("normcounts",hEMWPC[t][i]->Integral()*t0norm[i]);
hEMWPC[t][i]->GetXaxis()->SetTitle("E (keV)");
hEMWPC[t][i]->SetLineColor(2+2*i);
hEMWPC[t][i]->Scale(t0norm[i]/hEMWPC[t][i]->GetBinWidth(1));
hToPlot.push_back(hEMWPC[t][i]);
OM.qOut.insert("emwpc",m);
}
drawSimulHistos(hToPlot);
TLegend *emleg = new TLegend(0.13,0.82,0.4,0.9);
emleg->AddEntry(hEMWPC[t][0],"Geant4","l");
emleg->AddEntry(hEMWPC[t][1],"Penelope","l");
emleg->Draw();
OM.printCanvas("EMWPCgas_Type_"+itos(t));
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
Stringmap m;
m.insert("type",t);
m.insert("sim",i);
m.insert("mean",hEMWPCd[t][i]->GetMean());
m.insert("rms",hEMWPCd[t][i]->GetRMS());
m.insert("counts",hEMWPCd[t][i]->Integral());
m.insert("normcounts",hEMWPCd[t][i]->Integral()*t0norm[i]);
hEMWPCd[t][i]->GetXaxis()->SetTitle("E (keV)");
hEMWPCd[t][i]->SetLineColor(2+2*i);
hEMWPCd[t][i]->Scale(t0norm[i]/hEMWPCd[t][i]->GetBinWidth(1));
hToPlot.push_back(hEMWPCd[t][i]);
OM.qOut.insert("emwpcdead",m);
}
drawSimulHistos(hToPlot);
TLegend *emdleg = new TLegend(0.13,0.82,0.4,0.9);
emdleg->AddEntry(hEMWPCd[t][0],"Geant4","l");
emdleg->AddEntry(hEMWPCd[t][1],"Penelope","l");
emdleg->Draw();
OM.printCanvas("EMWPCgasd_Type_"+itos(t));
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
Stringmap m;
m.insert("type",t);
m.insert("sim",i);
m.insert("mean",hEMylarf[t][i]->GetMean());
m.insert("rms",hEMylarf[t][i]->GetRMS());
m.insert("counts",hEMylarf[t][i]->Integral());
m.insert("normcounts",hEMylarf[t][i]->Integral()*t0norm[i]);
hEMylarf[t][i]->GetXaxis()->SetTitle("E (keV)");
hEMylarf[t][i]->SetLineColor(2+2*i);
hEMylarf[t][i]->Scale(t0norm[i]/hEMylarf[t][i]->GetBinWidth(1));
hToPlot.push_back(hEMylarf[t][i]);
OM.qOut.insert("emylarf",m);
}
drawSimulHistos(hToPlot);
TLegend *emyfleg = new TLegend(0.13,0.82,0.4,0.9);
emyfleg->AddEntry(hEMylarf[t][0],"Geant4","l");
emyfleg->AddEntry(hEMylarf[t][1],"Penelope","l");
emyfleg->Draw();
OM.printCanvas("EMylarfront_Type_"+itos(t));
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
Stringmap m;
m.insert("type",t);
m.insert("sim",i);
m.insert("mean",hEMylarb[t][i]->GetMean());
m.insert("rms",hEMylarb[t][i]->GetRMS());
m.insert("counts",hEMylarb[t][i]->Integral());
m.insert("normcounts",hEMylarb[t][i]->Integral()*t0norm[i]);
hEMylarb[t][i]->GetXaxis()->SetTitle("E (keV)");
hEMylarb[t][i]->SetLineColor(2+2*i);
hEMylarb[t][i]->Scale(t0norm[i]/hEMylarb[t][i]->GetBinWidth(1));
hToPlot.push_back(hEMylarb[t][i]);
OM.qOut.insert("emylarb",m);
}
drawSimulHistos(hToPlot);
TLegend *emybleg = new TLegend(0.13,0.82,0.4,0.9);
emybleg->AddEntry(hEMylarb[t][0],"Geant4","l");
emybleg->AddEntry(hEMylarb[t][1],"Penelope","l");
emybleg->Draw();
OM.printCanvas("EMylarback_Type_"+itos(t));
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
Stringmap m;
m.insert("type",t);
m.insert("sim",i);
m.insert("mean",hEFoils[t][i]->GetMean());
m.insert("rms",hEFoils[t][i]->GetRMS());
m.insert("counts",hEFoils[t][i]->Integral());
m.insert("normcounts",hEFoils[t][i]->Integral()*t0norm[i]);
hEFoils[t][i]->GetXaxis()->SetTitle("E (keV)");
hEFoils[t][i]->SetLineColor(2+2*i);
hEFoils[t][i]->Scale(t0norm[i]/hEFoils[t][i]->GetBinWidth(1));
hToPlot.push_back(hEFoils[t][i]);
OM.qOut.insert("efoils",m);
}
drawSimulHistos(hToPlot);
TLegend *eefleg = new TLegend(0.13,0.82,0.4,0.9);
eefleg->AddEntry(hEFoils[t][0],"Geant4","l");
eefleg->AddEntry(hEFoils[t][1],"Penelope","l");
eefleg->Draw();
OM.printCanvas("EFoils_Type_"+itos(t));
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
Stringmap m;
m.insert("type",t);
m.insert("sim",i);
m.insert("mean",hEWires[t][i]->GetMean());
m.insert("rms",hEWires[t][i]->GetRMS());
m.insert("counts",hEWires[t][i]->Integral());
m.insert("normcounts",hEWires[t][i]->Integral()*t0norm[i]);
gPad->SetLogy(1);
hEWires[t][i]->GetXaxis()->SetTitle("E (keV)");
hEWires[t][i]->SetLineColor(2+2*i);
hEWires[t][i]->Scale(t0norm[i]/hEWires[t][i]->GetBinWidth(1));
//gPad->SetLogy(1);
hToPlot.push_back(hEWires[t][i]);
OM.qOut.insert("ewires",m);
}
drawSimulHistos(hToPlot);
TLegend *ewleg = new TLegend(0.13,0.82,0.4,0.9);
ewleg->AddEntry(hEWires[t][0],"Geant4","l");
ewleg->AddEntry(hEWires[t][1],"Penelope","l");
ewleg->Draw();
OM.printCanvas("EWires_Type_"+itos(t));
}
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
hCTScint[i]->SetLineColor(2+2*i);
hCTScint[i]->Scale(scintnorm[i]/hCTScint[i]->GetBinWidth(1));
hToPlot.push_back(hCTScint[i]);
}
drawSimulHistos(hToPlot);
TLegend *ctsleg = new TLegend(0.13,0.82,0.4,0.9);
ctsleg->AddEntry(hCTScint[0],"Geant4","l");
ctsleg->AddEntry(hCTScint[1],"Penelope","l");
ctsleg->Draw();
OM.printCanvas("Scint_Costheta");
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
hCTMWPC[i]->SetLineColor(2+2*i);
hCTMWPC[i]->Scale(mwpcnorm[i]/hCTMWPC[i]->GetBinWidth(1));
hToPlot.push_back(hCTMWPC[i]);
}
drawSimulHistos(hToPlot);
TLegend *ctmleg = new TLegend(0.13,0.82,0.4,0.9);
ctmleg->AddEntry(hCTMWPC[0],"Geant4","l");
ctmleg->AddEntry(hCTMWPC[1],"Penelope","l");
ctmleg->Draw();
OM.printCanvas("MWPC_In_Costheta");
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
hCTMWPCo[i]->SetLineColor(2+2*i);
hCTMWPCo[i]->Scale(mwpcoutnorm[i]/hCTMWPCo[i]->GetBinWidth(1));
hToPlot.push_back(hCTMWPCo[i]);
}
drawSimulHistos(hToPlot);
TLegend *ctmlego = new TLegend(0.13,0.82,0.4,0.9);
ctmlego->AddEntry(hCTMWPCo[0],"Geant4","l");
ctmlego->AddEntry(hCTMWPCo[1],"Penelope","l");
ctmlego->Draw();
OM.printCanvas("MWPC_Out_Costheta");
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
hPScintX[i]->GetXaxis()->SetTitle("Pos (mm)");
hPScintX[i]->SetLineColor(2+2*i);
hPScintX[i]->Scale(t0norm[i]/hPScintX[i]->GetBinWidth(1));
hToPlot.push_back(hPScintX[i]);
}
drawSimulHistos(hToPlot);
TLegend *psxleg = new TLegend(0.13,0.82,0.4,0.9);
psxleg->AddEntry(hPScintX[0],"Geant4","l");
psxleg->AddEntry(hPScintX[1],"Penelope","l");
psxleg->Draw();
OM.printCanvas("TrigposX_Scint");
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
hPMWPCX[i]->GetXaxis()->SetTitle("Pos (mm)");
hPMWPCX[i]->SetLineColor(2+2*i);
hPMWPCX[i]->Scale(t0norm[i]/hPMWPCX[i]->GetBinWidth(1));
hToPlot.push_back(hPMWPCX[i]);
}
drawSimulHistos(hToPlot);
TLegend *pmxleg = new TLegend(0.13,0.82,0.4,0.9);
pmxleg->AddEntry(hPMWPCX[0],"Geant4","l");
pmxleg->AddEntry(hPMWPCX[1],"Penelope","l");
pmxleg->Draw();
OM.printCanvas("TrigposX_MWPC");
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
hPScintY[i]->GetXaxis()->SetTitle("Pos (mm)");
hPScintY[i]->SetLineColor(2+2*i);
hPScintY[i]->Scale(t0norm[i]/hPScintY[i]->GetBinWidth(1));
hToPlot.push_back(hPScintY[i]);
}
drawSimulHistos(hToPlot);
TLegend *psyleg = new TLegend(0.13,0.82,0.4,0.9);
psyleg->AddEntry(hPScintY[0],"Geant4","l");
psyleg->AddEntry(hPScintY[1],"Penelope","l");
psyleg->Draw();
OM.printCanvas("TrigposY_Scint");
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
hPMWPCY[i]->GetXaxis()->SetTitle("Pos (mm)");
hPMWPCY[i]->SetLineColor(2+2*i);
hPMWPCY[i]->Scale(t0norm[i]/hPMWPCY[i]->GetBinWidth(1));
hToPlot.push_back(hPMWPCY[i]);
}
drawSimulHistos(hToPlot);
TLegend *pmyleg = new TLegend(0.13,0.82,0.4,0.9);
pmyleg->AddEntry(hPMWPCY[0],"Geant4","l");
pmyleg->AddEntry(hPMWPCY[1],"Penelope","l");
pmyleg->Draw();
OM.printCanvas("TrigposY_MWPC");
hToPlot.clear();
for(unsigned int i=0; i<sps.size(); i++) {
hCTFoil[i]->SetLineColor(2+2*i);
hCTFoil[i]->Scale(foilnorm[i]/hCTFoil[i]->GetBinWidth(1));
hToPlot.push_back(hCTFoil[i]);
}
drawSimulHistos(hToPlot);
TLegend *ctfleg = new TLegend(0.13,0.82,0.4,0.9);
ctfleg->AddEntry(hCTFoil[0],"Geant4","l");
ctfleg->AddEntry(hCTFoil[1],"Penelope","l");
ctfleg->Draw();
OM.printCanvas("Foils_Costheta");
}
int main(int, char **) {
gROOT->SetStyle("Plain");
gStyle->SetPalette(1);
gStyle->SetNumberContours(255);
// list of simulated energies
//int enlist[] = {50,100,150,200,300,400,600,800};
//for(int i = 1; i < 8; i++) {
// int l = enlist[i];
// set up output directories
//OutputManager OM("MC_Compare",getEnvSafe("UCNA_ANA_PLOTS")+"/test/MC_Compare/"+itos(l)+"_keV");
OutputManager OM("MC_Compare",getEnvSafe("UCNA_ANA_PLOTS")+"/test/MC_Compare/Xenon131");
Stringmap mcdat;
//mcdat.insert("energy",l);
mcdat.insert("n_MC",2);
// make PMT response look like run 15925
PMTCalibrator PCal(19891);
// load Geant4 simulation
G4toPMT g2p(true);
//std::string fname = getEnvSafe("G4OUTDIR")+"/IsotLine_eGunRandMomentum_"+itos(l)+".0keV/analyzed_*";
std::string fname = getEnvSafe("G4OUTDIR")+"/geant4_data_MB/NEW_Xe131_11-2-/analyzed*";
mcdat.insert("MC_1",fname);
g2p.addFile(fname);
//if(!g2p.getnFiles()) continue;
g2p.setCalibrator(PCal);
// load Penelope simulation
PenelopeToPMT p2p;
//fname = "/home/ucna/penelope_output/iso_line_sources/event_"+itos(l/50-1)+" _*.root";
std::string fpname = getEnvSafe("PENOUTDIR")+"/Xenon131_001*";
mcdat.insert("MC_2",fpname);
p2p.addFile(fpname);
//if(!p2p.getnFiles()) continue;
p2p.setCalibrator(PCal);
// make comparison plots between simulations
//mc_compare_plots(OM,g2p,p2p,2*l);
mc_compare_plots(OM,g2p,p2p,200);
OM.qOut.insert("mcdat",mcdat);
OM.write();
OM.setWriteRoot(true);
//}
return 0;
}
|
UCNA/main
|
Standalone/MC_Comparisons.cc
|
C++
|
gpl-3.0
| 22,595
|
#ifndef _PMINIT_H
#define _PMINIT_H
void pminit();
#endif
|
tomoyat1/tomos
|
sysroot/usr/include/kernel/x86/pminit.h
|
C
|
gpl-3.0
| 60
|
/**
* @file camoto/gamemusic/playback.hpp
* @brief Helper class for managing song playback.
*
* Copyright (C) 2010-2015 Adam Nielsen <malvineous@shikadi.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CAMOTO_GAMEMUSIC_PLAYBACK_HPP_
#define _CAMOTO_GAMEMUSIC_PLAYBACK_HPP_
#include <camoto/gamemusic/music.hpp>
#include <camoto/gamemusic/synth-opl.hpp>
#include <camoto/gamemusic/synth-pcm.hpp>
#include <camoto/gamemusic/eventconverter-opl.hpp>
namespace camoto {
namespace gamemusic {
/// Helper class to assist with song playback.
class CAMOTO_GAMEMUSIC_API Playback: virtual public SynthPCMCallback
{
public:
struct CAMOTO_GAMEMUSIC_API Position
{
Position();
/// Number of times the song has looped.
unsigned int loop;
/// Order number (0 to largest order+1)
/**
* The order number starts at 0 and after the last note is played (when
* \ref end is set to true) this value will equal the number of orders
* in the song. If you are using this field as an index into the order
* list, be careful to check that it is in range first, as it will go out
* of range when the end of the song has been reached!
*/
unsigned int order;
/// Row index within pattern. Starts at 0.
unsigned long row;
/// True if the end of the song has been reached.
bool end;
/// Current tempo at this point in the song. May be different to the
/// song's initial tempo.
Tempo tempo;
bool operator== (const Playback::Position& b);
inline bool operator!= (const Playback::Position& b)
{
return !(*this == b);
}
};
class CAMOTO_GAMEMUSIC_API OPLHandler : virtual public OPLWriterCallback
{
public:
OPLHandler(Playback *playback, bool midi);
// OPLWriterCallback
virtual void writeNextPair(const OPLEvent *oplEvent);
protected:
Playback *playback;
bool midi;
};
Playback(unsigned long sampleRate, unsigned int channels,
unsigned int bits);
~Playback();
/// Set the MIDI patch bank to use for MIDI events.
/**
* @param bankMIDI
* OPL or PCM patch bank to use. Obviously this can't be a MIDI patch
* bank as the point is to translate the MIDI patches to something
* audible.
*/
void setBankMIDI(std::shared_ptr<const PatchBank> bankMIDI);
/// Set the song to play.
/**
* This also resets playback to the start of the song.
*
* @param music
* The song to play.
*/
void setSong(std::shared_ptr<const Music> music);
/// Set the number of times the song should loop.
/**
* @param count
* The number of times the song should be played. 1 means play once, 2
* means play twice (so loop once), and 0 means loop forever.
*/
void setLoopCount(unsigned int count);
/// Get the length of the song, in milliseconds.
/**
* @return The length of the song in milliseconds.
*/
unsigned long getLength();
/// Jump to a specific point in the song, specified by order number.
/**
* @param destOrder
* The order to start playing from. 0 will jump back to the start of the
* song. An order number that is out of range will immediately end the
* song, or jump back to the loop point if the song is set to loop.
*/
void seekByOrder(unsigned int destOrder);
/// Jump to a specific point in the song, specified in milliseconds.
/**
* @param ms
* The new playback point, in milliseconds. The actual playback point
* will always be at the start of a row, so the playback time may not
* be exactly at this number of milliseconds, but will be as close to
* it as possible.
*
* @return Actual seek position, in milliseconds. Will be similar to the
* input parameter, just rounded to the start of the row.
*/
unsigned long seekByTime(unsigned long ms);
/// Synthesize and mix audio into the given buffer.
/**
* @param output
* Input and output buffer. Synthesized audio is mixed into this buffer
* and combined with whatever audio is already in it. Make sure you zero
* the buffer with memset() before the first call!
*
* @param samples
* Size of output, in samples. One sample is one int16_t, and two
* samples is needed for one frame of stereo audio (four bytes).
*
* @param pos
* Pointer to a structure that on return, will receive the playback
* position of the data just placed in the buffer.
*/
void mix(int16_t *output, unsigned long samples, Position *pos);
/// Switch all playing notes off. Notes will still linger as they fade out.
void allNotesOff();
protected:
unsigned long outputSampleRate; ///< in Hertz, e.g. 44100
unsigned int outputChannels; ///< e.g. 2 for stereo
unsigned int outputBits; ///< e.g. 16 for 16-bit output
std::shared_ptr<const Music> music;
unsigned int loopCount; ///< 0=loop forever, 1=no loop, 2=loop once, etc.
std::map<const void *, unsigned int> loopEvents;
// TempoCallback
virtual void tempoChange(const Tempo& tempo);
private:
// These are kept as indices rather than iterators so that the song can be
// modified in between calls to generate() without causing problems.
bool end;
unsigned int loop;
unsigned int order;
unsigned int pattern;
unsigned int row;
unsigned int frame;
unsigned int nextRow;
unsigned int nextOrder;
Tempo tempo;
unsigned int samplesPerFrame;
/// A single frame of audio, copied into the output buffer as needed
std::vector<int16_t> frameBuffer;
unsigned int frameBufferPos;
/// Optional patch bank for MIDI notes
std::shared_ptr<const PatchBank> bankMIDI;
SynthPCM pcm;
SynthPCM pcmMIDI;
SynthOPL opl;
SynthOPL oplMIDI;
OPLHandler oplHandler;
OPLHandler oplHandlerMIDI;
std::shared_ptr<EventConverter_OPL> oplConverter;
std::shared_ptr<EventConverter_OPL> oplConvMIDI;
/// Populate frameBuffer with the next frame
void nextFrame();
};
} // namespace gamemusic
} // namespace camoto
#endif // _CAMOTO_GAMEMUSIC_PLAYBACK_HPP_
|
Malvineous/libgamemusic
|
include/camoto/gamemusic/playback.hpp
|
C++
|
gpl-3.0
| 6,628
|
/**
* OpenKM, Open Document Management System (http://www.openkm.com)
* Copyright (c) 2006-2015 Paco Avila & Josep Llort
*
* No bytes were intentionally harmed during the development of this application.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
package com.openkm.frontend.client.extension.widget.userinfo;
import com.google.gwt.user.client.ui.Composite;
/**
* UserInfoExtension
*
* @author jllort
*
*/
public abstract class UserInfoExtension extends Composite implements HasUserInfoExtension {
}
|
papamas/DMS-KANGREG-XI-MANADO
|
src/main/java/com/openkm/frontend/client/extension/widget/userinfo/UserInfoExtension.java
|
Java
|
gpl-3.0
| 1,213
|
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>LAN Academy V2</title>
<!-- Viewport -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSS -->
<link rel="stylesheet" href="/etc/css/normalize.css">
<link rel="stylesheet" href="/etc/css/styles.css">
<!-- JS -->
<!--[if lt IE 9]>
<script src="/etc/js/html5shiv.js"></script>
<![endif]-->
<!-- Favicons -->
<link rel="shortcut icon" href="/etc/css/img/favicon.ico">
<link rel="apple-touch-icon" href="/etc/css/img/apple-touch-icon.png">
<link href="/etc/css/playlist.css" rel="/tylesheet" type="text/css">
<!--Video-->
<link href="/etc/js/video-js.css" rel="stylesheet" type="text/css">
<link href="/etc/js/video.playlist.css" rel="stylesheet" type="text/css">
<script src="/etc/js/jquery-1.9.1.min.js"></script>
<script src="/etc/js/autoellipsis.min.jquery.js"></script>
<script src="/etc/js/video.js"></script>
<script src="/etc/js/video.playlist.js"></script>
</head>
<body>
<header class="clearfix">
<div class="wrapper">
<h1 class="logo">
<a href="/">LAN Academy LMS</a>
</h1>
<!--Nav-->
<nav>
<ul>
<li><a href="/learn.php?=/var/www/static/content">Video Courses</a></li>
<li><a href="/typing">Typing Games</a></li>
<li><a href="/quiz">Math Practice</a></li>
</ul>
</nav> <!--/ responsive-nav -->
</div> <!--/ wrapper -->
</header>
<section class="main clearfix">
<div class="wrapper">
<!--Add left sidebar here, change width of tasters-->
<div class="tasters" style="width:100%;">
<article>
<!--Title -->
<div class="title-head"><h3>Exercise: linear equations 4</h3></div><!--Dir Listing-->
<iframe src="/static/khan-exercises/exercises/linear_equations_4.html" seamless height="820px" scrolling="no" width="100%"></iframe>
</article>
</div><!--/ tasters -->
</div> <!--/ wrapper -->
</section><!--/ main -->
<footer>
<div class="wrapper">
<p>© Copyleft LAN Academy 2013 <a href="css/acknowledgments.html">Acknowledgments</a>
</p>
</div>
</footer>
<!--Other js-->
<script type="text/javascript">
var playerWidth = 600;
var playerHeight = 400;
</script>
<script src="/etc/js/custom.js"></script>
</body>
</html>
|
lanacademy/Server-Package-V2
|
Server-Package-V2/quiz/linear_equations_4.iframe.html
|
HTML
|
gpl-3.0
| 2,312
|
// _4.h
// This file is part of the _4 program.
// Copyright 2014 David Raymond McCortney II
//
// The _4 program is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The _4 program is distributed in the hope that it will be
// useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with _4. If not, see <http://www.gnu.org/licenses/>.
#pragma once
#include <X11/X.h>
#include <X11/Xlib.h>
#include "board.h"
#include "image.h"
typedef enum { PLAYING, WIN, GAME_OVER } state_t;
extern char WINMSG[]; // Win message.
extern char CREMSG[]; // Credits message.
extern const int B; // Dimensions of each block in pixels.
extern const int BSTARTX, BSTARTY; // Start positions.
// Shapes.
extern const int _[]; // HHHH
extern const int F[]; // HH
extern const int H[]; // H HH
extern const int L[]; // H HH H
extern const int S[]; // H HH
extern const int T[]; // HH HH HHH
extern const int Z[]; // H HH
// HH
enum
{ // Colors.
GREY, PINK, RED, ORANGE, LIME_GREEN, BLUE, ORCHID, MAX_COLOR,
TRANSPARENT = 8,
AREA_X = 10, // Width in blocks.
AREA_Y = 20, // Height in blocks.
MAX_LEVEL = 10, // Maximum number of levels.
MAX_WHICH = 6, // Maximum number of shapes.
GNUTEXT = 9, // Lines of text for copying and warranty.
HELPTEXT = 9 // Lines of help text.
};
extern const int MOD[MAX_LEVEL]; // Clock modulus.
typedef struct
{
Display* display; // Connection to the X server.
int screen; // Default number.
Window root; // Display screen.
Window window; // _4 area.
XEvent event; // Asynchronous data.
Atom deletion; // Destroy.
unsigned long black, white; // Default.
unsigned long color[MAX_COLOR]; // Named.
GC context; // Graphics.
image_t image; // Background.
int clock; // Time.
state_t state; // Track whether user is playing, game ended, etc.
int level; // Difficulty.
int x, y; // Current coordinates.
int angle; // One unit is ninety degrees.
int which; // Shape index.
int which_next; // Next shape index.
bool redraw; // Display is rendered if this is true.
bool pause; // Halt.
int goal; // Number of _4s required to advance.
int score; // +1 for row, +100 for duo, +10K for trio, +1M for _4.
board_t board; // Play area.
XColor c; // Color allocation.
Colormap m; // Map.
} x11;
#define IMGPATH "image.g.c"
x11* _4init(int,
char**,
bool);
void _4init_game_state(x11*);
bool input(x11*);
void stop_x11(x11*);
void box(int, // Color.
int, // Column.
int, // Row.
x11*);
void shape(int, // Bitmap.
int, // Color.
int, // Column.
int, // Row.
x11*);
void shapesub(int, // Bitmap.
int, // Color.
int, // Column.
int, // Row.
bool, // Forced if true, clipped otherwise.
x11*);
int pickshape(int, // Which shape.
int); // Angle.
void announce(const char*, // Display the given message as a bar
x11*); // across the center of the screen.
void announce_y(const char*,
int,
x11*);
bool lose(x11*); // True if game lost, false otherwise. Also displays notice.
void setgoal(x11*); // Set goal based on level.
|
david10r/_4
|
_4.h
|
C
|
gpl-3.0
| 3,841
|
#!/bin/sh
#-------------------------------------------------------------------
# config.sh: This file is read at the beginning of the execution of the ASGS to
# set up the runs that follow. It is reread at the beginning of every cycle,
# every time it polls the datasource for a new advisory. This gives the user
# the opportunity to edit this file mid-storm to change config parameters
# (e.g., the name of the queue to submit to, the addresses on the mailing list,
# etc)
#-------------------------------------------------------------------
#
# Copyright(C) 2019 Jason Fleming
#
# This file is part of the ADCIRC Surge Guidance System (ASGS).
#
# The ASGS is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# ASGS is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# the ASGS. If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------
# Fundamental
INSTANCENAME=ncfs-dev-ec95d-nam-master # "name" of this ASGS process
SCRATCHDIR=/scratch/ncfs-dev/${INSTANCENAME}
# Input files and templates
GRIDNAME=ec95d
source $SCRIPTDIR/config/mesh_defaults.sh
# Physical forcing (defaults set in config/forcing_defaults.sh)
TIDEFAC=on # tide factor recalc
HINDCASTLENGTH=25.0 # length of initial hindcast, from cold (days)
BACKGROUNDMET=on # NAM download/forcing
FORECASTCYCLE="00,06,12,18"
TROPICALCYCLONE=off # tropical cyclone forcing
STORM=-1 # storm number, e.g. 05=ernesto in 2006
YEAR=2019 # year of the storm
WAVES=off # wave forcing
REINITIALIZESWAN=no # used to bounce the wave solution
VARFLUX=off # variable river flux forcing
RIVERSITE=data.disaster.renci.org
RIVERDIR=/opt/ldm/storage/SCOOP/RHLRv9-OKU
RIVERUSER=bblanton
RIVERDATAPROTOCOL=scp
CYCLETIMELIMIT="99:00:00"
# Computational Resources (related defaults set in platforms.sh)
NCPU=63 # number of compute CPUs for all simulations
NCPUCAPACITY=256
NUMWRITERS=1
ACCOUNT=null
# Post processing and publication
INTENDEDAUDIENCE=developers-only # "general" | "developers-only" | "professional"
#POSTPROCESS=( accumulateMinMax.sh createMaxCSV.sh cpra_slide_deck_post.sh includeWind10m.sh createOPeNDAPFileList.sh opendap_post.sh )
POSTPROCESS=( includeWind10m.sh createOPeNDAPFileList.sh opendap_post.sh )
#OPENDAPNOTIFY="asgs.cera.lsu@gmail.com jason.g.fleming@gmail.com"
OPENDAPNOTIFY="bblanton@renci.org"
NOTIFY_SCRIPT=ncfs_nam_notify.sh
# Initial state (overridden by STATEFILE after ASGS gets going)
COLDSTARTDATE=2019080100 # calendar year month day hour YYYYMMDDHH24
HOTORCOLD=coldstart # "hotstart" or "coldstart"
LASTSUBDIR=null
# Scenario package
#PERCENT=default
SCENARIOPACKAGESIZE=2
case $si in
-2)
ENSTORM=hindcast
;;
-1)
# do nothing ... this is not a forecast
ENSTORM=nowcast
;;
0)
ENSTORM=namforecastWind10m
source $SCRIPTDIR/config/io_defaults.sh # sets met-only mode based on "Wind10m" suffix
;;
1)
ENSTORM=namforecast
;;
*)
echo "CONFIGRATION ERROR: Unknown ensemble member number: '$si'."
;;
esac
PREPPEDARCHIVE=prepped_${GRIDNAME}_${INSTANCENAME}_${NCPU}.tar.gz
HINDCASTARCHIVE=prepped_${GRIDNAME}_hc_${INSTANCENAME}_${NCPU}.tar.gz
|
jasonfleming/asgs
|
config/2019/ncfs-dev/asgs_config_ec95d_nam.sh
|
Shell
|
gpl-3.0
| 3,778
|
form table tr th {
margin: 15px 15px;
}
body {
text-align: center;
}
nav ul {
list-style: none;
margin: 20px 0px;
}
h2 {
font-size: 1.75em;
}
nav ul li a {
font-size: 1.75em;
}
table {
margin: 1em auto;
border-collapse: separate;
border-spacing: 20px;
}
|
gorrog/isitup
|
is_it_up_interface/interface/static/interface/contact.css
|
CSS
|
gpl-3.0
| 303
|
using System;
using System.Windows.Forms;
using mraNet.Forms;
namespace mraNet
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
private static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new ApplicationWindow());
}
}
}
|
kelsos/mra-net-sharp
|
mraSharp/Program.cs
|
C#
|
gpl-3.0
| 413
|
# Copyright (C) 2013 Michael Biggs. See the COPYING file at the top-level
# directory of this distribution and at http://shok.io/code/copyright.html
# Tokens that come from the Lexer are either pairs or tuples:
# colno:type
# colno:type:value
class LexToken:
colno = 0
ttype = ''
tvalue = ''
def __init__(self, tokenstr):
t = tokenstr.split(':')
if len(t) < 2 or len(t) > 3:
raise Exception("invalid token: %s" % t)
self.colno = t[0]
self.ttype = t[1]
if len(t) == 3:
self.tvalue = t[2]
def __repr__(self):
if '' == self.tvalue:
return "<%s:%s>" % (self.colno, self.ttype)
else:
return "<%s:%s:%s>" % (self.colno, self.ttype, self.tvalue)
def NewlineToken():
return LexToken('0:NEWL')
|
nfomon/shok
|
parser/shokparser/LexToken.py
|
Python
|
gpl-3.0
| 757
|
//**************
// Golden Gears Robotics
// 2/7/15
// Hardware H
//**************
// Tyler Robbins - 2-7-15 - Added Hardware class definition.
// Tyler Robbins - 2-8-15 - Added PIDrift object.
#ifndef _HARDWARE_H_
#define _HARDWARE_H_
#include "WPILib.h"
#include "ADXRS453Z.h"
#include "PIDrift.h"
enum Talons{FRONT_LEFT_WHEEL,FRONT_RIGHT_WHEEL,BACK_LEFT_WHEEL,BACK_RIGHT_WHEEL,ELEVATOR_MOTOR};
const float SPOOL_RADIUS = 1.25; // inches
class Hardware{
public:
~Hardware();
void move(Joystick *joy);
void ElevatorPeriodic(bool up=false, bool down=false, int gotop=-1);
void toggleSolenoid(Solenoid *sol);
void setSolenoid(Solenoid *sol, bool value);
void resetDrift();
float shiftThrottle(float throt);
float filterJoyValue(float val);
ADXRS453Z* GetGyro(){ return ggnore; };
PIDrift* GetPIDrift(){ return drift; };
RobotDrive* GetDrive(){ return drive; };
CANTalon* GetTalon(Talons tal){
switch(tal){
case Talons::FRONT_RIGHT_WHEEL: return frontRight;
case Talons::FRONT_LEFT_WHEEL: return frontLeft;
case Talons::BACK_RIGHT_WHEEL: return backRight;
case Talons::BACK_LEFT_WHEEL: return backLeft;
case Talons::ELEVATOR_MOTOR: return elevator;
}
};
AnalogPotentiometer* GetPotentiometer(){ return poten; }
static Hardware* GetInstance();
double GetGyroRate() { return ggnore->GetRate(); };
double GetGyroAngle() { return ggnore->GetAngle(); };
double GetGyroOffset() { return ggnore->GetOffset(); };
float GetPotenValue(){ return poten->Get(); };
private:
Hardware();
void moveElevator(float pwr);
void ElevatorUp(float percent);
void ElevatorDown(float percent);
void ElevatorGoTo(int pos);
float stripDecimals(float num,int place);
float convertDisToVolt(float dist);
float convertVolToDist(float volt);
float GetNextPosition(JoystickButton* buttons);
CANTalon *frontLeft;
CANTalon *frontRight;
CANTalon *backLeft;
CANTalon *backRight;
CANTalon *elevator;
AnalogPotentiometer *poten;
RobotDrive *drive;
ADXRS453Z *ggnore;
PIDrift *drift;
static Hardware* m_instance;
};
#endif
|
GoldenGears/RobotCode2015V
|
src.v5/Hardware.h
|
C
|
gpl-3.0
| 2,150
|
# Install script for directory: /home/ryu/workspace/library/opencv/opencv-3.2.0/modules/videostab
# Set the install prefix
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX "/home/ryu/workspace/library/opencv/opencv-3.2.0/build/install")
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# Set the install configuration name.
IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
IF(BUILD_TYPE)
STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
ELSE(BUILD_TYPE)
SET(CMAKE_INSTALL_CONFIG_NAME "Release")
ENDIF(BUILD_TYPE)
MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
# Set the component getting installed.
IF(NOT CMAKE_INSTALL_COMPONENT)
IF(COMPONENT)
MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
ELSE(COMPONENT)
SET(CMAKE_INSTALL_COMPONENT)
ENDIF(COMPONENT)
ENDIF(NOT CMAKE_INSTALL_COMPONENT)
# Install shared libraries without execute permission?
IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
SET(CMAKE_INSTALL_SO_NO_EXE "1")
ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
|
ujuo/opencv
|
opencv-3.2.0/build/modules/videostab/.videostab/cmake_install.cmake
|
CMake
|
gpl-3.0
| 1,247
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.