Posts

Showing posts from June, 2011

html - Foundation interchange responsive images only loading img src -

new foundation.so far, don't know why interchange isn't working. image working img src. none of others being dynamically generated. it's not bad path, code wrong below or perhaps javascript file needed? have foundation.interchange.js along rest of js files. <img data-interchange="[img/small.jpg, (small)], [img/medium.jpg, (medium)], [img/large.jpg, (large)]" data-uuid="interchange-i2pip11r1" src="img/large-banner.jpg"> i had problem , looking long time find answer , had use normal css images because couldn't solve problem. @media (max-width: 1120px) { .map { width: 625px; height: 380px; } } @media (max-width: 855px) { .map { width: 480px; height: 375px; } } @media (max-width: 675px) { .map { width: 0; height: 0; } } map class image.

java - Apache Commons CLI 1.3.1: Option coming after another option with multiple arguments is consumed as ARGUMENT -

i'm using apache commons cli 1.3.1 process options , of options can take 1 unlimited number arguments. trivia example 2 options this usage: myprogram -optionx <arg1> <arg2> <arg3> < ... > [-optiony] -optionx <arg1> <arg2> <arg3> < ... > optionx takes 1 unlimited number of arguments. -optiony optiony optional what found second option optiony recognized argument of optionx instead of being recognized option itself. means if type myprogram -optionx arg1 arg2 -optiony in command line, 3 arguments ( arg1 , arg2 , , -optiony ) associated optionx . here code can use reproduce problem. import org.apache.commons.cli.*; public class testcli { public static void main(string[] args) { option optobj1 = option.builder("optionx") .argname("arg1> <arg2> <arg3> < ... ") ...

java - How to set custom icons for individual nodes on a JTree? -

