Posts

Showing posts from March, 2014

java - How to set a specific DataSource for a Repository? -

is possible assign specific datasource @repository ? i'd create test environment in general want use test-datasource, few crudrepository should operate on different db (the production db; read-only operations). can tell spring datasource use repository explicit? public interface myrepository extends crudrepository<customer, long> {} @enablejparepositories answer question. should work crudrepository according informal documentations. refer detail tutorial on how this. didn't put effort post codes here may directly refer clearer in it. link tutorial...

javascript - Embedding video in an iframe? -

i have below code embed video. not working. suggestions? <!doctype html> <html> <body> <iframe src="https://vimeo.com/63534746"></iframe> </body> </html> the error in console refused display 'https://vimeo.com/63534746' in frame because set 'x-frame-options' 'sameorigin'. vimeo blocking doing trying do. there 3 possible values x-frame-options: deny - page cannot displayed in frame, regardless of site attempting so. sameorigin - page can displayed in frame on same origin page itself. allow-from uri - page can displayed in frame on specified origin. instead of embedding whole page, can use embed code provided vimeo (found clicking 'share' button). <iframe src="https://player.vimeo.com/video/63534746?color=ffffff" width="500" height="281" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe> &

android - listview is not updating with notifydataSetChanged -

my listview not updating data retrieved after first 20 items. i checked multiple times if data not passed json, is, listview not updating added data. here part of code: @override public void ongetdata(jsonobject obj) { serie[] serieslist; if (obj != null) { if (pagenumber == 1) { series = serie.serielistfromjson(this, jsonhandling .getinstance().getjsonarrayseriefromurltmdb(obj)); serieslist = series.toarray(new serie[series.size()]); adapter = new searchcustomadapter(this, serieslist); lvsearch = (listview) findviewbyid(r.id.lvsearch); lvsearch.setadapter(adapter); lvsearch.setonscrolllistener(this); } else { try { toast.maketext(this, "obj ?"+obj.tostring(1), toast.length_long).show(); } catch (jsonexception e) { // todo auto-generated catch block e.printstacktrace();

oracle - Database backup using PGP -

i using oracle 11 , postgre in local machine. want write program in pgp dump of data table .csv file. example, if have table name table1 . after running program csv file(after zip) generated timestamp. mytable.yyyymmddhhmiss.csv.gz i new pgp, there link or example can @ please?

c# - Why Collection assignment act differently inside method and consecutive lines? -

from below results, know why 'test 2' have value 30 , expect same result in 'test 3' (100) ? here fiddler link https://dotnetfiddle.net/rco1md better understanding. ilist<test> initialcollection = new list<test>(); initialcollection.add(new test(){ value = 30}); console.writeline("test 1 : before update method : " + initialcollection.last().value ); updatevaluecollection(initialcollection); console.writeline("test 2: after update method : " + initialcollection.last().value ); ilist<test> check = new list<test>(); check.add(new test(){ value = 100}); initialcollection = check; console.writeline("test 3: same update method code added consecutive line : " + initialcollection.last().value ); and method is public void updatevaluecollection(ilist<test> lsttest) { ilist<test> check = new list<test>(); check.add(new test(){ value = 100}); lsttest = check; } the results are

scala - Converting `flatMap` to `for-comprehension` with Either -

given either[string,int] : scala> val z: either[string, int] = right(100) z: either[string,int] = right(100) i can write following code flatmap : scala> z.right.flatmap(x => if(x == 100) left("foo") else right(x)) res14: scala.util.either[string,int] = left(foo) but, doing wrong for comprehension version? scala> { | <- z.right | _ <- if(a == 100) left("foo") else right(a) | } yield <console>:11: error: value map not member of product serializable scala.util.either[string,int] _ <- if(a == 100) left("foo") else right(a) ^ if(a == 100) left("foo") else right(a) either[string, int] , , not leftprojection or rightprojection , doesn't have map or flatmap . need project well: for { <- z.right _ <- (if(a == 100) left("foo") else right(a)).right } yield the difference between , one-liner one-liner equivalent

javascript - Meteor publishing field issue -

my application publishing 'memberprice' field when not supposed to. in publish.js file, specified memberprice not published. here server/publish.js: meteor.publish('cars', function() { return products.find({category: 'vehicle'}, {limit: 10}, {fields: {memberprice: 0}}); }); my controller: carscontroller = routecontroller.extend({ waiton: function () { var sessionid = session.get('sessionid'); console.log("session: ", sessionid); meteor.subscribe('cars'); meteor.subscribe('cartitems', sessionid); }, action: function() { this.render('cars'); } }); here's table using aldeed:tabular package: tabulartables = {}; meteor.isclient && template.registerhelper('tabulartables', tabulartables); tabulartables.cars = new tabular.table({ name: "cars", collection: products, columns: [ {data: "productcode", title: "product code"}, {data: "brand&

java - Byte to "Bit"array -

a byte smallest numeric datatype java offers yesterday came in contact bytestreams first time , @ beginning of every package marker byte send gives further instructions on how handle package. every bit of byte has specific meaning in need entangle byte it's 8 bits. you convert byte boolean array or create switch every case can't best practice. how possible in java why there no bit datatypes in java? because there no bit data type exists on physical computer. smallest allotment can allocate on modern computers byte known octet or 8 bits. when display single bit pulling first bit out of byte arithmetic , adding new byte still using 8 byte space. if want put bit data inside of byte can stored @ least single byte no matter programming language use.

asp.net - ASP Chart Control - issue displaying all SQL data -

i new @ using mschart control. know how single series of data display in column chart, having issues displaying multiple data values in chart. here data sql query need display: area totalcnt compliant cpercent noncompliant ncpercent area1 29027 25468 87.7 3559 12.3 area2 13659 12035 88.1 1624 11.9 area3 25358 22221 87.6 3137 12.4 area4 47747 42340 88.7 5407 11.3 here's series section of column chart: <series> <asp:series isvalueshownaslabel="true" chartarea="chartarea1" label="#valy" name="compliant" bordercolor="180, 26, 59, 105" color="#00cc00" xvaluemember="area" yvaluemembers="compliant"></asp:series> <asp:series isvalueshownaslabel="true" chartarea="chartarea1" label="#valy" name="non-compl

c# - WCF Service Authorizing with Active Directory - Access Denied Error -

i have question around wcf authorization against domain account on http traffic hosted on iis (none production no ssl cert available use on internet) i'd know how set windows authentication client web service. i'm testing on same lan proxies not problem i have included list of tried steps @ end of post edit: error occurring access denied, nothing else, given try, catch in client application. if there way more detailed information, please let me know , ill add result post. wcf service code: [aspnetcompatibilityrequirements(requirementsmode = aspnetcompatibilityrequirementsmode.allowed)] servicebehavior(instancecontextmode = instancecontextmode.single, concurrencymode = concurrencymode.single, includeexceptiondetailinfaults = true)] public class data : idata { [principalpermission(securityaction.demand, role=@"administrators")] public list<incident> getcases() { queries query = new querie

java - socket.accept() does not execute -

i have code, wich download it. import java.io.*; import java.net.*; public class server { public static void main(string argv[]) throws exception { string clientsentence; string capitalizedsentence; serversocket welcomesocket = new serversocket(6060); while(true) { socket connectionsocket = welcomesocket.accept(); system.out.println("ssss"); bufferedreader infromclient = new bufferedreader(new inputstreamreader(connectionsocket.getinputstream())); dataoutputstream outtoclient = new dataoutputstream(connectionsocket.getoutputstream()); clientsentence = infromclient.readline(); system.out.println("received: " + clientsentence); capitalizedsentence = clientsentence.touppercase() + '\n'; outtoclient.writebytes(capitalizedsentence); } } } first ran when tried run runs not reach print statement : system.out.println("ssss"); it stops on welcomesock

matlab - Getting intensity value for all pixels in an image -

i have create algorithm determine dark "grayscale image" in matlab, have collect pixels' intensity value evaluate if 65% of pixels in particular image lesser 100 dark. the question how collect/get these value create algorithm this? assume image contained in array img (for instance, obtained imread ). then: % define threshold th = 100; % percentage of pixels below threshold p = nnz(img<th)/numel(img)*100; % decide if p<65 ... else ... end hope helps,

Python : array tuple extraction -

results=[('uid=alex,class=zenth',{'age':['12'],'uidnumber':['12ac']}),('uid=beth,class=nenth',{'age':['22'],'uidnumber':['13sd']})] like have many tuples, how can extract uids want alex, beth , anyother uid in results array i can uid_val_list=[] _,val in enumerate(results): list_vals=val[0].split(",") uid_val=list_vals[0].split("=")[1] uid_val_list.append(uid_val) is there better way it? try: import re results = [('uid=alex,class=zenth', {'age': ['12'], 'uidnumber': ['12ac']}), ('uid=beth,class=nenth', {'age': ['22'], 'uidnumber': ['13sd']})] c = re.compile('uid=(?p<uid>.+?),') uid_val_list = [c.search(result[0]).group('uid') result in results] print(uid_val_list) make compiled before search may speed up. except list comprehension, can use

How to revoke Oauth token by using Google's Javascript APIs? -

in (client-side angularjs) web application use google api's oauth let user sign-in gapi.auth.authorize({ client_id: clientid, scope: scopes, immediate: true }, handleauthresult); now want let user signout well. i found can using http request explained in: https://developers.google.com/+/web/signin/disconnect however since i'm using javascript apis sign-in, use javascript logout (i.e. revoking access token) . is possible? if yes, how? edit : precise goal not use http request via jquery more alike login, example : gapi.auth.signout (.. the google gapi library doesn't have such method. if you're jquery averse, it's not difficult replace $.ajax xmlhttprequest. make sure understand difference between "signing out" (of google account) , revoking access token. not same thing. on sessions, typical sequence is:- 1/ check session object see if holding user object

linker - Problems with libturbojpeg compiling love-0.9.2 -

just starting löve , i'm loving it! i'm testing under ubuntu 14.04. i able compile love 0.8.0 no trouble, i'm having problems compiling 0.9.2 bitbucket. seems, might have been eaten grue... i got error when linking, due libturbojpeg : /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libturbojpeg.a(libturbojpeg_la-turbojpeg.o): relocation r_x86_64_32 against `.data' can not used when making shared object; recompile -fpic according this stackoverflow entry , seems default libturbojpeg binary installed in ubuntu via apt-get: tomas@ubuntu:~/tomas/love/love-0.9.2-bitbucket$ dpkg -l libjpeg-turbo8-dev | grep libturbojpeg.a /usr/lib/x86_64-linux-gnu/libturbojpeg.a tomas@ubuntu:~/tomas/love/love-0.9.2-bitbucket$ dpkg -l libjpeg-turbo8-dev desired=unknown/install/remove/purge/hold | status=not/inst/conf-files/unpacked/half-conf/half-inst/trig-await/trig-pend |/ err?=(none)/reinst-required (status,err: uppercase=bad) ||/ name

buildpath - Change java build path for multiple projects in Eclipse -

Image
in eclipse, have libs project. project has test.jar file. i have 15 other projects in eclipse use test.jar under java build path/libraries. new versions of test.jar made every month, , name change (test1.jar, test2.jar) once new version available, remove old 1 libs project , add new one. question is, how can modify 15 projects use jar file reference new one? know how 1 project @ time configuring build path each project. there way make mass change 15 projects @ same time? to achieve same follow below steps. 1) open eclipse go windows->preferences->java->build path->user library 2) click on new button , give name test_jar , add after add jar test.jar or test.jar. see below screen shot. 3) 1 time task delete entry 15 project build classpath set in global path. 4) whenever build other project bundle user libraries.

distributed computing - Run multiple instance of a process on a number of servers -

i run multiple instances of randomized algorithm. performance reason, i'd distribute tasks on several machines. typically, run program follows: ./main < input.txt > output.txt and takes 30 minutes return solution. i run many instances of possible, , ideally not change code of program. questions are: 1 - online services offer computing resources suit need? 2 - practically, how should launch remotely processes, notified of termination, , aggregate results (basically, pick best solution). there simple framework use or should ssh-based scripting? 1 - online services offer computing resources suit need? amazon ec2. 2 - practically, how should launch remotely processes, notified of termination, , aggregate results (basically, pick best solution). there simple framework use or should ssh-based scripting? amazon ec2 has api launching virtual machines. once they're launched, can indeed use ssh control jobs, , recommend solution. expect other

python - Hierarchical indexing with Pandas -

i have pandas dataframe with 3 index levels , 2 columns. can see part of here: av_intensity std_dev key1 key2 time 0 0 32000 -0.005203 0.006278 32200 0.005330 0.005221 32400 0.002679 0.005006 32600 -0.000723 0.006145 32800 -0.000317 0.010467 33000 -0.006543 0.007808 33200 -0.004180 0.005070 33400 -0.006275 0.009662 33600 -0.014763 0.006938 33800 -0.029516 0.004710 the indices numbers, e.g. (0.0, 0, 32000.0) set of indices. i trying use df.ix[ 0.0, :, 32000.0] or df.ix[ :, 0, 32000] kind of hierarchical indexing doesn't work. is because indices not integer? how can kind of hierarchical indexing data frame? see advanced hierarchical indexing section in docs full explanation: http://pandas.pydata.org/panda

html - Nav with two dynamic elements + border of first -

Image
i've made image of want archieve. logo resizes on different screen resolutions , actual navigation container long <li>'s . the bottom border needs reach lower left edge of logo. the logo has shadow below, border cant full width. what i've got far nav has border reaches last <li> this quick mockup: http://jsfiddle.net/2x6hddv8/ here's of -- called flight! http://jsfiddle.net/8k45z7nl/ i'd avoid skew maximum browser compatibility.

junit - Unit Test Service method Consuming Soap Service -

in spring based rest services have service method returns token, method actaully consumes soap service, not able decide how write unit test that. method signature below public string methodname(){ string token=""; try { token = util.getsoapservice(); }catch(exception e){ } return token; } can use junit , mockito test code you need create mock implementation of service, assign util variable , implement expected behaviour. after check trat token value correct.

manage logstash from Java -

i want manage starting , stopping of logstash java. there easy/nice way this? so, can give me example of how start logstash without needing logstash instance started run.bat manually.? you can run batch file process in java this string cmd = "cmd /c start c:\\path\\to\\run.bat"; process logstashprocess = runtime.getruntime().exec(cmd); and kill process calling destroy() method when needed logstashprocess.destroy(); you can add these startup , shutdown hooks of application (the application log analyzing using logstash) or write standalone java app maintain starting , stopping logstash.

javascript - Yii2 add image,css,js files from vendor folder on page from js script -

i try create lib editing pictures. have main js file including other js, css , images files. example, used: $.getscript(site_url + '/vendor/first_folder/second_folder/assets/js/script.js'); i read path web sets @ appasset.php, if ask change @webroot @vendor.. @ extention configuration think wrong. created myasset.php , set there such configurations: namespace app\vendor\first_folder\second_folder; use yii\web\assetbundle; class edikeditorasset extends assetbundle { public $sourcepath = '@vendor/first_folder/second_folder/assets/'; public $css = [ 'css/main.css' ]; public $js = [ 'js/jquery.colorbox-min.js', 'js/main.js' ]; } but cannot include others js, css , image files extention, because js,css , images start including web folder , don't know how go above. can change including js, css, images files vendor folder? p.s. tried change using different paths pa

production environment - Shared java HashMap in a clustered enviroment -

i've client application requesting information url every 1 second. in server (a servlet & jsp application), in order avoid db access when it's not necessary, it's been implemented next solution. here's snippet: //a static hashmap save last record inserted in db public static map<long, long> values = new hashmap<long, long>(); // lastrecordread sent client if (values.get(id) != lastrecordread) { //access database information //cause last value read different last record inserted ... }else{ //do nothing //it's not necessary access db cause parameters match } this working expected in development environment. the problem comes when have clustered environment. have server deployed in 2 nodes (using jboss), each 1 own hashmap, , own values. depending on node attack, can different values... ¿is there way share hashmap between 2 nodes? looking answer don't need keep 2 maps updated, meaning not calls between nod

javascript - jQuery dropdown not displaying first option -

so, have dropdown filter on client web page, dropdown should work matching class in hidden div , displaying relevant content. however, in ie9 (and on linked fiddle) can see doesn't work. the second option (iphone) doesn't appear display results. think issue down numbering of 'select.dropdown' function can't figure out is, exactly. snippet: $("select.dropdown").change(function(){ var filters = $.map($("select.dropdown").toarray(), function(e){ return $(e).val(); }); var filter; if(filters[0]=="all") { if(filters[1]=="all") filter = ""; else filter = "." + filters[1]; } else{ if(filters[1]=="all") filter = "." + filters[0]; else filter = "." + filters.join("."); } $("div#filtercontainer > div").hide(); $("div#filtercontainer").find("div" + filter).show(); console.log(filters);

java - JMS publish to topic takes really long time and gets killed by the transaction reaper -

so have code publishes jms topic: public void notifycreatelisteners(mycreatedobject payload) { logger.trace("serviceimpl.notifycreatelisteners"); topicconnection conn = null; topicsession session = null; topic topic = null; try { properties props = new properties(); props.setproperty("java.naming.factory.initial", "org.jnp.interfaces.namingcontextfactory"); props.setproperty("java.naming.factory.url.pkgs","org.jboss.naming"); props.setproperty("java.naming.provider.url", "jnp://localhost:49227"); context context = new initialcontext(props); topicconnectionfactory tcf = (topicconnectionfactory) context.lookup("/connectionfactory"); conn = tcf.createtopicconnection(jbossjaasauthenticator.principal, jbossjaasauthenticator.credentials); topic = (topic)context.lookup("topic/create_notify_topic"); sess

iterate over result pages using selenium and python: StaleElementReferenceException -

i think people understood selenium tool laugh maybe can share you're knowledge because want laugh now, too. my code this: def getzooverlinks(country): global countries countries = country zooverweb = "http://www.zoover.nl/" url = zooverweb + country driver = webdriver.firefox() driver.get(url) button = driver.find_element_by_class_name('next') links = [] page in xrange(1,4): webdriverwait(driver, 60).until(lambda driver :driver.find_element_by_class_name('next')) divlist = driver.find_elements_by_class_name('blue2') div in divlist: hreftag = div.find_element_by_css_selector('a').get_attribute('href') print(hreftag) newlink = zooverweb + hreftag links.append(newlink) button.click() driver.implicitly_wait(10) time.sleep(60) return links so want iterate on result pages , link

scala - Scalaz ValidationNel: traverse is not a member of List -

playing scalaz validationnel , trying transform list[validationnel[string, mytype]] validationnel[string, list[mytype]] my code: import scalaz._ import scalaz.syntax.traverse._ import scalaz.std.list._ import scalaz._ val ns: nodeseq = // ... val v: validationnel[string, list[mytype]] = ns.tolist.traverse[({ type l[x] = validationnel[string, x] })#l, mytype](extractmytype(_)) private def extractmytype(n: node): validationnel[string, mytype] = //... when compiling sbt, get: [error] myclass.scala:xx: value traverse not member of list[scala.xml.node] [error] val v: validationnel[string, list[mytype]] = ns.tolist.traverse[({ type l[x] = validationnel[string, x] })#l, mytype](extractmytype(_)) i not traverseu work either version work before going further. i using scala 2.10.0 , scalaz 7.1.1 where mistake?

Javascript in HTML does not execute -

<html> <head> <title>test environment</title> </head> <body> <script> document.bgcolor="#222222"; document.fgcolor="#11ee11"; document.writeln("test environment."); document.writeln("last update: " + document.lastmodified); var today = new date(); var dd = today.getdate(); var mm = today.getmonth()+1; //january 0! var yyyy = today.getfullyear(); if(dd<10) { dd='0'+dd } if(mm<10) { mm='0'+mm } today = dd+'/'+mm+'/'+yyyy; function enterexpenses(){ var _desc = window.prompt("what kind of expenses?"); var _amount = window.prompt("amount spent?"); var _entry = {type:_desc amount:_amount date:today}; document.writeln(_entry.date); document.writeln(_entry.type); document.writeln(_entry.amount); } </script> <form> <button onclick="enterexpenses()">click me</button> </form

php - I cannot grab a $_POST value in controller using Yii 2.0 -

using yii 2.0 i'm trying grab $_post values in controller view cannot this. show code , talk through below. models/casesearch.php <?php namespace app\models; use yii; use yii\base\model; use yii\data\activedataprovider; use app\models\cases; /** * casesearch represents model behind search form `app\models\cases`. */ class casesearch extends cases { public $category; public $subcategory; public $childcategory; public $newcategory; /** * @inheritdoc */ public function rules() { return [ [['case_id', 'year'], 'integer'], [['name', 'judgement_date', 'neutral_citation', 'all_er', 'building_law_r', 'const_law_r', 'const_law_j', 'cill', 'adj_lr'], 'safe'], ]; } /** * @inheritdoc */ public function scenarios() { // bypass scenarios() implementation in parent class return model::scenarios(); } /** * creates data provider inst

mysql - SQL Where Date is greater than X -

i trying run query; select po_purchaseorderdetail.itemcodedesc, po_purchaseorderdetail.quantityordered, po_purchaseorderdetail.quantityreceived, po_purchaseorderdetail.unitcost, po_purchaseorderdetail.jt158_wtsalesorderno, po_purchaseorderdetail.purchaseorderno, po_purchaseorderheader.purchasename, po_purchaseorderheader.purchaseorderdate po_purchaseorderdetail po_purchaseorderdetail, po_purchaseorderheader po_purchaseorderheader (po_purchaseorderdetail.purchaseorderno=po_purchaseorderheader.purchaseorderno) , ***(po_purchaseorderheader.purchaseorderdate > '2013-12-31')*** order po_purchaseorderdetail.jt158_wtsalesorderno, po_purchaseorderdetail.purchaseorderno my problem is, date stored in yyyy-mm-dd format. need show data after date. so, because 2013-12-31 string rather number, operator > doesn't work. ideas? try cast string date in following: p.s. if purchaseorderdate not date datatyp

extjs - Define new xtype fields sencha touch MVC -

i have create new xtype in sencha application don't know have put code. tried create new file , add in views array in app.js doesn't work because new xtype field not view ext.define('dynamo.field.patterntext', { extend : 'ext.field.text', xtype : 'patterntextfield', config : { pattern : '[0-9]*' }, updatepattern : function(pattern) { var component = this.getcomponent(); component.updatefieldattribute('pattern', pattern); }, initialize : function() { this.callparent(); var component = this.getcomponent(); component.input.on({ scope : this, keydown : 'onkeydown' }); }, onkeydown : function(e) { var code = e.browserevent.keycode; if (!(code >= 48 && code <= 57) && !(code >= 97 && code <= 105) && code !== 46 && code !== 8 && code !== 188 && code != 190) { e.stopevent(); } } });

how to read sms while testing in appium or selenium -

while testing of android , ios app. provisioning screen of app, otp usecase comes stops further testing of app. usecase is. when user enters mobile number in app's starting page instruction . after tap on send button text box otp option comes on app's screen. upto point, possible record/playback. after this, stops our process. because usecase not possible automate our app further processings. here, otp comes via sms , verification purpose user needs enter otp(one time passcode) comes via sms. so, complication ... how check otp sms app of device, , return testing app , enter verification code it. step validate user , app appears user. query is... how can test use case using automation? please me because blocks complete further testings. i think cannot navigate 1 application application single test passing capabilities of test application , cannot work application. however workaround can try is: 1. first test, send otp test application. 2. second test, ot

version control - SVN JSHint Hook? -

i have been searching in google , on here have not found relavant answer. project working on using svn. question have wondering if has implemented pre-commit hook stop check in if jshint fails? thank has experience doing this. i not make pre-commit hook because of length of time jshint takes. when commit, they'll have wait jshint complete , wait verdict. remember subversion hooks run on server , not client's machine. means pre-commit hook has checkout, , run jshint. if takes 30 seconds perform, it's 30 seconds developer sitting there waiting commit finish , having hatred you, company, , subversion grow. plus, if happens hook causes fail, you'll have debug , fix while developers unable commit code. your developers grow hate , subversion , may take step of setting own source repository. i've seen done in days when clearcase ruled , subversion first created. developers setup own repository subversion (since easy do) , stopped using corporate clearcas

c# - How to login into other person account - EF6 Identity -

i have asp.net mvc 5 webapp using ef6. i've used identity managing user account. i've structure under user there can sub users. if need log in sub user account without knowing password? password stored encrypted in db. is possible? if not work around.

haskell - How can I run a scaffolded Yesod website in a cabal sandbox? -

let's have cabal sandbox @ folder root , i've installed yesod packages in it. then, do: root> yesod init i go through prompts , end folder project inside root . yesod devel doesn't appear support passing sandbox arguments it, packages install in sandbox not visible scaffolded yesod site (and don't want install in global space, because that's impossible manage , replicate). i've tried the suggestion here , gives me these errors: root> runhaskell -no-user-package-db -package-db=.cabal-sandbox\x86_64-windows-ghc-7.8.4-packages.conf.d project/app/main.hs project\app\main.hs:2:8: not find module `application' use -v see list of files searched for. running inside root/project : root/project> runhaskell -no-user-package-db -package-db=../.cabal-sandbox\x86_64-windows-ghc-7.8.4-packages.conf.d app/main.hs foundation.hs:6:8: not find module `text.jasmine' use -v see list of files searched for. settings.hs:8:8: not find m

ios - poptorootviewcontroller and dismiss to mainViewController -

i new ios . question is, have view-controllers navigationcontroller,mainvc, vc1, vc2, vc3, cameravc. in cameravc have done button having action doneclicked. these view-controller pushed in navigationcontroller. vc1 presented, not pushed in nav-controller. doneclicked function implemented poptorootviewcontroller. when click on done button let me vc1 not mainvc. there way can pop view controller vc1 , after automatically dismiss vc1 mainvc. make mainvc root view controller , in ibaction of done button use code pop mainvc. [self.navigationcontroller poptorootviewcontrolleranimated:yes]; hope helps.

playframework - How can I run play application to be visible across the network? -

i cloned application on amazon ec2. when type sbt run , runs on localhost (by way, can't @ via lynx, ok?) tried sbt run -dhttp.port=port -dhttp.address=my.amazon.public.ip , regular browser this webpage not available on my.amazon.public.ip:port . also need amazon, not heroku etc. so, how can run application visible across network, not localhost? just did not open port in security group. after that, worked.

php - MongoDB find count of all entries in child array by key -

i have collection in mongodb database looks this: { "_id": "0123456789", "merchants": { "13142": { "deeplink1": "http://xx.tld", "programid": 13142, "price": 24.9, "ean": "0123456789", "shipping": 0.0, "cf_farbe": "schwarz", "cf_geschlecht": "men", "cf_größe": "l", "cf_imgurl2": "http://img.tld", "cf_stamm-artikelnummer": "329830", "cf_verfügbare größen": "s, l" } } } these merchant information products. _id product code, "merchants" array merchant id key. now need count of entries of merchant specific merchant id ("13142" example). how can perform (with php mongoclient class)? thanks help! db.collenctionname.find({'merchants.13142'

cllocationmanager - CLLocation manager not working iOS 8 -

i'm trying follow google maps tutorial: http://www.raywenderlich.com/81103/introduction-google-maps-ios-sdk-swift like many others have hit roadblock cllocationmanager not seem fire startupdatinglocation() . i have updated plist nslocationalwaysusagedescription , nslocationwheninuseusagedescription in accordance location services not working in ios 8 , still no location being fired. code below - appreciated! import uikit class mapviewcontroller: uiviewcontroller, typestableviewcontrollerdelegate, cllocationmanagerdelegate { @iboutlet weak var mapview: gmsmapview! @iboutlet weak var mapcenterpinimage: uiimageview! @iboutlet weak var pinimageverticalconstraint: nslayoutconstraint! var searchedtypes = ["bakery", "bar", "cafe", "grocery_or_supermarket", "restaurant"] let locationmanager = cllocationmanager() override func viewdidload() { super.viewdidload() locationmanager.deleg

c - syslogd not adding process/program name in logs -

i using syslog() function log messages. however, doesn't add program name in message originator of messages; instead, adding syslog e.g jul 16 01:44:49 2025 localhost syslog: passwords encrypted it should jul 16 01:44:49 2025 localhost mmy_c_program: passwords encrypted you may call openlog function first set name of application , facility.

android - Map is not showing in app installed from playstore -

i strange problem. app available on play store. when app install eclipse, map showing. while @ same time, if app install play store, map not seen. not know make mistake. please help. link app - https://play.google.com/stor/apps/details?id=netleon.sansar.childsafeapp with eclipse have debug keystore, google play store have different key store. api key needs match keystore have used sign application.

sql server - update on datagridview does not update local db with update statement -

i have login form should updating local db current logged on users. on form_load pulls users db hidden datagridview via tableadapter , refreshes every 5 seconds via timer. on login disables timer, changes single value on datagridview , runs table adapter.update statement. on completion enables timer again refresh datagridview. my problem is, @ runtime testing, datagridview visible , can see changes value user, once refreshes, old value. code loginbtn_click , timer1_tick below : private sub loginbtn_click(sender object, e eventargs) handles loginbtn.click if pwtxt.text = pw if datagridview1.item(4, temppos).value = false timer1.enabled = false loggedinid = tempid datagridview1.item(4, temppos).value = true me.logintableadapter.update(logindataset) menuform.show() menuform.focus() timer1.enabled = true else msgbox(trim(tempid) & " logged in. please contac

css - How to hide Bootstrap column on some pages -

i need hide "right" column in "md position" on pages (login, registration,contacts...) , extend "main" col-md-12. my index.php <div class="container"> <div class="row"> <div id="main" class="col-md-9 col-xs-12"> <jdoc:include type="component" /> </div> <div id="right" class="col-md-3 col-xs-12"> <?php if($this->countmodules('right')) : ?> <jdoc:include type="modules" name="right" style="none" /> <?php endif; ?> </div> </div> </div> i think easiest way checking option & view in template , act based on value , example : $app = jfactory::getapplication(); if(in_array($app->input->get('view'), array('login', 'registration') && in_array($app->input->get(

asp.net - DropDownList in Bootstrap XS do not open -

i have asp application , problem dropdownlist. not open on xs mobile devices: <div class="row"> <div class="col-xs-4 col-sm-2 col-md-1"> <!-- anzahl zeilen dropdownlist --> <asp:dropdownlist id="ddlusergridviewrows" runat="server" autopostback="true" cssclass="form-control font-13" data-style="btn-primary"> <asp:listitem value="5"> 5 </asp:listitem> <asp:listitem value="10"> 10 </asp:listitem> <asp:listitem value="15"> 15 </asp:listitem> <asp:listitem value="20"> 20 </asp:listitem> <asp:listitem value="30"> 30 </asp:listitem> <asp:listitem value="50"> 50 </asp:listitem> </asp:dropdownlist> </div> <div

php - Why does my mail() class send twice? -

i got small problem mail class, reason mailing twice. , im not sure why, mail class: <?php class contact { public $sendername; public $senderemail; public $recipient; public $copy; public $subject; public $message; public $bcc; public $errors; public function __construct($sendername, $senderemail, $subject, $message){ $this->sendername = $sendername; $this->senderemail = $senderemail; $this->recipient = 'me@email.com'; //ofcourse not real email $this->subject = $subject; $this->message = $message; $this->copy = ''; $this->bcc = ''; $this->errors = ''; } public function sendmail() { if ($this->sendername != "") { $this->sendername = filter_var($this->sendername, filter_sanitize_string); if ($this->sendername == "") { $this->errors .= '- please enter valid name!'; } } else { $this-&

php - Multiple jQuery AJAX calls conflicts? -

i trying create simple shopping cart using ajax , php. everything works should 1 thing doesn't work time , seems fails execute. (it works 3 times out of 5). to explain issue please take @ code bellow: jquery(document).ready(function() { //////////////////////lets run our add cart feature using ajax ////////////// $(function(){ $('.form1').on('submit', function(e){ $( "#preloader" ).fadein( 850 ); // prevent native form submission here e.preventdefault(); // whatever want here $.ajax({ type: $(this).attr('method'),// <-- method of form url: $(this).attr('action'), //url: "cart.php", data: $(this).serialize(), // <-- serialize fields string ready posted php file beforesend: function(){ }, success: function(data){ $( "#preloader" ).fadeout( 850 );

eclipse - Error while installing Visual Page Editor in JBoss Developer Studio -

i trying install visual page editor in jboss developer studio (basically customized eclipse luna). per instrauctions should: visual page editor has experimental support windows 64-bit. follow link below details on how install. until can click on source tab hide error/info message. did , added " http://download.jboss.org/jbosstools/updates/integration/luna/core/xulrunner/xulrunner-1.9.2_win64-2014-08-22_09-55-58-b4/ " through install new software, fails error: org.jboss.tools.vpe.xulrunner.xulrunnerbundlenotfoundexception: bundle org.mozilla.xulrunner.win32.win32.x86_64 not found. @ org.jboss.tools.vpe.xulrunner.browser.xulrunnerbrowser.getxulrunnerpath(xulrunnerbrowser.java:233) @ org.jboss.tools.vpe.xulrunner.browser.xulrunnerbrowser.<init>(xulrunnerbrowser.java:117) @ org.jboss.tools.vpe.xulrunner.editor.xulrunnereditor.<init>(xulrunnereditor.java:128) @ org.jboss.tools.vpe.editor.mozilla.xulrunnereditor2.<init>(xulrunnereditor2.java

Servicestack.net custom XML DateTime serialization -

is there way override xml datetime serialization in servicestack.net can json: jsconfig<datetime>.serializefn = date => new datetime(date.ticks, datetimekind.local).tostring("dd.mm.yyyy hh:mm:ss"); i want same thing xml datetimes. edit: i found out can hook xml serialization this: this.contenttypefilters.register("application/xml", serializexmltostream, deserializexmlfromstream); public static void serializexmltostream(irequestcontext requestcontext, object response, stream stream) { using (var sw = new streamwriter(stream)) { sw.write(response.toxml()); } } this returns same xml without hook. if has idea how can change serialiazation of datetime custom format or other global way please let me know.

Grouping objects with AngularJS -

i have bunch of objects in array , trying figure out how group them within angular repeater. example want group fruit items parenttag key tag key of parent. fruit has tag of 1 , apple has parent tag value of 1, meaning apple grouped fruit. so using array... [ { "code":"fruit", "tag":1 }, { "code":"apple", "tag":2, "parenttag":1 }, { "code":"vegetable", "tag":3 }, { "code":"meat", "tag":4 }, { "code":"banana", "tag":5, "parenttag":1 }, { "code":"carrot", "tag":6, "parenttag":3 }, { "code":"chicken", "tag":7, "parenttag":4 } ] i trying group objects this... fruit apple banana vegetable carrot meat chicken so far have repeater displays object

java - show applet from JUnit test -

how show applet junit test(like eclipse run applet). example code: public class applettest { @test public void test() throws interruptedexception { justonecircle applet=new justonecircle(); applet.init(); applet.start(); applet.setvisible(true); timeunit.hours.sleep(2); } } no results. the applet needs container drawn. example jframe . even not think reason why want that. find example below. @test public void showjustonecircle() throws interruptedexception { jframe frame = new jframe("justonecircle"); justonecircle onecircle = new justonecircle(); frame.add(onecircle); frame.setsize(200, 200); frame.setdefaultcloseoperation(jframe.exit_on_close); frame.setlocationrelativeto(null); frame.setvisible(true); onecircle.init(); onecircle.start(); // applet closed after 5 seconds timeunit.seconds.sleep(5); }

javascript - Proxy CORS requests with grunt to localhost -

my app ( http://localhost:8099 ) doing cors requests https://api.parse.com/ want proxy local api http://localhost:8077 testing purposes. can achived grunt-connect-proxy ? here's config of grunt-connect-proxy not work expect. connect: { dev: { options: { port: 8099, hostname: 'localhost', base: 'build/', livereload: false, keepalive: true, middleware: function (connect, options) { var proxy = require('grunt-connect-proxy/lib/utils').proxyrequest; return [ // include proxy first proxy, // serve static files. connect.static('build/') ]; } } }, proxies: [ { context: ['api/'], //same domain api requests, proxy works fine! host: 'localhost', port: 8077 }, { context: ['api.parse.com/

how to call web service from prolog -

i have web service created using java (jsp , servlet).now need call web service using prolog. for example: in prolog, ?:getusercategory(username) . prolog call web service these parameters. please me how this? nb;web service running on tomcat server. you can use mprolog web related project. light weighted prolog engine. mprolog you can edit engine according requirement.

ios - how to delete a cell from a UITableView with multi section in swift -

i'm trying delete cell uitableview in swift, follow tutorial: http://www.ioscreator.com/tutorials/delete-rows-table-view-ios8-swift problem uitableview has many section, can't delete cell way tutorial. 1 know how delete cell form table multiple section? thanks. you cannot delete multiple cells @ once method described in tutorial. work single cell. if select multiple cells , use button, example, trigger delete action, code this: if let indexpaths = tableview.indexpathsforselectedrows() as? [nsindexpath] { indexpath in indexpaths { // 1 one remove items datasource } tableview.deleterowsatindexpaths(indexpaths, withrowanimation: .automatic) }