Posts

Showing posts from July, 2010

html - Positioning a box below an image background -

Image
i got image , box working accordingly far. problem is, when go add height , goes instead of down. my fiddle - https://jsfiddle.net/kg6plk4e/ .post { height: 255px; font-size: 14px; position: relative; padding: 5px; margin-right: 3%; margin-top: 3%; } .box-one { background-image: url("http://www.getmdl.io/templates/blog/images/coffee.jpg"); background-repeat: no-repeat; background-size: cover; } .image-text { position: absolute; width: 100%; margin: 0; left: 0; font-weight: bold; color: white; text-align: center; background: black; bottom: 0; padding: 5px; height: 40px; } <div class="late-post grid-60 tablet-grid-50 mobile-grid-100"> <div class="post box-one"> <h1>pottery</h1> <p class="image-text">lorem ipsum dummy text of print

regex - Pattern for month with low and capital letters -

i have following strings: emini mar 15 me emini ice mar 15 rta emini abc apr 15 rta and use pattern: [\s]*(jan|feb|mar|apr|may|jin|jul|aug|sep|oct|nov|dec)+(\s+\d{1,2}) how create short pattern instead ...(jan|jan|jan|feb|feb|feb...) etc. in advance just add case-insensitive modifier i (?i)\s*(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)+(\s+\d{1,2})

javascript - Sending the keydown event does not work in PhantomJS -

