repo_name
stringlengths
4
116
path
stringlengths
4
379
size
stringlengths
1
7
content
stringlengths
3
1.05M
license
stringclasses
15 values
lfreneda/cepdb
api/v1/65040851.jsonp.js
154
jsonp({"cep":"65040851","logradouro":"Rua Frei J\u00falio","bairro":"Vila dos Frades","cidade":"S\u00e3o Lu\u00eds","uf":"MA","estado":"Maranh\u00e3o"});
cc0-1.0
lfreneda/cepdb
api/v1/27210180.jsonp.js
149
jsonp({"cep":"27210180","logradouro":"Rua do Varj\u00e3o","bairro":"Santo Agostinho","cidade":"Volta Redonda","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/21852229.jsonp.js
135
jsonp({"cep":"21852229","logradouro":"Travessa Acre","bairro":"Bangu","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
liangzz92/MyBaby
MyBaby/src/com/canace/mybaby/activity/SlidesActivity.java
9666
/** * SlidesActivity.java * 查看大图,可左右滑动切换图片,以及分享图片到第三方平台 * @author liangzz * 2014-12-2 */ package com.canace.mybaby.activity; import java.util.ArrayList; import java.util.List; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.view.animation.Animation; import android.view.animation.LinearInterpolator; import android.view.animation.RotateAnimation; import android.widget.ImageView; import android.widget.Toast; import com.canace.mybaby.R; import com.canace.mybaby.adapter.ImagePagerAdapter; import com.canace.mybaby.db.model.ImageItem; import com.canace.mybaby.utils.BitmapHelper; import com.canace.mybaby.utils.CommonsUtil; import com.canace.mybaby.utils.MyBabyConstants; import com.canace.mybaby.view.ImageViewPager; import com.canace.mybaby.view.PView; import com.umeng.analytics.MobclickAgent; import com.umeng.socialize.bean.SHARE_MEDIA; import com.umeng.socialize.bean.SocializeConfig; import com.umeng.socialize.bean.SocializeEntity; import com.umeng.socialize.controller.UMServiceFactory; import com.umeng.socialize.controller.UMSocialService; import com.umeng.socialize.controller.listener.SocializeListeners.SnsPostListener; import com.umeng.socialize.media.QQShareContent; import com.umeng.socialize.media.QZoneShareContent; import com.umeng.socialize.media.UMImage; import com.umeng.socialize.sso.QZoneSsoHandler; import com.umeng.socialize.sso.SinaSsoHandler; import com.umeng.socialize.sso.TencentWBSsoHandler; import com.umeng.socialize.sso.UMQQSsoHandler; import com.umeng.socialize.sso.UMSsoHandler; import com.umeng.socialize.weixin.controller.UMWXHandler; public class SlidesActivity extends MyBabyActivity { public static final int RESULT_SLIDESACTIVITY = 0; protected static final String TAG = "SlidesActivity"; private final int DEFAULT_SCROLL_ROWS = 5; private ImageViewPager imagesViewPager; private ImageView loadingImageView; private ImageView backImageView; private ImageView shareImageView; private ImagePagerAdapter imagePagerAdapter; private int fromItem; private int fromFirstVisiblePosition; private Context mContext; private final UMSocialService mController = UMServiceFactory .getUMSocialService("com.umeng.share"); private ImageItem[] imageItems; protected List<PView> largeImagesPViews = new ArrayList<PView>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_slides); initComponents(); } /** * */ private void initComponents() { // TODO Auto-generated method stub mContext = this; fromItem = getIntent().getIntExtra("fromItem", 0); fromFirstVisiblePosition = getIntent().getIntExtra( "firstVisiblePosition", 0); imageItems = HomePageActivity.getImageItems(); if (largeImagesPViews.size() < imageItems.length) { for (int i = largeImagesPViews.size(); i < imageItems.length; i++) { largeImagesPViews.add(new PView(mContext)); } } imagesViewPager = (ImageViewPager) findViewById(R.id.vPager); loadingImageView = (ImageView) findViewById(R.id.loading); startAnimation(loadingImageView); backImageView = (ImageView) findViewById(R.id.backbutton); shareImageView = (ImageView) findViewById(R.id.sharebutton); backImageView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { finishAndReturnResult(); } }); shareImageView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // 添加微信平台 UMWXHandler wxHandler = new UMWXHandler(mContext, MyBabyConstants.WEIXIN_APPID, MyBabyConstants.WEIXIN_APPKEY); wxHandler.setTargetUrl(MyBabyConstants.MYBABY_WEBSITE); wxHandler.addToSocialSDK(); // 添加微信朋友圈 UMWXHandler wxCircleHandler = new UMWXHandler(mContext, MyBabyConstants.WEIXIN_APPID, MyBabyConstants.WEIXIN_APPKEY); wxCircleHandler.setToCircle(true); wxCircleHandler.setTargetUrl(MyBabyConstants.MYBABY_WEBSITE); wxCircleHandler.addToSocialSDK(); UMQQSsoHandler qqSsoHandler = new UMQQSsoHandler( SlidesActivity.this, MyBabyConstants.QQAPPID, MyBabyConstants.QQAPPKEY); qqSsoHandler.addToSocialSDK(); QZoneSsoHandler qZoneSsoHandler = new QZoneSsoHandler( SlidesActivity.this, MyBabyConstants.QQAPPID, MyBabyConstants.QQAPPKEY); qZoneSsoHandler.addToSocialSDK(); // 设置新浪SSO handler mController.getConfig().setSsoHandler(new SinaSsoHandler()); // 设置腾讯微博SSO handler mController.getConfig() .setSsoHandler(new TencentWBSsoHandler()); try { UMImage mUMImgBitmap = new UMImage( mContext, BitmapHelper.getScaledBitmapFromSDCard( imageItems[imagesViewPager.getCurrentItem()] .getImagePath(), 600)); QQShareContent qqShareContent = new QQShareContent( mUMImgBitmap); // 设置分享title qqShareContent.setTitle("我的宝贝"); // 设置分享文字 qqShareContent.setShareContent(MyBabyConstants.ABOUT); // 设置点击分享内容的跳转链接 qqShareContent.setTargetUrl(MyBabyConstants.MYBABY_WEBSITE); mController.setShareMedia(qqShareContent); QZoneShareContent qzone = new QZoneShareContent( mUMImgBitmap); // 设置分享文字 qzone.setShareContent(MyBabyConstants.ABOUT); // 设置点击消息的跳转URL qzone.setTargetUrl(MyBabyConstants.MYBABY_WEBSITE); // 设置分享内容的标题 qzone.setTitle("我的宝贝"); mController.setShareMedia(qzone); // 设置分享图片 mController.setShareMedia(mUMImgBitmap); mController.setShareContent("我的宝贝"); mController.setAppWebSite(MyBabyConstants.MYBABY_WEBSITE); } catch (Exception exception) { if (CommonsUtil.DEBUG) { Log.i(TAG, "GetBitmapFailed" + imageItems[imagesViewPager .getCurrentItem()] .getImagePath()); } } mController.setAppWebSite(SHARE_MEDIA.RENREN, MyBabyConstants.MYBABY_WEBSITE); SocializeConfig config = mController.getConfig(); config.registerListener(new SnsPostListener() { @Override public void onStart() { } @Override public void onComplete(SHARE_MEDIA arg0, int arg1, SocializeEntity arg2) { if (arg1 == 200) { Toast.makeText(mContext, "分享成功", Toast.LENGTH_SHORT) .show(); } } }); // 分享面板中的平台将按照如下顺序进行排序, // 微信、微信朋友圈、新浪、腾讯微博、QQ、QQ空间、人人、豆瓣、邮件、短信...... config.setPlatformOrder(SHARE_MEDIA.WEIXIN, SHARE_MEDIA.WEIXIN_CIRCLE, SHARE_MEDIA.SINA, SHARE_MEDIA.QQ, SHARE_MEDIA.QZONE, SHARE_MEDIA.TENCENT, SHARE_MEDIA.RENREN, SHARE_MEDIA.DOUBAN, SHARE_MEDIA.EMAIL, SHARE_MEDIA.SMS, SHARE_MEDIA.GOOGLEPLUS); mController.openShare(SlidesActivity.this, false); } }); imagePagerAdapter = new ImagePagerAdapter(largeImagesPViews); imagePagerAdapter.setImageItems(imageItems); imagesViewPager.setAdapter(imagePagerAdapter); imagesViewPager.setCurrentItem(fromItem); // Set up the user interaction to manually show or hide the system UI. imagesViewPager .setOnClickListener(new ImageViewPager.OnClickListener() { @Override public void onClick(View view) { finishAndReturnResult(); } }); } /** * @param loadingImageView */ private void startAnimation(ImageView loadingImageView) { // TODO Auto-generated method stub Animation animRoute = new RotateAnimation(0.0f, +360.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);// 设置位移动画 animRoute.setDuration(1000);// 持续1秒 animRoute.setRepeatMode(Animation.RESTART);// 重复 animRoute.setRepeatCount(Animation.INFINITE);// 无限次 // 旋转一次不停顿一下,需要以下两行代码 LinearInterpolator lir = new LinearInterpolator(); animRoute.setInterpolator(lir); loadingImageView.startAnimation(animRoute); } @Override public void onBackPressed() { finishAndReturnResult(); } private void finishAndReturnResult() { Intent mIntent = new Intent(); if (imagesViewPager.getCurrentItem() / 3 - fromFirstVisiblePosition / 3 > DEFAULT_SCROLL_ROWS || imagesViewPager.getCurrentItem() < fromFirstVisiblePosition) { mIntent.putExtra("currentItem", imagesViewPager.getCurrentItem()); } else { mIntent.putExtra("currentItem", -1); } this.setResult(RESULT_SLIDESACTIVITY, mIntent); finish(); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); /** 使用SSO授权必须添加如下代码 */ UMSsoHandler ssoHandler = mController.getConfig().getSsoHandler( requestCode); if (ssoHandler != null) { ssoHandler.authorizeCallBack(requestCode, resultCode, data); } } @Override public void onResume() { super.onResume(); MobclickAgent.onResume(this); } @Override public void onPause() { super.onPause(); MobclickAgent.onPause(this); } }
cc0-1.0
lfreneda/cepdb
api/v1/13606390.jsonp.js
154
jsonp({"cep":"13606390","logradouro":"Rua Nelson Ferreira","bairro":"Jardim Jos\u00e9 Ometto II","cidade":"Araras","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/30624140.jsonp.js
169
jsonp({"cep":"30624140","logradouro":"Pra\u00e7a Marabu","bairro":"Fl\u00e1vio Marques Lisboa (Barreiro)","cidade":"Belo Horizonte","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/36307428.jsonp.js
184
jsonp({"cep":"36307428","logradouro":"Rua Professor Jo\u00e3o Batista Viegas","bairro":"Vila Maria (Bonfim)","cidade":"S\u00e3o Jo\u00e3o Del Rei","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/18278701.jsonp.js
148
jsonp({"cep":"18278701","logradouro":"Rua Jos\u00e9 Ferraz","bairro":"Jardim Planalto","cidade":"Tatu\u00ed","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/75535681.jsonp.js
153
jsonp({"cep":"75535681","logradouro":"Rua Nig\u00e9ria","bairro":"Lad\u00e1rio Cardoso de Paula","cidade":"Itumbiara","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
lfreneda/cepdb
api/v1/21911140.jsonp.js
156
jsonp({"cep":"21911140","logradouro":"Rua Marau","bairro":"Freguesia (Ilha do Governador)","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/06045445.jsonp.js
142
jsonp({"cep":"06045445","logradouro":"Alameda dos Aic\u00e1s","bairro":"Novo Osasco","cidade":"Osasco","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
jonstuebe/farkle
src/components/BottomDrawer.js
210
import React from 'react'; const BottomDrawer = React.createClass({ render() { return ( <footer className="bottom-drawer"> {this.props.children} </footer> ) } }); export default BottomDrawer;
cc0-1.0
lfreneda/cepdb
api/v1/82400450.jsonp.js
152
jsonp({"cep":"82400450","logradouro":"Rua Ezequiel Hon\u00f3rio Vialle","bairro":"Butiatuvinha","cidade":"Curitiba","uf":"PR","estado":"Paran\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/71961360.jsonp.js
164
jsonp({"cep":"71961360","logradouro":"Quadra QS 5 Rua 400 B","bairro":"Areal (\u00c1guas Claras)","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
cc0-1.0
lfreneda/cepdb
api/v1/39347000.jsonp.js
90
jsonp({"cep":"39347000","cidade":"Alva\u00e7\u00e3o","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/40100070.jsonp.js
123
jsonp({"cep":"40100070","logradouro":"Avenida Andrade","bairro":"Garcia","cidade":"Salvador","uf":"BA","estado":"Bahia"});
cc0-1.0
lfreneda/cepdb
api/v1/41130330.jsonp.js
139
jsonp({"cep":"41130330","logradouro":"Pra\u00e7a Arthur Lago","bairro":"Pernambu\u00e9s","cidade":"Salvador","uf":"BA","estado":"Bahia"});
cc0-1.0
lfreneda/cepdb
api/v1/29031720.jsonp.js
166
jsonp({"cep":"29031720","logradouro":"Rua Manoel Ferreira Constantino","bairro":"Inhanguet\u00e1","cidade":"Vit\u00f3ria","uf":"ES","estado":"Esp\u00edrito Santo"});
cc0-1.0
lfreneda/cepdb
api/v1/65092123.jsonp.js
164
jsonp({"cep":"65092123","logradouro":"Rua Magalh\u00e3es de Almeida","bairro":"Mata de Itapera","cidade":"S\u00e3o Lu\u00eds","uf":"MA","estado":"Maranh\u00e3o"});
cc0-1.0
lfreneda/cepdb
api/v1/96095210.jsonp.js
139
jsonp({"cep":"96095210","logradouro":"Avenida Pernambuco","bairro":"Laranjal","cidade":"Pelotas","uf":"RS","estado":"Rio Grande do Sul"});
cc0-1.0
lfreneda/cepdb
api/v1/21550230.jsonp.js
152
jsonp({"cep":"21550230","logradouro":"Rua \u00c1tila Silveira","bairro":"Oswaldo Cruz","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
Kattjakt/soundmist
app/directives/sidebar/sidebar.js
412
angular.module('soundmist').directive('sidebar', function (API) { return { restrict: 'E', scope: false, replace: false, templateUrl: 'directives/sidebar/sidebar.html', controller: function ($scope, $q, API, Handler) { API.ready.promise.then(() => { $scope.user = cache.user $scope.playlists = cache.playlists Handler.setLoaded() }) } } })
cc0-1.0
lfreneda/cepdb
api/v1/72870249.jsonp.js
152
jsonp({"cep":"72870249","logradouro":"Rua 8","bairro":"Novo Jardim Oriente","cidade":"Valpara\u00edso de Goi\u00e1s","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
weis0061/GGJ2015
Developers/Assets/Flare.cs
1422
using UnityEngine; using System.Collections; public class Flare : MonoBehaviour { float lightTimer = 1.0f; public float lightIntensityMin = 0.5f; public float lightIntensityMax = 1.0f; bool isLightOn = true; // Use this for initialization void Start () { } // Update is called once per frame void Update () { lightTimer -= Time.deltaTime; //checks if the light is on if(isLightOn) { //checks if the light timer is less or equal to zero if( lightTimer <= 0) { //changes the intensity of the light to zero (off) this.gameObject.light.intensity = Random.Range(lightIntensityMin, lightIntensityMax); isLightOn = false; //resets the timer to a random value between 0 and 0.666 lightTimer = Random.Range(0.0f, lightTimer); } } //checks if the light is off if(!isLightOn) { //checks if the timer is less than 0 if( lightTimer <= 0) { //sets the light intensity this.gameObject.light.intensity = Random.Range(lightIntensityMin, lightIntensityMax); isLightOn = true; lightTimer = Random.Range(0.0f, lightTimer); } } } }
cc0-1.0
lfreneda/cepdb
api/v1/14707032.jsonp.js
155
jsonp({"cep":"14707032","logradouro":"Rua Walter Padovani","bairro":"Est\u00e2ncia Vila Verde","cidade":"Bebedouro","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/86035770.jsonp.js
160
jsonp({"cep":"86035770","logradouro":"Rua Ant\u00f4nio Mendes da Silva","bairro":"Jardim Santa F\u00e9","cidade":"Londrina","uf":"PR","estado":"Paran\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/65093324.jsonp.js
136
jsonp({"cep":"65093324","logradouro":"Rua do Fio","bairro":"Estiva","cidade":"S\u00e3o Lu\u00eds","uf":"MA","estado":"Maranh\u00e3o"});
cc0-1.0
larlequin/labnotebook
plugin/notify.py
2522
#!/usr/bin/env python # -*- coding: utf-8 -*- import re import os import glob from time import strftime from subprocess import call author = 'GT Vallet' fmd = 'notebook.md' def change_mdheading(content): if re.search(r"#{1}", content): for lvl in range(5,0,-1): pattern = re.compile(r'[^#]#{%s}[^#]' % lvl) subs = "\n" + '#' * (lvl+1) + " " content = re.sub(pattern, subs, content) return content def extract_head(heading): title = re.search(r"TITLE:\s+(.*)", heading).group(1) creation = re.search(r"CREATED:\s+(.*)", heading).group(1) last_modif = re.search(r"LAST CHANGE:\s+(.*)", heading).group(1) return {'title': title, 'creation': creation, 'last_change': last_modif} def get_content(note): head_pattern = re.compile(r"^\"-+\n(.*)\"-+", re.DOTALL) fnote = open(note).readlines() head = re.search(head_pattern, "".join(fnote)).group(1) body = fnote[head.count('\n')+2:] body = change_mdheading("".join(body)) data = extract_head(head) data['content'] = body return data def create_template(project, author): today = strftime("%Y-%m-%d") header = "% {0}\n".format(project) header += "% {0}\n".format(author) header += "% {0}\n".format(today) with open(fmd, 'w+') as fnote: fnote.write(header) def notify(project, output='html'): # Define the project's directory as the working directory os.chdir(project['path']) # Get all the lab files inside that directory notes = glob.glob('*.lab') if len(notes) < 1: print("No note to compile into a notebook") return create_template(project['name'], 'GT Vallet') # Extract content of each note and transform it to markdown format for note in notes: data = get_content(note) head_note = "<span class='notetitle'> %s </span>" % data['title'] head_note += "<span class='datecrea'> %s </span>" % data['creation'] if data['last_change'] != data['creation']: head_note += "<span class='update'> (%s) </span>" % data['last_change'] if output == 'html': head_note = "\n\n# " + head_note + "\n</span>\n\n" with open(fmd, 'a+') as fnote: fnote.write("<article class='note'>") fnote.write(head_note) fnote.write(data['content']) fnote.write("</article>") call(['pandoc', '-s', '-S', 'notebook.md', '-o', 'notebook.html', '--toc', '--template=template.html', '--css=style.css'])
cc0-1.0
lfreneda/cepdb
api/v1/29156548.jsonp.js
154
jsonp({"cep":"29156548","logradouro":"Rua Oswaldo Prud\u00eancio","bairro":"Santa Luzia","cidade":"Cariacica","uf":"ES","estado":"Esp\u00edrito Santo"});
cc0-1.0
lfreneda/cepdb
api/v1/13083090.jsonp.js
152
jsonp({"cep":"13083090","logradouro":"Rua Danton Jobim","bairro":"Cidade Universit\u00e1ria","cidade":"Campinas","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/77818714.jsonp.js
148
jsonp({"cep":"77818714","logradouro":"Rua QC 0002","bairro":"Conjunto Urban\u00edstico","cidade":"Aragua\u00edna","uf":"TO","estado":"Tocantins"});
cc0-1.0
biomodels/MODEL1201070001
setup.py
377
from setuptools import setup, find_packages setup(name='MODEL1201070001', version=20140916, description='MODEL1201070001 from BioModels', url='http://www.ebi.ac.uk/biomodels-main/MODEL1201070001', maintainer='Stanley Gu', maintainer_url='stanleygu@gmail.com', packages=find_packages(), package_data={'': ['*.xml', 'README.md']}, )
cc0-1.0
lfreneda/cepdb
api/v1/22710235.jsonp.js
149
jsonp({"cep":"22710235","logradouro":"Rua Soldado Diogo Martins","bairro":"Taquara","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/79904382.jsonp.js
152
jsonp({"cep":"79904382","logradouro":"Rua Amambai","bairro":"Bairro Santa Isabel","cidade":"Ponta Por\u00e3","uf":"MS","estado":"Mato Grosso do Sul"});
cc0-1.0
nschulz/portfolio-site
js/parts/Experience.js
417
var Experience = $V.classes.VViewController.extend({ displayName: "Experience", viewWillInit: function(prop) { prop.margins = { top: 40, left: 0, right: 0, bottom: 40 }; prop.allowWheelScroll = true; prop.id = "ExperienceContent"; this._view = $V.ScrollView.alloc(prop); }, viewDidLoad: function(aView) { this.view().setContentFromUrl("content/experience.html"); } }); $V.setIncludeObject(Experience);
cc0-1.0
lfreneda/cepdb
api/v1/18200025.jsonp.js
136
jsonp({"cep":"18200025","logradouro":"Rua Adolfo Lutz","bairro":"Centro","cidade":"Itapetininga","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/38442228.jsonp.js
137
jsonp({"cep":"38442228","logradouro":"Rua L","bairro":"Goi\u00e1s (Parte Alta)","cidade":"Araguari","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/77816700.jsonp.js
148
jsonp({"cep":"77816700","logradouro":"Rua dos L\u00edrios","bairro":"Jardim Pedra Alta","cidade":"Aragua\u00edna","uf":"TO","estado":"Tocantins"});
cc0-1.0
lfreneda/cepdb
api/v1/86085500.jsonp.js
138
jsonp({"cep":"86085500","logradouro":"Rua Francisco Lucas Lopes","bairro":"Assis","cidade":"Londrina","uf":"PR","estado":"Paran\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/73804055.jsonp.js
138
jsonp({"cep":"73804055","logradouro":"Via Via 10","bairro":"Ch\u00e1caras do Abreu","cidade":"Formosa","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
lfreneda/cepdb
api/v1/25215040.jsonp.js
165
jsonp({"cep":"25215040","logradouro":"Alameda Dur\u00e3o","bairro":"Parque Nossa Senhora da Penha","cidade":"Duque de Caxias","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/06716352.jsonp.js
141
jsonp({"cep":"06716352","logradouro":"Rua Piracema","bairro":"Parque S\u00e3o Paulo","cidade":"Cotia","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
amecky/dodger
src/Dodger.cpp
6496
#include "Dodger.h" #include <core\log\Log.h> #include "Constants.h" #include <renderer\sprites.h> #include <gamestates\GameStateMachine.h> #include "gamestates\MainGameState.h" #include "gamestates\GameOverState.h" #include "gamestates\MainMenuState.h" #include <particles\ParticlesTestState.h> #include "gamestates\FourierTestState.h" //#include "gamestates\HighscoreState.h" #include "GameContext.h" #include "GameSettings.h" #include "objects\WarpingGrid.h" #include "objects\ElasticBorder.h" #include <core\world\actions\ScaleByPathAction.h> #include <core\world\actions\MoveByAction.h> #include <core\world\actions\LookAtAction.h> #include <core\world\actions\WiggleAction.h> #include <core\world\actions\AlignToForceAction.h> #include <core\world\actions\CollisionAction.h> #include <core\world\actions\RotateByAction.h> #include <core\world\actions\ScalingAction.h> #include "objects\Stages.h" ds::BaseApp *app = new Dodger(); Dodger::Dodger() : ds::BaseApp() { //_server = new ds::GameServer('127', '0', '0', '1', 9000); } Dodger::~Dodger() { //_server->close(); //delete _server; delete _process; delete _context->elasticBorder; delete _context->settings; delete _context->world; delete _context->grid; delete _context; } // ------------------------------------------------------- // prepare // ------------------------------------------------------- void Dodger::prepare(ds::Settings* settings) { settings->screenWidth = 1024; settings->screenHeight = 768; settings->clearColor = ds::Color(0, 0, 0, 255); settings->fullScreen = false; settings->reportingDirectory = "reports"; settings->synched = true; settings->reloading = true; } // ------------------------------------------------------- // Load content and prepare game // ------------------------------------------------------- bool Dodger::loadContent() { _scale_path.add(0.0f, v3(0.1f, 0.1f, 0.0f)); _scale_path.add(0.5f, v3(1.2f, 1.2f, 0.0f)); _scale_path.add(0.75f, v3(0.75f, 0.75f, 0.0f)); _scale_path.add(1.0f, v3(1.0f, 1.0f, 0.0f)); RID material = ds::res::find("SpriteMaterial", ds::ResourceType::MATERIAL); ds::Material* m = ds::res::getMaterial(material); m->texture = ds::res::find("TextureArray", ds::ResourceType::TEXTURE); _border_color = ds::Color(107, 72, 72, 255); _context = new GameContext; _context->settings = new GameSettings; _context->settings->load(); _context->grid = new WarpingGrid(_context->settings); _context->grid->createGrid(); // create game objects ds::game::add_game_object(new SimplePlayer(_context)); ds::game::add_game_object(new Bullets(_context)); ds::game::add_game_object(new Stages(_context)); _context->world = new ds::World; _context->world->setBoundingRect(ds::Rect(25, 20, 1250, 680)); _context->world->useTemplates(ds::res::getWorldEntityTemplates(SID("game_objects"))); _context->world->ignoreCollisions(OT_FOLLOWER, OT_FOLLOWER); _context->world->ignoreCollisions(OT_WIGGLE_FOLLOWER, OT_WIGGLE_FOLLOWER); _context->world->ignoreCollisions(OT_PLAYER, OT_BULLET); _context->world->ignoreCollisions(OT_BULLET, OT_BULLET); behaviors::createBasicBehaviors(_context->world, &_scale_path); behaviors::createBulletBehavior(_context->world, _context->settings->bullets.velocity); behaviors::createSpotterBehavior(_context->world); behaviors::createWanderer(_context->world); //behaviors::createFollowerBehavior(_context->world, &_scale_path, _context->settings); behaviors::createWiggleFollowerBehavior(_context->world, &_scale_path, _context->settings); _context->particles = ds::res::getParticleManager(); _context->additiveBlendState = ds::res::findBlendState("AdditiveBlendState"); _context->elasticBorder = new ElasticBorder(); ds::ParticlesTestSettings pts; pts.render = false; pts.blendState = _context->additiveBlendState; pts.screenSize = v2(1024, 768); addGameState(new MainGameState(_context)); addGameState(new GameOverState(_context)); addGameState(new ds::ParticlesTestState(pts)); addGameState(new MainMenuState(_context)); addGameState(new FourierTestState(_context)); // connect game states connectGameStates("MainGame", 1, "GameOver"); connectGameStates("MainGame", 2, "ParticlesTestState"); connectGameStates("GameOver", 1, "MainGame"); connectGameStates("GameOver", 2, "MainMenuState"); connectGameStates("MainMenuState", 3, "MainGame"); addShortcut("Save world", '0', 100); //_server->connect(this); ds::GrayFadePostProcessDescriptor desc; desc.source = ds::res::find("RT1", ds::ResourceType::RENDERTARGET); desc.target = INVALID_RID; desc.ttl = 1.0f; _process = new ds::GrayFadePostProcess(desc); return true; } void Dodger::init() { pushState("FourierTestState"); } // ------------------------------------------------------- // Update // ------------------------------------------------------- void Dodger::update(float dt) { _context->grid->tick(dt); //_context->elasticBorder->tick(dt); _process->tick(dt); //_server->poll(); } // ------------------------------------------------------- // Draw // ------------------------------------------------------- void Dodger::render() { _context->grid->render(); // grayfade _process->begin(); ds::SpriteBuffer* sprites = graphics::getSpriteBuffer(); ds::ChannelArray* array = _context->world->getChannelArray(); v3* positions = (v3*)array->get_ptr(ds::WEC_POSITION); ds::Texture* textures = (ds::Texture*)array->get_ptr(ds::WEC_TEXTURE); v3* rotations = (v3*)array->get_ptr(ds::WEC_ROTATION); v3* scales = (v3*)array->get_ptr(ds::WEC_SCALE); ds::Color* colors = (ds::Color*)array->get_ptr(ds::WEC_COLOR); for (uint32_t i = 0; i < array->size; ++i) { v2 p = positions[i].xy(); float r = rotations[i].x; ds::Texture t = textures[i]; sprites->draw(positions[i].xy(), textures[i], rotations[i].x, scales[i].xy(), colors[i]); } sprites->end(); graphics::selectBlendState(_context->additiveBlendState); _context->particles->render(); //_context->elasticBorder->render(); graphics::selectViewport(0); graphics::selectBlendState(0); _process->render(); } void Dodger::get(const ds::HTTPRequest& request, ds::HTTPResponse* response) { LOG << "requesting: " << request.path; //response->data.append("callback("); _context->world->generateJSON(response->data); //response->data.append(");"); response->size = response->data.size(); } void Dodger::OnChar(uint8_t ascii) { if (ascii == '9') { if (_process->isActive()) { _process->deactivate(); } else { _process->activate(); } } }
cc0-1.0
lfreneda/cepdb
api/v1/82110510.jsonp.js
159
jsonp({"cep":"82110510","logradouro":"Rua H\u00e9rcio de Figueiredo Mello Filho","bairro":"Pilarzinho","cidade":"Curitiba","uf":"PR","estado":"Paran\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/77006710.jsonp.js
147
jsonp({"cep":"77006710","logradouro":"Quadra 602 Norte Rua 7 B","bairro":"Plano Diretor Norte","cidade":"Palmas","uf":"TO","estado":"Tocantins"});
cc0-1.0
lfreneda/cepdb
api/v1/29705222.jsonp.js
156
jsonp({"cep":"29705222","logradouro":"Rua Jos\u00e9 Tozi","bairro":"Carlos Germano Naumann","cidade":"Colatina","uf":"ES","estado":"Esp\u00edrito Santo"});
cc0-1.0
lfreneda/cepdb
api/v1/53570680.jsonp.js
135
jsonp({"cep":"53570680","logradouro":"Rua Tit\u00e2nio","bairro":"Desterro","cidade":"Abreu e Lima","uf":"PE","estado":"Pernambuco"});
cc0-1.0
lfreneda/cepdb
api/v1/37006135.jsonp.js
149
jsonp({"cep":"37006135","logradouro":"Rua Doutor Manoel Rodrigues","bairro":"Vila Nogueira","cidade":"Varginha","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/15086586.jsonp.js
196
jsonp({"cep":"15086586","logradouro":"Rua Ip\u00ea","bairro":"Est\u00e2ncia S\u00e3o Marcos II e IV (Zona Rural)","cidade":"S\u00e3o Jos\u00e9 do Rio Preto","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/97541501.jsonp.js
143
jsonp({"cep":"97541501","logradouro":"Rua Ven\u00e2ncio Aires","bairro":"Centro","cidade":"Alegrete","uf":"RS","estado":"Rio Grande do Sul"});
cc0-1.0
lfreneda/cepdb
api/v1/29120190.jsonp.js
138
jsonp({"cep":"29120190","logradouro":"Rua Mandacaru","bairro":"Aribiri","cidade":"Vila Velha","uf":"ES","estado":"Esp\u00edrito Santo"});
cc0-1.0
lfreneda/cepdb
api/v1/45658675.jsonp.js
125
jsonp({"cep":"45658675","logradouro":"Rua 10","bairro":"Esperan\u00e7a","cidade":"Ilh\u00e9us","uf":"BA","estado":"Bahia"});
cc0-1.0
lfreneda/cepdb
api/v1/66690450.jsonp.js
138
jsonp({"cep":"66690450","logradouro":"Quadra Quatro","bairro":"\u00c1guas Lindas","cidade":"Bel\u00e9m","uf":"PA","estado":"Par\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/61933210.jsonp.js
140
jsonp({"cep":"61933210","logradouro":"Rua Ingazeiras","bairro":"Paju\u00e7ara","cidade":"Maracana\u00fa","uf":"CE","estado":"Cear\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/86062590.jsonp.js
130
jsonp({"cep":"86062590","logradouro":"Rua Cianorte","bairro":"Champagnat","cidade":"Londrina","uf":"PR","estado":"Paran\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/94850350.jsonp.js
137
jsonp({"cep":"94850350","logradouro":"Travessa Chile","bairro":"Aparecida","cidade":"Alvorada","uf":"RS","estado":"Rio Grande do Sul"});
cc0-1.0
lfreneda/cepdb
api/v1/14808026.jsonp.js
159
jsonp({"cep":"14808026","logradouro":"Avenida C\u00e1ssio Ciampolini","bairro":"Jardim Guanabara","cidade":"Araraquara","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/03319090.jsonp.js
153
jsonp({"cep":"03319090","logradouro":"Rua Umberto Corradi","bairro":"Vila Gomes Cardim","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/03053010.jsonp.js
156
jsonp({"cep":"03053010","logradouro":"Rua In\u00e1cio de Ara\u00fajo","bairro":"Br\u00e1s","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/78090795.jsonp.js
147
jsonp({"cep":"78090795","logradouro":"Rua Cinco","bairro":"Cohab S\u00e3o Gon\u00e7alo","cidade":"Cuiab\u00e1","uf":"MT","estado":"Mato Grosso"});
cc0-1.0
lfreneda/cepdb
api/v1/02676045.jsonp.js
150
jsonp({"cep":"02676045","logradouro":"Viela Benedito Batista","bairro":"Jardim Peri","cidade":"S\u00e3o Paulo","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/37901236.jsonp.js
138
jsonp({"cep":"37901236","logradouro":"Rua Seringueira","bairro":"Serra das Brisas","cidade":"Passos","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
rzorzal/MyZend2Skeleton
config/application.config.php
428
<?php return array( 'modules' => array( 'DoctrineModule', 'DoctrineORMModule', 'DOMPDFModule', 'Admin', ), 'module_listener_options' => array( 'module_paths' => array( './module', './vendor', ), 'config_glob_paths' => array( 'config/autoload/{,*.}{global,local}.php', ), ), );
cc0-1.0
lfreneda/cepdb
api/v1/75909502.jsonp.js
143
jsonp({"cep":"75909502","logradouro":"Rua AS 6","bairro":"Residencial \u00c1gua Santa","cidade":"Rio Verde","uf":"GO","estado":"Goi\u00e1s"});
cc0-1.0
lfreneda/cepdb
api/v1/09570160.jsonp.js
157
jsonp({"cep":"09570160","logradouro":"Rua S\u00e3o Bento","bairro":"Ol\u00edmpico","cidade":"S\u00e3o Caetano do Sul","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/77807220.jsonp.js
135
jsonp({"cep":"77807220","logradouro":"Rua 2","bairro":"S\u00e3o Jo\u00e3o","cidade":"Aragua\u00edna","uf":"TO","estado":"Tocantins"});
cc0-1.0
lfreneda/cepdb
api/v1/73060208.jsonp.js
168
jsonp({"cep":"73060208","logradouro":"Quadra AR 11 Conjunto 8","bairro":"Setor Oeste (Sobradinho II)","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
cc0-1.0
lfreneda/cepdb
api/v1/70730778.jsonp.js
151
jsonp({"cep":"70730778","logradouro":"Quadra SHCGN 705 Bloco R","bairro":"Asa Norte","cidade":"Bras\u00edlia","uf":"DF","estado":"Distrito Federal"});
cc0-1.0
lfreneda/cepdb
api/v1/14407569.jsonp.js
148
jsonp({"cep":"14407569","logradouro":"Rua Carlos Roberto Liporoni","bairro":"Jardim Luiza","cidade":"Franca","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/54740180.jsonp.js
165
jsonp({"cep":"54740180","logradouro":"Rua Manoel da N\u00f3brega","bairro":"Capibaribe","cidade":"S\u00e3o Louren\u00e7o da Mata","uf":"PE","estado":"Pernambuco"});
cc0-1.0
lfreneda/cepdb
api/v1/65074090.jsonp.js
145
jsonp({"cep":"65074090","logradouro":"Rua Francisco Serra","bairro":"Cohama","cidade":"S\u00e3o Lu\u00eds","uf":"MA","estado":"Maranh\u00e3o"});
cc0-1.0
DigitalPerson/Saeed-Web-App
saeed/views/manage_companies_view.php
8739
<a id="newCompany" href="">شركة جديدة</a> <div id="newCompanyDialog" title="إنشاء شركة جديدة" style="display: none"> <form id="newCompanyForm" action="../controllers/ManageCompanies.php?function=addCompany" method="post"> <table> <tr> <td><label for="name" class="title">الاسم</label></td> <td><input type="text" id="name" name="name"/></td> </tr> <tr> <td class="titleTD"><label for="phone" class="title">الهاتف</label></td> <td><input type="text" id="phone" name="phone"/></td> </tr> <tr> <td class="titleTD"><label for="address" class="title">العنوان</label></td> <td><input type="text" id="address" name="address"/></td> </tr> <tr> <td></td> <td><input type="submit" id="submit" name="submit" value="إضافة"/></td> </tr> </table> </form> </div> <div id="editCompanyDialog" title="تعديل شركة" style="display: none"> <form id="editCompanyForm" action="../controllers/ManageCompanies.php?function=addCompany" method="post"> <table> <tr> <td><input type="hidden" id="companyID2" name="companyID2" value=""> <label for="name2" class="title">الاسم</label></td> <td><input type="text" id="name2" name="name2"/></td> </tr> <tr> <td class="titleTD"><label for="phone2" class="title">الهاتف</label></td> <td><input type="text" id="phone2" name="phone2"/></td> </tr> <tr> <td class="titleTD"><label for="address2" class="title">العنوان</label></td> <td><input type="text" id="address2" name="address2"/></td> </tr> <tr> <td><input type="submit" id="submit2" name="submit2" value="تعديل"/></td> <td><a id="deleteCompany" href="">حذف الشركة</a></td> </tr> </table> </form> </div> <p id="msg"></p> <table cellpadding="0" cellspacing="0" border="0" class="display" id="rolesTable"> </table> <script> $(document).ready(function(){ $(document).tooltip(); $('#submit, #submit2, #deleteCompany').button(); loadCompaniesTable(); $('#newCompany').button().click(function () { $( "#newCompanyDialog" ).dialog({ width: 300, modal: true, draggable : true, closeOnEscape: true, resizable : true, show: "blind", hide: "explode" }); return false; }); $('#submit').click(function(){ $.ajax({ type: "POST", url: "../controllers/ManageCompanies.php?function=addCompany", data: $('#newCompanyForm').serialize(), success: function(msg) { $( "#newCompanyDialog" ).dialog('close'); updateTips(msg); loadCompaniesTable(); } }); return false; }); $('#deleteCompany').click(function(){ $.ajax({ type: "POST", url: "../controllers/ManageCompanies.php?function=deleteCompany", data: { companyID: $(this).attr('href') }, success: function(msg) { $( "#editCompanyDialog" ).dialog('close'); updateTips(msg); loadCompaniesTable(); } }); return false; }); $('#submit2').click(function(){ $.ajax({ type: "POST", url: "../controllers/ManageCompanies.php?function=editCompany", data: $('#editCompanyForm').serialize(), success: function(msg) { $( "#editCompanyDialog" ).dialog('close'); updateTips(msg); loadCompaniesTable(); } }); return false; }); }); function fillEditCompanyFields(company) { $('#deleteCompany').attr("href", company.id); $('#companyID2').val(company.id); $('#name2').val(company.name); $('#phone2').val(company.phone); $('#address2').val(company.address); } function datatablesReady() { var company; $('.editCompany').click(function(){ var companyID = decodeURIComponent($(this).html()); $.ajax({ type: "GET", url: "../controllers/ManageCompanies.php?function=getCompanyForAjax", data: { companyID:companyID }, success: function(msg) { company = eval('('+ msg + ')'); fillEditCompanyFields(company); } }); $( "#editCompanyDialog" ).dialog({ width: 400, modal: true, draggable : true, closeOnEscape: true, resizable : true, show: "blind", hide: "explode" }); return false; }); } function loadCompaniesTable() { $('#rolesTable').dataTable( { "bProcessing": true, "bServerSide": true, //to destroy and rebuild data "bDestroy": true, "bAutoWidth": false, "sAjaxSource": "../controllers/ManageCompanies.php?function=getAllCompaniesForDataTables", // by default order by this column "aaSorting": [[ 0, "asc" ]], //take the jQueryUI style "bJQueryUI": true, "sPaginationType": "full_numbers", "aoColumns": [ { "sTitle": "الرقم" }, { "sTitle": "الاسم" }, { "sTitle": "الهاتف" }, { "sTitle": "العنوان" } ], // edit the style of the target columns "aoColumnDefs": [{ "sClass": "center", "aTargets": [ 0 ,1] }], // edit a specific column "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { // convert emails to link var idCell = $('td:eq(0)', nRow); idCell.html( '<a class=editCompany title="تعديل" href="">' + idCell.html() + '</a>' ); return nRow; }, "fnInitComplete": function(oSettings, json) { datatablesReady(); }, "oLanguage": { "sProcessing": "جاري التحميل...", "sLengthMenu": "أظهر مُدخلات _MENU_", "sZeroRecords": "لم يُعثر على أية سجلات", "sInfo": "إظهار _START_ إلى _END_ من أصل _TOTAL_ مُدخل", "sInfoEmpty": "يعرض 0 إلى 0 من أصل 0 سجلّ", "sInfoFiltered": "(منتقاة من مجموع _MAX_ مُدخل)", "sInfoPostFix": "", "sSearch": "ابحث:", "sUrl": "", "oPaginate": { "sFirst": "الأول", "sPrevious": "السابق", "sNext": "التالي", "sLast": "الأخير" } } } ); } function updateTips(msg) { var tips = $( "#msg" ); tips.css('visibility', 'visible'); tips.html(msg) tips.addClass( "ui-state-highlight" ); setTimeout(function() { tips.removeClass( "ui-state-highlight", 1500 ); }, 500 ); setTimeout(function() { tips.css('visibility', 'hidden'); }, 2500 ); } </script>
cc0-1.0
lfreneda/cepdb
api/v1/85603200.jsonp.js
150
jsonp({"cep":"85603200","logradouro":"Rua Amap\u00e1","bairro":"Pinheir\u00e3o","cidade":"Francisco Beltr\u00e3o","uf":"PR","estado":"Paran\u00e1"});
cc0-1.0
lfreneda/cepdb
api/v1/12243800.jsonp.js
162
jsonp({"cep":"12243800","logradouro":"Rua Santo Agostinho","bairro":"Vila Adyana","cidade":"S\u00e3o Jos\u00e9 dos Campos","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
enarod/enarod-wordpress-theme
smpl-skeleton/functions.php
34885
<?php /** * @package Skeleton WordPress Theme Framework * @subpackage skeleton * @author Simple Themes - www.simplethemes.com * * Layout Hooks: * * skeleton_header // header tag and logo/header text * skeleton_header_extras // Additional content may be added to the header * skeleton_navbar // main menu wrapper * skeleton_before_content // Opening content wrapper * skeleton_after_content // Closing content wrapper * skeleton_before_sidebar // Opening sidebar wrapper * skeleton_after_sidebar // Closing sidebar wrapper * skeleton_footer // Footer * * For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API. * * @package WordPress * @subpackage skeleton * @since skeleton 2.0 * */ /*-----------------------------------------------------------------------------------*/ /* Theme Customizer /*-----------------------------------------------------------------------------------*/ require_once get_template_directory() . '/customizer.php'; /*-----------------------------------------------------------------------------------*/ /* Register Core Stylesheets /* These are necessary for the theme to function as intended /* Supports the 'Better WordPress Minify' plugin to properly minimize styleshsets into one. /* http://wordpress.org/extend/plugins/bwp-minify/ /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_scripts' ) ) { function skeleton_scripts() { // Set a dynamic version for cache busting $theme = wp_get_theme(); if(is_child_theme()) { $parent = $theme->parent(); $version = $parent['Version']; } else { $version = $theme['Version']; } wp_enqueue_script('superfish',get_template_directory_uri()."/javascripts/superfish.js",array('jquery'),$version,true); wp_enqueue_script('formalize',get_template_directory_uri()."/javascripts/jquery.formalize.min.js",array('jquery'),$version,true); wp_enqueue_script('custom',get_template_directory_uri()."/javascripts/custom.js",array('jquery'),$version,true); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } // register the various widths based on max_layout_width option $maxwidth = skeleton_options('layout', '960'); wp_enqueue_style('skeleton', trailingslashit(get_template_directory_uri()) .'/css/skeleton-'.$maxwidth.'.css', array(), $version, 'screen, projection'); wp_enqueue_style('formalize', trailingslashit(get_template_directory_uri()).'/css/formalize.css', array(), $version, 'screen, projection'); wp_enqueue_style('superfish', trailingslashit(get_template_directory_uri()).'/css/superfish.css', array(), $version, 'screen, projection'); // Get Typography Options $body_font = str_replace("+"," ", skeleton_options('body_font', 'Sans-Serif')); $heading_font = str_replace("+"," ", skeleton_options('heading_font', 'Sans-Serif')); $protocol = is_ssl() ? 'https' : 'http'; $body_query_args = array('family' => skeleton_options('body_font').':400,700'); $heading_query_args = array('family' => skeleton_options('heading_font').':400,700'); if ($body_font != 'Sans-Serif' && $body_font != 'Serif') { wp_enqueue_style('skeleton-body-fonts',add_query_arg($body_query_args, "$protocol://fonts.googleapis.com/css" ),array(), null); } if ($heading_font != 'Sans-Serif' && $body_font != 'Serif') { wp_enqueue_style('skeleton-heading-fonts',add_query_arg($heading_query_args, "$protocol://fonts.googleapis.com/css" ),array(), null); } wp_enqueue_style( 'skeleton-style', get_stylesheet_uri() ); wp_enqueue_style( 'skeleton-theme-settings-css', trailingslashit(get_template_directory_uri()) . 'css/layout.css', array(), null ); $secondary_color = skeleton_options('secondary_color', '#BE3243'); $primary_color = skeleton_options('primary_color', '#375199'); $body_bg_color = skeleton_options('body_bg_color', '#f9f9f9'); $body_text_color = skeleton_options('body_text_color', '#333333'); $link_color = skeleton_options('link_color', '#55a038'); $link_hover_color = skeleton_options('link_hover_color', '#55a038'); $css = " body { color: {$body_text_color}; font-family: {$body_font}; background-color: {$body_bg_color}; } h1,h2,h3,h4,h5 { font-family: {$heading_font}; } a,a:visited { color: {$link_color}; } a:hover, a:focus, a:active { color: {$link_hover_color}; } #header h1#site-title a { color:{$primary_color}; } h3.widget-title, #header span.site-desc { color:{$secondary_color}; } "; wp_add_inline_style( 'skeleton-theme-settings-css', $css ); } add_action( 'wp_enqueue_scripts', 'skeleton_scripts'); } /** Tell WordPress to run skeleton_setup() when the 'after_setup_theme' hook is run. */ add_action( 'after_setup_theme', 'skeleton_setup' ); if ( ! function_exists( 'skeleton_setup' ) ): /** * Sets up theme defaults and registers support for various WordPress features. * * Note that this function is hooked into the after_setup_theme hook, which runs * before the init hook. The init hook is too late for some features, such as indicating * support post thumbnails. * * To override skeleton_setup() in a child theme, add your own skeleton_setup to your child theme's * functions.php file. * */ function skeleton_setup() { add_editor_style(); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'custom-background'); set_post_thumbnail_size( 150, 150 ); // 150px square add_image_size( $name = 'squared150', $width = 150, $height = 150, $crop = true ); // 250px square add_image_size( $name = 'squared250', $width = 250, $height = 250, $crop = true ); // 4:3 Video add_image_size( $name = 'video43', $width = 320, $height = 240, $crop = true ); // 16:9 Video add_image_size( $name = 'video169', $width = 320, $height = 180, $crop = true ); register_nav_menus( array( 'primary' => __( 'Primary Navigation', 'smpl' ), 'footer' => __( 'Footer Navigation', 'smpl' ) )); // Load TGM plugin activation load_template( get_template_directory() . '/inc/class-tgm-plugin-activation.php' ); // Translations can be filed in the /languages/ directory load_theme_textdomain( 'smpl', get_template_directory() . '/languages' ); } endif; // end skeleton_setup /*-----------------------------------------------------------------------------------*/ // Opening #header /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_header_open' ) ) { function skeleton_header_open() { echo "<div id=\"wrap\" class=\"container\">"; echo "<div id=\"header\" class=\"sixteen columns\">\n<div class=\"inner\">\n"; } add_action('skeleton_header','skeleton_header_open', 2); } /*-----------------------------------------------------------------------------------*/ // Hookable theme option field to add add'l content to header // such as social icons, phone number, widget, etc... // Child Theme Override: skeleton_child_header_extras(); /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_header_extras' ) ) { function skeleton_header_extras() { $header_extras = skeleton_options('header_extras'); if ($header_extras) { $extras = "<div class=\"header_extras\">"; $extras .= $header_extras; echo "<div class = 'lang_top' id = 'lang_top'>"; echo qtrans_generateLanguageSelectCode('dropdown'); echo "</div>"; $extras .= "</div>"; echo apply_filters ('skeleton_child_header_extras',$extras); //$extras = "<div class=\"header_extras\">"; //$extras .= $header_extras; //$extras .= "</div>"; //echo apply_filters ('skeleton_child_header_extras',$extras); } } add_action('skeleton_header','skeleton_header_extras', 3); } /*-----------------------------------------------------------------------------------*/ /* Header Logo /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_logo' ) ) { function skeleton_logo() { // image if ( skeleton_options( 'logotype' ) ) : $skeleton_logo = '<h1 id="site-title">'; $skeleton_logo .= '<a class="logotype-img" href="'.esc_url( home_url( '/' ) ).'" title="'.esc_attr( get_bloginfo( 'name', 'display' ) ).'" rel="home">'; $skeleton_logo .= '<img src="'.skeleton_options( 'logotype' ).'" alt="'.esc_attr( get_bloginfo( 'name', 'display' ) ).'"></a>'; $skeleton_logo .= '</h1>'; // text else : $skeleton_logo = '<h1 id="site-title">'; $skeleton_logo .= '<a class="text" href="'.esc_url( home_url( '/' ) ).'" title="'.esc_attr( get_bloginfo( 'name', 'display' ) ).'" rel="home">Електронна <span>демократія</span></a>'; $skeleton_logo .= '</h1>'; $skeleton_logo .= '<span class="site-desc">'.get_bloginfo('description').'</span>'. "\n"; endif; echo apply_filters ( 'skeleton_child_logo', $skeleton_logo); } add_action('skeleton_header','skeleton_logo', 4); } /*-----------------------------------------------------------------------------------*/ /* Closes the #header markup /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_header_close' ) ) { function skeleton_header_close() { echo "</div>"."\n"; echo "</div>"."\n"; echo "<!--/#header-->"."\n"; } add_action('skeleton_header','skeleton_header_close', 5); } /*-----------------------------------------------------------------------------------*/ /* Navigation Hook (skeleton_navbar) /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_main_menu' ) ) { function skeleton_main_menu() { echo '<div id="navigation" class="row sixteen columns">'; wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary')); echo '</div><!--/#navigation-->'; } add_action('skeleton_navbar','skeleton_main_menu', 1); } /*-----------------------------------------------------------------------------------*/ // Content Wrap Markup - skeleton_content_wrap() // Be sure to add the excess of 16 to skeleton_before_sidebar() as well /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_content_wrap' ) ) { function skeleton_content_wrap() { $columns = ''; $columns = apply_filters('skeleton_set_colwidth', $columns, 1); echo '<a id="top"></a>'; echo '<div id="content" class="'.$columns.' columns">'; } add_action( 'skeleton_before_content', 'skeleton_content_wrap', 1 ); } /*-----------------------------------------------------------------------------------*/ // After Content Wrap Markup - skeleton_content_wrap_close() /*-----------------------------------------------------------------------------------*/ if (! function_exists('skeleton_content_wrap_close')) { function skeleton_content_wrap_close() { echo "\t\t</div><!-- /.columns (#content) -->\n"; } add_action( 'skeleton_after_content', 'skeleton_content_wrap_close', 1 ); } /*-----------------------------------------------------------------------------------*/ // Sidebar Wrap Markup - skeleton_sidebar_wrap() // Be sure to add the excess of 16 to skeleton_content_wrap() as well /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_sidebar_wrap' ) ) { function skeleton_sidebar_wrap() { $columns = ''; $columns = apply_filters('skeleton_set_sidebarwidth', $columns, 1); echo '<div id="sidebar" class="'.$columns.' columns" role="complementary">'; } add_action( 'skeleton_before_sidebar', 'skeleton_sidebar_wrap', 1 ); } /*-----------------------------------------------------------------------------------*/ /* After Sidebar Markup /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_sidebar_wrap_close' ) ) { function skeleton_sidebar_wrap_close() { echo '</div><!-- #sidebar -->'; } } add_action( 'skeleton_after_sidebar', 'skeleton_sidebar_wrap_close'); /*-----------------------------------------------------------------------------------*/ // Global hook for footer actions /*-----------------------------------------------------------------------------------*/ function skeleton_footer() { do_action('skeleton_footer'); } add_action('wp_footer', 'skeleton_footer',1); /*-----------------------------------------------------------------------------------*/ /* Before Footer /*-----------------------------------------------------------------------------------*/ if (!function_exists('skeleton_before_footer')) { function skeleton_before_footer() { $footerwidgets = is_active_sidebar('footer-widget-area-1') + is_active_sidebar('footer-widget-area-2') + is_active_sidebar('footer-widget-area-3') + is_active_sidebar('footer-widget-area-4'); $class = ($footerwidgets == '0' ? 'noborder' : 'normal'); echo '<div class="clear"></div><div id="footer" class="'.$class.' sixteen columns">'; } add_action('skeleton_footer', 'skeleton_before_footer',1); } /*-----------------------------------------------------------------------------------*/ // Footer Widgets /*-----------------------------------------------------------------------------------*/ if (! function_exists('skeleton_footer_widgets')) { function skeleton_footer_widgets() { get_sidebar( 'footer' ); } add_action('skeleton_footer', 'skeleton_footer_widgets',2); } /*-----------------------------------------------------------------------------------*/ // Footer Navigation /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_footer_nav' ) ) { function skeleton_footer_nav() { $defaults = array( 'theme_location' => 'footer', 'container' => 'div', 'container_id' => 'footermenu', 'menu_class' => 'menu', 'echo' => true, 'fallback_cb' => false, 'after' => '<span> | </span>', 'depth' => 1); wp_nav_menu($defaults); echo '<div class="clear"></div>'; } add_action('skeleton_footer', 'skeleton_footer_nav',3); } /*-----------------------------------------------------------------------------------*/ /* Footer Credits /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_footer_credits' ) ) { function skeleton_footer_credits() { $footer_extras = skeleton_options('footer_extras'); $extras = '<div id="credits">'; $extras .= $footer_extras; //$extras .= '<div class="themeauthor">WordPress Theme by <a href="http://www.simplethemes.com" title="Simple WordPress Themes">Simple Themes</a></div>'; $extras .= "</div>"; echo apply_filters('skeleton_author_credits',$extras); } add_action('skeleton_footer', 'skeleton_footer_credits',4); } /*-----------------------------------------------------------------------------------*/ /* After Footer /*-----------------------------------------------------------------------------------*/ if (!function_exists('skeleton_after_footer')) { function skeleton_after_footer() { echo "</div><!--/#footer-->"."\n"; echo "</div><!--/#wrap.container-->"."\n"; } add_action('skeleton_footer', 'skeleton_after_footer',5); } /*-----------------------------------------------------------------------------------*/ // Register widgetized areas, including two sidebars and four widget-ready columns in the footer. // To override skeleton_widgets_init() in a child theme, remove the action hook and add your own // function tied to the init hook. /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_widgets_init' ) ) { function skeleton_widgets_init() { // Area 1, located at the top of the sidebar. register_sidebar( array( 'name' => __( 'Posts Widget Area', 'smpl' ), 'id' => 'sidebar-1', 'description' => __( 'Shown only in Blog Posts, Archives, Categories, etc.', 'smpl' ), 'before_widget' => '<div id="%1$s" class="widget-container %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Area 2, located below the Primary Widget Area in the sidebar. Empty by default. register_sidebar( array( 'name' => __( 'Pages Widget Area', 'smpl' ), 'id' => 'sidebar-2', 'description' => __( 'Shown only in Pages', 'smpl' ), 'before_widget' => '<div id="%1$s" class="widget-container %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Area 3, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'First Footer Widget Area', 'smpl' ), 'id' => 'footer-widget-area-1', 'description' => __( 'The first footer widget area', 'smpl' ), 'before_widget' => '<div class="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Area 4, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Second Footer Widget Area', 'smpl' ), 'id' => 'footer-widget-area-2', 'description' => __( 'The second footer widget area', 'smpl' ), 'before_widget' => '<div class="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Area 5, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Third Footer Widget Area', 'smpl' ), 'id' => 'footer-widget-area-3', 'description' => __( 'The third footer widget area', 'smpl' ), 'before_widget' => '<div class="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); // Area 6, located in the footer. Empty by default. register_sidebar( array( 'name' => __( 'Fourth Footer Widget Area', 'smpl' ), 'id' => 'footer-widget-area-4', 'description' => __( 'The fourth footer widget area', 'smpl' ), 'before_widget' => '<div class="%1$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); } /** Register sidebars by running skeleton_widgets_init() on the widgets_init hook. */ add_action( 'widgets_init', 'skeleton_widgets_init' ); } /*-----------------------------------------------------------------------------------*/ // Featured Thumbnails // Utility function for defining conditional featured image settings /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_thumbnailer' ) ) { function skeleton_thumbnailer($content) { global $post; global $id; $size = 'squared150'; $align = 'alignleft scale-with-grid'; $image = get_the_post_thumbnail($id, $size, array('class' => $align)); $content = $image . $content; return $content; } add_filter('the_content','skeleton_thumbnailer'); } /*-----------------------------------------------------------------------------------*/ // Sets the post excerpt length to 40 characters. // To override this length in a child theme, remove the filter and add your own // function tied to the excerpt_length filter hook. /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_excerpt_length' ) ) { function skeleton_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_length', 'skeleton_excerpt_length' ); } /*-----------------------------------------------------------------------------------*/ // Returns a "Continue Reading" link for excerpts /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_continue_reading_link' ) ) { function skeleton_continue_reading_link() { return ' <a href="'. get_permalink() . '">' . __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'smpl' ) . '</a>'; } } /*-----------------------------------------------------------------------------------*/ // Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis // and skeleton_continue_reading_link(). // // To override this in a child theme, remove the filter and add your own // function tied to the excerpt_more filter hook. /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_auto_excerpt_more' ) ) { function skeleton_auto_excerpt_more( $more ) { return ' &hellip;' . skeleton_continue_reading_link(); } add_filter( 'excerpt_more', 'skeleton_auto_excerpt_more' ); } /*-----------------------------------------------------------------------------------*/ // Adds a pretty "Continue Reading" link to custom post excerpts. /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_custom_excerpt_more' ) ) { function skeleton_custom_excerpt_more( $output ) { if ( has_excerpt() && ! is_attachment() ) { $output .= skeleton_continue_reading_link(); } return $output; } add_filter( 'get_the_excerpt', 'skeleton_custom_excerpt_more' ); } /*-----------------------------------------------------------------------------------*/ // Removes the page jump when read more is clicked through /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'remove_more_jump_link' ) ) { function remove_more_jump_link($link) { $offset = strpos($link, '#more-'); if ($offset) { $end = strpos($link, '"',$offset); } if ($end) { $link = substr_replace($link, '', $offset, $end-$offset); } return $link; } add_filter('the_content_more_link', 'remove_more_jump_link'); } /*-----------------------------------------------------------------------------------*/ // Comment Styles /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( 'skeleton_comments' ) ) : function skeleton_comments($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>"> <div id="comment-<?php comment_ID(); ?>" class="single-comment clearfix"> <div class="comment-author vcard"> <?php echo get_avatar($comment,$size='64'); ?></div> <div class="comment-meta commentmetadata"> <?php if ($comment->comment_approved == '0') : ?> <em><?php _e('Comment is awaiting moderation','smpl');?></em> <br /> <?php endif; ?> <h6><?php echo __('By','smpl').' '.get_comment_author_link(). ' '. get_comment_date(). ' - ' . get_comment_time(); ?></h6> <?php comment_text() ?> <?php edit_comment_link(__('Edit comment','smpl'),' ',''); ?> <?php comment_reply_link(array_merge( $args, array('reply_text' => __('Reply','smpl'),'depth' => $depth, 'max_depth' => $args['max_depth']))); ?> </div> </div> <!-- </li> --> <?php } endif; if ( ! function_exists( 'skeleton_posted_on' ) ) : /** * Prints HTML with meta information for the current post-date/time and author. * * @since Skeleton 1.0 */ function skeleton_posted_on() { printf( __( '<span class="%1$s">Posted on</span> %2$s <span class="meta-sep">by</span> %3$s', 'smpl' ), 'meta-prep meta-prep-author', sprintf( '<a href="%1$s" title="%2$s" rel="bookmark"><span class="entry-date">%3$s</span></a>', get_permalink(), esc_attr( get_the_time() ), get_the_date() ), sprintf( '<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s">%3$s</a></span>', get_author_posts_url( get_the_author_meta( 'ID' ) ), sprintf( esc_attr__( 'View all posts by %s', 'smpl' ), get_the_author() ), get_the_author() ) ); } endif; if ( ! function_exists( 'skeleton_posted_in' ) ) : // Prints HTML with meta information for the current post (category, tags and permalink). function skeleton_posted_in() { // Retrieves tag list of current post, separated by commas. $tag_list = get_the_tag_list( '', ', ' ); if ( $tag_list ) { $posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'smpl' ); } elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) { $posted_in = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'smpl' ); } else { $posted_in = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'smpl' ); } // Prints the string, replacing the placeholders. printf( $posted_in, get_the_category_list( ', ' ), $tag_list, get_permalink(), the_title_attribute( 'echo=0' ) ); } endif; /*-----------------------------------------------------------------------------------*/ /* Custom Page Navigation /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( 'skeleton_custom_pagenav' ) ) : function skeleton_custom_pagenav() { echo '<div id="nav-below" class="navigation">'; if ( function_exists( 'wp_pagenavi' ) ) { if (is_page()) { wp_pagenavi( array( 'type' => 'multipart' ) ); } elseif (is_single()) { previous_post_link( '<div class="nav-prev">%link</div>', __( 'Previous Post', 'smpl' ) ); next_post_link( '<div class="nav-next">%link</div>', __( 'Next Post', 'smpl' ) ); } else { wp_pagenavi(); } } else { if (is_page()) { wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'smpl' ), 'after' => '</div>' ) ); } elseif (is_single()) { previous_post_link( '<div class="nav-prev">%link</div>', __( 'Previous Post', 'smpl' ) ); next_post_link( '<div class="nav-next">%link</div>', __( 'Next Post', 'smpl' ) ); } else { next_posts_link( __( '<div class="nav-prev">Older posts</div>', 'smpl' ) ); previous_posts_link( __( '<div class="nav-next">Newer posts</div>', 'smpl' ) ); } } echo '</div><!-- #nav-below -->'; } add_action('skeleton_page_navi','skeleton_custom_pagenav'); endif; /*-----------------------------------------------------------------------------------*/ // Sidebar Positioning Utility (sidebar-left | sidebar-right) // Sets a body class for source ordered sidebar positioning /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_sidebar_position' ) ) { function skeleton_sidebar_position($class) { $sidebar_position = skeleton_options('sidebar_position', 'right'); $sidebar_position = ($sidebar_position == "right" ? "right" : "left"); $class[] = 'sidebar-'.$sidebar_position; return $class; } add_filter('body_class','skeleton_sidebar_position'); } /*-----------------------------------------------------------------------------------*/ /* Filterable utility function to set the content width - skeleton_content_width() /* Specifies the column classes via conditional statements /* See http://codex.wordpress.org/Conditional_Tags for a full list /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_content_width' ) ) { function skeleton_content_width() { global $post; $columns = skeleton_options('content_width', 'eleven'); // Single Posts if ( is_single() ) { $post_wide = get_post_meta($post->ID, "sidebars", $single = true) == "false"; // make sure no Post widgets are active if ( !is_active_sidebar('sidebar-1') || $post_wide ) { $columns = 'sixteen'; } // wide attachement pages if ( is_attachment() ) { $columns = 'sixteen'; } // Single Pages } elseif ( is_page() ) { $page_wide = is_page_template('onecolumn-page.php'); // make sure no Page widgets are active if ( !is_active_sidebar('sidebar-2') || $page_wide ) { $columns = 'sixteen'; } } return $columns; } // Create filter add_filter('skeleton_set_colwidth', 'skeleton_content_width', 10, 1); } /*-----------------------------------------------------------------------------------*/ /* Filterable utility function to set the sidebar width - skeleton_sidebar_width() /* Specifies the column classes via conditional statements /* See http://codex.wordpress.org/Conditional_Tags for a full list /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'skeleton_sidebar_width' ) ) { function skeleton_sidebar_width() { global $post; $columns = skeleton_options('sidebar_width', 'five'); // Single Posts if ( is_single() ) { // Check for custom field of sidebars => false $post_wide = get_post_meta($post->ID, "sidebars", $single = true) == "false"; // make sure no Post widgets are active if ( !is_active_sidebar('sidebar-1') || $post_wide ) { $columns = false; } // Single Pages } elseif ( is_page() ) { // Pages: check for custom page template $page_wide = is_page_template('onecolumn-page.php'); // make sure no Page widgets are active if ( !is_active_sidebar('sidebar-2') || $page_wide ) { $columns = false; } } return $columns; } // Create filter add_filter('skeleton_set_sidebarwidth', 'skeleton_sidebar_width', 10, 1); } /*-----------------------------------------------------------------------------------*/ /* Enable Shortcodes in excerpts and widgets /*-----------------------------------------------------------------------------------*/ add_filter('widget_text', 'do_shortcode'); add_filter( 'the_excerpt', 'do_shortcode'); add_filter('get_the_excerpt', 'do_shortcode'); /*-----------------------------------------------------------------------------------*/ /* Override default embeddable content width /*-----------------------------------------------------------------------------------*/ if (!function_exists('skeleton_content_width')) { function skeleton_content_width() { $content_width = 580; } } /*-----------------------------------------------------------------------------------*/ /* TGM plugin activation /*-----------------------------------------------------------------------------------*/ if ( ! function_exists( 'smpl_recommended_plugins' ) ) { function smpl_recommended_plugins() { $plugins = array( array( 'name' => 'Regenerate Thumbnails', 'slug' => 'regenerate-thumbnails', 'required' => false, 'force_activation' => false, 'force_deactivation'=> false, ), array( 'name' => 'WP-PageNavi', 'slug' => 'wp-pagenavi', 'required' => false, 'force_activation' => false, 'force_deactivation'=> false, ), array( 'name' => 'Simple Shortcodes', 'slug' => 'smpl-shortcodes', 'required' => true, 'force_activation' => false, 'force_deactivation'=> false, ) ); tgmpa( $plugins ); } } add_action( 'tgmpa_register', 'smpl_recommended_plugins' ); /*-----------------------------------------------------------------------------------*/ /* Remove WP Pagenavi Styles /* Theme Includes Native Support /*-----------------------------------------------------------------------------------*/ function skeleton_deregister_styles() { wp_deregister_style( 'wp-pagenavi' ); } add_action( 'wp_print_styles', 'skeleton_deregister_styles', 100 ); /*-----------------------------------------------------------------------------------*/ /* Filters wp_title to print a proper <title> tag based on content /*-----------------------------------------------------------------------------------*/ if (!function_exists('skeleton_wp_title')) { function skeleton_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'skeleton' ), max( $paged, $page ) ); return apply_filters ('skeleton_child_wp_title',$title); } } add_filter( 'wp_title', 'skeleton_wp_title', 10, 2 ); /*-----------------------------------------------------------------------------------*/ /* Instead of remove_filter('the_content', 'wpautop'); /* The function below removes wp_autop from specified pages with a custom field: /* Name: wpautop Value: false /*-----------------------------------------------------------------------------------*/ if ( !function_exists( 'st_remove_wpautop' ) ) { function st_remove_wpautop($content) { global $post; // Get the keys and values of the custom fields: $rmwpautop = get_post_meta($post->ID, 'wpautop', true); // Remove the filter if ('false' === $rmwpautop) { remove_filter('the_content', 'wpautop'); remove_filter('the_content', 'wptexturize'); } return $content; } // Hook into the Plugin API add_filter('the_content', 'st_remove_wpautop', 9); }//Added by Olga to disable cachefunction remove_cssjs_ver( $src ) { if( strpos( $src, '?ver=' ) ) $src = remove_query_arg( 'ver', $src ); return $src;}add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 ); //Added by Olga add_action( 'init', 'create_post_type' ); function create_post_type() { register_post_type( 'carousel', array( 'labels' => array( 'name' => __( 'Carousel' ), 'singular_name' => __( 'Carousel' ) ), 'supports' => array( 'title', 'editor','thumbnail' ), 'public' => true, 'has_archive' => true, ) ); } // Added by Illia //Making jQuery Google API function modify_jquery() { if (!is_admin()) { // comment out the next two lines to load the local copy of jQuery wp_deregister_script('jquery'); wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', false, '1.7.2'); wp_enqueue_script('jquery'); } } add_action('init', 'modify_jquery'); // Added by Anton Goncharuk (02.09.2014) add_filter( 'wpcf7_load_js', '__return_false' ); add_filter( 'wpcf7_load_css', '__return_false' ); function include_cf7_files() { if ( is_page( 'faq' ) ) { if ( function_exists( 'wpcf7_enqueue_scripts' ) ) wpcf7_enqueue_scripts(); if ( function_exists( 'wpcf7_enqueue_styles' ) ) wpcf7_enqueue_styles(); } } add_action( 'wp_head', 'include_cf7_files' );
cc0-1.0
lfreneda/cepdb
api/v1/22755320.jsonp.js
139
jsonp({"cep":"22755320","logradouro":"Rua Raposo Tavares","bairro":"Anil","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/13336610.jsonp.js
147
jsonp({"cep":"13336610","logradouro":"Rua Coroinha","bairro":"Ch\u00e1cara Viracopos","cidade":"Indaiatuba","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/69095030.jsonp.js
146
jsonp({"cep":"69095030","logradouro":"Rua Professora Francelina Dantas","bairro":"Cidade Nova","cidade":"Manaus","uf":"AM","estado":"Amazonas"});
cc0-1.0
lfreneda/cepdb
api/v1/51340765.jsonp.js
128
jsonp({"cep":"51340765","logradouro":"Rua Rio das Flores","bairro":"COHAB","cidade":"Recife","uf":"PE","estado":"Pernambuco"});
cc0-1.0
lfreneda/cepdb
api/v1/35500592.jsonp.js
140
jsonp({"cep":"35500592","logradouro":"Rua Blumenau","bairro":"Vale do Sol","cidade":"Divin\u00f3polis","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
ObisiaB/CodepenTesla
pen.js
64
document.getElementsByTagName("h1")[0].style.fontSize = "63px";
cc0-1.0
lfreneda/cepdb
api/v1/36202780.jsonp.js
146
jsonp({"cep":"36202780","logradouro":"Rua Jo\u00e3o V. de Souza","bairro":"Santa Maria","cidade":"Barbacena","uf":"MG","estado":"Minas Gerais"});
cc0-1.0
lfreneda/cepdb
api/v1/64023210.jsonp.js
127
jsonp({"cep":"64023210","logradouro":"Quadra 15","bairro":"Morada Nova","cidade":"Teresina","uf":"PI","estado":"Piau\u00ed"});
cc0-1.0
lfreneda/cepdb
api/v1/18215040.jsonp.js
159
jsonp({"cep":"18215040","logradouro":"Rua Alc\u00eddio Jos\u00e9","bairro":"Jardim Monte Santo","cidade":"Itapetininga","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
douglaszuqueto/be-mean-instagram
auth-basic-jwt/public/src/controllers/studentctrl.js
1390
(function(){ "use strict"; angular.module("rschool.students") .controller("StudentCtrl", StudentCtrl); StudentCtrl.$inject = ["Student", "$routeParams", "$scope", "$localStorage", "UserStorage"]; function StudentCtrl(Student, $routeParams, $scope, $localStorage, UserStorage){ var vm = this; vm.save = save; vm.remove = remove; if($routeParams.studentId){ getOneStudent(); } else{ vm.student = new Student(); } function getOneStudent(){ Student.get({id:$routeParams.studentId} , function(data){ vm.student = data; } , function(err){ vm.message = { text: "Não foi possível obter o contato" } }); } function getAllStudents (){ Student.query(function(data){ console.log(data); vm.students = data; }, function(err){ console.log(err); }); } getAllStudents(); function save(){ // from ng-model vm.student.$save() .then(function(){ vm.message = { text: "Salvo com sucesso" }; vm.student = new Student(); }) .catch(function(err){ console.log(err); vm.mesage = { text: "Ocorreu um erro, desculpe"} }); }; function remove(student){ Student.delete({id: student._id } , getAllStudents , function(err){ vm.message = { text: "Não foi possível remover o contato" } console.log(err); }); } }; })();
cc0-1.0
lfreneda/cepdb
api/v1/23087380.jsonp.js
152
jsonp({"cep":"23087380","logradouro":"Rua Hugo Gon\u00e7alves","bairro":"Campo Grande","cidade":"Rio de Janeiro","uf":"RJ","estado":"Rio de Janeiro"});
cc0-1.0
lfreneda/cepdb
api/v1/15057200.jsonp.js
217
jsonp({"cep":"15057200","logradouro":"Rua Jo\u00e3o Jos\u00e9 Lucania Fernandes","bairro":"Conjunto Habitacional S\u00e3o Deocleciano","cidade":"S\u00e3o Jos\u00e9 do Rio Preto","uf":"SP","estado":"S\u00e3o Paulo"});
cc0-1.0
lfreneda/cepdb
api/v1/58428455.jsonp.js
145
jsonp({"cep":"58428455","logradouro":"Rua Santo Ant\u00f4nio","bairro":"Pedregal","cidade":"Campina Grande","uf":"PB","estado":"Para\u00edba"});
cc0-1.0
triper2/triper2
triper/src/faq/service/action/DeleteFormAction.java
652
package faq.service.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import faq.service.controller.Action; public class DeleteFormAction implements Action{ @Override public String execute(HttpServletRequest request,HttpServletResponse response) throws Throwable { String service_id = request.getParameter("service_id"); String service_img = request.getParameter("service_img"); request.setAttribute("service_id", service_id); request.setAttribute("service_img", service_img); return "/_faq/service/deleteForm.jsp"; } }
epl-1.0
bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs
plugins/org.eclipse.persistence.asm/src/org/eclipse/persistence/internal/libraries/asm/tree/IntInsnNode.java
2981
/*** * ASM: a very small and fast Java bytecode manipulation framework * Copyright (c) 2000-2007 INRIA, France Telecom * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. Neither the name of the copyright holders 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. */ package org.eclipse.persistence.internal.libraries.asm.tree; import java.util.Map; import org.eclipse.persistence.internal.libraries.asm.MethodVisitor; /** * A node that represents an instruction with a single int operand. * * @author Eric Bruneton */ public class IntInsnNode extends AbstractInsnNode { /** * The operand of this instruction. */ public int operand; /** * Constructs a new {@link IntInsnNode}. * * @param opcode the opcode of the instruction to be constructed. This * opcode must be BIPUSH, SIPUSH or NEWARRAY. * @param operand the operand of the instruction to be constructed. */ public IntInsnNode(final int opcode, final int operand) { super(opcode); this.operand = operand; } /** * Sets the opcode of this instruction. * * @param opcode the new instruction opcode. This opcode must be BIPUSH, * SIPUSH or NEWARRAY. */ public void setOpcode(final int opcode) { this.opcode = opcode; } public int getType() { return INT_INSN; } public void accept(final MethodVisitor mv) { mv.visitIntInsn(opcode, operand); } public AbstractInsnNode clone(final Map labels) { return new IntInsnNode(opcode, operand); } }
epl-1.0
OpenLiberty/open-liberty
dev/com.ibm.ws.el.3.0_fat/test-applications/ELServicesLookup.war/src/com/ibm/ws/el30/fat/servicelookup/TestServiceLookupServlet.java
1185
/******************************************************************************* * Copyright (c) 2021 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package com.ibm.ws.el30.fat.servicelookup; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import javax.el.ELProcessor; public class TestServiceLookupServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); try { ELProcessor elp = new ELProcessor(); out.println("<h1>" + "Lookup works!" + "</h1>"); } catch(Exception e){ out.println("<p>" + e + "</p>"); } } }
epl-1.0
georgeerhan/openhab2-addons
addons/binding/org.openhab.binding.homematic/src/main/java/org/openhab/binding/homematic/internal/model/TclScriptDataEntry.java
1230
/** * Copyright (c) 2010-2017 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.openhab.binding.homematic.internal.model; import com.thoughtworks.xstream.annotations.XStreamAlias; import com.thoughtworks.xstream.annotations.XStreamAsAttribute; /** * Simple class with the XStream mapping for a data entry returned from a TclRega script. * * @author Gerhard Riegler - Initial contribution */ @XStreamAlias("entry") public class TclScriptDataEntry { @XStreamAsAttribute public String name; @XStreamAsAttribute public String description; @XStreamAsAttribute public String value; @XStreamAsAttribute public String valueType; @XStreamAsAttribute public boolean readOnly; @XStreamAsAttribute public String options; @XStreamAsAttribute @XStreamAlias("min") public String minValue; @XStreamAsAttribute @XStreamAlias("max") public String maxValue; @XStreamAsAttribute public String unit; }
epl-1.0
cgourdin/LightTutorial
martserver/org.occiware.mart.servlet/src/main/java/org/occiware/mart/servlet/impl/ServletEntry.java
13311
/** * Copyright (c) 2015-2017 Inria * <p> * 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 * <p> * http://www.apache.org/licenses/LICENSE-2.0 * <p> * 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. * <p> * Contributors: * - Christophe Gourdin <christophe.gourdin@inria.fr> */ package org.occiware.mart.servlet.impl; import org.occiware.mart.server.exception.ParseOCCIException; import org.occiware.mart.server.parser.DefaultParser; import org.occiware.mart.server.parser.HeaderPojo; import org.occiware.mart.server.parser.IRequestParser; import org.occiware.mart.server.parser.ParserFactory; import org.occiware.mart.server.utils.CollectionFilter; import org.occiware.mart.server.utils.Constants; import org.occiware.mart.servlet.utils.ServletUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.net.URI; import java.util.HashMap; import java.util.Map; import java.util.Optional; /** * Created by cgourdin on 13/04/2017. * This class is used with main servlet, when a query is done on the servlet, this parse input entries datas (for all queries). */ public abstract class ServletEntry { private static final Logger LOGGER = LoggerFactory.getLogger(ServletEntry.class); protected OCCIServletInputRequest occiRequest; protected OCCIServletOutputResponse occiResponse; private HttpServletRequest httpRequest; private HeaderPojo headers; private HttpServletResponse httpResponse; private String path; private String contentType = Constants.MEDIA_TYPE_JSON; private String acceptType = Constants.MEDIA_TYPE_JSON; /** * If parameters are in inputquery, it must declared here. Key: name of the * parameter Value: Value of the parameter (if url ==> decode before set the * value). */ private Map<String, String> parameters = new HashMap<>(); /** * Uri of the server. */ private URI serverURI; /** * Build a new Servlet input entry for workers. * * @param serverURI http server uri object like http://localhost:8080 * @param resp Http servlet response. * @param headers headers in a map KEY:String, Value: String. * @param req http servlet request object. * @param path the relative request path. ex: /mycompute/1/ */ public ServletEntry(URI serverURI, HttpServletResponse resp, HeaderPojo headers, HttpServletRequest req, String path) { this.serverURI = serverURI; this.httpResponse = resp; this.headers = headers; this.httpRequest = req; this.path = path; } /** * Get here the parameters of a request, this can be filters, action * parameters, pagination as describe here. Parse the request parameters * filtering : http://localhost:9090/myquery?attribute=myattributename or * http://localh...?category=mymixintag usage with category or attributes. * Pagination : * http://localhost:9090/myquery?attribute=myattributename&page=2&number=5 * where page = current page, number : max number of items to display. * Request on collections are possible with http://localhost:9090/compute/ * with text/uri-list accept type, give the full compute resources created * uri. Request on collections if no text/uri-list given, return in response * the entities defined in detail like a get on each entity (if text/occi * this may return a maximum of 3 entities not more due to limitations size * of header area in http). */ public void parseRequestParameters() { Map<String, String[]> params = httpRequest.getParameterMap(); String key; String[] vals; String val; if (params != null && !params.isEmpty()) { for (Map.Entry<String, String[]> entry : params.entrySet()) { key = entry.getKey(); vals = entry.getValue(); if (vals != null && vals.length > 0) { val = vals[0]; parameters.put(key, val); } } } } /** * @return */ public Map<String, String> getRequestParameters() { if (parameters == null) { parameters = new HashMap<>(); } return parameters; } /** * The server uri. (server part of the full url). like http://localhost:8080/ * * @return */ public URI getServerURI() { return serverURI; } public void setServerURI(final URI serverURI) { this.serverURI = serverURI; } public HttpServletResponse buildInputDatas() { String contextRoot = serverURI.getPath(); LOGGER.debug("Context root : " + contextRoot); LOGGER.debug("URI relative path: " + path); // Load the parsers. // check content-type header. contentType = headers.getFirst(Constants.HEADER_CONTENT_TYPE); acceptType = headers.getFirst(Constants.HEADER_ACCEPT); // TODO : add support for uri-list combined with other type rendering. if (acceptType == null) { acceptType = contentType; } // Default values. if (contentType == null || contentType.isEmpty()) { contentType = Constants.MEDIA_TYPE_JSON; } if (acceptType == null || acceptType.isEmpty() || acceptType.equals("*/*")) { // Default to MEDIA_TYPE_JSON. acceptType = Constants.MEDIA_TYPE_JSON; } // TODO : Manage authentication and pass username to MART engine. String username = "anonymous"; // validateAuth(). // Build inputparser and output parser. IRequestParser inputParser = ParserFactory.build(contentType, username); IRequestParser outputParser = ParserFactory.build(acceptType, username); // Create occiRequest objects. occiResponse = new OCCIServletOutputResponse(acceptType, username, httpResponse, outputParser); occiRequest = new OCCIServletInputRequest(occiResponse, contentType, username, httpRequest, headers, this.getRequestParameters(), inputParser); if (inputParser instanceof DefaultParser) { LOGGER.warn("No parser for content type : " + contentType); return occiResponse.parseMessage("content type : " + contentType + " not implemented.", HttpServletResponse.SC_NOT_IMPLEMENTED); } if (outputParser instanceof DefaultParser) { LOGGER.warn("No parser for accept type : " + acceptType); return occiResponse.parseMessage("accept type : " + contentType + " not implemented.", HttpServletResponse.SC_NOT_IMPLEMENTED); } // Get Client user agent to complain with http_protocol spec, control the occi version if set by client. boolean result = ServletUtils.checkClientOCCIVersion(headers); if (!result) { LOGGER.warn("Version is not compliant, max: OCCI v1.2"); return occiResponse.parseMessage("The requested version is not implemented", HttpServletResponse.SC_NOT_IMPLEMENTED); } parseRequestParameters(); // Parse worker datas content. try { // Parse input query to data objects. occiRequest.parseInput(); } catch (ParseOCCIException ex) { String msg = "Error while parsing input request: " + ex.getMessage(); LOGGER.error(msg); return occiResponse.parseMessage(msg, HttpServletResponse.SC_BAD_REQUEST); } return httpResponse; } /** * Build a collection filter. * * @return Must never return null. */ public CollectionFilter buildCollectionFilter() { String pageTmp = getRequestParameters().get(Constants.CURRENT_PAGE_KEY); String itemsNumber = getRequestParameters().get(Constants.NUMBER_ITEMS_PER_PAGE_KEY); int items = Constants.DEFAULT_NUMBER_ITEMS_PER_PAGE; int page = Constants.DEFAULT_CURRENT_PAGE; if (pageTmp != null && !pageTmp.isEmpty()) { // Set the value from request only if this is a number. try { items = Integer.valueOf(itemsNumber); } catch (NumberFormatException ex) { // Cant parse the number LOGGER.error("The parameter \"number\" is not set correctly, please check the parameter, this must be a number."); LOGGER.error("Default to " + items); } try { page = Integer.valueOf(pageTmp); } catch (NumberFormatException ex) { LOGGER.error("The parameter \"page\" is not set correctly, please check the parameter, this must be a number."); LOGGER.error("Default to " + page); } } String operatorTmp = getRequestParameters().get(Constants.OPERATOR_KEY); if (operatorTmp == null) { operatorTmp = "0"; } int operator = 0; try { operator = Integer.valueOf(operatorTmp); } catch (NumberFormatException ex) { } String categoryFilter = getRequestParameters().get(Constants.CATEGORY_KEY); String attributeFilter = getRequestParameters().get(Constants.ATTRIBUTE_KEY); String attributeValue = getRequestParameters().get(Constants.VALUE_KEY); CollectionFilter filter = new CollectionFilter(); filter.setOperator(operator); filter.setNumberOfItemsPerPage(items); filter.setCurrentPage(page); filter.setCategoryFilter(categoryFilter); filter.setAttributeFilter(attributeFilter); filter.setValue(attributeValue); String requestPath = occiRequest.getRequestPath(); // Collection on partial or complete entity location. boolean onEntitiesLocation = occiRequest.isOnBoundedLocation(); boolean onEntityLocation = occiRequest.isOnEntityLocation(); if (onEntitiesLocation || onEntityLocation) { filter.setFilterOnEntitiesPath(path); return filter; } // Collection on mixin tag location. boolean onMixinTagLocation = occiRequest.isOnMixinTagLocation(); if (onMixinTagLocation) { // Case of the mixin tag entities request. Optional<String> optMixinTag = occiRequest.getMixinTagSchemeTermFromLocation(path); if (optMixinTag.isPresent()) { // Check if we need a subfilter. if (categoryFilter != null) { filter.setSubCategoryFilter(filter.getCategoryFilter()); filter.setCategoryFilter(optMixinTag.get()); filter.setFilterOnEntitiesPath(null); } else { filter.setCategoryFilter(optMixinTag.get()); filter.setSubCategoryFilter(null); filter.setFilterOnEntitiesPath(null); } return filter; } else { LOGGER.warn("Unknown mixin tag location : " + requestPath); } } // Determine if the collection is on a category path (kind or mixins term location). boolean onExtensionCategoryLocation = occiRequest.isOnCategoryLocation(); if (onExtensionCategoryLocation) { String categorySchemeTermFilter = null; Optional<String> optCat = occiRequest.getCategorySchemeTermFromLocation(requestPath); if (optCat.isPresent()) { // If a category filter is already there via request parameters we use a subfilter. if (categoryFilter != null) { filter.setSubCategoryFilter(filter.getCategoryFilter()); filter.setCategoryFilter(optCat.get()); filter.setFilterOnEntitiesPath(null); } else { filter.setCategoryFilter(optCat.get()); filter.setSubCategoryFilter(null); filter.setFilterOnEntitiesPath(null); } return filter; } else { LOGGER.warn("Unknown Category kind/mixin location : " + requestPath); } } // Default to entities location. filter.setFilterOnEntitiesPath(requestPath); return filter; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } public String getContentType() { return contentType; } public void setContentType(String contentType) { this.contentType = contentType; } public String getAcceptType() { return acceptType; } public void setAcceptType(String acceptType) { this.acceptType = acceptType; } }
epl-1.0
Link1234Gamer/FiveNightsAtFreddysUniverseMod
src/main/java/link1234gamer/fnafmod/common/entity/ai/Pre_MangleAI/EntityPre_MangleAIBreakDoor.java
5166
package link1234gamer.fnafmod.common.entity.ai.Pre_MangleAI; import link1234gamer.fnafmod.common.entity.EntityPre_Mangle; import net.minecraft.block.Block; import net.minecraft.block.BlockDoor; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.pathfinding.PathEntity; import net.minecraft.pathfinding.PathNavigate; import net.minecraft.pathfinding.PathPoint; import net.minecraft.util.MathHelper; public class EntityPre_MangleAIBreakDoor extends EntityAIBase { protected EntityPre_Mangle entity; protected int doorPosX; protected int doorPosY; protected int doorPosZ; protected BlockDoor door; boolean hasStoppedDoorInteraction; float entityPositionX; float entityPositionZ; public EntityPre_MangleAIBreakDoor(EntityPre_Mangle animatronic) { this.entity = animatronic; } public boolean shouldExecute() { //// if (!this.entity.isCollidedHorizontally) //// { //// return false; //// } //// else // { // PathNavigate pathnavigate = this.entity.getNavigator(); // PathEntity pathentity = pathnavigate.getPath(); // // if (pathentity != null && !pathentity.isFinished()) // { // for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i) // { // PathPoint pathpoint = pathentity.getPathPointFromIndex(i); // this.doorPosX = pathpoint.xCoord; // this.doorPosY = pathpoint.yCoord + 1; // this.doorPosZ = pathpoint.zCoord; // // if (this.entity.getDistanceSq((double)this.doorPosX, this.entity.posY, (double)this.doorPosZ) <= 2.25D) // { // this.door = this.getDoorObject(this.doorPosX, this.doorPosY, this.doorPosZ); // // if (this.door != null) // { // return true; // } // } // } // // this.doorPosX = MathHelper.floor_double(this.entity.posX); // this.doorPosY = MathHelper.floor_double(this.entity.posY + 1.0D); // this.doorPosZ = MathHelper.floor_double(this.entity.posZ); // this.door = this.getDoorObject(this.doorPosX, this.doorPosY, this.doorPosZ); // return this.door != null; // } // else // { // return false; // } // } return true; } public boolean continueExecuting() { // return !this.hasStoppedDoorInteraction; return true; } public void startExecuting() { this.hasStoppedDoorInteraction = false; this.entityPositionX = (float)((double)((float)this.doorPosX + 0.5F) - this.entity.posX); this.entityPositionZ = (float)((double)((float)this.doorPosZ + 0.5F) - this.entity.posZ); } public void updateTask() { // float f = (float)((double)((float)this.entityPosX + 0.5F) - this.entity.posX); // float f1 = (float)((double)((float)this.entityPosZ + 0.5F) - this.entity.posZ); // float f2 = this.entityPositionX * f + this.entityPositionZ * f1; // // if (f2 < 0.0F) // { // this.hasStoppedDoorInteraction = true; // } PathNavigate pathnavigate = this.entity.getNavigator(); PathEntity pathentity = pathnavigate.getPath(); if (pathentity != null && !pathentity.isFinished()) { for (int i = 0; i < Math.min(pathentity.getCurrentPathIndex() + 2, pathentity.getCurrentPathLength()); ++i) { PathPoint pathpoint = pathentity.getPathPointFromIndex(i); this.doorPosX = pathpoint.xCoord; this.doorPosY = pathpoint.yCoord + 1; this.doorPosZ = pathpoint.zCoord; if (this.entity.getDistanceSq((double)this.doorPosX, this.entity.posY, (double)this.doorPosZ) <= 2.25D) { this.door = this.getDoorObject(this.doorPosX, this.doorPosY, this.doorPosZ); } } this.doorPosX = MathHelper.floor_double(this.entity.posX); this.doorPosY = MathHelper.floor_double(this.entity.posY + 1.0D); this.doorPosZ = MathHelper.floor_double(this.entity.posZ); this.door = this.getDoorObject(this.doorPosX, this.doorPosY, this.doorPosZ); } if (door != null) { entity.worldObj.playAuxSFX(2001, doorPosX, doorPosY, doorPosZ, Block.getIdFromBlock(door)); entity.worldObj.setBlockToAir(doorPosX, doorPosY, doorPosZ); door = null; } } private BlockDoor getDoorObject(int x, int y, int z) { Block block = entity.worldObj.getBlock(x, y, z); return !(block instanceof BlockDoor) ? null : (BlockDoor)block; } }
epl-1.0
edgarmueller/emfstore-rest
bundles/org.eclipse.emf.emfstore.client.ui/src/org/eclipse/emf/emfstore/internal/client/ui/controller/UIControllerFactoryImpl.java
4448
/******************************************************************************* * Copyright (c) 2012-2013 EclipseSource Muenchen GmbH and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: ******************************************************************************/ package org.eclipse.emf.emfstore.internal.client.ui.controller; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.emfstore.client.ESLocalProject; import org.eclipse.emf.emfstore.client.ESProject; import org.eclipse.emf.emfstore.client.ESRemoteProject; import org.eclipse.emf.emfstore.client.ESServer; import org.eclipse.emf.emfstore.client.ESUsersession; import org.eclipse.emf.emfstore.client.ui.ESUIControllerFactory; import org.eclipse.emf.emfstore.server.model.versionspec.ESBranchVersionSpec; import org.eclipse.emf.emfstore.server.model.versionspec.ESPrimaryVersionSpec; import org.eclipse.emf.emfstore.server.model.versionspec.ESVersionSpec; import org.eclipse.swt.widgets.Shell; public final class UIControllerFactoryImpl implements ESUIControllerFactory { public static UIControllerFactoryImpl INSTANCE = new UIControllerFactoryImpl(); private UIControllerFactoryImpl() { } public ESPrimaryVersionSpec commitProject(Shell shell, ESLocalProject project) { return new UICommitProjectController(shell, project).execute(); } public ESPrimaryVersionSpec createBranch(Shell shell, ESProject project) { // TODO Auto-generated method stub return null; } public ESPrimaryVersionSpec createBranch(Shell shell, ESProject project, ESBranchVersionSpec branch) { // TODO Auto-generated method stub return null; } public ESLocalProject createLocalProject(Shell shell) { return new UICreateLocalProjectController(shell).execute(); } public ESLocalProject createLocalProject(Shell shell, String name) { return new UICreateLocalProjectController(shell, name).execute(); } public ESRemoteProject createRemoteProject(Shell shell, ESUsersession usersession) { return new UICreateRemoteProjectController(shell, usersession) .execute(); } public ESRemoteProject createRemoteProject(Shell shell, ESUsersession usersession, String projectName) { return new UICreateRemoteProjectController(shell, usersession, projectName).execute(); } public void deleteLocalProject(Shell shell, ESLocalProject project) { new UIDeleteProjectController(shell, project).execute(); } public void deleteRemoteProject(Shell shell, ESRemoteProject remoteProject, ESUsersession usersession) { new UIDeleteRemoteProjectController(shell, usersession, remoteProject) .execute(); } public void login(Shell shell, ESServer server) { new UILoginSessionController(shell, server).execute(); } public void logout(Shell shell, ESUsersession usersession) { new UILogoutSessionController(shell, usersession).execute(); } public void mergeBranch(Shell shell, ESLocalProject project) { new UIMergeController(shell, project).execute(); } public void registerEPackage(Shell shell, ESServer server) { new UIRegisterEPackageController(shell, server).execute(); } public void removeServer(Shell shell, ESServer server) { new UIRemoveServerController(shell, server).execute(); } public void shareProject(Shell shell, ESLocalProject project) { new UIShareProjectController(shell, project).execute(); } public void showHistoryView(Shell shell, ESLocalProject project) { new UIShowHistoryController(shell, project).execute(); } public void showHistoryView(Shell shell, EObject eObject) { new UIShowHistoryController(shell, eObject).execute(); } public ESPrimaryVersionSpec updateProject(Shell shell, ESLocalProject project) { return new UIUpdateProjectController(shell, project).execute(); } public ESPrimaryVersionSpec updateProject(Shell shell, ESLocalProject project, ESVersionSpec version) { return new UIUpdateProjectController(shell, project, version).execute(); } public ESPrimaryVersionSpec updateProjectToVersion(Shell shell, ESLocalProject project) { return new UIUpdateProjectToVersionController(shell, project).execute(); } }
epl-1.0
miklossy/xtext-core
org.eclipse.xtext.tests/src-gen/org/eclipse/xtext/parsetree/reconstr/complexrewritetest/TrickyB.java
2229
/** * generated by Xtext */ package org.eclipse.xtext.parsetree.reconstr.complexrewritetest; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Tricky B</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * </p> * <ul> * <li>{@link org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyB#getName <em>Name</em>}</li> * <li>{@link org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyB#getType <em>Type</em>}</li> * </ul> * * @see org.eclipse.xtext.parsetree.reconstr.complexrewritetest.ComplexrewritetestPackage#getTrickyB() * @model * @generated */ public interface TrickyB extends EObject { /** * Returns the value of the '<em><b>Name</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Name</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Name</em>' attribute. * @see #setName(String) * @see org.eclipse.xtext.parsetree.reconstr.complexrewritetest.ComplexrewritetestPackage#getTrickyB_Name() * @model * @generated */ String getName(); /** * Sets the value of the '{@link org.eclipse.xtext.parsetree.reconstr.complexrewritetest.TrickyB#getName <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Name</em>' attribute. * @see #getName() * @generated */ void setName(String value); /** * Returns the value of the '<em><b>Type</b></em>' attribute list. * The list contents are of type {@link java.lang.Integer}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Type</em>' attribute list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Type</em>' attribute list. * @see org.eclipse.xtext.parsetree.reconstr.complexrewritetest.ComplexrewritetestPackage#getTrickyB_Type() * @model unique="false" * @generated */ EList<Integer> getType(); } // TrickyB
epl-1.0
trevorallred/Tantalum
tests/tantalum/data/DataSaverTest.java
1037
package tantalum.data; import java.util.HashMap; import java.util.Map; import org.junit.Test; import tantalum.entities.CoreFactory; import tantalum.entities.Model; public class DataSaverTest { private DataSaver saver = new DataSaver(); private CoreFactory factory = new CoreFactory(); public DataSaverTest() { saver.setTesting(true); } @Test public void save() { Model model = factory.createInvoiceView(); System.out.println(model.toString()); Map<Model, Store> list = new HashMap<Model, Store>(); Store store = new Store(); list.put(model, store); Record invoice = new Record(); store.getUpdates().add(invoice); invoice.setValue("DefineInvoiceInvoiceID", "123"); invoice.setValue("DefineInvoiceAccountID", "456"); invoice.setValue("DefineInvoiceInvoiceDate", "2010-01-01"); invoice.setValue("DefineInvoiceInvoiceTotal", "123"); invoice.setValue("DefineInvoiceDescription", "This is a description"); try { saver.save(model, list); } catch (Exception e) { e.printStackTrace(); } } }
epl-1.0
gemoc/activitydiagram
dev/gemoc_concurrent/language_workbench/org.gemoc.activitydiagram.concurrent.xactivitydiagram/src/org/gemoc/activitydiagram/concurrent/xactivitydiagram/activitydiagram/impl/ActionImpl.java
855
/** */ package org.gemoc.activitydiagram.concurrent.xactivitydiagram.activitydiagram.impl; import org.eclipse.emf.ecore.EClass; import org.gemoc.activitydiagram.concurrent.xactivitydiagram.activitydiagram.Action; import org.gemoc.activitydiagram.concurrent.xactivitydiagram.activitydiagram.ActivitydiagramPackage; /** * <!-- begin-user-doc --> * An implementation of the model object '<em><b>Action</b></em>'. * <!-- end-user-doc --> * * @generated */ public abstract class ActionImpl extends ExecutableNodeImpl implements Action { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ protected ActionImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override protected EClass eStaticClass() { return ActivitydiagramPackage.Literals.ACTION; } } //ActionImpl
epl-1.0
sonatype/nexus-public
components/nexus-repository-content/src/main/java/org/sonatype/nexus/repository/content/event/asset/AssetUpdatedEvent.java
1102
/* * Sonatype Nexus (TM) Open Source Version * Copyright (c) 2008-present Sonatype, Inc. * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions. * * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0, * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. * * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the * Eclipse Foundation. All other trademarks are the property of their respective owners. */ package org.sonatype.nexus.repository.content.event.asset; import org.sonatype.nexus.repository.content.Asset; /** * Event sent whenever an {@link Asset} is updated. * * @since 3.26 */ public class AssetUpdatedEvent extends AssetEvent { protected AssetUpdatedEvent(final Asset asset) { super(asset); } }
epl-1.0
css-iter/cs-studio
applications/alarm/alarm-plugins/org.csstudio.alarm.beast.msghist/src/org/csstudio/alarm/beast/msghist/gui/MaxMessagesConfigureAction.java
2627
/******************************************************************************* * Copyright (c) 2010-2019 ITER Organization. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package org.csstudio.alarm.beast.msghist.gui; import org.csstudio.alarm.beast.msghist.MessageHistoryView; import org.csstudio.alarm.beast.msghist.Messages; import org.csstudio.alarm.beast.msghist.model.Model; import org.eclipse.jface.action.Action; import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.window.Window; /** * <code>MaxMessagesConfigureAction</code> opens a dialog that allows * configuring maximum number of messages shown. * * @author Borut Terpinc */ public class MaxMessagesConfigureAction extends Action { private final MessageHistoryView view; /** * Constructs a new action that acts on the message history view. * * @param view * the view to configure its columns */ public MaxMessagesConfigureAction(final MessageHistoryView view) { super(Messages.SetMaxMessages, AS_PUSH_BUTTON); this.view = view; } @Override public void run() { // open dialog with current max messages value Model model = view.getModel(); InputDialog dialog = new InputDialog(view.getViewSite().getShell(), Messages.SetMaxMessagesDialogTitle, Messages.SetMaxMessagesDialogMessage, Integer.toString(model.getMaxMessages()), s -> { try { int i = Integer.parseInt(s.trim()); if (i > 0) return null; return Messages.SetMaxMessagesInputError; } catch (NumberFormatException ex) { return Messages.SetMaxMessagesInputError; } }); // set new filter values on dialog confirm if (dialog.open() == Window.OK) { try { int maxMessages = Integer.parseInt(dialog.getValue().trim()); model.setMaxMessages(maxMessages); } catch (Exception e) { MessageDialog.openError(view.getViewSite().getShell(), Messages.Error, Messages.SetMaxMessagesError + e.getMessage()); } } } }
epl-1.0