Posts

Showing posts from January, 2011

objective c - How to use a system keyboard into custom keyboard for iOS -

i try make custom keyboard, need put uitextfield custom keyboard. how can use system keyboard write information uitextfield? any idea? thanks regards. i want custom keyboard this you cannot use system keyboard when presenting custom keyboard. need provide own keyboard functionality.

web - What language/tool can I use to generate a dynamic 3d model on a website -

i developing sort of browser (war) game, in player can have village different buildings (watchtowers, walls etc..) overview want generate small 3d model of village little interactivity (maybe can click on building in village , display info building). should dynamic (they can upgrade these buildings, , want them change after upgrade) , depend on values in database. tool or programming language best use this? thank you! you try three.js or babylonjs .

c++ - Returning other classes variables with function and declaration order -

im trying c++ class function can return other classes values. code works if class defined first have more code dont want mangle around. figured need somekind of forward declaration class a. what kind of forward declaration need work? code in 1 file. problem dissapear if split classes multiple files , include them project or make difference vc++ compiler? semi pseudo code below. // forward declaration class a; // class deifinitions class b { private: int testvalue; public: void settestvalue(a &aobj); } void b::settestvalue(a &aobj) { testvalue = aobj.settestvalue(); } class { private: int test = 10; public: int testvalue(); }; int a::testvalue() { return test; } // mainloop aobj; b bobj; bobj.settestvalue (aobj); just put defination of b's member-function after a's class definition.

graph - Drawing things in the right order, Java -

i'm in process of writing "paint" application in java consisting of rectangular nodes , undirected edges. problem beginning of edge in center of rectangle edge connected to, , end of edge in center of other rectangle edge connected to. to avoid drawing intersection between rectangle , edge, draw edges first , nodes afterwards, placed on top of edges, hiding intersection. the problem arises when node, not correspond edge placed along edge. in scenario, because edges drawn first, node appears on top of edge. however, not want. want edge show on top of node. images: how is , how should be the comprehensive way can think of fix draw nodes first , afterwards draw edges avoiding intersections of edge 2 nodes connected to. difficult on paper because draw edges using drawline , , not have possibility check intersections. this why draw edges first, problem mentioned arises. ideas? what need solution problem #1. need "move" edge's endpoints aw

jmonkeyengine - Putting JMEcanvas into JPanel SWING -