i tried code web page content loaded dynamically when press keydown. (like facebook) the goal net traffic , print console. var page = require('webpage').create(), system = require('system'), address; if (system.args.length === 1) { console.log('usage: netlog.js <some url>'); phantom.exit(1); } else { address = system.args[1]; page.onloadfinished = function(req) { console.log('requested: ' + json.stiringify(req, undefined, 4)); }; page.open(url, function () { page.sendevent('keypress', page.event.key.keydown); }); page.onresourcerequested = function (req) { console.log('requested: ' + json.stringify(req, undefined, 4)); }; page.onresourcereceived = function (res) { console.log('received: ' + json.stringify(res, undefined, 4)); }; page.open(address, function (status) { if (status !== 'success') {

node.js - Error while piping POST request using request library -

i'm using request communicate between 2 sails applications. concerned actions seem triggered form data shows undefined . in app a: the concerned form <form action="/testreq" method="post" enctype="multipart/form-data"> <input name="name" type="text"><br/> <input name="dp" type="file"><br/> <input type="submit" value="submit"> </form> the concerned controller testreq: function(req, res, next) { console.log(req.param('name')); var r = request.post('http://localhost:9999/upload'); req.pipe(r); return r.pipe(res); }, in app b: the concerned controller upload: function(req, res, next) { var name = req.param('name'); console.log(name);// prints "undefined" return res.json({ message: 'some message' }); } while console.log should print name sent form,

Removing powered by Jetty -

i using jetty server embedded web app. whenever hit resource not present in serves default page shows message "powered jetty". page being served defaulthandler class of org.eclipse.jetty.server.handler , handle methos implementation. want write custom handler current while trying register custom handler in jetty.xml file, getting syntax exception , server not getting started. can please on this. thanks in advance! i able resolve issue doing tweaks along changes mentioned in deactivate jetty's default 404 error handler . thank you.

java - How can BigDecimal make no floating point inaccuracy? -

i have known there floating point inaccuracy regardless of os, programming language. i, however, found there no inaccuracy in example. how can possible? think converting stirng double needed calculation, there should floating point inaccuracy! import java.math.*; class noerrorbigdecimal { public static void main(string[] args) { bigdecimal e1=new bigdecimal("1.6"); bigdecimal e2=new bigdecimal("0.1"); system.out.println("result of add : "+e1.add(e2)); system.out.println("result of multiplication : "+e1.multiply(e2)); } } how can bigdecimal make no floating point inaccuracy? the answer cannot. floating point inaccuracy (as call it) fundamental of practical number representations used in computers. the counter example proposition bigdecimal value of 1 / 3 cannot represented precisely using single bigdecimal (or float or double matter). it representable precisely using

Trying to make my own vbscript -

i have been working on vb script around hour trying work there many skype spammer scipts want make 1 includes random number generator script call @ moment "skype_randizer_mk1" if able take @ it appreciated. when posting website said had indent may little strange the delay variable amount of time take enter number don't mind if program makes numerical values intend do set shell = createobject ("wscript.shell") dim max dim min dim delay max = 100 min = 1 delay = 0.00000001 = 1 5 randomize intnumber = int((max - min + 1) * rnd + min ) wscript.echo intnumber next b=1 delay shell.sendkeys (intnumber) wscript.sleep(delay) if not isnumeric(delay) wscript.quit end if msgbox "you have 5 seconds inputbox." wscript.sleep ( 5000 ) next you have lots of problems code:- you should declare variables using dim : e.g. dim shell you missing next 1 of for loops line 10 doesn't make sense. says: for b=1 delay , de

cgi - Perl script run in some browsers but not others -

Image
i have perl script running on webserver appears run fine browsers, not in others. on machine runs in firefox not in chrome or safari. on machine b runs in chrome not in firefox or safari. here screen shot of 2 browsers: any ideas why might happen? the error showed inability locate json.pm in response doing use json; or require json; . install module using system's package manager.

google chrome - Get a proper DOM copy -

Image
with objective of debugging ie9 styles issue not present on chrome or firefox, thought compare 'calculated' dom on ie9 vs these 2 browsers (i calculated dom because of page made through dom manipulation since using gwt). cannot proper copy of dom google chrome. go "inspect element", click element want, right click > copy, paste text file. if select top html element, end ! <html><head> <title>title</title> </head><frameset> <frame src="ezaeza.jsp" name="sqdsqdsq" id="sqdsqdsq" scrolling="no" noresize="noresize"> <frameset cols="210,20,*" border="0" name="retract" id="retract"> <frame src="one.jsp" noresize="noresize" name="jiojiji" id="jiojiji"> <frame src="two.jsp" noresize="noresize"

javascript - Fade-out and fade-in transition not working on ng-hide -

i'm developing application button clicked hides or shows specific element. i'm achieving ng-hide angularjs. reason transition isn't working correctly. i'm quite new transitions css3 doing wrong? all wish smooth fade in fade out effect appearance doesn't seem un-natural css3 #custom-url{ -webkit-transition: 2s ease; transition: 2s ease; } #custom-url .ng-hide{ opacity: 0; } html <input ng-model="custom_url" id="custom-url" ng-show="custommode" type="text" placeholder="place custom url text here" class="ng-hide form-control"/> <button class="btn btn-success" ng-click="custommode = !custommode">make own url <b class="glyphicon glyphicon-heart"></b></button></div> angularjs (function(angular) { angular.module('urlshortener', []) .controller('shortenercontroller', function($scope){

angularjs - Slide div from left to right in Angular -

in plunk have div should move left right in transition when user clicks on checkbox. instead, div hides , shows in new position. how achieve transition effect in angular? html: move <input type="checkbox" ng-model="checked" /> <div class="panel" ng-class="{ 'class1' : checked, 'class2' : !checked }"></div> css: .panel{ position: fixed; background:orange; width:100px; height:30px; top: 10px; } .class1{ left: 80px; } .class2{ left: 240px; } .class1.ng-show-add-active, .class1.ng-show-remove-active { transition: ease-in-out 2s; } .class2.ng-show-add-active, .class2.ng-show-remove-active { transition: ease-in-out 2s; } javascript: var app = angular.module("app", ['nganimate']); app.controller('ctl', function($scope) { $scope.checked = true; }); this answer: need use -add , -remove after class name. plunk

TFS 2013 fails on second build -

i have bizarre thing happening tfs 2013 server. first build fines, subsequent builds keep failing message. have delete build definition , recreate , melodrama repeats. after creating build definition first build successful. ideas? exception message: api resource location 225f7195-f9c7-4d14-ab28-a83f7ff77e1f not registered on http://tfsserver:8081/tfs/mycollection . (type vssresourcenotfoundexception) exception stack trace: @ microsoft.visualstudio.services.webapi.vsshttpclientbase.d__1c.movenext() make sure delete cache folder located under service account choose run team foundation server. c:\windows\serviceprofiles\networkservice\appdata\local\microsoft\team foundation\5.0\cache\

sql - Join between two tables -

table1 - doctors +---------+--------+------+ | country | state | doc | +---------+--------+------+ | india | ap | 20 | +---------+--------+------+ | india | tn | 30 | +---------+--------+------+ | india | ka | 10 | +---------+--------+------+ | | la | 30 | +---------+--------+------+ | | ca | 10 | +---------+--------+------+ | | ny | 50 | +---------+--------+------+ table2 - engineers +---------+--------+-------+ | country | state | engg | +---------+--------+-------+ | india | ap | 100 | +---------+--------+-------+ | india | tn | 400 | +---------+--------+-------+ | india | ka | 250 | +---------+--------+-------+ | | la | 140 | +---------+--------+-------+ | | ca | 120 | +---------+--------+-------+ | | ny | 150 | +---------+--------+-------+ desired output: +---------+------+-------+ | country | doc | engg | +---------+------+-------+ | india | 60

Hash Parsing with Ruby -

i have array of hash shown below: @line_statuses = [ {:name=>"1", :status=>"online"}, {:name=>"2", :status=>"online"} ] i'd parse each hash inside of @line_statuses array can print out name , status shown below. 1: online 2: online how go doing this? technically @line_statuses variable array, have array of hashes. in ruby, iterate on array use .each method. then, in each iteration, can access values of hash using defined keys: @line_statuses.each |hash| puts hash[:name] puts hash[:status] end

Python: Hangman game problems -

i brand new python have littel matlab , c++ background. please help!!!! i having problems hangman code. if word has multiple of same letter in cannot figure out how switch of them. have couple tries of them commented out. import random import time import sys def pickword(): words = [line.strip() line in open('word_list.txt')] word = random.choice(words) word = word.lower() return word def checkletter(word, input): if input not in word: in_letter = 0 else: in_letter = 1 return in_letter def check_input(input): if input.isaplha() == false : input = raw_input('your input not letter, please enter letter: ') elif len(input) > 0: input = raw_input('your entry longer 1 letter, please enter 1 letter: ') else: input = input return input #main function running = 'y' print('lets play hangman!\n\n ------------------------ \n\ngenerating random word \n\n&

javascript - Posting data dynamically without refreshing the page -

i want know how can post data without refreshing page example, facebook when post comment posted , shown people without refreshing page. know how insert data in mysql without refreshing page ajax question is: how insert data , @ same time without refreshing page. thank you osdm's answer might seem accomplish behavior want isn't 1 you're asking about. answer provide updates when user upload's , not created in system (uploaded). there 2 different ways can accomplish fetching of new information in server: ajax , websockets. ajax - ajax stands asynchronous javascript , xml. allows fetch content particular server behind scene , can insert newly fetched data page display user. has manually triggered , therefore doesn't happen in real time . trigger fetching of data either manually (e.g. press of button), or on timer (e.g. every 5 seconds, 10 minutes, etc). important note hard server know information page displaying , therefore each ajax call request al

html - Corner ribbon in responsive image -

i need align corner ribbon image. here's managed do: <div class="row"> <div class="col-sm-6"> <a href="http://website.com"> <img src="/images/web1.jpg"><div class="ribbon"><span>featured</span></div></img> </a><br><br> <hr> </div> <div class="col-sm-6"> <a href="http://website.com"> <img src="/images/web2.jpg"><div class="ribbon"><span>featured</span></div></img> </a><br><br> <hr> </div> </div> the css .ribbon { position: absolute; right: 62px; top: -5px; z-index: 1; overflow: hidden; width: 75px; height: 75px;

timestamp - ISO8601 format - Amazon Web service -

i receiving following error: 'timestamp 2015-06-29t15%3a08%3a27z must in iso8601 format' have double checked , believe in is08601 format (then urlencoded) when have matched format again 1 created within https://mws.amazonservices.co.uk/scratchpad/index.html seems same. any idea? mine: 2015-06-29t15%3a08%3a27z theirs: 2015-06-29t15%3a12%3a47z thanks, clare unsure issue was, found on site (relating amazon timespan issue. did solve issue. public static string convertdatetostring(datetime date) { datetime utctime; if (date.kind == datetimekind.local) { utctime = new datetime( date.year, date.month, date.day, date.hour, date.minute, date.second, date.millisecond, datetimekind.local).touniversaltime(); } else { utctime = date; }

asp.net - EADDRINUSE address already in use -

when run dnu . kestrel start asp.net 5 server on os x, , press ctl+c stop server, run dnu . kestrel second time, receive following exception: sullys-macbook-pro:test1app sully$ dnx . kestrel system.exception: error -48 eaddrinuse address in use @ microsoft.aspnet.server.kestrel.networking.libuv.check (int32 statuscode) [0x00000] in :0 @ microsoft.aspnet.server.kestrel.networking.libuv.listen (microsoft.aspnet.server.kestrel.networking.uvstreamhandle handle, int32 backlog, microsoft.aspnet.server.kestrel.networking.uv_connection_cb cb) [0x00000] in :0 @ microsoft.aspnet.server.kestrel.networking.uvstreamhandle.listen (int32 backlog, system.action`4 callback, system.object state) [0x00000] in :0 ^c the terminal acts server running, because have press ctl+c again terminate server process. while "running", can't navigate browser. is there proper way shut down server change code, without having kill terminal, open new one, navigate proj

excel - Copy and paste to new sheet -

i trying copy row of data 1 sheet having run other macros, keep getting error message paste area , copy area not same size , shape. i have tried using special cells paste method seems missing data last 9 columns. code: id.entirerow.specialcells(xlcelltypeconstants).copy missingdata.range("a" & rows.count).end(xlup).offset(1,1).pastespecial xlpastevaluesandnumberformats application.cutcopymode = false i need changing code copies full row of data , pastes under existing entries in missingdata. it seems when works when choose paste in column a, not allow me paste column b i use: rows(index).copy cells(1,rows.count+1).select activesheet.paste

javascript - Jquery Mobile - including fragments for a multipage template? -

we're doing codeigniter/jqm web application , have been debating multipage template vs. single-page/file. most of cons of multi-page template (meaning multiple data-role=page divs in single file) cited relate single file getting unwieldy maintenance (and possible load time) perspective. cons of single-page approach seem focus on potential latency between pages. given vagaries of internet, latter approach seems more risky. opinion user tolerate long load time if app runs smoothly once loaded more app inconsistent between touches/swipes. that being said, have growing team of folks working on various parts of app , having one, huge file presents challenge -- git. so, question this: is there reason can't break multi-page template separate files, each containing <div data-role=page> , contents, , -include- each 1 in main file? seem solve maintenance issue , alleviate potential delay between page transitions. what missing, here? and answer no. works

PHP:json_encode dilema with strings containing invalid UTF8? is it ok to utf8_encode each string? -

Image
this json_encode dropping/nullifying values contain non standard utf8 string accented characters. i've read many different solutions this, , conceptualized creating own function automatically me blanket solution. by way, expect plain english strings. basically want function replace json_encode , 1 have routine correct string/objects passed before passing actual json_encode function. so question is, what's best routine this? , best, takes account practical , efficient. for example, i've created routine break each character in string , evaluates if valid utf8, if not encodes it.. (this exampled 1 of users @ php.net this character character check , fix w/c seems bullet proof. but problem impact performance. so way run utf8_encode on each string passed.. i'm thinking checking each value / string if contains invalid utf8 characters first, before running utf8_encode() on save on overhead.. again , each "check" routine overhead in itself.. so ch

python - Tor and Python3 using SocksiPy -

i copy pasted code post them, seems fine mine prints error , don't know why... how make urllib2 requests through tor in python? can me error? import socks import socket socks.setdefaultproxy(socks.proxy_type_socks5, "127.0.0.1", 9150) socket.socket = socks.socksocket import urllib.request print(urllib.request.urlopen('http://www.google.com').read()) traceback (most recent call last): file "/users/raphael/desktop/whatsmyip.py", line 17, in <module> r = requests.get("http://checkip.dyn.com") file "/library/frameworks/python.framework/versions/3.4/lib/python3.4/site-packages/requests/api.py", line 68, in return request('get', url, **kwargs) file "/library/frameworks/python.framework/versions/3.4/lib/python3.4/site-packages/requests/api.py", line 50, in request response = session.request(method=method, url=url, **kwargs) file "/library/frameworks/python.framework/versions/3.4/lib/python3.4/site-packa

swift - How to proper use YouTube iOS Player Helper? -

i trying load videos/playlists youtube (personal account) using swift. added ytplayerview class , iframe html file videos not loading. added uiview in storyboard , changed class ytplayerview , created iboutlet. here's code: import uikit import youtube_ios_player_helper class ytviewcontroller: uiviewcontroller, ytplayerviewdelegate { @iboutlet var videoplayer: ytplayerview! override func viewdidload() { let videoid = "https://www.youtube.com/watch?v=m7lc1uvf-ve" videoplayer.loadvideobyurl(videoid, startseconds: 0.0, suggestedquality: .small) videoplayer.playvideo() } } as far read in documentation takes show video. when run app uiview nothing. how can working? make sure ytplayerview-iframe-player.html file has been added project , being copied bundle under "copy bundle resources."

json - How can I pass data from a service into my controller? -

okay right messing around ionic framework , learning angularjs @ same time. came across $q , async calls, can't seem right. want able parse json file have set using getjsonspecials pass getdata pass controller specialsctrl can attach $scope . know not understanding promises correctly because inside specialservice undefined. can data fine other 2 serivces, when try passing specialservice seems crumble in turn ends undefined in controller. maybe not going right way? there best practices of doing kind of thing? angular.module('starter.controllers', []) .controller('specialsctrl', function ($scope, specialservice) { $scope.specials = specialservice.all(); console.log("specials controller: got data", $scope.specials); }) //create methods access specials inside controller in inject in .factory('specialservice', function (getdata) { var specials = getdata.getspecials(); console.log("dataaaa: ", specials); return {

Angularjs: push data into array from resource query and show in ngRepeat -

there array data retrieved restful api using $resource , fetch using query() method. create new data , want push data created fetched array $resource shown in ngrepeat directive, when make push function, doesn't push , wouldn't re-query whole data again. controller self.submit = function(){ //this function called when submit data creation var form = self.form; form.user_id = global.user.id; // hide error message if it's shown self.data.error.show = false; // check if submition on request (for reason submit twice) if(!self.status.request){ self.status.request = true; $timeout(function(){ projects.save({data: form}, function(data){ //function called $resource console.log(data); self.status.request = false; // resolve error if(data.error[1])

php - How do I remove/hide specific parts of my Wordpress url? -

my current url below. i'm using custom php function pass 3 variables page "world": http://wordpress.dev/hello/world/?one=volvo&two=ford&three=chevy how can make url this? http://wordpress.dev/hello/world/volvofordchevy some googling points me towards .htaccess file none of tips specific goal , haven't worked htaccess. generally url rewriting being done adding url rewriting rules in .htaccess file. wordpress have builtin functionality name permalink it. in wordpress admin go settings → permalinks panel (options → permalinks before wordpress 2.5), can choose 1 of "common" structures or enter own in "custom structure" field using structure tags defining choose of url. can find plenty of plugins url rewriting in wordpress like: https://wordpress.org/plugins/custom-permalinks/ https://wordpress.org/plugins/enhanced-custom-permalinks/

sql server - Select multi value from another table and put in one string split by - -

i have 2 tables in ms sql server. table 1 id name ------------- 10 series 11 movie 12 music 13 other table 2 id idcatg value --------------------------- 1 10 hannibal 2 10 blacklist 3 10 poi 4 11 hitman 5 11 saw 6 11 spider man 7 12 taylor swift 8 12 britney spears i want select idcatg in table 2 , create new column in table 1 this: idcatg name value -------------------------------------------- 10 series hannibal-blacklist-poi 11 movie hitman-saw-spider man 12 music taylor swift-britney spears how can view? you can using stuff : select t21.idcatg, t1.name, [value] = stuff(( select '-' + t22.[value] table2 t22 t21.idcatg = t22.idcatg xml path(''), type).value('.', 'nvarchar(

javascript - Real time notification in PHP -

i creating php application, want 1 user make database entry. should reflected users whoever have app open on browser instant notification data has been updated on database or whatever data has been inserted. is there way can real time notification of data inserted or updated? on opened browser without delay. we use ajax now. seems our application working slow due continues request. other way? free. thank you! you can use web sockets . 1 existing library example php ratchet .

javascript - bootstrap.css and IE11 issues -

Image
i'm working on angularjs app using bootstrap.css. looks great in chrome formatting issues in both firefox , ie11. head <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <title>application</title> <!-- bootstrap core css --> <link href="css/bootstrap.min.css" rel="stylesheet"> <!-- custom css --> <link href="css/simple-sidebar.css" rel="stylesheet"> <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></sc

php - How to get numeric value from cURL array? -

i'm trying fetch numeric value curl response array. unable that. i'm using code $urltopost = "http://www.xxxx.yyy.com/zzz.php"; $ch = curl_init ($urltopost); curl_setopt ($ch, curlopt_post, true); curl_setopt ($ch, curlopt_postfields, $data); curl_setopt ($ch, curlopt_returntransfer, true); $returndata = curl_exec ($ch); print_r($returndata); its prints our new invoice id is: [{-10191}] on page. want fetch 10191 array. tried 1 failed. $id = abs(filter_var(implode($returndata), filter_sanitize_number_int)); how can retreive numeric value? if got $returndata string put after curl_exec: <?php $urltopost = "http://www.xxxx.yyy.com/zzz.php"; $ch = curl_init ($urltopost); curl_setopt ($ch, curlopt_post, true); curl_setopt ($ch, curlopt_postfields, $data); curl_setopt ($ch, curlopt_returntransfer, true); $returndata = curl_exec ($ch); //$returndata = 'our new invoice (id) is: [{-10191}]

java - what is the best way to check Internet connection continuously in android -

i developing application. in 1 screen check internet connection, after oncreate() method. if network connection calling 1 asynctask class load countries list , show on screen in spinnerview. if there no network connection showing toast message user , call check_network(asynctask). in class protected long doinbackground(url... params) method i'm checking network connected or not if connected call countries asynctask otherwise again calling check_network(asynctask). process repeat until network connected. problem is correct way check network repeatedly. please suggested me. sorry poor in english please understand.blow showing code if (checknetwork.isonline(this)) { try { new countryprocess().execute(); } catch (exception e) { e.printstacktrace(); } } else { toast.maketext( getapplicationcontext(), getstring(r.string.network_connection_fail)

java - Setting key for picasso for S3 Amazon -

i trying use amazon s3 client files uploading , downloading. caching trying use picasso right now. there few points note. 1- in s3, there no single link file. have randomly generate url each image. url expire in 1 min or can set expire in 1 hour. in oncreateview of adapter calling this string url = getamazontempurl() 2- each file name same can modified on server. e.g abc.png file name , can 1mb today , tomorrow there 1 more image there. now want ask how can picasso handle key such scenario. url changing time in single scroll. name same. not want picasso check name , don't download new updated file. what want keep cache of generated urls in hashmap, , if there no value key, generate url getamazontempurl() , store in cache. if set url expiry time hour can record activity load time variable, , check if has been longer hour. if so, clear cache. what can do callback picasso in case image fails , recreate url: picasso.with(this).load(imageurl).into(imgaeview

Xcode 7 beta 3 crash at startup -

i have problem after xcode7 beta 3 installation: not possible me use xcode because every time crash @ startup! have crash report don't understand problem. xcode 6.4 works without problem. can me? here first line of crash report... process: xcode [1012] path: /applications/xcode-beta.app/contents/macos/xcode identifier: com.apple.dt.xcode version: 7.0 (8163.8) build info: ideframeworks-8163008000000000~7 code type: x86-64 (native) parent process: ??? [1] responsible: xcode [1012] user id: 501 date/time: 2015-07-11 09:37:48.062 +0200 os version: mac os x 10.10.4 (14e46) report version: 11 anonymous uuid: 9ae5a2b5-e5a8-37f4-e7b7-c9e99a3cb864 sleep/wake uuid: 60dc0ed0-51da-4158-b5ff-f5b35b44d0a4 time awake since boot: 9200 seconds time since wake: 6500 seconds crashed thread: 0 dispatch queue: idesourcecontroltr

php - Cakephp 3 loading vendor files -

in cakephp 2 when need vendor or related class loaded globally, adding require or app use inside bootstrap.php ot core php. in cakephp 3 should require vendor files ? dont want declare vendor require in every class , template file use vendor files. http://book.cakephp.org/3.0/en/core-libraries/app.html#loading-vendor-files vendor files 3rdparty files. custom static utility classes not vendor files rather app files. can put them under src/lib/ . ensure use proper namespace classes , add proper use statement wherever need use class. for e.g. if lib class src/lib/foobar.php should have classname app\lib , "use" statement use app\lib\foobar .

Changing colorschemes in vim disables syntax highlighting for html -

so yeah, question in title. situation that, imaging 1 vim window split 1 half of html , other half css. when change colorscheme badwolf molokai, syntax coloring on html disappears. reasons why? when change colorscheme seems html filetypes affected (as css syntax highlighting still present), , colorschemes don't highlight syntax. examples include molokai, monokai, etc exceptions being badwolf , gruvbox. do guys think bug or there wrong _vimrc? don't wanna go through 100+ lines of code neatly folded last night :(

vsts - Change VSO account region/location -

early on during setup of vso account, either missed region setup field or ended default, turned out south central us. i change field west us. however, when go named vso account ( https://username.visualstudio.com )>control panel>settings>region, there not seem way make change. in azure, region information displayed under column titled "location" , other azure services use configured west us. how change region/location setting named account? the last saw (mentioned in here http://blogs.msdn.com/b/bharry/archive/2014/10/28/visual-studio-online-is-in-europe.aspx ) not possible planned future. blog possible support move different region looks judge on case case request.

ruby on rails - Unknown request /cgi-bin/chs/numreg/init from 61.160.213.108 -

i using nginx & phusion passenger running rails app. got these errors in access log: i, [2015-07-11t02:21:16.369230 #12228] info -- : started "/cgi-bin/chs/numreg/init" 61.160.213.56 @ 2015-07-11 02:21:16 -0400 f, [2015-07-11t02:21:16.382745 #12228] fatal -- : actioncontroller::routingerror (no route matches [get] "/cgi-bin/chs/numreg/init"): i tried search ip 61.160.213.56 on google, found page: http://www.ipillion.com/ip/61.160.213.108 it said that: 61.160.213.108 known firewall alert, port scanning. could 1 tell me mean? need block ip site? it's port scanning, , sending lots of dummy url allowing attacker login admin page.

ruby on rails - prawn pdf rendering partial results in blank page -

i try use rails prawn template style. in main prawn document "order_summary", want render prawn template this: pdf = prawn::document.new(:page_size => "a4") render :partial => "invoice" the name of partial is: _invoice.pdf.prawn , resides in same folder main document. when running it, results in blank page. page rendered according logs: rendered documents/_invoice.pdf.prawn (756.7ms) rendered documents/order_summary.pdf.prawn (1100.9ms) completed 200 ok in 2323ms (views: 1141.1ms | activerecord: 0.4ms) if run partial "invoice.pdf.prawn" (without rendering through file), works fine assume there no code error or sth. what do wrong? this gotcha documented in prawnto wiki . if partial in same folder, still have specify full path. in case, 'documents/invoice'.

variables returning null value upon switching View Controllers in Objective C -

im new programming objective c , working on moving data between view controllers. wondering if bi-directional flow of data (variables) between viewcontrollers possible. can move data backwards (to presentingviewcontroller / sourceviewcontroller) cannot move data forward (to presentedviewcontroller / destinationviewcontroller). i have made simple case scenario (involving strings principle of idea) of , involves updating uitextfield on destinationviewcontroller using uilabel in sourceviewcontroller , vice-versa. cannot update uitextfield using uilabel , can update uilabel using uitextfield . have made logs of different statements track variable values when switch viewcontrollers variables data returns null if marked strong. can please offer guidance, been tearing away @ mind, or missing obvious? don't why keep getting (null) value (in nslog) when switch viewcontrollers. my sourceviewcontroller / presentingviewcontroller named "viewcontroller." my destinatio

c++ - Json-cpp - how to initialize from string and get string value? -

my code below crashes(debug error! r6010 abort() has been called). can me? i'd know how initialize json object string value. json::value obj; obj["test"] = 5; obj["testsd"] = 655; string c = obj.asstring(); hello pretty simple: 1 - need cpp json value object (json::value) store data 2 - use json reader (json::reader) read json string , parse json object 3 - stuff :) here simple code make steps: #include <stdio.h> #include <jsoncpp/json/json.h> #include <jsoncpp/json/reader.h> #include <jsoncpp/json/writer.h> #include <jsoncpp/json/value.h> #include <string> int main( int argc, const char* argv[] ) { std::string strjson = "{\"mykey\" : \"myvalue\"}"; // need escape quotes json::value root; json::reader reader; bool parsingsuccessful = reader.parse( strjson.c_str(), root ); //parse process if ( !parsingsuccessful ) { std::cout <&

printf - MATLAB - Error while writing output in a CSV file using fprintf -

i consistently getting error while writing output in csv file using fprintf. want write results in csv file. have tried different lengths of matrix, , same error 2 columns. what's mistake here , how can resolve error? sample code: colname = {'col1' 'col2' 'col3'}; fid = fopen('test.csv','w'); fprintf(fid, '%s, %s, %s\n', colname{1:}); p=1:5 % <some code> fname = %reading image name directory % <some code> val1 = %calculating value1 val2 = %calculating value2 datacol = {fname val1 val2}; fprintf(fid, '%s, %f, %f\n', datacol{p+1:}); end fclose(fid); error: ??? index exceeds matrix dimensions. @ fprintf(fid, '%s, %f, %f\n', datacol{p+1:}); p.s.: writing "datacol = {fname val1 val2};" "datacol = {fname,val1,val2};" brought same error message. you indexing cell contents of datacol. if not mistaken datacol looks sth this: {'some_stri

eclipse - How to add feature crop image using intent on android camera? -

i try make app android crop image using intent on android camera , save result crop. follow this tutorial make camera capture, don't know how add feature crop using intent , save result crop that. we use library https://github.com/jdamcd/android-crop crop image camera or gallery can see library sample see method begincrop , pass new file(_path) parameter

javascript - Input box getting thicker after a CSS background-color modification -

this question has answer here: why text inputs change border attributes when background color applied? 3 answers i have form validated through javascript script. 1 of function of script highlight input fields have been modified original values contained. it works, when 1 of input field highlighted, become thicker when normally. the js script add class input box: function evidenzia_cambiamenti(id,testo) { if (typeof(testo) === 'undefined') testo = ''; if ((document.getelementbyid(id).value != testo)) { $('#'+id).addclass('campo_modificato'); $('#'+id).removeclass("errore_campo"); $('#'+id).removeclass("campo_obbligatorio"); } else if (document.getelementbyid(id).value == testo) { $('#'+id).removeclass('campo_modificato'); } } whil

ef code first - OnModelCreating fails when Context inherits from IdentityDbContext -

i had data access implemented below , working contexct inheriting db context had onmodelcreating configurations manually addding configurations however modified context inherit identitydbcontext<applicationuser> , stopped manually generating configurations , after onmodelcreating fails , db updates not happening @ all. if remove onmodelcreating , works fine. run application. can 1 guide me whats going wrong here? i missing below line in onmodelcreating method override. after started working. base.onmodelcreating(modelbuilder);

vb.net - Can I put parentheses inside a string? -

this question has answer here: how put data containing double-quotes in string variable? [duplicate] 1 answer i'm writing script generator in visual studio , i've run across problem. code: dim text string text = "register.node("play") {(speed = 0, evnt=0,)}" and string doesn't cover it.. don't know why keeps exiting string? in other languages i've used there no way of exiting string inside. i suggest either using double quotes... text = "register.node(""play"") {(speed = 0, evnt=0,)}" or typing thusly. text = 'register.node("play") {(speed = 0, evnt=0,)}' or maybe so. text = "register.node("+"play"+") {(speed = 0, evnt=0,)}"

c# - User Control error Object reference not set to an instance of an object? -

i have 2 webusercontrol . 1. uc_1.axcx 2. uc_2.ascx i tried access uc_2.ascx.cs method uc_1.axcx.cs . below uc_1.ascx.cs method. protected void page_load(object sender, eventargs e) { uc_2 objuc = new uc_2(); objuc.assignname("123'); } uc_2.ascx.cs : public string assignname(string nameparam) { textbox1.text = nameparam; //here getting object null error. retrun "access uc_2 successfully."; } while accessing uc_2 method uc_1 , getting: object reference not set instance of object. how solve issue ? you need register uc_2.ascx in uc_1.ascx instead of instantiate it. in uc_1.ascx : <%@ register src="~/uc_2.ascx" tagprefix="uc1" tagname="uc_2" %> <uc1:uc_2 runat="server" id="uc_2" /> and in uc_1 code behind change page_load this: protected void page_load(object sender, eventargs e) { uc_2.assignname("123"); } edit : call uc2 method

swift - Will my app get rejected if the user has to close and open the app to unlock the in app purchase? -

sorry code want right. have 3 different in app purchases , code in gameviewcontroller. called functions in viewdidload() function. see wrong code? edit: override func viewdidload() { super.viewdidload() callthis() callthis2() callthis3() } func callthis() { if(skpaymentqueue.canmakepayments()) { println("iap enabled, loading") var productid:nsset = nsset(object: "unlockleveltwo") var request: skproductsrequest = skproductsrequest(productidentifiers: productid set<nsobject>) request.delegate = self request.start() } else { println("please enable iaps") } } func callthis2() { if(skpaymentqueue.canmakepayments()) { println("iap enabled, loading") var productid:nsset = nsset(object: "unlocklevelthree") var request: skproductsrequest = skproductsrequest(productidentifiers: productid set<nsobject>) request.delegate = self request.start() } else { pri

tsql - Delete Redundant Sql Server Stored Procedures -

how delete redundant stored procedures in t-sql? saying "redundant", talking sps may have different names, work same way -- same input, same output. approaches can different. here situation: 20-30 databases hundreds of tables each, thousands of stored procedures keeps growing everyday, no version control on stored procedures, , did on production databases, no test databases. profiler , hard work answer. set profiler monitor rpc:completed event. remove possible columns , add "text data" column. output saved parsed find stored procedures have same paramertes , produce same output. check stored procedure output parameters in sql server profiler more information on results of rpc:completed event.

python automatic email response system -

this question has answer here: receive , send emails in python 9 answers i planning create program(with python) analyzes , responds emails on ubuntu, cant seem find serve receiving , sending part of program(in python, or terminal commands) have suggestions on use? you can use libraries poplib , imaplib receiving emails, smtplib sending emails, have @ email compose more complex emails.