i need able set icons jtree individual nodes. example, have jtree , need nodes have custom icons represent are. (wrench icon) settings (bug icon) debug (smiley face icon) fun stuff ... and on. have tried several sources , got 1 working, messed tree events so, no cigar. in advance. as requested: class country { private string name; private string flagicon; country(string name, string flagicon) { this.name = name; this.flagicon = flagicon; } public string getname() { return name; } public void setname(string name) { this.name = name; } public string getflagicon() { return flagicon; } public void setflagicon(string flagicon) { this.flagicon = flagicon; } } class countrytreecellrenderer implements treecellrenderer { private jlabel label; countrytreecellrenderer() { label = new jlabel(); } public component gettreecellrenderercomponent(jtree tree, ...

php - Magento header jumping -

i have strange bug while browsing through categories on magento webshop header of webshop changes height on different pages ( http://shop.tvornica-snova.hr/index.php/ ) ie if on homepage, , click on of categories header extends additinal 10px in height , kind of pushes content down. i seem have same html structure , layout both homepage , categories cannot figure out bug. can help? check out header-top section of markup normal page, , "jumping" page. normal: <div class="logo"> <strong>magento commerce</strong> <a href="http://shop.tvornica-snova.hr/index.php/" title="magento commerce" class="logo"> <img src="http://shop.tvornica-snova.hr/skin/frontend/default/f002_yellow/images/logotvornica.png" alt="magento commerce"> </a> </div> jumping: <a href="http://shop.tvornica-snova.hr/index.php/" title="magento commer...

java - Enabling AES-256 Cipher suites on Openfire -

i'm putting xmpp server project of mine, , have rather strict encryption standards. namely, need tls protocol utilize aes-256 cipher suites , equivalents. basically, doesn't require jce unlimited policy, want excluded. yes, know it's highly prohibitive on client because need able use/install jce policy. i'm ok that, , i'm not allowed work around it. as understand, openfire runs off of base jre. i've found how install jce unlimited policy in jre, , further how remove cipher suites java environment via jdk.tls.disabledalgorithms in java.security. however, testing shows when set environment client , server have no shared supported suites, , encrypted connections set "required," client can still connect , communicate. i'm trying avoid behavior. furthermore, release of openfire 4.0, , ability modify list of enabled cipher suites directly, notice aes-256 ciphers not on supported list in first place, when jce unlimited policy installed. meaning, w...

apache zookeeper - VM architecture for running HA Mesos Cluster -

i'm reading mesos architecture docs which, ironically, don't specify components supposed run on vms/physicals. it looks like, run mesos in ha, need several categories of components: mesos masters zookeeper instances (quorum) hadoop clusters (job nodes? name nodes?) but there's never mention of how many need of each type. so ask: how many vms/physicals need run mesos ha, , components should deployed each? did have @ ha docs ? run mesos in ha, you'll need mesos masters , zookeeper. hadoop-related configurations out of scope mesos ha itself. to have ha setup, you'll need uneven number of nodes masters , zookeeper (because of quorum mechanism). in our case, we're running 3 master , 3 zookeeper nodes on 3 machines (one master , 1 zookeeper instance per machine), , number of mesos slaves/agents on different machines. theoretically, slaves/agents can run on same machines masters/zookeepers well. guess matter of preferences , availability o...

Adding code example to QT C++ -

i'd add qt example code simple project. sample code here: https://wiki.qt.io/download_data_from_url it consists of filedownloader.cpp , filedownloader.h -- code downloads graphic supplied url. i've added these files project , clean compile. think understand code ok (i'm c coder, not c++) don't understand how can pass qurl created project filedownloader.cpp the "project" simple main.cpp/mainwindow.cpp/mainwindow.ui offers button pressed. pressing button calls routine below: void mainwindow::on_pushbutton_clicked() { // pass filedownloader process qurl fileloc("http://www.test.com/test.jpg"); } how feed qurl fileloc filedownload.cpp? you have add new method filedownloader, accepts qurl , starts download. filedownloader.h: #ifndef filedownloader_h #define filedownloader_h #include <qobject> #include <qbytearray> #include <qnetworkaccessmanager> #include <qnetworkrequest> #include <qnetworkreply>...

scope - Javascript game loop state in an anonymous function -

i'm messing around canvas, , starting reading bunch of game loop snippets/posts , combining them best 1 possible. i came upon snippet today (it's part way through a post , make further iterations on later. i'm integrating ideas go), it's perplexing me little. game.run = ( function() { var loops = 0; var skipticks = 1000 / game.fps; var maxframeskip = 10; var nextgametick = (new date).gettime(); return function { loops = 0; while ((new date).gettime() > nextgametick && loops < maxframeskip) { game.update(); nextgametick += skipticks; loops++; } game.draw(); }; } )(); game._intervalid = setinterval(game.run, 1000 / game.fps); so game.run gets assigned result of outer function, inside function. inside function relies on nextgametick , defined in outer function... so game keeping state in outer...

javascript - how will asp.net mvc-5 bunble behave if i am referecing .min and the full scripts -

i working on asp.net mvc-5 web application . , inside bundle define following (where referencing .js , min.js files):- bundles.add(new scriptbundle("~/bundles/jstemplate").include( "~/bower_components/moment/min/moment.min.js", "~/bower_components/fullcalendar/dist/fullcalendar.min.js", "~/js/jquery.datatables.min.js", "~/bower_components/responsive-tables/responsive-tables.js", "~/bower_components/bootstrap-tour/build/js/bootstrap-tour.min.js", "~/js/jquery.raty.min.js", )); where referencing .js & min.js files, how bundle work in case on production server ?. know bundle (when debug=false) these 2 main tasks:- 1. combine scripts inside bundle single file 2. minify combined file. now in case bundle contain minify , non-minify files, mean minify files additional minification ? or minified files can not minified , bundle deliver .min.js client ? the bundle minify files first(if...

c# - Change values in Class Attribute at runtime -

if have class this [attr("blah", data = "blah")] public class test : superclass{} is there way can change values of attribute of instance of class @ runtime? eg in pseudo code superclass test = new test(); test.attr.value = "blah1"; test.attr.data = "blah2"; (i have instance of class want change attributes on, cast class extends) there no implicit connection between attributes , objects instances. between class , attribute. best bet attribute in constructor , "cache" values in properties on object. of course doesn't make sense if looking @ test class, make sense if constructor of superclass looks custom attributes on type retrieved "this.gettype()".

node.js - Strange symbols in log with winston -

initialization: var winston = require('winston'); var logger = new (winston.logger)({ levels: { trace: 0, input: 1, verbose: 2, prompt: 3, debug: 4, info: 5, data: 6, help: 7, warn: 8, error: 9 }, colors: { trace: 'magenta', input: 'grey', verbose: 'cyan', prompt: 'grey', debug: 'blue', info: 'green', data: 'grey', help: 'cyan', warn: 'yellow', error: 'red' } }); logger.add(winston.transports.console, { level: 'error', prettyprint: true, colorize: true, silent: false, timestamp: false, json: false }); for example call logger this: logger.info("issandbox: " + issandbox); in idea see: info: issandbox: true but when i've uploaded script ubuntu server, saw in log: ...

audio - Accessing Files in the Raw folder in Android -

i working on exporting function in android application. files wav files stored in res/raw folder. how can access files? uri = uri.parse("android.resource://" + getpackagename() + "/raw/" + selection[i]); try{ file[i] = new file(uri.getpath()); if(file[i].exists()){ log.i("exist", "exist"); }else{ log.i("exist", "not"); } } catch(exception e){ log.i("error", "file not found"); } selection[i] filename of file need in res/raw folder. code returns "not", means has not found file want res/raw folder. can me please? thanks. i'm not sure can access resource through file that. here's how i'm reading html files in raw folder: public static string getstringfromresource(context context, @rawres int id) { ...

go - Golang - TLS handshake error -

i running https web server in go. testing using angular web app (chrome browser) makes ajax calls web server. if keep hitting web server continuously seems working. whenever leave idle sometime , hit web server ajax call browser doesn't response. see log line in server log. 2016/01/16 04:06:47.006977 http: tls handshake error 42.21.139.47:51463: eof i can confirm ip address ip address. i starting https server this: r := mux.newrouter() r.handlefunc("/status", handlestatus) setuploginendpoint(&cfg.session, r) setuplogoutendpoint(cfg.session.cookiename, r) setupchangepasswordendpoint(cfg.session.cookiename, r) setupmetricsinkendpoint(cfg.metric.sinkapikey, r) setupmetricqueryendpoint(cfg.session.cookiename, r) http.listenandservetls(":443", "../cert.pem", "../keys.pem", &server{r}) i can confirm closing request body in every handler using defer r.body.close(). i using go 1.5.2. any appreciated. regards, sathya ...

r - Set precision inside a function -

i trying figure out how increase precision of output of function. need have output of acf function @ least 5 digits accuracy, while gives me 3. v = c(1.1,3.2,2.1,4.5) acfv = acf(v) acfv the precision-adjusting function know options(digits=...) , works explicit calculations in global environment. can me? you looking @ print-method output. acf values stored in full numeric precision: > acfv$acf , , 1 [,1] [1,] 1.0000000 [2,] -0.3399337 [3,] 0.2900897 [4,] -0.4501561

javascript - Automatically Submit Form If there is Value -

i have problem store visitor session. have idea fix automatically submit form input if there value. if use auto submit javascript, automatically submit regardless of whether or not existing value in input section. html code <form id="id_form" action="login.php" method="post"> username: <input type="text" name="user" id="user" value="this_value" /><br /> password: <input type="password" name="password" id="password" value="this_password" /><br /> save password: <input type="checkbox" name="session"/><br /> <input type="submit" value="submit" /> </form> javascript <script> setinterval(function() {submitform();}) { document.getelementbyid("id_form").submit(); } </script> visitors save password checking section, submit automatical...

scala - Can I use shapeless to return the same arity of HList as passed HList? -

here example. i'm trying wrap external api accepts , returns same arity of list : def externapi(args: list[int]): list[string] = args.map(_.tostring) i thought excuse learn shapeless seems hlist able do. def foo(args: hlist): hlist = ??? how can encode in type passed hlist , returned hlist of same arity? to expand on @stew's comment, can use sized enforce equal arity between lists. import shapeless._ import syntax.sized._ def externapi[n <: nat](args: sized[list[int], n]): sized[list[string], n] = args.map(_.tostring) usage: scala> externapi(sized[list](1, 2, 3, 4)) res0: shapeless.sized[list[string],shapeless.nat._4] = list(1, 2, 3, 4) scala> res0 foreach println 1 2 3 4 i'm far shapeless expert, don't know if there way hlist , seems collections homogeneous anyway.

c# - Null Table adapter value with if then statement -

i have vb.net program checks see if specific terminal has been used on last week. i'd use if statement send me results. if tableadapter empty (null) execute in program... right have: me.1tableadapter.fill(me.swipercheck.1, dtstartdate, todayend) if (me.swipercheck.1.count = 0) msgbox ("it worked") here dataset query: select case when count(sterminal) = 0 null else count(sterminal) end terminal swipe (dtcreated between @startdate , @enddate) , (sterminal = 'swiper 1') however it's not working , know output "null" if output not null, program works correctly. if want return no records when count 0 have this: select count(sterminal) terminal swipe (dtcreated between @startdate , @enddate) , (sterminal = 'swiper 1') having count(sterminal) > 0 that should make orignial if work correctly.

php mysql query | html table -

Image
guys confused populated data in table not showing first record html table: <table class="table table-bordered table-condensed" align="center" bordercolor="#cccccc"> <tr bgcolor="#009933"> <td align="center" style="color:#fff;">name</td> <td align="center" style="color:#fff;">course</td> <td align="center" style="color:#fff;">grade</td> <td align="center" style="color:#fff;">remark</td> </tr> <?php while($result= mysql_fetch_array($query1)){ echo "<tr>"; echo "<td>".$result[...

linux - awesome wm - how to bind a key to another key -

i'm new awesome wm , i'm trying bind key key. e.g. when press alt+j , act pressed down key on keyboard. i don't know whether awesome wm has function or not? any function this? awful.key({ altkey }, "j", function () "down" i think may misunderstanding question. interpretation 1: just copy code other key binding. in default config, mod+j is: awful.key({ modkey, }, "j", function () awful.client.focus.byidx( 1) if client.focus client.focus:raise() end end), copy part , change key: awful.key({ }, "down", function () awful.client.focus.byidx( 1) if client.focus client.fo...

python - Run app from Flask-Migrate manager -

i used these lines start application: from app import app app.run(host='0.0.0.0', port=8080, debug=true) using flask-migrate, have instead: from app import manager manager.run() manager.run not take same arguments app.run , how define host , port? manage.py replaces running app python app.py . provided flask-script, not flask-migrate adds commands it. use runserver command supplies run dev server. can pass host , port command: python manage.py runserver -h localhost -p 8080 -d or can override defaults when configuring manager: manager = manager() manager.add_command('runserver', server(host='localhost', port=8080, debug=true)

Bad Authentication Data QuickBlox - Android -

i working on quickblox sdk , using sdk trying login on facebook . have visited helpfull links on stackoverflow this , didn't me . here code snippet . qbauth.createsession(new qbentitycallbackimpl<qbsession>() { @override public void onsuccess(qbsession session, bundle params) { string token = session.gettoken(); qbusers.signinusingsocialprovider(qbprovider.facebook, token, null, new qbentitycallbackimpl<qbuser>() { @override public void onsuccess(qbuser user, bundle args) { toast.maketext(getapplicationcontext() , "success" ,toast.length_short).show(); } @override public void onerror(list<string> errors) { toast.maketext(getapplicationcontext() , "onerror" ,toast.length_short).show(); } }); } @override public void onerror(list<string> errors) { } }); logcat details : access-co...

c# - MVC3 Razor CMS - create localized page dynamically -

i building cms allows admin create pages (.cshtml) dynamically without controller. so far if page created code behind , saved in page folder, can access new page. however in page folder cannot create directory-type structure new pages. ex. page/home/new, page/settings/mysettings ..etc only pages created in page folder displayed correctly, others 404 error. the other problem cannot perform globalization of new pages. what able access new pages like: en/home/aboutus english culture fr/accueil/qui-sommes-nous french culture. globalized content stored in db. any link, tutorial, documentation or hints how highly appreciated. thanks, vishal

python - Keras AttributeError: 'module' object has no attribute 'relu' -

when try use keras in python, pycharm tells me: file "d:/bitbucket/kaggle/homesite quote conversion/keras_nn_test_0.96363.py", line 167, in <module> model.compile(loss='binary_crossentropy', optimizer="sgd") attributeerror: 'module' object has no attribute 'relu' does know why? this has been marked issue on issue tracker , caused fact version on pip not date. users on there suggested, re-installing theano cloning repository , using setup.py solves issue. p.s: explicitly mentioned in their installation guide : note: you should use latest version of theano, not pypi version. install with: sudo pip install git+git://github.com/theano/theano.git along other dependencies, of course.

android - Monitoring Listener detects only one beacon -

i have 3 estimote beacons (div kit). in android app i'm trying change 3 textviews show each beacon's major , minor. i've changed beacons settings advertise signal every 1ms shortest period of time. the problem beaconmanager object detecting 1 beacon , takes while that. here code app.java public class app extends application { public static beaconmanager mbeaconmanager; @override public void oncreate() { super.oncreate(); mbeaconmanager = new beaconmanager(getapplicationcontext()); mbeaconmanager.setbackgroundscanperiod(timeunit.seconds.tomillis(1), 0); mbeaconmanager.connect(new beaconmanager.servicereadycallback() { @override public void onserviceready() { mbeaconmanager.startmonitoring(new region( "monitored region", uuid.fromstring("b9407f30-f5f8-466e-aff9-25556b57fe6d"), null, null...

javascript - Uncaught TypeError: elements[i].attr is not a function -

this code: function () { var container = document.getelementbyid('data-table'); var elements = container.getelementsbytagname("input"); (i = 0; < elements.length; i++) { elements[i].on("ifchanged", handle_company_state(elements[i].attr('id'))); } } function handle_company_state(element_id) { //.... } when i'm trying run i' getting error: uncaught typeerror: elements[i].attr not function why? i think looking like: function () { var elements = $("#data-table input"); (i = 0; < elements.length; i++) { $(elements[i]).on("ifchanged", handle_company_state($(elements[i]).attr('id'))); } } function handle_company_state(element_id) { //.... }

d - How to create a tuple of ranges? -

template tupindextorange(alias tup, indicies...){ import std.meta; import std.typecons; static if(indicies.length == 0){ enum tupindextorange = tuple(); } else{ enum tupindextorange = tuple(tup[ indicies[0] ][], tupindextorange!(tup,indicies[1..$])); } } void main(){ alias integrals = aliasseq!(array!int, array!float, array!double); tuple!integrals integrals; integrals[0].insertback(1); integrals[1].insertback(2); integrals[2].insertback(3); auto t = tupindextorange!(integrals, 0, 1, 2); auto r = zip(t.expand); } err: source/app.d(119,34): error: variable integrals cannot read @ compile time source/app.d(119,33): called here: tuple(integrals.__expand_field_2.opslice(), tuple()) source/app.d(119,56): error: template instance app.main.tupindextorange!(integrals, 2) error instantiating source/app.d(119,56): instantiated here: tupindextorange!(integrals, 1, 2) source/app.d(219,12): instantiated here: tupindextorange!(integrals...

java - How to prevent Android from inserting the trailing \n\n when SetText using Html.FromHtml()? -

i settext edittext way: edittext.settext(html.fromhtml("<p><a href='#'>cadbury</a> fav chocolate</p>"); problem is, line inserts 2 additional breakpoints on edittext when value using html.tohtml(edittext.gettext()) result is: "<p><a href='#'>cadbury</a> fav chocolate</p>\n\n" i dont want trailing \n's, how remove them?

javascript - ReferenceError: $setTimeout is not defined -

i'm doing course , ran across , error. i'm making tinder producthunt using ionic , angular. ionic $ 0 776918 error referenceerror: $settimeout not defined @ scope.$scope.sendfeedback (http://localhost:8100/js/controllers.js:41:5) @ fn (eval @ <anonymous> (http://localhost:8100/lib/ionic/js/ionic.bundle.js:26457:15), <anonymous>:4:239) @ http://localhost:8100/lib/ionic/js/ionic.bundle.js:62386:9 @ scope.$eval (http://localhost:8100/lib/ionic/js/ionic.bundle.js:29158:28) @ scope.$apply (http://localhost:8100/lib/ionic/js/ionic.bundle.js:29257:23) @ htmlanchorelement.<anonymous> (http://localhost:8100/lib/ionic/js/ionic.bundle.js:62385:13) @ htmlanchorelement.eventhandler (http://localhost:8100/lib/ionic/js/ionic.bundle.js:16583:21) @ triggermouseevent (http://localhost:8100/lib/ionic/js/ionic.bundle.js:2948:7) @ tapclick (http://localhost:8100/lib/ionic/js/ionic.bundle.js:2937:3) @ htmldocument.tapmouseup (h...

java - How to add number of String values to an ArrayList? -

i have scenario wherein have bean class i'm getting client names , other client related details. i'm creating bean object , getting details. arraylist<clientbean> clientlist = (arraylist<clientbean>) (new queriesdao()) .getallclient(); from above code getting details of client. , client names i'm through index form, clientbean clist = clientlist.get(2); (clientbean clientbean : clientlist) { clientbean.getclientname(); // here i'm getting client names 1 one. } my question how add client names in arraylist dynamically? generally add values list (so arraylist ) can use methods: add(e e) add element @ end of list add(int index, e element) add element in specified position addall(collection<? extends e> c) add element @ end of list addall(int index, collection<? extends e> c) add element starting specified position please check documentation (linked on answer) detail...

python - XMPP rspauth token should contain what in a DIGEST-MD5 auth? -

background: i'm fiddling xmpp server doesn't work. so documentation on particular response token called rspauth not documented anywhere really. appear skip , go static string looking this: cnnwyxv0ad1lytqwzjywmzm1yzqyn2i1nti3yjg0zgjhymnkzmzmza== which b64decodes to: rspauth=ea40f60335c427b5527b84dbabcdfffd however @ last stages of md5-digest authentication, supposedly should sending following: <challenge xmlns='urn:ietf:params:xml:ns:xmpp-sasl'> cnnwyxv0ad1lytqwzjywmzm1yzqyn2i1nti3yjg0zgjhymnkzmzmza== </challenge> again, i'm not sure why everywhere in every bug report uses static string. xmpp client respond with: jabber: error -10 : sasl(-10): server failed mutual authentication step: digest-md5: server wants believe knows shared secret i try follow rfc's close can, , this rfc says rspauth= : the server receives , validates "digest-response". server checks nonce-count "00000001". if supports sub...

javascript - Show a different gallery depending on which button is clicked -

i have gallery here nation select buttons opens 1 background image in div ".displayarea", picking pics array "arrayindex". , "next"/"previous" select buttons, open separate gallery, in div ".containsnext", placed above displayarea div. close button closes both these divs. working far. want display different gallery different arrays(or can same, don't know more efficient)within .containsnext div, based on nation button clicked. say, button "croatia", pic photos array on line 3 displayed, button spain, array, arrayspain(line 9) displayed. know supposed post code of have tried, did not come useful. background pic in displayarea, have done following function addimageinto(arrayindex, container) { var displayarea = document.queryselector('.displayarea'); if (displayarea.queryselector('.' + container.id)) { return; } displayarea.innerhtml = ''; but cam not able achieve goal that. else working, ...

persistence - Spring ROO - GenerationType.IDENTITY instead GenerationType.AUTO -

hy, thers option roo command line generate _roo_jpa_entity @id column @generatedvalue(strategy = generationtype.identity) instead generationtype.auto ? i have mysql database autoincrement column key , launch roo reverse enginerr command: database reverse engineer --schema myschema --activerecord false --package mypackage in _roo_jpa_entity generated column key generationtype.auto , manually modify che entity generationtype.identity. thanks lot. all roo commands , options described in commands reference sections . database reverse engineer currently doesn't support option. if wish can contribute spring roo improving add-on feature. good luck!

javascript - Problems with the video slider -

hi i've added simple function javascript pauses video when slider handle being dragged , unpauses when released(this happens if video playing , works properly).if video paused instead, when slider handle released want video remain paused(this part doesn't work) . problem i've encountered after release slider handler resumes playing. i've tried working around problem variable doesn't seem work. here code: js: // pause video when slider handle being dragged var control=0; seekslider.addeventlistener("mousedown", function() { if(video.pause==true) { control=1; } else { video.pause(); } }); // play video when slider handle dropped seekslider.addeventlistener("mouseup", function() { if(control>0) { control=0; } else { video.play(); } }); add 1 more function function seektimeupdate(){ var nt = v...

ios - How to enable parts of code with external files .plist or .xcconfig -

i have project i'm using fastlane toolchain build. i have multiple deployment targets (hockey app, test flight, app store) - , each deployment i'm interested in disabling , enabling features. for example - when i'm doing alpha build enterprise cert hockeyapp want disable flurry analytics. when i'm doing beta build want change app-id and/or change flurry key i have working in fastlane variety of sed commands search , replace files etc. that being said, i'm sure there better way. i know in obj-c can #ifdef against build environment flags enable / disable parts of code. best way go in swift. do use sort of custom .plist file or .xcconfig setting tell app do/use or there different way? the things i'm interested in are disabling portions of code ( ignore function in specific config) changing values used in code aka api_key or that you can still use similar #ifdef preprocessor in swift, , can combine .xcconfig can used specif...

python 2.7 - Why does Beautiful Soup Return filename instead of full link? -

this question has answer here: reconstructing absolute urls relative urls on page 2 answers using below simple code, i'm facing following problem: why beautiful soup return file names rather full link addresses? from bs4 import beautifulsoup import urllib2 url = 'http://www.gks.ru/bgd/free/b00_25/isswww.exe/stg/d000/i000650r.htm' data = urllib2.urlopen(url).read() page = beautifulsoup(data,'lxml') link in page.findall('a'): l = link.get('href') print l all i'm getting output: i000660r.htm i000670r.htm i000680r.htm i000690r.htm i000700r.htm i000706r.htm i000707r.htm i000708r.htm i000709r.htm 000710.htm 000711.htm 000712.htm 000713.htm 000714.htm 000715.htm problem solved, given relativeness of links concatenated output root of url. thanks.

html - Displaying information within an infobox in Bing Maps -

i using bing maps display markers on map. i able display infobox on over of markers. infobox contains summary display this var pininfoboxoptions = { width: 300, height: sumxi, description: summ, visible:true }; now able display inbox description has full information marker. if add link using infoboxoptions actions infobox not displayed. please help var pininfoboxoptions = { width: 300, height: sumxi, description: summ, actions:[{label:'test1',eventhandler: testevent1}], visible:true }; if want link need use infobox option htmlcontent, example sdk docs: var infoboxoptions = {width :200, height :100, showclosebutton: true, zindex: 0, offset:new microsoft.maps.point(10,0), showpointer: true, htmlcontent:' custom html '}; based on q's edit, title click handler job: again doc: ' titleclickhandler string ' name of function call when title of info box clicked. if property set, title of ...

How to get only one marker in the Google Maps API with JavaScript -

my code: <script src="http://maps.googleapis.com/maps/api/js"> </script> <script> var map; var mycenter=new google.maps.latlng(51.508742,-0.120850); function initialize() { var mapprop = { center:mycenter, zoom:5, maptypeid:google.maps.maptypeid.roadmap }; map = new google.maps.map(document.getelementbyid("googlemap"),mapprop); google.maps.event.addlistener(map, 'click', function(event) { placemarker(event.latlng); }); } function placemarker(location) { var marker = new google.maps.marker({ position: location, map: map, }); var infowindow = new google.maps.infowindow({ content: 'latitude: ' + location.lat() + '<br>longitude: ' + location.lng() }); infowindow.open(map,marker); } google.maps.event.adddomlistener(window, 'load', initialize); </script> </head> <body> <div id="googlemap" style="width:500px;height:380px;"...

bash - parsing a file with a column of key/value pairs -

i trying parse tab delimited file last column has variable number of key-value pairs separated semicolon. here example ab cd ef as=2;sd=5;df=12.3 gh ij kl sd=23;df=55 mn op qr as=24;df=77 i want print 2nd column , value associated key "sd" expected output should be cd 5 ij 23 can in bash? the problem here key-value column has variable no of entries target key have different positions in different rows. i can grep values of given key grep -o 'sd=[^;]*' file.txt but can not print other column values @ same time awk rescue! $ awk -v k="sd=" '{n=split($nf,a,";"); for(i=1;i<=n;i++) if(a[i]~k) {sub(k,$2" ",a[i]); print a[i]}}' file cd 5 ij 23 if key not fixed length anchoring on left better idea. change a[i]~k a[i]~"^"k

javascript - Get dynamic request params in node.js -

how can construct array says have dynamic dom below? <input type="hidden" name="file1" value="1.jpg"> <input type="hidden" name="file2" value="2.jpg"> <input type="hidden" name="file3" value="3.jpg"> <input type="hidden" name="file4" value="4.jpg"> .. .. , on one way save input calculate length of file, req.body.number_of_file later on can loop through that. is there alternative it? if inputs consistently , consecutively numbered, in example, go for: <input type="hidden" name="files" value="4"> <!-- or 5, 6, 42, etc. --> otherwise, try having inputs part of input array: <input type="hidden" name="files[]" value="1.jpg"> <input type="hidden" name="files[]" value="2.jpg"> <input type="hidden" nam...

Unity 2D Jump Animation C# -

i'm activating trigger parameter cycle jump animation using: isgrounded 'is player grounded bool', i'm using determine wether or not player allowed jump. i'm using child player object , using physics2d.linecast(myplayer, myplayerground, playermask) so. i'm triggering jump animation (using trigger parameter transfer jump animation run or idle, 2 other animations i'm using work flawlessly) using spacebar, same way tap in y axis jump velocity. i can't figure out reliable way reset trigger. tried resetting if isgrounded returned true, i'm assuming i'm getting false positive, trigger in first place if isgrounded returns true? tried triggering animation on running check see if isgrounded returns false, if that's case, jump animation play if fall off ledge, jumping, of course doesn't make sense. i put couple of conditions, including velocity direction , isgrounded state. reset jump animation, must moving downward, , isgro...

php - Paypal payment through database -

Image
good day people! i have question: im making webshop takes items out of database , shows them code: foreach($result $row) { print "<div id='item'>"; echo "product id: ".$row['productid']; echo "<br/>"; echo "<img src=images/".$row['image'].">"; echo "<br/>"; echo "price: ".$row['price']; echo "<br/>"; echo "desc: ".$row['description']; echo "<br/>"; if($_session['username'] == ""){ echo "login buy!"; }else{ echo "<button name='buy'>buy item</button>"; } echo "</div>"; } it works beautifull, can see have button "buy item", there tutorial paypal migration buttons buying specific item, because i've been looking on interwebs , couldnt find one, in advan...

HTML5, jQuery,... >> Smooth touch-compatible drag and drop / input range slider solution anyone? -

can out , recommend touch-compatible solution drag , drop based ui elements? i'm looking input range slider, similar html5 input range or http://jqueryui.com/slider . while native html5 causing many troubles (in older browsers , on touchscreens), go jquery. far, - overall performance of jquery drag , drop events not satisfying, since there kind of delay when dragging objects. in slider example, cursor (and/or finger on touch devices) couple of pixles ahead, when doing fast moves. are there alternatives, plug-ins, hacks,... out there, may out? or there way speed jquery's drag , drop functionality? hammer.js,maybe : http://eightmedia.github.io/hammer.js/ try slide on window of website (with mouse or finger), hope answers

javascript - How to hide divs when radio button is checked on page load? -

i have existing jquery code hides divs if radio button selected. however, when page loads.. if radio button checked, want able hide divs without clicking anything. <script> $('input[name=resident]').click(function () { if (this.id == "residentno") { $(".d").hide('slow'); $('.d').find('#precinctnum').val(''); $('.d').find('#yearstartedliving').val(''); } else { $(".d").show('slow'); $('.d').find('#precinctnum').val(''); $('.d').find('#yearstartedliving').val(''); } }); </script> html form: <label class="radio-inline"><input type="radio" class = "res" id = "residentyes" name="resident" value="...

cmis - CmisObjectNotFound ephesoft export to Alfresco -

i'm using ephesoft-community-edition-2.4.0.7 alfresco 4.0 got cmisobjectnotfoundexception when try export uploaded file meta-data. this log in dcma-all.log - batchinstanceidentifieridentifier : bi16 inputfilename : bi16_batch.xml outputfilename : pre_state_bi16_batch.xml - copy of file batch instance identifier : bi16 - cmis export plugin. - initializing properties... - cmis: http basic authentication used cmis messaging. determining if target folder "sites" exists within repository folder "/". - folder present - found child folder. folder id workspace://spacesstore/383973c1-0325-408f-8f54-551c9bd86ebc. - determining if target folder "ephesoftintegration" exists within repository folder "/sites". - folder present - found child folder. folder id workspace://spacesstore/5c4c7e20-7148-4c59-a3a8-edd76748aa3d. - determining if target folder "documentlibrary" exists within repository folder "/sites/epheso...

Skyscanner API example in Java -

i trying build example of request skyscanner api in java - doing wrong - link skyscanner api test: http://business.skyscanner.net/portal/en-gb/documentation/flightslivepricingquickstart here test code have far - "internal server error". anyone can see incorrect in example? thanks package flights; import com.google.gson.gson; import com.google.gson.gsonbuilder; import java.io.ioexception; import java.util.collections; import java.util.hashmap; import java.util.map; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.statusline; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpclient; import org.apache.http.client.httpresponseexception; import org.apache.http.client.responsehandler; import org.apache.http.client.methods.httppost; import org.apache.http.entity.stringentity; import org.apache.http.impl.client.defaulthttpclient; import org.apache.http.util.entityutils; public class t...

Java Printing - Spooling in Printing Queue -

Image
i want print pdf file printer using java-based software netbeans. when ran code below, saw document in printing queue file name "java document" spooling status . the questions are: i want know why printer not printing document if in queue? because of code or because of printer? here code: public string gonnago(string newfile) throws filenotfoundexception, printexception, ioexception{ system.out.println("hello!" + newfile); inputstream is; = new bufferedinputstream(new fileinputstream(newfile)); //the new file 1 printed doc doc = new simpledoc(in, docflavor.input_stream.autosense,null); printservice service = printservicelookup.lookupdefaultprintservice(); // locate default print service environment. system.out.println("default printer: " + printservicelookup.lookupdefaultprintservice().getname()); //check if file directory of file printed included printrequestattributeset p...

r - find out word frequency in a table according to a list -

now have dtm, turn dtm frequency table freqs <- as.data.frame(inspect(dtm1)) here's how freqs looks like, contains 1 row shows frequency of these words in document i hate school how can hi 4 5 3 2 3 1 4 5 1 i have list list <- c("hi", "how", "are", "you") how can find out frequency of words in frequency table according list, compile these word frequencies in table hi how 1 3 4 5 if words variable names in data.frame > freqs[,list] hi how 1 1 3 4 5

c++ - Calculating accurate cpu usage per task in assembly -

i've multi-task program written in c++ , want calculate cpu usage each of threads in sub second basis (may 100 ms) may know /proc/stat or didn't have accuracy resolution of time. i want know there way calculate clock cycles consumed each thread in assembly or c/c++? starting linux 2.6.12 , glibc 2.4, can use clock_gettime clock of type clock_thread_cputime_id realiable timing information

Python List methods -

i had make text processing in python. so created class textprocessing : manipulator = textprocessing("one 2 3 4 four") repr(manipulator) => "one 2 3 4 four" manipulator["four"] //=> [3, 4] => made list but after had make function that: manipulator.two.replace("second") => "one second 3 4 four" i have no idea how link 2 here list. you can play overriding __getattr__ class a(object): def __init__(self, s): self.s = s def replace(self, x): self.s = self.s.replace(self.x, x) def __getattr__(self, name): self.x = name return self = a('abc') a.b.replace('x') print a.s or class b(object): def __init__(self, x, y): self.x = x self.y = y def replace(self, x): self.x.s = self.x.s.replace(self.y, x) class a(object): def __init__(self, s): self.s = s def __getattr__(self, name): return b(self...