i need put jme canvas app jpanel. in class jme init this: public jmecanvascontext ctx; public dimension dim = new dimension(800, 600); private void init() { appsettings settings = new appsettings(true); settings.setwidth(dim.width); settings.setheight(dim.height); // settings.setrenderer(appsettings.lwjgl_opengl1); setsettings(settings); createcanvas(); // create canvas! ctx = (jmecanvascontext) getcontext(); ctx.setsystemlistener(this); ctx.getcanvas().setpreferredsize(dim); startcanvas(); } then, in main window create jpanel (using netbeans designer tool) , add jme canvas panel. paneldelagente.add(agentemolon.ctx.getcanvas()); but doesntwork. first time use jme , dont know how can put in jpanel thanks time! in case use https://github.com/davidb/jme3_ext_swing the question posted on jme forum : https://hub.jmonkeyengine.org/t/putting-jme-canvas-into-jpanel-swing , more answers.

arm - How to specify GNU / Linux version compiling dropbear -

i have compiled binary of dropbear. when file dbclient following : dbclient: elf 32-bit lsb executable, arm, version 1 (sysv), dynamically linked (uses shared libs), stripped when trying compile on own (very beginner) ./configure --host=arm-linux-gnueabi --prefix=/ --disable-zlib cc=arm-linux-gnueabi-gcc ld=arm-linux-gnueabi-ld make make install i following after compiled dbclient: elf 32-bit lsb executable, arm, version 1 (sysv), dynamically linked (uses shared libs), gnu/linux 2.6.31, buildid[sha1]=0x016ac7e729afb02d60248393619b41380379777d, not stripped for stripped part, don't care strip later. but question how specify " for gnu/linux 2.6.31 ". mean , how change target linux 3.10.49 armv5tejl ?

android - Why can't I configure a device on Firebase Test Lab to use API Level 23? -

i trying reproduce issue in android app specific galaxy s6 running android 6.0.1, none of devices listed support api level 23. tried of devices api level 23 , each 1 says "1 device/api level combination unsupported , marked skipped in test matrix." looked said api level 23 supported couldn't find anything. as of right now, not have support api level 23 galaxy s6. may change in future looking expand our device , api level support, aren't able give date on that. support api level 23 virtual nexus 6 device. if want stay in loop on test lab , more direct support staff, please considering joining discussion group .

How to create a init-script for an Perl catalyst application running on nginx with fastcgi and perlbrew -

i'm looking initscript make usage of perlbrew on webserver running nginx proxy perl catalyst application. i'm trying start app via source $perlbrew execute "perlbrew use perl-5.14.4@devel" execute "mkdir -p $pid_path && $start_icos_app > /dev/null 2>&1 &" echo "$desc started" but appers cannot find local perl installation. $perlbrew set perlbrew folder. this step step guide how this, french (but still understandable). http://www.catapulse.org/articles/view/124 i copied here: setup user going run catalyst app (www-data in example) su - www-data curl -kl http://install.perlbrew.pl | bash echo 'source ~/perl5/perlbrew/etc/bashrc' >> .profile . .profile perlbrew install perl-5.16.3 -dusethreads --as perl-5.16.3_with_threads perlbrew switch perl-5.16.3_with_threads #perlbrew install-cpanm #cpanm catalyst catalyst::devel #catalyst.pl myapp (i assume application name myapp, replace y

c# - Why isn't my exception handler firing in Sitecore.mvc.Pipelines? -

i trying create nice exception message our public site, overriding "sitecore.mvc.pipelines.mvcevents.exceptions.showaspneterrormessage" modifying sitecore.pipelines config file, so <mvc.exception patch:source="pipelines.config"> <processor type="northwestern.core.infrastructure.pipelines.exceptionerrorhandler, northwestern.core"/> <processor type="sitecore.mvc.pipelines.mvcevents.exception.showaspneterrormessage, sitecore.mvc" patch:source="sitecore.mvc.config"/> </mvc.exception> and here exceptionerrorhandler code: namespace northwestern.core.infrastructure.pipelines { public class exceptionerrorhandler : exceptionprocessor { public override void process(exceptionargs args) { var context = args.exceptioncontext; var httpcontext = context.httpcontext; var exception = context.exception; // return 500 status code , execute custom err

forms - Symfony2 setDefaultOptions(OptionsResolverInterface $resolver) -

i quite new in symfony2. trying develop website can register/login. trying make register form thows exception regarding setdefaultoptions(optionsresolverinterface $resolver) method. registertype.php: <?php namespace myappbundle\form\type; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; use symfony\component\form\extension\core\type\emailtype; use symfony\component\form\extension\core\type\texttype; use symfony\component\form\extension\core\type\repeatedtype; use symfony\component\form\extension\core\type\passwordtype; use symfony\component\form\extension\core\type\numbertype; use symfony\component\optionsresolver\optionsresolver; use symfony\component\optionsresolver\optionsresolverinterface; class registertype extends abstracttype { public function buildform(formbuilderinterface $builder, array $options){ $builder ->add('name', texttype::class, array( 'label' => &#

How to read tiff images with lua torch -

i'm working tiff images, using torch train neural network , need load tiff images , there library in lua can read images tiff??? one possibility use torch opencv bindings (see blog post more details): local cv = require 'cv' require 'cv.imgcodecs' local img = cv.imread{'myimage.tiff', cv.imread_color} -- note layout hxwxd -- can permute(3,1,2) work dxhxw another possibility use graphicsmagick binding : local gm = require 'graphicsmagick' local img = gm.image('myimage.tiff'):totensor('byte', 'rgb', 'dhw')

security - Do I need to check if a Facebook UserID provided by a client is actually a valid UserID? -

for instance, let's i'm getting picture user. client code might call mysite.com/api/getprofilepicture?user=000123 , app send url appropriate image load. internally, it'd making api call /v2.6/{user_id}/picture literally taking user parameter receives , placing in string. think want keep serverside client doesn't have worry profile picture comes (if end adding, example, google+ login in future). is security concern? nefarious user make call mysite.com/api/getprofilepicture?user=destructiveendpoint , have run /v2.6/destructiveendpoint/picture ? or there no such destructive endpoints worry (since app secret not being used here). if there are destructive endpoints worry about, should making sure whatever userid valid 1 before using it, correct? so after sql injection comes api parameter injection :) if take arbitrary string , put somewhere graph api url, theoretically scenarios imaginable lead unwanted results, yes. but every api endpoint create/alter

c - How to store array to fit cache line size -

i want have array 32 elements of 64bit numbers : long int arr[32]; however cache line size 64 bytes. mean array not go @ cache system or rather of elements do? would fit cache if split array two-dimensional : long int arr[4][8]; ? your array 256 bytes, not fit in 1 64 byte cache line. splitting array won't decrease size, #1 still applies. your cpu has multiple cache lines, it's 256 bytes fit in whatever cache worried about.

github - Git unstage committed files before push -

i trying start on adding , committing files before push. every time type in git push origin master -f error saying files big. want unstage files pushed, can reselect ones want push. tried git reset --soft head~1 git rm -r --cached . -f then type git diff --stat --cached origin/master , still see files. have tried git reset head , git reset . after resets try push , still errors saying trying push big of file. how reset this? want keep of changes have made on local copy. git reset -- * unstages files in index, leaves them in working directory. git reset --mixed head~1 will unstage files index when reset branch

python - How do I concatenate lines from a file onto a single line of code? -

i'm new programming , working on problem #269 r/dailyprogrammer. want add ability read files , format them based on indention format given. current code: import sys filename=input("what file reformat?") f=open(filename,"r") n_lines= int(f.readline()) indents=(f.readline()) block=0 line in f: line=line.lstrip('·» \t') if line.startswith('endif') or line.startswith('next'): block-=1 print(indents*block+line) if line.startswith('for') or line.startswith('if'): block+=1 gives me this var i=1 31 ···· if !(i mod 3) ···· ···· print "fizz" ···· endif ···· if !(i mod 5) ···· ···· print "buzz" ···· endif ···· if (i mod 3) && (i mod 5) ···· ···· print "fizzbuzz" ···· endif next ,but want print pseudo indentions+line on same line. your indents string ends newline, this: " \n" . want rid of that. indents=f.readline(

php - 2 CSV columns displayead as a one column on MAC -

csv file looks fine if open in microsoft excel on windows os, if open on mac os you'll see 1 column instead 2 columns (see picture ) what's wrong? (((( test2.aristovapro. ru https://www.instagram.com/p/bgcxrsfmdh6/ ini_set('auto_detect_line_endings',true); function outputcsv($results, $filename = 'file.csv') { header('content-type: text/csv'); header('content-disposition: attachment; filename='.$filename); header('pragma: no-cache'); header("expires: 0"); $outstream = fopen("php://output", "w"); foreach($results $result) { fputcsv($outstream, $result, ";"); } fclose($outstream); }

pip - Cannot install bob.measure python package -

i have installed dependencies of bob.measure according graph presented in https://github.com/idiap/bob/wiki/dependencies , https://github.com/idiap/bob/wiki/installation : however, cannot install package traceback: omar@ubuntuv2:~/bob.measure$ sudo python setup.py traceback (most recent call last): file "setup.py", line 50, in <module> boost_modules = boost_modules, file "/usr/local/lib/python2.7/dist-packages/bob/blitz/extension.py", line 52, in __init__ bobextension.__init__(self, *args, **kwargs) file "/usr/local/lib/python2.7/dist-packages/bob/extension/__init__.py", line 294, in __init__ bob_includes, bob_libraries, bob_library_dirs, bob_macros = get_bob_libraries(self.bob_packages) file "/usr/local/lib/python2.7/dist-packages/bob/extension/__init__.py", line 186, in get_bob_libraries pkg = importlib.import_module(package) file "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_

Line Terminator (JavaScript) -

this question has answer here: javascript string newline character? 14 answers can please explain me line terminator? have trouble searching online. may irrelevant question know. a line terminator os specific. doesn't have javascript. on windows line terminated control character sequence \r\n , on unix systems, \n . recall control characters aren't printable characters, \r , \n conceptual, they're put in string literals represent control character.

winforms - VB.Net 4.6 using Zipfile -

i have been searching site while , cant seem find solution. trying to use zipfile zip pdfs directory whenever type using zip zipfile = new zipfile errors saying: 'using' operand of type 'system.io.compression.zipfile' must implement 'system.idisposable' 'system.io.compression.zipfile' has no constructors. after searching through site found out had add references did added: system.io.compression , system.io.compression.filesystem made sure using correct .net framework , using .net 4.6 in vs 2013. stuck on do, wanted zip several files folder, can't use zipfile . information on appreciated. the code using is: dim ziptocreate string = "ex1.zip" dim directorytozip string = "c:\temp" using zip zipfile = new zipfile dim filenames string() = system.io.directory.getfiles(directorytozip) dim filename string each filename in filenames zip.addfile(filename) next zip.save(ziptocreate) end

Why is this PHP-PDO script failing to connect to MySQL server on localhost? -

ubuntu 14.04, mysql 5.5, php5, php5-mysql - nothing outside ubuntu 14.04 distro versions - here's error , code: sqlstate[hy000] [2005] unknown mysql server host '(localhost)' (11) <?php $db_host='localhost'; $db_name='my_guitar_shop2'; $db_user='included'; $db_pass='included'; try { $conn = new pdo("mysql:host=($db_host);dbname=($db_name)", $db_user, $db_pass); $conn->setattribute(pdo::attr_errmode, pdo::errmode_exception); $query = $conn->query('select * products'); while($row = $query->fetch(pdo::fetch_obj)) { $results[] = $row; } print r($results); } catch(pdoexception $e) { echo 'error : ' . $e->getmessage(); } ?> a mysqli version of code (not shown) - returns data mysql database. php-pdo version of code returns error. have substituted loop address, , pc's ip, , various combinations. far mysqli works. want able use pdo. there error in

php - Alias in ZF2 select - with calculated field -

i want create following query zf2: select (a + b) c ta c > 1; with table ta contain 2 integer fields a , b . i tried far code: $columns = array('c'=>'(a + b)'); $where = 'c > 1'; $tablegateway = $this->gettablegateway('ta'); $sql = $tablegateway->getsql(); $select = $sql->select()->columns($columns); $select->where($where); $itemdata = $tablegateway->selectwith($select); unfortunately query given is: select `ta`.`a + b` `c` `ta` c > 1; any idea how achieve that? tried without brackets: $columns = array('c'=>'a + b'); not work either. i've tried before $this->getadapter()->query($sqlquery, adapter::query_mode_execute); have run unbuffered query issue not resolvable ->closecursor() . use zend\db\sql\predicate\expression : $columns = array('c'=> new expression('(ta.a + ta.b)'));

Google +1 and multilanguage website -

i want add "google +1" button website. add elements <html itemscope itemtype="http://schema.org/other"> <meta itemprop="name" content="title"> <meta itemprop="description" content="erterter"> <meta itemprop="image" content="http://www.mmaer.com"> to page. works fine on single-language page, works incorrectly in multilanguage case. page defines language of page language of browser , description fills depend on language. so, see code of page: <meta itemprop="name" content="magic screenshot"> <meta itemprop="description" content="russian text"> <meta itemprop="image" content="http://www.magicscreenshot.com/content/images/error_filenotfound_small.jpg"> when click on "google +1" see english text. how fix it? i'm adding button following code <div style="text-alig

api - Instagram Thumbnails not showing on site -

i have website pulling images instagram account , morning not. can't seem find documentation on instagram account explains need do. also: mamp versions of website drawing blanks. site url: http://impressphotographymainsite2.melbourne-website-designer.com/ thank you. check status of app on instagram.com/developers , you'll see in "sandbox" mode. according site: any app created before nov 17, 2015 continue function until june 1, 2016. on date, app automatically moved sandbox mode if wasn't approved through review process. also have read of blog post on matter.

html - Use Submit button to send form data to an email -

i browsing around internet , created consensus form. layout , want it.what id when user clicks submit button contents of form sent email example somemail@mail.com can me please.this useful me. thank you <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>goodjob - badjob - tenerife</title> <link rel="stylesheet" type="text/css" href="view.css" media="all"> <script type="text/javascript" src="view.js"></script> </head> <body id="main_body" > <img id="top" src="top.png" alt=""> <div id="form_container"> <h1><a>good - bad -

Android Image Base Size -

i building graphics android application , plan on making each image several times fit different dpi categorys such ldpi, mdpi, hdpi , on. i aware of sizes each image needs example, mdpi image of 48x48 72x72 hdpi 96x96 xhdpi ect. question is, how know size make base image (mdpi), making button home screen, how know base dimensions button needs fit in mdpi category , there can adjust other categorys. take @ design @ x, here artcile designing @ 1x

How to start tomcat using maven in debug mode -

i have found maven plugin start tomcat. do maven have plugin start tomcat in debug mode? if you're using eclipse , you're running maven externally (not using m2eclipse) can use whatever command line command use use mvndebug instead of mvn . as example, run tomcat plugin under "run" profile normal command is: mvn clean install -prun this uses <maven-dir>/bin/mvn script run in debug mode, substitute <maven-dir>/bin/mvndebug in. mvndebug clean install -prun if mvndebug isn't on path might have use full path (or create link directory on path, /usr/bin , it), e.g: /path/to/maven-dir/mvndebug clean install -prun i'm using maven 3.0.5 , mvndebug script comes out of box. if inside you'll see titi wangsa bin damhore says, you'll note suspend=y used jvm waits connect debugger before continuing: maven_debug_opts="-xdebug -xnoagent -djava.compiler=none -xrunjdwp:transport=dt_socket,server=y,s

ios - Module 'google maps' not found after adding another dependency on Xcode -

i have been working googles map sdk , haven't had problems until added dependency in podfile. error in xcode saying, "module 'google maps' not found" have '@import googlemaps'. if take out new pod error goes away , works fine. started using cocoapods, there i'm missing in podfile? platform :ios, '6.1' pod 'sdwebimage', '~>3.7' source 'https://github.com/cocoapods/specs.git' pod 'googlemaps' you have add target 'your project' pod 'sdwebimage', '~>3.8' pod 'googlemaps' target 'your projecttests' # pods testing end the project run fine now..

javascript - JSON.stringify() <input> values as numbers? -

i using json.stringify() on html <input> s send through websocket so: json.stringify({ numbervalue: $('#numbervalue').val() }) but encodes $('#numbervalue').val() string . how can encoded number ? convert integer first. json.stringify({ numbervalue: parseint($('#numbervalue').val(), 10); })

javascript - Trying to understand Maybe Monads using LiveScript -

i trying understand monads better. minimal implementation of maybe monad correct ? maybe = (value) -> @value = value maybe.prototype.ret = -> @value maybe.prototype.bind = (fn) -> if not (@value null) return fn @value @value maybe.prototype.lift = (fn) -> (val) -> new maybe fn val also if correct - there final function confused how generalize. maybe.prototype.lift2 = (fn) -> (m1, m2) -> f = m1.bind ((val1) -> m2.bind (val2) -> fn val1, val2) new maybe f now how generalize lift3,lift4.... liftn source : http://modernjavascript.blogspot.co.uk/2013/06/monads-in-plain-javascript.html follow question: could give me simple example of how combine maybe monad monad simplicity sake lets keep promise .then method since real usefulness of monads transforming them. this 1 way of implementing maybe monad in livescript: class maybe ({x}:hasvalue?) -> # map :: [maybe -> ] (a -> b) -> maybe b

python - Creating list throws error -

i learning python , trying out parse , create list part of logs. 09 jan 2011 11:24:02 utc,09 jan 2011 11:24:02 utc,5,,,,32871237,,,finance [trievent] imported [jan:9|aol deal|restricted new||low_val_pass|low_val_pass|low| transid=32871237 region=us in=347 out=2308 significance=error category=finance outcome=/failure art=1382919579 cat=main deviceresponse=200 act=observed uri=/all trans/fiance system suser=u98932 dst=10.1.1.1 filetype=text/javascript;charset=utf-8 request=https://www.dsakdjasdj.org/graphs/concepts/expect_and_var#focus=problem&mode=learn heres code create new list use create dictionary. path = 'd:/\testfie' new_list = ['transid', 'region', 'in', 'out'] new_dict = {} val_list = [] open( path, 'rb') f: reader = csv.reader(f,delimiter=',') word in reader: d= word[9] start = d.find('transid') d= d[start:].split(' ') new = d[0].split(

Can't integrate Spring Boot Data with Neo4j -

i started spring boot data neo4j , trying finish movie tutorial. got error not sure how debug. error summary : (1) error creating bean (2)could not autowire field. help, thank you. my files structure follows : springbootapplication.java package com.test.springdataneothree; import org.springframework.beans.factory.annotation.autowired; import org.springframework.boot.commandlinerunner; import org.springframework.boot.springapplication; import org.springframework.boot.autoconfigure.enableautoconfiguration; import org.springframework.boot.autoconfigure.springbootapplication; import com.test.services.movieservice; @enableautoconfiguration @springbootapplication public class springdataneothreeapplication implements commandlinerunner { @autowired movieservice movieservice; public static void main(string[] args) { springapplication.run(springdataneothreeapplication.class, args); } @override public void run(string... arg0) throws exception {

swift - Firebase v3.2 iOS - how to stop the logs -

the new firebase started logging console ( print ), in: <firanalytics/info> firebase analytics v.3200000 started how stop it? i don't mean removing analytics, mean stop print 's. there no way stop info, error , warning logs.

c++11 - call functions from vector of class in c++ -

i writing program insertion sort.i creating class read print , sort vector of integers.i have created vector of class , want call functions read,sort , print vector of class created.how ? thanks, #include <iostream> #include <vector> using namespace std; class sorting { private: vector<int>arr; public: void read(); void sortt(); void print(); }; void sorting :: read() { int n; cin>>n; for(int i=0; i<n; i++) { int t; cin>>t; arr.push_back(t); } } void sorting :: sortt() { int j,temp; for(unsigned int i=0; i<arr.size(); i++) { temp=arr[i]; j=i; while(temp<arr[j-1] && j>0) { arr[j]=arr[j-1]; j=j-1; } arr[j]=temp; } } void sorting :: print() { for(unsigned int k=0; k<arr.size(); k++) { cout<<arr[k]<<"\t"; } cout<<endl

ios Swift Program app to delete things from parse after x amount of time? -

im creating ios app using parse , swift. want users post delete after x amount of time server. possible ? similar how snapchat stories disapear after 24 hours. i thinking within app make posts visible if posted withiin alotted time frame. stops people seeing old posts. understand need called cloud code delete posts. correct , how go doing that.? you can query through, createdat date of parse object , compare current time, delete if overdue. wherever data retrieved, if user posts, can put query wherever load user posts. once 1 person tries load data , it's old, deleted , no 1 see it.

javascript - Fill gradient from left to right -

Image
i have volume slider in custom htm5 player doing , have problem, when drag volume slider thumb, behind should blue, background color coming bottom. tried: how rotate background in css? but disappeared completely. use javascript find out how many steps dragged: function updateslider(slideamount) { mediaplayer.volume = slideamount; $('#volumeamount').css('background-position', '0 '+ slideamount*100 +'%'); } and html: <input class="volume-slider" id="volumeamount" type="range" value="1" max="1" step="0.01" onchange="updateslider(this.value)" name="center"style="position:relative; left:40%; top:19%;"/> and css: #volumeamount{ width: 60px; position:absolute; top:10%; left:30%; margin: 0.8em 0.0em 0.0em; } #volumeamount:after{ -webkit-transform: skew(90deg, 0deg); background-size: 100% 200%; background-image: linear-gradient(to bo

performance - Cassandra fail to write 500MB data -

i trying write 2gb(which limit of cassandra single key/value) data single(or many) column using datastax driver,cql3 on 1 machine windows node.i hardly able write data 100mb(in single column), facing kind of exceptions , config changes.if try write 100mb data have keep "commitlog_segment_size_in_mb: 200" works; after cassandra killing itself.is there way can insert upto 2gb data one(at least) or many column , find out timing ?

javascript - variable(search) not defined error -

function sort(type) { $("#parentdiv").empty(); $.getjson("raw_data.json", ({ search })); function sear(a, b) { return (a[search.type] < b[search.type]) ? -1 : (a[search.type] > b[search.type]) ? 1 : 0; }; } my raw_data.json here . though i've declared search. occuring error: search not defined. function sort(type) { $("#parentdiv").empty(); $.getjson("raw_data.json", ({ search }) => { search.sort(function(a,b){ if(a[type]<b[type]){return -1;} else if(a[type]>b[type]){ return 1; } else { return 0; } }); console.log(`sorted by: ${type}`); console.log("movies displayed!!"); var i; ... code

php - E-commerce theme development in WordPress -

i learning wordpress , know how edit , develop site available templates, trying make custom e-commerce template scratch, , couldn't find tutorials available. please suggest me video tutorial helpful me reffer , develop template. you create child theme on woocommerce plugin https://support.woothemes.com/hc/en-us/articles/203105897-how-to-set-up-and-use-a-child-theme

css - Span text not changing on hover -

i got learning css3 , html5 , right i'm trying span text transition color when mouse hovers on .link div following code. reason not working, have tried couple of things work no luck far. can me fix issue or point me right direction? thank you! -- html <div id="celebrity-list"> <header> <h2>celebrities</h2> </header> <div id="a"> <span class="letter">a.</span> <div class="links"> </div> </div> </div> css #celebrity-list > div span.letter{ position: relative; font: 22px arial; color: #3a3a3a; -webkit-transition: color .3s ease-out; -moz-transition: color .3s ease-out; -o-transition: color .3s ease-out; -ms-transition: color .3s ease-out; transition: color .3s ease-out; } #celebrity-list > div .links:hover #celebrity-list > div span.letter{ color: #b4383

ios - Why is textFieldwithPlaceHolderText undefined for one view controller that conforms to UITextFieldDelegate? -

i have 2 uiviewcontroller sublcasses, both of them conform uitextfielddelegate protocol. iow, have these classes. # myvc1.h @interface myvc1 : uiviewcontroller <uitextfielddelegate> # myvc1.m @interface myvc1 () { // private variable, not property uitextfield *_mytextfield; } @end @implementation myvc1 - (void)viewdidload { _mytextfield = [self textfieldwithplaceholdertext:@"*text"]; } @end same code myvc2 class, except of course class name. however, , strange part, code compiles myvc1, not myvc2. myvc2, compiler says "no visible @interface "myvc2" declares selector "textfieldwithplaceholdertext". missing myvc2? i've double- , triple-checked! like jsdodgers said, textfieldwithplaceholdertext not method of uitextfielddelegate. check #imports section on both controllers - maybe vc1 imports category uiviewcontroller class adds method it. category import this: #import "uiviewcontroller+ _ .h"

sql server - SQL Query to build a delimited string for a column for each distinct id in a table -

this question has answer here: simulating group_concat mysql function in microsoft sql server 2005? 9 answers i have 4 tables have 2 columns each. 'column 1' 'one' 'column 2' 'many' column 1 has several different id's need group somehow , build delimited string of 'columns 2' values. i need every distinct 'column 1' value.... possible? so example have table.. declare @tbldeadsdata table ( [id] int identity(1,1) not null, [containerid] int null, [deadsid] int null ) it populated data, need build delimited string of [deadsid] each [containerid], , these delimited string need placed table (the deadsdatatable data goes tbllastmerge.deadsidlist in case).. create table tbllastmerge( [id] int identity(1,1) not null, [feedlotid] int null, [containerid] int null, [containername]

cocoa - NSDocument subclass instance apparently not in responder chain -

i'm creating first nsdocument based application. i'm able create new documents, both scratch , importing legacy files. this app allow multiple windows per document, overriding makewindowcontrollers. method simple: - (void) makewindowcontrollers { if (documentdatabase == nil) return; datasheetwindowcontroller * dswc = [[datasheetwindowcontroller alloc] initwithdatabase:documentdatabase]; [self addwindowcontroller: dswc]; } the window appears expected, however, save, revert save, , other document enabled menus disabled, if document not in responder chain. as experiment, tried adding method nswindowcontroller class: - (void)savedocument:(id)sender { [[self document] savedocument:sender]; } with method in place, save menu item enabled, , selecting causes document's save methods invoked. from reading documentation , other questions on stack overflow, it's clear wrong -- should not have put method in nswindowcontroller class. i'm sure i&#

Struggling with Python Regex for a very specific array -

i'm trying make regex method (if can find easier method, please tell) for example: need lines marked "!" @ end [expertsingle] { 192 = n 0 0 384 = n 0 0 576 = n 0 0 768 = n 0 0 960 = n 0 0 } edit : replaced actual data you find lines 1 or more numbers import re inputstr = """[expertsingle] { 192 = n 0 0 270 = n 1 0 270 = n 2 0 360 = n 0 0 }""" goodlines = re.findall(r"\d+.+", inputstr) print(goodlines) this outputs: ['192 = n 0 0', '270 = n 1 0', '270 = n 2 0', '360 = n 0 0'] if wanted ultra strict , find words in format of digits, space, equals, space, letter, space, digit, space, digit use goodlines = re.findall(r"\d+\s=\s\w\s\d\s\d", inputstr)

database - HP ALM 12.5 installation fails with 'Unable to validate DB connection parameters' error. Help needed -

we trying install hp alm 12.5 on windows server 2012 os. we have pre-requisite components .net framework 3.5,4.5, jre 1.8 during installation, face error unable validate db connection parameters . checked vendor, repeatedly pointing db only. however, nothing seems wrong db. able make connections using sql developer , express. able view table schema tried installing sysdb role, fails making connection. on listener find traffic app machine, in attempting installation. we confused whether app server issue or db server issue. port checks done , no question of firewall. open. any suggestions here appreciated !! db details: oracle 12.1.0.2 enterprise db server: unix app server: win 2012 server standard alm: 12.5 hp pc 12.5 check, please, in alm installation if using sid or service name of oracle instance. default should provide service name - can use sid modifying connection string directly (put sid instead of servicename). 1 - see screenshot. also can

php - Get node values and attributes as an array using xpath -

is there way attributes , values array. here have node <vehicle wheels="four" color="red"/> what need array like $vehicle = array("wheels" => "four", "color" => "red"); you can using simplexmlelement parsing. $xml = '<vehicle wheels="four" color="red"/>'; $x = new simplexmlelement($xml); $array = current($x->attributes()); print_r($array);

java - Generics and ArrayList -

how can access methods in students class. when print mylist uses tostring in students class, i'm not sure how access other methods. possible? ps have try , catch in program, didn't post here make code shorter. public class databaseaccess <t> { public t[] database; public arraylist<t>mylist = new arraylist<t>(); public arraylist<t> testlist = new arraylist<t>(); public void userinterface(){ int count = 1; (t : mylist){ system.out.println(count++ + ": " + i); } } public void readdatabase(){ try { objectinputstream in = new objectinputstream(new fileinputstream("grocery.bin")); database = (t[]) in.readobject(); (int = 0; < database.length; i++){ mylist.add(database[i]); } mylist.add((t) "\n"); mylist.add((t) "\

machine learning - AdaBoostClassifier with different base learners -

i trying use adaboostclassifier base learner other decisiontree. have tried svm , kneighborsclassifier errors. can 1 point out classifiers can used adaboostclassifier? ok, have systematic method find out base learners supported adaboostclassifier. compatible base learner's fit method needs support sample_weight, can obtained running following code: import inspect sklearn.utils.testing import all_estimators name, clf in all_estimators(type_filter='classifier'): if 'sample_weight' in inspect.getargspec(clf().fit)[0]: print name this results in following output: adaboostclassifier, bernoullinb, decisiontreeclassifier, extratreeclassifier, extratreesclassifier, multinomialnb, nusvc, perceptron, randomforestclassifier, ridgeclassifiercv, sgdclassifier, svc. if classifier doesn't implement predict_proba, have set adaboostclassifier parameter algorithm = 'samme'. thanks andreas showing how list estimators.

iphone - Is it possible to create a IOS app that can download plugins and extension later? -

we have ios app provides platform many similar games. when install app. app contains binaries of x number of games. now having size issue. wanted know possible create ios app can installed , after per user selection can download games binaries separately , run. app can download games plugins or extensions. i work on game side part dont know ios apps. far understanding -> when create ios executable while compiling should have code present (app + games run). it not possible download native executable , run -- not capability provided app extensions. one loophole might consider: permissible download , run javascript, or else runs in uiwebview or wkwebview , both sandboxed ios app's process, , have access opengles 2.0 in form of webgl. there apps have been accepted in app store can run code in interpreted languages python.

php - Less equal than specific date query not working on equal date -

Image
i have query: select count(a.no_registrasi) jumlah, b.nama_negara, a.tanggal_reg tb_registrasi join tb_negara_tujuan b on a.id_negara = b.id_negara a.tanggal_reg >= '2016-02-01' , a.tanggal_reg <= '2016-03-01' group b.nama_negara the result is: but when im change to: select count(a.no_registrasi) jumlah, b.nama_negara, a.tanggal_reg tb_registrasi join tb_negara_tujuan b on a.id_negara = b.id_negara a.tanggal_reg >= '2016-02-01' , a.tanggal_reg <= '2016-02-29' //this 1 group b.nama_negara it didnt show result, im trying select data between 2 different dates, when when there's data on date @ end of month, didnt show data. have 5 data registered date 2016-04-30, when im selecting data 2016-04-01 2016-04-30 didnt show result. hope guys understand mean, in advance. apply date function columns where date(a.tanggal_reg) >= '2016-02-01' , date(a.tanggal_reg) <= '2016-02-29' or use between

delphi - XML-RPC with Lazarus freepascal -

i know there plenty of freepascal xml tutorials , posts, nothing found far seem job me. building lazarus desktop app connect through api odoo, data, process , respond. structure of xml response quite difficult (at least me) work with. example response is: <?xml version='1.0'?> <methodresponse> <params> <param> <value> <array> <data> <value> <struct> <member> <name>create_date</name> <value> <string>2016-03-30 09:05:23</string> </value> </member> <member> <name>file_name</name> <value> <string>o156ap000100</string> </value> </member> <member>