Posts

Showing posts from June, 2010

Ruby automatically expands Hash into keyword arguments without double splat -

the below ruby code results in: unknown keyword: (argumenterror) : def test(x={}, y: true); end test({a:1}) why? expect happen test(**{a:1}) , don't understand why hash being automagically expanded without double splat. since x optional, hash moves on kwarg argument. unspecified keywords raise error in case: def foo(name:) p name end foo # raises "argumenterror: missing keyword: name" expected foo({name: 'joe', age: 10}) # raises "argumenterror: unknown keyword: age" check out this article

c# - voice command to capture photo -

i use windows.media.capture.mediacapture in windows phone 8.1 app capture photo. instead of button, i'd trigger photo capturing process voice command (for example, if user says 'cheese'). how can detect such voice command? you can use speechrecognizer class . here's sample msdn : private async void startrecognizing_click(object sender, routedeventargs e) { // create instance of speechrecognizer. var speechrecognizer = new windows.media.speechrecognition.speechrecognizer(); // compile dictation grammar default. await speechrecognizer.compileconstraintsasync(); // start recognition. windows.media.speechrecognition.speechrecognitionresult speechrecognitionresult = await speechrecognizer.recognizewithuiasync(); // recognition result. var messagedialog = new windows.ui.popups.messagedialog(speechrecognitionresult.text, "text spoken"); await messagedialog.showasync(); }

raspberry pi - Make Python FFT code faster -

can me make python code faster? @ moment reach 11 meassurements per second. hope faster don't know how it. import matplotlib.pyplot plt import matplotlib.animation animation import numpy np import time pylab import * ################################################################### import accelneu accel import rpi.gpio gpio scipy.fftpack import fft gpio.setmode(gpio.bcm) high=true low=false ###variablendefinitionen: ##adda wandler: #pins: sclk = 18 #taktuhr mosi = 24 #master-out-slave-in miso = 23 #master-in-slave-out cs1 = 25 #chip-select 1 (a/d) cs2 = 12 #chip-select 2 (d/a) cs3 = 4 #chip-select 2 (acceleration) #sonst infos: numbit1 = 12 # in anzahl bits ic 1 (a/d) numbit2 = 10 # out anzahl bits ic 2 (d/a) #variablendefinition voltagemaxin = 5.000 voltagemaxout = 4.0955 #maximalspannung voltage = 2.500 ##drucksensor: voltageoffset = 0.014652014652014652 #v spannungsoffs

python - Access local files from locally running http server -

i want access files in local machine using urls. example "file:///usr/local/home/thapaliya/constants.py". best way achieve this? use simple http server: python -m http.server 8000 or python 2: python -m simplehttpserver 8000 https://docs.python.org/3/library/http.server.html

Unable to start an Activity from Application class - Android -

i trying access if user logged in or not, based on try start activity application. while doing this, app crashes in application class. the code application class is public class myclass extends application { public static context context; @override public void oncreate() { super.oncreate(); context = getapplicationcontext(); if(parseuser.getcurrentuser().isauthenticated()){ startactivity(new intent(context, mainactivity.class)); } } } any suggestion why happens ? in manifest have declared intent filter activity. <activity android:name=".activities.register" android:label="@string/title_activity_register" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> &l

c# - Could not load file or assembly Microsoft.Practices.Unity.resources -

i getting error , not root cause of , please me could not load file or assembly 'microsoft.practices.unity.resources, version=2.0.414.0, culture=en-us, publickeytoken=31bf3856ad364e35' or 1 of dependencies. system cannot find file specified.

php - How to import contents of a database into a new database with Phpmyadmin? -

Image
ok inside mysql databases there 15 tables. each table contains nothing inside, here tables. now have folder on pc contains 15 files same name, shown here. inside file, have line @ top should import existing database if i'm correct. drop table if exists inventories; however when import it, errors. here error when try import inventories file pc new database. i don't know how fix this. i'm new sql well, do. preferable add me on steam, link steam profile below if can.

serialization - IDataObject store managed object reference -

i trying implement drag-and-drop functionality within c++/cli application, using standard winforms , wpf (managed) apis. these apis accept object wrapped in implementation of idataobject, serialize it, , deserialize once drag-and-drop target has been specified. not want data transferred serialized , deserialized. a bit more concretely (albeit dramatically simplified): [serializableattribute] ref class mytype : public system::iobserver<object^> { public: system::iobservable<object^> ^myobj; static void watch(mytype ^wrapper) { myobj->subscribe(watcher); } private: static mytype ^watcher = gcnew mytype(); void oncompleted(void) = system::iobserver<object^>::oncompleted {} void onerror(system::exception^) = system::iobserver<object^>::onerror {} void onnext(object^) = system::iobserver::onnext { system::windows::forms::messagebox::show("hi!"); } } ref class mycontrol : public system::w

scala - 'case' keyword appearing without its corresponding 'match' keyword -

this question has answer here: using 'case' in pairrddfunctions.reducebykey() 1 answer i going through 1 scala example in 1 of popular spark books. looks strange me, @ least newbie. know how standard match/case construct in scala looks in scala. in example see 'case' being used without corresponding 'match' keyword. valid? or more of typo in book? val joined = userdata.join(events)// rdd of (userid, (userinfo, linkinfo)) pairs val offtopicvisits = joined.filter { case (userid, (userinfo, linkinfo)) => !userinfo.topics.contains(linkinfo.topic) }.count() so if it's not regular match/case, 'case' being used in other context? thanks that's called pattern matching anonymous functions in scala specification prior match can dropped same behaviour. { case p1 => b1 … case pn => bn } is equivalent to: (x1:

c# - I made a datatable. But it takes every time the first column of my database/datatable. How can I take the second row/column of it? -

can me second row/column of datatable because somehow takes everytime first 1 if want second one. int score = 1; private void pbbier_click(object sender, eventargs e) { mysqlconnection conn = new mysqlconnection("server=localhost;database=patn4lj1;uid=root;pwd=root;"); conn.open(); mysqlcommand command = conn.createcommand(); command.commandtext = "select * locaties"; mysqldatareader reader = command.executereader(); datatable dtdata = new datatable(); dtdata.load(reader); //lblx.text = rowx["x"].tostring(); int xpos1 = (int32)dtdata.rows[0][0]; //dit de 4de rij van de 1ste kollom. // lblx.text = rowx[colx].tostring(); int xpos2 = (int32)dtdata.rows[1][0]; int xpos3 = (int32)dtdata.rows[2][0]; int xpos4 = (int32)dtdata.rows[3][0]; int xpos5 = (int32)dtdata.rows[4][0]; int ypos1 = (int32)dtdata.rows[0][1];

video - Deleting photos on google photos backup folder -

i have installed google photos backup on machine. if delete photos/videos on google photos backup folder, delete photos/videos on google plus ? i've tried find answer on google support didn't found thanks no, not delete photos/videos google photos if delete backup folder. remember: it's google photos backup, not google drive.

reporting services - How do I display headers in reports even if the dataset is empty -

Image
i have simple report has structure the report spans horizontal different movie titles dataset. the issue i'm having when dataset returns empty set of results report single empty cell. is there way have row headers display if dataset returns null? or there better way this? maybe https://dba.stackexchange.com/questions/48101/how-to-keep-the-structure-of-the-tablix-when-there-is-no-data-to-show/48846#48846 ? unlike answer, have on title column group. right-click title column group, , click add group > adjacent before... or adjacent after... text answer: you can add row outside of outermost group right under tablix header row. {image} set row visibility show or hide based on expression. expression like: =iif(countrows("dataset1") > 0, true, false) when there no data, table show headers , empty row. {another image} when there data, empty row hidden.

sql - Get groups that are exactly equal to a table -

i have query groups easily. need groups have same records table (relationship). i'm using ansi-sql under sql server, accept answer of implementation. for example: table1: id | value ---+------ 1 | 1 1 | 2 1 | 3 2 | 4 3 | 2 4 | 3 table2: value | ... ------+------ 1 | ... 2 | ... 3 | ... in example, result is: id | ---+ 1 | how imagined code: select table1.id table1 group table1.id having ...? -- group has same elements of table2 thanks in advance! you can try following: select t1.id table2 t2 join table1 t1 on t1.value = t2.value group t1.id having count(distinct t1.value) = (select count(*) table2) sqlfiddle

python - How to use a parameter to select one or more columns in a SELECT statement -

i'm trying create function able select particular columns sqlite 3 table. idea this: con = sqlite3.connect("my_db.db") cursor = con.cursor() def my_func(parameter_list): con.execute("select parameter_list a_table") return cursor.fetchall() where parameter_list contains names of columns user wants selected. i've tried using ? placeholders, but: i still need use fixed amount in select statement itself; for reason output names of columns, not contents. want let user determine number of columns , columns he'd fetch. you need comma-separated string columns, right? can done his: "select {} a_table".format(','.join(parameter_list))

javascript - requireJS load non AMD common scripts -

how load non-amd complaint scripts common in requirejs or should have manually? speaking of jquery, bootstrap , other little scripts needed globally custom modules. you can still ask requirejs load library need use "shim" functionality in requirejs.config() call specified here: http://requirejs.org/docs/api.html#config-shim if i've understood asking, here example (i didn't see if bootstrap exposed global or mixed in jquery you'll see point): requirejs.config({ paths: { 'jquery': 'path/to/jquery/jquery.min', 'bootstrap': 'path/to/bootstrap/bootstrap.min' }, shim: { 'bootstrap': { deps: ['jquery'], exports: 'bootstrap' } } }); require(['bootstrap'], function(bootstrap) { /* because of specified dependencies above, requirejs load jquery first , bootstrap, supplying library function signature can use "bootstrap" va

google apps script - Error msg from custom function when trying to open another spreadsheet. "You do not have permission to perform that action." -

i have custom function want use retrieve cell value in sheet spreadsheet. 2 parameters of function row , col , determine cell reference. whenever try use function, error "you not have permission perform action." , pointing line openbyid method. here custom function: function test(row,col) { var formdataspreadsheet = spreadsheetapp.openbyid(form_data_spreadsheet_id); spreadsheetapp.setactivespreadsheet(formdataspreadsheet); var formdatasheet = formdataspreadsheet.getsheetbyname(website_form_data_sheet_name); formdataspreadsheet.setactivesheet(formdatasheet); return formdataspreadsheet } do need publish form_data_spreadsheet? appreciated. sorry, can't in custom function: quote google documentation: if custom function throws error message "you not have permission call x service.", service requires user authorization , cannot used in custom function. google documentation - custom functions

java - What is the difference between textureregion and atlasregion in LibGdx? -

i wondered difference is. , can diference between texture , textureatlas. greetz luc when load texture in game doing texture t = new texture(""); , load texture in gpu. textureregion, takes area texture according dimension provide, advantage of having don't have load textures again , again , bigger advantage don't have load each , every texture on gpu can directly loading 1 big texture , extracting sub regions(textureregions) it. now because want use textureregions , hard know dimensions of each , every sub image load them texture sheet. we pack textures bigger texture using texturepacker(an application) creates .pack file. pack every texture 1 image , create .pack file. when load .pack file, loaded using textureatlas class example imagine pokemon pack file has pokemons it. textureatlas pokemonfrontatlas = new textureatlas(gdx.files.internal("pokemon//pokemon.pack")); now imagine packed 100 files using texture packer , want load im

colors - Change a ParticleEffect colour in a LibGDX game to a certain RGB value -

i created 2d particle effect particle editor tool comes libgdx. then, needed change particle effect colour rgb colour programatically. purpose, found method: myeffect.getemitters().get(0).gettint().setcolors(float [] colours); my problem don't know how convert rgb colour proper array values required method since don't know colour format used. in particleeditor, colour selection format looks hsv. however, colour values stored in resulting *.p file don't seem match format. i wish tell me how conversion. thanks from javadocs public void setcolors(float[] colors) parameters colors - r, g , b values every timeline position it takes rgb values in float, there online convertor takes html color ( hex ) , convert them rgb decimal values , can pass them inside setcolors() method. here link. convertor

php - In Laravel 5 error in array validation with Form Request? -

the part of form (the field text array)[1]: <div id="cp1"> <div class="form-group"> {!! form::text('names[]',null,['class'=>'form-control', 'maxlength'=>'30', 'placeholder'=>'name']) !!} </div> <div class="form-group"> {!! form::text('contents[]',null,['class'=>'form-control', 'maxlength'=>'30', 'placeholder'=>'content']) !!} </div> </div> when send form, validation fails with: htmlentities() expects parameter 1 string, array given (view: /applications/mamp/htdocs/telovendogdl/resources/views/ads/new.blade.php) this rules in form request: return ['title' => 'required|min:8|max:100', 'description' => 'required|min:10|max:1100', 'price' => 'required|integer|max:15',

node.js - How to add cordova plugins now that they are renamed and ported to npm? -

for example, want add camera , file cordova plugin. according official documentation, should do meteor add cordova:org.apache.cordova.camera@0.3.1 however, plugin has been renamed cordova-plugin-camera, how can add newest compatible version? know need use 0.3.1 because documentation said that. how know version use cordova-plugin-file? meteor support new cordova npm plugin registry in next release . for time being, add latest camera plugin github tarball: meteor add cordova:cordova-plugin-camera@https://github.com/apache/cordova-plugin-camera/tarball/437cf3d93a2c0c841d38c6c80472b2ba118f372a

java - How to listen on save button or assign an event after it was clicked in Vaadin 7 -

Image
when editing grid inline can save or cancel grid row changes. want update database entries after button 'save' pushed(data base mechanism has done) how can implement it? my container: beanitemcontainer<categoryofservice> beanscontainer; editing view: all need know listeners have use. found commithandler can add editorfieldgroup class can't implement maybe there have way resolve problem. there's kind of way capture inline save click on grid. grid.geteditorfieldgroup().addcommithandler(new fieldgroup.commithandler() { @override public void precommit(fieldgroup.commitevent commitevent) throws fieldgroup.commitexception { //... } @override public void postcommit(fieldgroup.commitevent commitevent) throws fieldgroup.commitexception { //... } }); after clicking save both methods precommit , postcommit called. hope helps :)

numpy - Fastest non negative matrix factorization (NMF) solver in python? -

i'm using sklearn's projectedgradientnmf , nimfa's lsnmf solvers factor sparse matrix. projectegradientnmf runs slower converges closer solution while lsnmf runs twice fast converges further solution (frobenius norm distance measure). i'm curious current fastest or closest solvers available python community or there better option sparse matrix (the matrix sparse, not scipy.sparse)? there benchmark here: https://github.com/scikit-learn/scikit-learn/pull/4852 pull request including coordinate descent solver mblondel https://gist.github.com/mblondel/09648344984565f9477a what mean sparse not scipy.sparse? library from?

resteasy @Consume json fails with java.util.Map -

i have following json structure: { "foo" : { "foo1" : { "txt" : "val", "txt1" : "val1", "txt2" : "val2", }, "foo2" : { "txt" : "val", "txt1" : "val1", "txt2" : "val2", } }, "bar" : { "bar1": { "txt" : "val", "txt1" : "val1", "txt2" : "val2", }, "bar2": { "txt" : "val", "txt1" : "val1", "txt2" : "val2", } } } while have following pojo: class pojo { string txt; string txt1; string txt2; } and resteasy method looks like: @post @produces({ mediatype.applic

node.js - Socket.io - when I run my node app on localhost I can connect, but on the production server I can't? -

i'm using passport.socketio. debug statements authorization success firing, not connect event. these debug statements on server: setting poll timeout discarding transport cleared post timeout client laknraalkn3but clearing poll timeout jsonpolling writing io.j[o]("8::"); set post timeout client laknraalkn3but jsonpolling closed due exceeded duration setting request /socket.io/1/jsonp-polling/laknraalkn3but not sure if problem, i'm trying connect on port 8086, have told me high of port university web server. can allow ports? in server firewall? i'm using windows server 2008 , iis 7, , i've set reverse proxy forward traffic port 8086. thanks! this firewall issue, without knowing full setup, it's kind of impossible diagnose. make sure port 8806 open on server, see if there physical hardware firewall between , server , port 8806 open on well.

c - Error creating shared library on Linux -

i have created makefile c shared library. tried using -o & -fpic flags after shared word. same error. not sure wrong makefile. makefile myprogram: main.o libmylib.so gcc -lm -o myprogram main.o -l. -lmylib main.o: main.c gcc -o -c main.c main.h addsorted.o: addsorted.c addsorted.h gcc -c -fpic addsorted.c freelinks.o: freelinks.c freelinks.h gcc -c -fpic freelinks.c libmylib.so: addsorted.o freelinks.o gcc -shared libmylib.so addsorted.o freelinks.o all: myprogram libs: libmylib.so clean: rm -f myprogram *.o *.a *.gch linux terminal error gcc -shared libmylib.so addsorted.o freelinks.o gcc: libmylib.so: no such file or directory make: *** [libmylib.so] error 1

javascript - Where is ther unexpected Syntax error? -

the console states there unexpected { in code. went on syntax several times , cannot seem find it. var userchoice = prompt("do choose rock, paper, or scissors?"); var computerchoice = math.random(1); if (computerchoice <= 0.33){ computerchoice = "rock"; } elseif (computerchoice <= 0.67 && computerchoice >= 0.34) { computerchoice = "paper"; } else { computerchoice = "scissors"; } elseif should have space in between. var userchoice = prompt("do choose rock, paper, or scissors?"); var computerchoice = math.random(1); if (computerchoice <= 0.33){ computerchoice = "rock"; } else if (computerchoice <= 0.67 && computerchoice >= 0.34) { computerchoice = "paper"; } else { computerchoice = "scissors"; }

Can Python be made statically typed? -

i know python slower languages fortran , c/c++ because interpreted rather compiled. another reason have read is quite slow because dynamically typed, i.e. don't have declare variable types , automatically. nice because makes code cleaner , don't have worry variable types. i know there won't reason can wrap eg. fortran code python, possible manually override dynamicly typed nature of python , declare variable types manually, , increasing python's speed? if interpret question "is there statically-typed mode python?" , cython comes closest offering functionality. cython superset of python syntax - valid python code valid cython code. cython compiler translates quasi-python source code not-for-human-eyes c, can compiled shared object , loaded python module. you can take python code , add many or few static type declarations like. wherever types undeclared, cython add in necessary boilerplate correctly infer them, @ cost of worse runtime perfo

Android app widget not updating after changing system clock -

i have android widget scheduled update every hour android:updateperiodmillis="3600000" however when change system clock (forward 1 hour or more) widget update method not being called, no visual changes or logs happen. i wait couple of minutes thinking os may wait till next minute because doesn't need precision, still nothing triggers. changing system time won't trigger basic widget updates? you doing right, there no guarantee updated @ exact time expected. delayed. check documentation . the actual update not guaranteed occur on time value.

spring security redirect user by ROLE -

i want redirect user page based on role don't know how it. serched on doesn't work me. it's taking redirect role_master if user has role_user or other. tried in different ways can see in commented code none of them worked correctly. the code is: @configuration @enablewebsecurity public class springsecurityconfig extends websecurityconfigureradapter { @autowired usersdetailsserviceimpl usersdetailsservice; @autowired public void configureglobal(authenticationmanagerbuilder auth) throws exception { auth.inmemoryauthentication().withuser("stefan").password("1234").roles("admin"); auth.userdetailsservice(usersdetailsservice); } @override public void configure(websecurity web) throws exception { web.ignoring().antmatchers("/res/**"); } //.csrf() optional, enabled default, if using websecurityconfigureradapter constructor @override protected void con

Python, sharing mysql connection in multiple functions - pass connection or cursor? -

i opening mysql connection in main function , use connection in multiple functions called main function. is there wrong passing cursor main function instead of passing connection? i.e.: pass in cursor main function def main(): conn = pymysql.connect(...) conn cursor: func1(cursor) func2(cursor) conn.close() def func1(cursor): cursor.execute('select ...') def func2(cursor): cursor.execute('insert ...') pass in connection main function def main(): conn = pymysql.connect(...) func1(conn) func2(conn) conn.close() def func1(conn): conn cursor: cursor.execute('select ...') def func2(conn): conn cursor: cursor.execute('insert ...') the answer comes law of demeter : pass cursor. this leads shorter code. in case, it's pretty trivial, may lot (e.g., passing database name vs. passing cursor).

python - Missing classes in wxPython -

in documentation of wxpython there classes missing. for example: textcompleter . in python get: >>> import wx >>> print wx.__version__ 2.9.3.1 >>> wx import textcompleter traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: cannot import name textcompleter i have tried newest version of wxpython (3.0) as may have noted, referring wxpython (phoenix) documentation. have classic version installed, textcompleter has not been wrapped in swig (and never will, because development effort concentrated on phoenix). class has been wrapped in phoenix. if absolutely interested in trying out phoenix, set virtualenv , pip install <path-to-wheel> snapshot build . favor , download wheel matching python local disk before trying install .whl -file.

Python: How to call class method from imported module? "Self" argument issue -

i have 2 files. know how call function, cant understand how call method imported module has "self" 1st argument. i got error: typeerror: prepare() missing 1 required positional argument: 'url' cinemas.py import requests lxml.html import fromstring class cinemas_info(): def __init__(self, url): self.basic_cinemas_info(url) def prepare(self, url): url = requests.get(url) tree = fromstring(url.text) tree.make_links_absolute(url.url) return tree def basic_cinemas_info(self, url): tree = self.prepare(url) city in tree.xpath(".//div[@class='city-caption']"): city1 = city.xpath("text()")[0] cinema in city.xpath("following-sibling::*[1]/li/a"): name1 = cinema.xpath("text()")[0] detailed_url = cinema.xpath("@href")[0] print (city1.strip(), name1.strip(),

javascript - Can I call all methods of an object? -

let's have object: var shapes = { addtriangle: function(color){ console.log("added " + color + " triangle"); }, addsquare: function(color){ console.log("added " + color + " square"); } } this object have methods changed , updated frequently, methods running sequentially. there way automatically , run methods, ease maintainability? like: function runshapes(color){ shapenames = object.getownpropertynames(shapes); for(i = 0; < shapenames.length; i++){ shapenames[i].apply(color); } } this gives `shapenames[i].apply not function'. bonus points telling me how functional programming, instead of loop :) codepen: http://codepen.io/anon/pen/mjxvye first off mistake... iterating through property names , not properties. shapenames[i].apply(color); should be: shapes[shapenames[i]](color); a more functional version might this: function runshapes(color){

python - Match a continuously repeated backreference in a given times and no more -

in simplified case, want extract repeated number(3 times) input string, 3 times , no more. #match backreference(\d here) 2 more times #11222(333)34445 matched , consumed, #then current position moves 11222333^34445 in [3]: re.findall(r'(\d)\1{2}','1122233334445') out[3]: ['2', '3', '4'] #try exclude 11222(333)34445 setting non-backreference(?!\1) #as negative lookahead assertion, skips match of #11222^(333)34445, captured in next position #112223^(333)4445 in [4]: re.findall(r'(\d)\1{2}(?!\1)','1122233334445') out[4]: ['2', '3', '4'] #backreference cannot go before referenced group in [5]: re.findall(r'(?!\1)(\d)\1{2}(?!\1)','1122233334445') --------------------------------------------------------------------------- error traceback (most recent call last) <ipython-input-5-a5837badf5bb> in <module>() ----> 1 re.findall(r'(?!\1)(

vb.net - Loading items in Combobox -

i working on project , problem have is; items of combobox being loaded database table(one field); table has more 1000 records: how can load these records(one field) items giving limit of 50 while allowing user wants see of records through combobox see them still group of 50? which event can best loading items combobox? textchanged, click.... i thinking use vertical scroll bar when user @ end of displayed items next 50 loaded , if on first , scrolls previous 50 loaded:problems way of thinking are: when user typed caracter word wanna select items' list if not loaded yet db obliged type whole word i don't know event raised when scroll bar of reaches end or @ beginning is there other way that?

javascript - -webkit-user-select:none and -ms-user-select:none copying the content -

Image
i trying disable selection of <td> s of table having specific class. in css file class added -webkit-user-select: none; -ms-user-select: none; but neither of them seems work. visually appears <td> s not getting selected. if copy , paste data, content cells getting copied. browser version - ie 11 , chrome 43.0.2357.132 m adding -moz-user-select: none; works perfect firefox. idea why not working rest 2 browsers? to make sure line numbers aren't being copied, can use standard <ol> tag: <ol> <li>can't select line number</li> </ol> to style it, create a counter along ::before make not selectable. can use element (not <ol> ) method. demo additional styling: http://jsfiddle.net/derekl/ae2fggl5/ (chrome) line numbers appear selected, can't copy them or select them individually. (firefox) line numbers can't selected in firefox.

White page in a wordpress site - plugin or server issue? -

this site: biodanza-meeting.com shows white page times , if reload it's working again. plugin issue? how can know issue is? there lots of different ways find php errors cause "white pages". use debug in wordpress https://codex.wordpress.org/debugging_in_wordpress check php error(s) lead plugin or code error on wordpress theme. if can't use debug, deactivate plugins , activate 1 one find 1 may causing error. check hosting account error logs; issue hosting problem 500 server error other php error.

ios - How to swipe UIPageViewController from Navigation Bar -

Image
i trying make uipageviewcontroller can swiped navigation bar. tinder ios app has example of this. i cannot add navigation bar inside content view controllers, because navigation bar dynamic , animates swipe between pages. so far architecture this: mainvc: uivc -contains uipageviewcontroller inside it -contains navigation bar inside it -contains data vc1 , vc2 how achieve swipe input navigation bar , affect uipagevc? i solved problem , created repo it: https://github.com/goktugyil/ezswipecontroller its more snapchats navigation, means navigation bar not animate works well.

ios - Accurate timer using AudioUnit -

i'm trying make accurate timer analyze input. i'd able measure 1% deviation in signals of ~200ms. understanding using audiounit able <1ms. tried implementing code stefan popp's example after updating few things work on xcode 6.3, have example working, however: while want capture audio, thought there should way notification, nstimer, tried audiounitaddrendernotify, says should - i.e it's tied render, not arbitrary timer. there way callback triggered without having record or play? when examine msampletime, find interval between slices match innumberframes - 512 - works out 11.6ms. see same interval both record , play. need more resolution that. i tried playing kaudiosessionproperty_preferredhardwareiobufferduration examples find use deprecated audiosessions, tried convert audiounits: float32 preferredbuffersize = .001; // in seconds status = audiounitsetproperty(audiounit, kaudiosessionproperty_preferredhardwareiobufferduration, kaudiounitscope_output

opencv - How can I separate color pixels that are not common for two images? -

here's do: i have image of rice leaf. have image of rice leaf got brown color spots on leaf. want separate color pixels not common 2 images using opencv.(color of spots can vary) i tried using histogram intersection. managed find number of pixels common between 2 images. is there way using opencv? please me kind enough me. if 2 images match perfectly if match use rhinodevel approach: so loop through pixels of first image and compare each pixel corresponding pixel second image if difference higher treshold you found not matching pixel , need do like add pixel output map or recolor (brown) pixel color first image or whatever if 2 images not match so got reference leaf image , processed image can have position/rotation skew create list of colors per each image sort them ascending color cross compare booth lists if color in list2 not in list1 then recolor/copy pixels contains such color in/from image2 this approach slower o(xs*ys*n) xs,ys imag

java - How to diagnose the root cause of tomcat crash -

i have tomcat server 7.0.54 running on suse linux 11 sp3. crashes occasionally. i checked catalina.out , found log “info: stopping service catalina” looked tomcat got abnormal shutdown signal. there no error log before stopping log. weird. it not jvm crash because has process: pause -> stop -> destroy. seems not shut down shutdown.sh through shutdown port normally. because should have important log “org.apache.catalina.core.standardserver await” if shut down shutdown port. this may have 2 reasons: system.exit executed. checked code , there no kind of code. it got system signal, e.g. sighup. how find signal got , program sent signal? any suggestion/comments find root cause appreciated. thanks just guess tomcat may crashing due insufficient memory. can use eclipse memory analysis tool analyse heap dump generated. eclipse memory analyzer fast , feature-rich java heap analyzer helps find memory leaks , reduce memory consumption. check tomcat logs thor

javascript - HTML5 / CSS GPU Performance optimization -

i created card game using html/css/js. moves animates cards around screen , animates scoreboard / messageboard. the performance on chromecast terrible though. degrading 4fps :(. when debug app using 20mb/512mb of gpu. i'm wondering if there way enable gpu rasterization or other advanced gpu features, or if has tips on how improve performance of game. so far i've been removing textures, transparencies, , simplifying animations. love advice on how more performance out of chromecast though. realize webgl allow me more use of gpu rewrite of animation classes. the trick force javascript animation library animate 2d animations 3d making use of gpu.

ios - Swift: Apple Mach-O Linker Error -

i'm working on parse/facebook login keeps giving me following error: undefined symbols architecture x86_64: "_fbsdkaccesstokendidchangenotification", referenced from: there on 60+ such errors, not sure why appearing since code working in different project. copying on code , started happening, advice? check if have import part copied new project well, dependencies. when said undefined symbols, means function _fbsdkaccesstokendidchangenotification can't found while compiling, means correspond framework/sdk/library not there.

apache - One directory on server not using correct include path (Set with php.ini) -

i'm having issues 1 particular directory on site, cannot find included php files outside of root directory. baffles me working every other page outside of directory, particular directory not set itself. set include paths in php.ini so: include_path = ".:/home1/(username)/inc:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear" the files i'm trying access in "inc" folder. all have in file i'm running include_once ('include.php'); which should, based on php.ini settings, find right file in inc directory. i've tried couple different things remedy including setting include path so: include (dirname($_server['document_root'].'/inc/include.php'); which cannot find correct file. as changing .htaccess located within folder manually set include path particular directory. # allow user ip <limit post> order deny,allow deny allow (ip of cron server) </limit> # prevent viewing of .htaccess <files .hta

php - Get a JSON value from an array using Laravel -

i trying latitude , longitude values json array - $response , returned google, geocoding services. the json array returned such (random address): { "results":[ { "address_components":[ { "long_name":"57", "short_name":"57", "types":[ "street_number" ] }, { "long_name":"polo gardens", "short_name":"polo gardens", "types":[ "route" ] }, { "long_name":"bucksburn", "short_name":"bucksburn", "types":[ "sublocality_level_1", "sublocality", "polit

Android panels/panes/islands -

Image
how make boxes here around text? have change relative- or tablelayout? called panels? android not have border property, can create border background image. can see answer: https://stackoverflow.com/a/3496310/587110

email - How to use @MailSessionDefinition in Wildfly -

i trying use @mailsessiondefinition configure mailsender in wildfly 8.2. using annotation not enough setup, had use specific xml, present in wildfly. tips? here code: @mailsessiondefinition(name = "java:jboss/mail/gmail", host = "smtp.gmail.com", user="user", password="password", transportprotocol = "smtps", from="test@gmail.com", properties = { "mail.debug=true", "mail.smtp.port=587", "mail.smtp.auth=true", "mail.smtp.starttls.enable=true" }) public class mailconfiguration { }

vb.net - ScriptHookV .NET "IsInBuilding" Property? -

i dont know if right section or website ask this, problem how can check if player inside building scripthookv .net (gta v .net modloader) , visual basic. i tried functions , properties under namespace gta , didn't find relevant buildings. any appreciated, thanks! i found answer gtaforums . answer c# : if (gta.native.function.call<bool>(gta.native.hash.is_interior_scene)) { 'player inside building } and answer vb .net : if (gta.native.function.call(of boolean)(gta.native.hash.is_interior_scene)) 'player inside building end if

ios - UITableViewCell Not Autoresizing in "Live" Search -

Image
little bit of background i in process of making search feature announcements in app. load initial announcements in uitableview custom cell display. achieve dynamic cell size in viewdidload() method of announcementtableviewcontroller class use autoresizing technique: tableview.estimatedrowheight = tableview.rowheight tableview.rowheight = uitableviewautomaticdimension that works displaying cells various heights. calling tableview.reloaddata() when refreshing cells' data works great. i have different uitableview displays blank tableview , uisearchbar header. implement uisearchbardelegate method searchbar(_:textdidchange:) , perform search filter logic , append filtered announcements filteredannouncements array. i call tableview.reloaddata() method in didset filteredannouncements . the issue when type in search bar cells not automatically resize themselves, in fact default height. have title , body each announcement, body gets cut off. what i've tri

javascript - magento xml for 1 cms page - js and css -

i trying add accordion 1 cms page in xml update. i uploaded default > default/js/ac/ , /css/ac/ and placed code in xml update pane this: <reference name="head"> <action method="additem"> <type>text/css</type> <name>css/ac/jquery-accordion.css</name> </action> <action method="additem"> <type>text/javascript</type> <name>js/ac/jquery-1.10.1.min.js</name> </action> <action method="additem"> <type>text/javascript</type> <name>js/ac/jquery-accordion.js</name> </action> </reference> <reference name="header"> <script type="text/javascript"> jquery(document).ready(function() { $("#accordion").jqueryaccordion(); }); </script> </reference> the dev of code knows nothing mangento. says this: installation place reference css , java

ios - What do you call the first item in Navigator area of Xcode? -

Image
when communicating other people have refer first blue (root) item of project navigators content area (see image below, in case item has name adventure). is there official name item? if not how refer it? people refer "the blue project file icon in project navigator", there not better or more succinct name? that called project navigator.

c++ - Parsing commands in a console application -

so console application based around commands, example user enter "connect 127.0.0.1" , stuff. able separate commands arguments, how make call function based on command string, , have match commands string counterparts? use standard parsing techniques, , read commands std::cin you might want declare type vector of arguments. typedef std::vector<std::string> vectarg_t; declare type functions processing commands: typedef std::function<void(vectarg_t)> commandprocess_t; and have map associating command names processors: std::map<std::string,commandprocess_t> commandmap; then fill map @ initialization time, e.g. using anonymous functions: commandmap["echo"] = [&](vectarg_t args){ int cnt=0; (auto& curarg: args) { if (cnt++ > 0) std::cout << ' '; std::cout << curarg; } std::cout << std::endl; }; if question parsing program arguments (of main ), use geto

scala - Scalatra, Atmosphere, and sending messages to clients from outside the message handler -

i'm reading through official scalatra documentation, particularly guide on using scalatra atmosphere . page explains how use scalatra , atmosphere write websocket based application responds incoming messages outgoing messages. for purposes of application connects multiple different messaging sources, how send outgoing messages elsewhere in application? possible examples include: messages sent result of incoming http request periodic messages on timer messages pulled queue etc. some of these messages potentially target multiple clients. i'm bit confused official docs on matter because examples happen various incoming message handlers , i'm not sure reference atmosphere system or where/how i'm allowed call it. i hope can clarify.

How to merge the list in python -

i read this , this , , this , no solution. i have list of 50 lists this: datatest=[list1,list2,list3,...,list50] each of lists list of images along labels. mean first dimension of list1 consists of images, , second dimension of list1 corresponding labels. this: list1=[images,labels] for example, list1 list 700 images label 0. list2 list 1000 images label 1, ... hence, have list of 50 lists in each individual list comes size 2. i want merge list in order following matrix. mean array this: datatest=[images of list1,2,3,...,50 , labels of list1,2,3,...,50] so, have list 2 size. first dimension images lists, , second dimension labels of images is want: a=[[1,2],[2,3]] [v d in v in d] [1, 2, 2, 3] changed after op's edit: a=[[2,3],[2,3]] c=[] c.append([v[0] v in a]) c.append([v[1] v in a]) print c [[2, 2], [3, 3]]

objective c - Programmatically create NSPopupButton and add items to list -

i've been able programmatically create nspopupbutton , add window, , can add items list same method, i'd figure out how can add items method. here's have far works: // in .h file: @interface avrecorderdocument : nsdocument { @private nspopupbutton *button; } @property (assign) iboutlet nswindow *mainwindow; // in .m file: @implementation avrecorderdocument @synthesize mainwindow; - (void)windowcontrollerdidloadnib:(nswindowcontroller *) acontroller { nsview *superview = [mainwindow contentview]; nsrect frame = nsmakerect(10,10,149,22); nspopupbutton *button = [[nspopupbutton alloc] initwithframe:frame]; [superview addsubview:button]; [button release]; } - (void)refreshdevices { // i'd add items popupbutton here: // [button additemwithtitle: @"item 1"]; } @end up in refreshdevices don't compiler error, nothing gets added popupbutton. method r

ios - TextField Input via speech(Speech To Text)? -

Image
i'm building ios app using swift , xcode 6. want implement speech text functionality in app. i googled , found links not helpful , in objective c openears. i have 2 or 3 textfields user enter his/her name,age , location. , there mike button speech entry in textfield. in image below. could me how can implement functionality using swift. help appreciated! in advance! you can implement openears way in swift project: first of add framework downloaded here . bridging-header.h #import <openears/oelanguagemodelgenerator.h> #import <openears/oeacousticmodel.h> #import <openears/oepocketsphinxcontroller.h> #import <openears/oeeventsobserver.h> #import <openears/oelogging.h> #import <openears/oeflitecontroller.h> #import <slt/slt.h> viewcontroller.swift // // viewcontroller.swift // speechtotext // // created anil on 08/07/15. // copyright (c) 2015 variya soft solutions. rights reserved. // import uikit var lmpath