Posts

Showing posts from August, 2015

dictionary - C++ STL associative containers: Get iterator from element? -

this has been asked vectors . possible sets & co too? c.equal_range(elem); for set-like, or c.equal_range(elem.first); for map-type containers return pair of iterators equivalent (under container's rules) element. takes between o(k) , o(lg n) time, n number of elements in container, , k number of elements pseudo-equivalent elem / elem.first (pseudo, hash collisions modulo bucket count count). average constant (for unordered)/lg n (for ordered).

c# - Dependency injection for a static method -

this question has answer here: dependency injection static logger, static helper class 4 answers i have class in api, have static method, intended validate , log details. guidance how inject ilogger interface please. public class validatedatainapi { public static bool isvalid(string data) { //do if(error) { _logger.error("log error implemented caller"); } } } if understand correctly, want inject instance of ilogger static method. figured out cannot make use of dependency injection "normal way" when dependent method static. what might looking here service locator pattern . using structuremap ioc container (but can use container), configuration wiring might this: for<ilogger>().use<someloggerimplementation>(); when implemented, calling code might this: public c

Why 'segmentation fault' occurs in the following C code -

$hoho b abcd $hoho | lala segmentation fault lala.c --> #include<stdio.h> int main(int argc, char* argv){ printf("%s\n", argv[1]); ... } then, how can use std_input a, b , abcd your main() has wrong signature. it's not int main(int argc, char* argv) it's int main(int argc, char **argv) or equivalently int main(int argc, char *argv[]) you trying print char "%s" specifier, printf() function tries read string , interprets char value address because it's expecting char pointer, leads undefined behavior 1 , hence problem. 1 please read link posted @ souravghosh answer advice.

Throwing custom error messages in java struts -

are there useful patterns or best practices throwing/showing user friendly error messages in struts 1? if(something nasty...) { throw new userexception("very bad thing happened"); } else if(something other nasty...) { throw new userexception("other thing happened"); } .... other 100 cases because using above sample in validate() method on , on again seems bit redundant , unprofessional. create actionmessage(s) , display these. there better information here can give you: http://www.mkyong.com/struts/struts-logic-messages-present-logic-messages-notpresent-example/

angularjs - AngualrJS ElasticUI dependency injection -

i have question regarding dependency injection in angular. i'm using elasticui: https://github.com/yousefed/elasticui the index-name needs set inside tag. <body ng-app="tutorial" eui-index="'index_name'"> is possible set index_name "outside" ? angular.module('tutorial', ['elasticui']). ??? i don't know angular. i'm sorry if stupid question... thanks help! it's passing value directive. in controller: .controller('mycontroller', function($scope) { $scope.indexname = "asdsd"; }) in html: <body ng-app="tutorial" ng-controller="mycontroller" eui-index="indexname">

java - How to load log4j2 configuration file from JNDI -

i migrating web applications log4j 1.12 log4j2. due company policies our log4j.xml file locations configured urls in application server , applications have them jndi. implemented servletcontextlistener allowed initialize log4j infraestructure way: public void contextinitialized(servletcontextevent servletcontextevent) { ... urllogconfig = (url) context.lookup("java:comp/env/"+loglocation); ... //urllogconfig -> file:///somepath/log4j.xml domconfigurator.configureandwatch(urllogconfig.getpath()); } public void contextdestroyed(servletcontextevent servletcontextevent) { servletcontext servletcontext = servletcontextevent.getservletcontext(); servletcontext.log("log4jconfigurationlistener - shutting down log4j"); logmanager.shutdown(); } however, log4j2 api changes can no longer used. log4j2 provides lo4j2-web.jar module uses log4jservletcontainerinitializer initialize library. ends calling log4jwebinitializerimpl.getconfigu

Show the euro simbol in a shiny R application -

i'm trying create shiny r application. have troubles show euro symbol (and return it) in radio button. i've tried different version of code: library(shiny) runapp(list( ui= navbarpage(title = 'shoe euro', radiobuttons('var', 'var', c("income_mgl", "income_mgl€", "income_mgl&euro;", "income_mgl&#8364;", "income_mgl\u20ac") )), server=function(input, output, session) { })) but "€" doesn't appear in web page. if select second option page returns error: "error in fromjson(content, handler, default.size, depth, allowcomments, : invalid json input" the problem lies in class shiny-options-group in div function. way class works appears convert & &amp; , preventing browser converting &#8364; € because first changes &amp;#8364; . try following ui.r see happen. library(shiny) options = as.list(c("a

android - AnimatedSprite displays with wrong size -

Image
sorry if problem asked before. have searched around didn't find thread this, post question here. i new on andengine. trying load tiled sprite , create animation it. here codes: public void loadgameresources() { bitmaptextureatlastextureregionfactory.setassetbasepath("gfx/player/"); msapotextureatlas = new bitmaptextureatlas(mactivity.gettexturemanager(),256,178,textureoptions.default); mplayerdownitiledtextureregion = bitmaptextureatlastextureregionfactory.createtiledfromasset(mplayertextureatlas, mactivity.getassets(), "player.png", 0,0,3,1); mplayertextureatlas.load(); } what expect player can actions walking don't. please see attached screenshots see real result. think codes split original texture 3 parts rather split 3 sprites @ first row. please take , me fix this. lot! , here how create animation: animatedsprite player= new animatedsprite(100,100,40,40,mresourcemanager.mplayerdownitiledtextureregion,mvertexbufferobj

javascript - session set in jquery cant able to get in php -

index.js file sessionstorage.setitem('name', 'xxxx'); login.php <?php echo $_session['name'] ?> in index.html page name , store in session using javascript after page navigate login.php in cant able session variable pls me solve issue. in index.html file create ajax request , send php file , in php file set session, in login.php file can session easily.

math - Java : how to get correct result? -

this question has answer here: integer division: how produce double? 10 answers in java: double b = 1234 / (1234+1500); result is: 0.0 why? how correct result? just make 1 of operand double / float - double b = (double) 1234.0/(1235+1500); here casting not required. the rules benind : if 1 of operand double / float (here 1234.0) other promoted double / float .

topology - Kafka Spout fails to acknowledge message in storm while setting multiple workers -

i have storm topology subscribes events kafaka queue. topology works fine while number of workers config.setnumworkers set 1. when update number of workers more 1 or 2, kafkaspout fails acknowledge messages while looking @ storm ui. might possible cause, not able figure out, exactness of problem. i have 3 node cluster running 1 nimbus , 2 supervisors. my problem got resolve. reason being kafka unable acknowledge spout message conflict hostname. had mistakenly same host name in /etc/hostname , /etc/hosts file of both workers. when check worker able exception - unable communicate host. there figured out, problem was host name .i updated host name in etc/hosts mapping , /etc/host name file. message started acknowledged. thank you.

jquery - table row click event and checkboxes -

this question has answer here: how have click event fire on parent div, not children? 5 answers i have click event attached table row , within columns have checkboxes. <table> <tbody> <tr class='shop_order_single_table'> <td><input type='checkbox' /></td> <td><input type='checkbox' /></td> <td><input type='checkbox' /></td> </tr> </tbody> </table> when click checkbox click event row still executes. here code: $(".shop_order_single_table").on("click",function() { //click event executes }); how have click event table row not execute when clicking checkbox? $(".shop_order_single_table input").on("click", func

Currying a function with a variable in J -

i can create function multiplies 2 2&\* , , indeed 20 = (2&\*)10 what want create factory-function makes these order. so, want monad f s.t. ( f y ) x == (y * x ) whilst (\*& 2) 3 works ((\*&) 2) 3 doesn't, trying explicitly: (3 : 'y&*') 2 produces syntax error. where going wrong ? a verb creates verb adverb 1 in j: f =: 1 : 'm&*' 2 f 2&* (2 f) 5 10 (i.10)f 5 0 5 10 15 20 25 30 35 40 45 or tacitly: f =: &* 2 f 2&* h =: 3 :'...' won't work because produces verb , h y wants noun. g =: 4 :'x&* y' fine , equivalent f . [1]: or conjunction

dih - Solr Throwing Error while full import( with clean option = false) -

my problem when full-importing solr( via dih ), when solr starts fetch documents mysql, if query on particular time getting server error below note: while running fullimport ( clean option set false) http status 500 - input string: "solr" java.lang.numberformatexception: input string: "solr" @ java.lang.numberformatexception.forinputstring(numberformatexception.java:65) @ java.lang.long.parselong(long.java:441) @ java.lang.long.parselong(long.java:483) @ org.apache.solr.schema.triefield.readabletoindexed(triefield.java:295) @ org.apache.solr.schema.triefield.tointernal(triefield.java:307) @ org.apache.solr.schema.fieldtype.getfieldquery(fieldtype.java:580) @ org.apache.solr.search.solrqueryparser.getfieldquery(solrqueryparser.java:201) @ org.apache.lucene.queryparser.queryparser.term(queryparser.java:1436) @ org.apache.lucene.queryparser.queryparser.clause(queryparser.java:1319) @ org.apache.lucene.queryparser.queryparser.query(queryparser.java:1245) @ org.

PHP - Attach HTML to Image/Jpeg Response -

the code below: if($file = $mongogridfs->findone(array('_id' => new mongoid($fileid)))) { $filename = $file->file['filename']; $filebytes = $file->getbytes(); header('content-type: image/jpeg'); header("content-length: " . strlen($filebytes)); ob_clean(); echo $filebytes; } returns response mongo .jpg file. how include response html? eg. <div id='container'> <img ... /> <!-- image generated script , stored in $filebytes --> <br> <span class='description'>this image</span> </div> i want not make <img src='...'> linked saved file on filesystem. is possible? you cannot return 2 resources within same http response. can inline image data (see embedding base64 images more details browser compatibility , other possible issues inline images). like: <img src="data:image/jpeg;base64,<?=base64_encode($filebytes

javascript - Radio Buttons with X-editable -

i've started using http://vitalets.github.io/x-editable/ jqueryui. i used input text , select menus, , next wish implement radio buttons. ux should same other input types (i.e. user clicks text, 2 or more radio buttons popup along enter , cancel icon). is possible, , if so, how? the following script works necessary... https://gist.github.com/taivo/da6d47c7b291f71b9502

Symfony configure Twig template for hinclude -

i trying obey http://symfony.com/doc/current/book/templating.html#asynchronous-content-with-hinclude-js setting hinclude don't contents of hinclude.html.twig , instead " ::hinclude.html.twig " displayed. in /app/config/config.yml have: templating: engines: ['twig'] hinclude_default_template: "::hinclude.html.twig" hinclude.html.twig resides in /app/ressources/views/default/hinclude.html.twig , nothing more than: loading.... the actual content loaded correctly hinclude.js instead of displaying loading... displays template path in config file: ::hinclude.twig.html also these configurations not work: hinclude_default_template: ::hinclude.html.twig hinclude_default_template: "hinclude.html.twig" hinclude_default_template: hinclude.html.twig how can use twig template? thanks! it figured out misconfiguration... this doesn't work: hinclude_default_template: "::hinclude.html.twig" hinclude_d

Cassandra control SSTable size -

is there way control max size of sstable, example 100 mb when there more 100mb of data cf, cassandra creates next sstable? unfortunately answer not simple, sizes of sstables influenced compaction strategy , there no direct way control max sstable size. sstables created when memtables flushed disk sstables. size of these tables depends on memtable settings , size of heap ( memtable_total_space_in_mb being large influencer). typically these sstables pretty small. sstables merged part of process called compaction . if use size-tiered compaction strategy have opportunity have large sstables. stcs combine sstables in minor compaction when there @ least min_threshold (default 4) sstables of same size combining them 1 file, expiring data , merging keys. has possibility create large sstables after while. using leveled compaction strategy there sstable_size_in_mb option controls target size sstables. in general sstables less or equal size unless have partition key lo

java - What do these JDatePicker Properties do? -

i viewed following code in context of implementing jdatepicker in this post . utildatemodel model = new utildatemodel(); //model.setdate(20,04,2014); // need this... properties p = new properties(); p.put("text.today", "today"); p.put("text.month", "month"); p.put("text.year", "year"); jdatepanelimpl datepanel = new jdatepanelimpl(model, p); // don't know formatter, there is... jdatepickerimpl datepicker = new jdatepickerimpl(datepanel, new datelabelformatter()); i wanted know properties keys "text.month" , "text.year" do. tried implementing code , no change when omitting them. furthermore, tried searching list of keys in properties class , found nothing helpful. know these property keys or how find out if omitting them acceptable? these internationalization support. jdatecomponentfactory has code load locale-dependent resource bundles in jdatepicker distribution. think you're s

android - java.lang.OutOfMemoryError background -

this one, java.lang.runtimeexception: unable start activity componentinfo{ders.raydingoz.com.dersprogram/ders.raydingoz.com.dersprogram.aksamyemek}: android.view.inflateexception: binary xml file line #1: error inflating class <unknown> @ android.app.activitythread.performlaunchactivity(activitythread.java:2305) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2363) @ android.app.activitythread.access$900(activitythread.java:161) @ android.app.activitythread$h.handlemessage(activitythread.java:1265) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:157) @ android.app.activitythread.main(activitythread.java:5356) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1265) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:1081) @ dalvik.system.nativestart.main(native method) caus

ios - Swift: return to tableview after selecting a search result -

Image
i have implemented search function. want able search list, select item on list, return main tableview while item remains selected. how do this? this tableview without selections or character typed searchbar. items not have detail view. items have more information can retrieved, e.g. url. data must retrieved later when user presses "mail" button top left. this list search results. grey highlight of cell indicates cell selected. how return main tableview, whilst keeping selection? see cancel-button top right, cross-button in searchbar top middle, , "search" button on lower right part of keyboard. none bring main tableview whilst storing selection. based on suggested answers, able store row's index path, using function below: override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { let rowtoselect = indexpath println(rowtoselect) selectedcelltitle = selectedcell?.textlabel?.text ?? "&quo

xml - Transparent dialog in android -

i using checkboxes , displayed on dialogbox(dynamically).the next thing need make dialog box transparent.i tried many methods,but failed(wasted entire day behind this).can please give me solution nb:currently getting white colour inside dialog box(not transparent) below code..... transparent_alert.java public class transparent_alert extends activity{ string tag="transparent_alert class"; static final string key_userid = "userid"; string errormsg = "", user_id; sessionmanager session; int k=0; intrested_in_adapter m_adapter; private builder mdialog; private dialog alertdialog; list<requestencapsulation> offferlist; list<offeringencapsulation> offerlist; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); hashmap<string, string> user = session.getuserdetails(); user_id = user.get(sessionmanager.key_id); setcontentview(r.la

php - Foreach returned $variable[] select from database and combine values -

i have tried around couple of ways , different manners no luck. (also searched different solutions) sure i'm missing something. i have following code: $variable = returned array eg. 7, 8, 9; foreach($variable $entry_id){ $query = mysql_query("select * table entry_id=$entry_id") or die (mysql_error()); while($row = mysql_fethc_array($query)){ $qty = $row['quantity']; $combination = array_combine($qty); } } everything works , correct quantities returned (on testing) combinations not correct. combinations - of each entry_id - combined next one. instead of receiveing eg. $entry_id(7) = 15; $entry_id(8) = 26; $entry_id(9) = 58; i getting: $entry_id(7) = 15; $entry_id(8) = 41; $entry_id(9) = 99; the table structure this: entry_id | quantity 7 | 5 7 | 5 9 | 29 8 | 26 7 | 5 9 | 29

graphite - What is the purpose of <Node "node"> in write_graphite plugin of collectd? -

i trying understand purpose of "node" tag is. plugin config file. situation 1 needs use multiple node tags? <plugin write_graphite> <node "default"> host "graphitehost" port "2003" protocol "tcp" logsenderrors true prefix "collectd." storerates true alwaysappendds false escapecharacter "_" </node> </plugin> simply when want send data multiple graphite servers.

javascript - AngularJS $scope issues in tabset -

i have problem trying watch in controller collection generated filter in view. i store filtered data in variable : <table class="table"> <tr ng-repeat="item in filteredcollection = (mycollection | filter: txtsearch)"> <td ng-bind="item"></td> </tr> </table> and subscribe changes of 'filteredcollection ' in controller : $scope.$watchcollection('filteredcollection', function() { if (typeof($scope.filteredcollection) != 'undefined') console.log('results changed : ' + $scope.filteredcollection.length); }); i have set this jsfiddle show issue : watch function never called. fun fact, works when remove <tabset> <tab> tags in html. think messed $scope, don't why. maybe tabset create new $scope child or something. i hope guys find out going on here, cheers try put filteredcollection in object, change correct scope prop

python - Inserting data in to matplotlib subplot Figures -

i've got csv of data , trying plot of data on same row in style: fig = plt.figure() ax1 = fig.add_subplot(1,3,1) ax2 = fig.add_subplot(1,3,2) ax3 = fig.add_subplot(1,3,3) how insert below data plotting sequentially on top of each other in created figures above? mru.plot(x='time', y='r1', color='black') plt.ylabel('roll', fontsize=18) plt.xlabel('') plt.title('mru primary roll') mru.plot(x='time', y='p1', color='black') plt.ylabel('pitch', fontsize=18) plt.xlabel('') plt.title('mru primary pitch') mru.plot(x='time', y='t1', color='black') plt.ylabel('tilt', fontsize=18) plt.xlabel('') plt.title('mru primary tilt') you can specify on ax should plotted ax keyword argument in plot . example: mru.plot(x='time', y='r1', color='black', ax=ax1) note have use axes object rest of formatting of figure

asp.net mvc - IIS 8.5 server 2012 not returning json -

at localhost iis express, doesn't give me error, when copy iis 8.5 on server 2012, gives me "internal server error 500" when request json result. here code. controller [httpget] public jsonresult ticketsabertos(string username) { computer computer = new computer(); computer.gethostdetails(); //return json(jsonconvert.serializeobject(result), jsonrequestbehavior.allowget); string json = jsonconvert.serializeobject(computer.getopentickets(computer.user)); return json(json, jsonrequestbehavior.allowget); // return this.json(computer.getopentickets(computer.user), jsonrequestbehavior.allowget); } model public list<computer> getopentickets(string user_) { list<computer> listar = new list<computer>(); dictionary<string, string> list = new dictionary<string, string>(); //int result; string connetionstring = null; sqlconne

java - JavaFX Application keeps running even if i have an error in my main class static initializer -

keeps running: package app; import javafx.application.application; import javafx.stage.stage; public class test extends application { static { throwanexception(); } @override public void start(stage primarystage) throws exception { } public static void main(string[] args) { launch(args); } private static void throwanexception() { throw new runtimeexception(); } } stops: package app; import javafx.application.application; import javafx.stage.stage; public class test extends application { @override public void start(stage primarystage) throws exception { } public static void main(string[] args) { throwanexception(); launch(args); } private static void throwanexception() { throw new runtimeexception(); } } why? in first case program keeps running, exception. in second case program stops before calling javafx thread. static initializer should run befo

objective c - IOS Apple Watch voice input -

i plan develop application apple watch. need implement text input voice. on official website found following method: - (void)presenttextinputcontrollerwithsuggestions:(nsarray *)suggestions allowedinputmode:(wktextinputmode)inputmode completion:(void (^)(nsarray *results))completion interested in following: what languages supported input? is possible set desired language programmatically? can programmatically selected language? the input language presenttextinputcontrollerwithsuggestions depends on selected language of selected keyboard on iphone.

generator - Understand the producer and receiver using coroutine in python -

i want use coroutine implement producer , receiver. idea using 2 coroutines , 1 producer , 1 recevier. understand coroutine's send , running mode wrong. here code : def coroutine(func): def start(*args,**kwargs): cr = func(*args,**kwargs) cr.next() return cr return start class producer(object): def __init__(self, recevier): self.count=1 self.producer_coroutine = self._producer() self.receiver = receiver @coroutine def _producer(self): print "waiting" yield while true: self.send("yeah, no, yeah, no") get_feedback = (yield ) print ("get feedback %s"%get_feedback) self.send("a series of tubes") break def send(self,arg): self.receiver.receive_coroutine.send(arg) def init_producer(self): self.producer_coroutine.send("begin send , receive") class rece

Knockout binding is bloating html (table cells), how to create bindings with javascript or bind from parent element? -

i've created reusable grid component via knockout , i'm finding html becoming bloating data-bind="..." strings particularly <td> elements. i have grid 8 columns , mere 20 rows yield 160 cells. issue cells this: <td data-bind="text: typeof rowtext == 'function' ? rowtext($parent) : $parent[rowtext], event: { dblclick: function() { $root.rowdoubleclicked($parent); } }, css: $data.columnclass">yale university</td> i may add future bindings. it'd nice if there way perhaps apply binding <tbody> automatically apply binding it's child <td> elements. or perhaps there way apply bindings via javascript instead of using "data-bind" attribute? normally 1 looking @ code (developer), looks unimportant in grand scheme of things. format markup make easier follow: <td data-bind=" text: typeof rowtext == 'function' ? rowtext($parent) : $parent[rowtext], event: { dblclick

ios - Multiple touch events from Calabash with single request -

calabash-ios tests involving single tap have started fail, multiple taps being received 1 should happen. i'm running tests against simulator "iphone 5s (8.2 simulator)" , i've tried various calabash tapping methods, include tap_mark , touch , example: wait_tap view_selector which generates single http call (using wireshark sniff): http://localhost:37265/uia-tap but causing multiple taps in simulator, can seen simulator console log: mar 31 13:28:38 mc-x.local myapp[13790]: nsuserdefaults path = /pathtoprefs/myapp.plist mar 31 13:28:38 mc-x.local myapp[13790]: current request: { command = "uia.tapoffset('{:x 160.000000, :y 332.000000}')"; index = 0; } and these 2 lines repeated identically (same timestamp) - once, twice or 3 times more, giving repeated identical uia.tapoffset events. i'm using xcode 6.2 build 6c131e calabash 0.13.0. failures started after upgraded 0.11.4, though i've upgraded xcode 6.1.1 6.2 i'

Powershell - Check if file is finished writing -

i have powershell code acts file listener on given folder path. listener kicks off command line call program opens , plays file. the problem powershell code kicks off command line call if file put folder. problem if file large (say 100+mb) because when person copies file folder, file may 5% done 'writing' when command function kicks off , tries open file (and fails). is there way in powershell check if file still being written too? way build loop check every x seconds , run once write completed? does file maintain "lock" if being written too? can checked in powershell? thanks everyone! there may lock check available in system.io.fileinfo, or somewhere use simple length check. goes in called script not file watcher script. $lastlength = 1 $newlength = (get-item $filename).length while ($newlength -ne $lastlength) { $lastlength = $newlength start-sleep -seconds 60 $newlength = (get-item $filename).length }

php - How can I select a subset of values from an array using the values from another array as keys? -

this question has answer here: get array values keys 4 answers here's array of $keys : array ( [0] => 1 [1] => 3 [2] => 4 ) and $values : array ( [0] => red [1] => orange [2] => yellow [3] => green [4] => blue ) i want create new array of of values in $values using values in $keys keys: array ( [1] => orange [3] => green [4] => blue ) obviously can foreach values want, want make sure i'm not overlooking in plethora of php array functions. i've googled question, , answer comes using array_combine , won't achieve desired output. your appreciated :) flip $keys array make values keys , use array_intersect_key() : $result = array_intersect_key($values, array_flip($keys)); returns values $values have same keys flipped $keys .

javascript - catch rejection in $q service without triggering success callbacks -

i have method returns $q ( q ) promise: var subtypesmetadataresolved = restservice.getnodesubtypesmetadata(); now, when metadata available, want run 2 functions process them. first, thought chain them this: subtypesmetadataresolved.then(createnodes).then(preparedataforwidgets) but realized since both require data returned subtypesmetadataresolved promise need return data createnodes success callback it's passed preparedataforwidgets , not option. made this: subtypesmetadataresolved.then(createnodes) subtypesmetadataresolved.then(preparedataforwidgets) which works need. problem how rejection callback called when subtypesmetadataresolved rejected , don't neither createnodes nor preparedataforwidgets callbacks triggered in case? have following, after triggering nodesubtypesmetadataerrorcb triggers createnodes callback: subtypesmetadataresolved.catch(nodesubtypesmetadataerrorcb); subtypesmetadataresolved.then(createnodes) subtypesmetadataresolved.then(pre

emacs - Use orgmode agenda content in html -

i working on agenda , orgmode works great in of senses. unfortunatelly stalled in 1 point: export orgmode agenda content html. i know how export .org ics , works fine. know how export .org html , works. when export .org html miss content of agenda. mean, if have schedulled event, like: * convocatoria de proyectos visualizar15 deadline: <2015-04-05 dom> http://medialab-prado.es/article/tallervisualizar15proyectos the html is: convocatoria de proyectos visualizar15 http://medialab-prado.es/article/tallervisualizar15proyectos so miss content of deadline. not rewrite every date , use orgmode agenda content. is possible? best!

events - How to redraw gtk widget in python without calling gtk.main_iteration? -

my application have window handle key press events. when user press key run long tasks , during task update label on window. update label while task still running call following code. while gtk.events_pending(): gtk.main_iteration(false) this update label problem process events including key presses. if user press key while tasks running calling main_iteration start processing task. want should update label other events should not processed . events should processed when task completed. one way remove key press handler or in keypress handler check if task running ignore key presses in way keypresses lost. want somehow should update label leave other events , events should handled after task completed , application become idle. there way this? thanks you want .queue_draw() , related gtkwidget methods. note these mark widget needing redraw when main loop; don't think gtk+ has method drawing right now (but marking dirty , letting system redraw when it's r

javascript - Error calling forEach on array -

i getting problem foreach within anoter foreach function: the results variable contains object like: { names: [ 'someone', 'someone else' ], emails: [ 'someone@someemail.com' 'something@somemail.com' ] } i want unwind arrays , result in array this: [ {term: 'someone', type: 'names'}, ... ] here code: var keys = _.keys(results); console.log(keys); var finalresult = []; keys.foreach( function (key) { var arrterms = results[key]; console.log(key, arrterms); //arrterms prints fine arrterms.foreach(function (term) { //this line throws exception finalresult.push({ term: term, type: key }); }); }); the nested call foreach throws following exception: typeerror: uncaught error: cannot call method 'foreach' of undefined i tried using loop iteration till length, generated exception: typeerror: uncau

parsing - Is there a complete test for GLR parser? -

is there complete series tests test if glr parser correctly written? i'am writing glr parser, want find tests code. can't figured out complete test suit self because of missing conditions perhaps. i've written tests test parser. don't know if fail on other conditions. need "a complete test", may lot of people adding test cases test. promise parser can handle cases. glr parser can handle context-free grammar, lot of conditions needed tested.

Python issue when reading from a file -

hello doing school project , wrote out got working next task make read message file changed definition asked message usermessage() run code works prints out whats in text file when last bit gets final answer shows error traceback (most recent call last): file "c:\users\christian\desktop\python\2 keywor cypher code.py", line 138, in <module> restart() file "c:\users\christian\desktop\python\2 keywor cypher code.py", line 127, in restart text = translatemessage2(key2, message2, option) file "c:\users\christian\desktop\python\2 keywor cypher code.py", line 107, in translatemessage2 translated.append(symbol) # symbol not in letters, add translated is. nameerror: name 'translated' not defined import pyperclip valid_letters = 'zabcdefghijklmnopqrstuvwxy' # stores letters witch being used in program def linespacer(): print('================================================================')

Re arranging the columns in csv file in php -

i m reading csv file , updating csv file , saving it.i want rearrange columns in new file after second column want add tenth column before third ,but when m trying replacing second column tenth column not adding after second one.following code <?php $infile='file.csv'; $outfile='file_updated.csv'; $read = fopen($infile, 'r'); $write = fopen($outfile, 'w'); if ($write && $read) { while (($data = fgetcsv($read)) !== false) { unset($data[1]); $data[2]=$data[10]; fputcsv($write, $data); } } fclose($write); fclose($read); ?> why not make array of order want after , build new data array write. $order = array(1,2,10,3,4,5,6,7,8,9); while (($data = fgetcsv($read)) !== false) { $new = array(); foreach($order $index) $new[] = $data[$index]; fputcsv($write, $new); }

css - Why random margins between HTML Div tags -

Image
i trying fill data in div tag using angularjs loop. <div> <div class='box' ng-repeat="product in products | filter:{'scid': scid.tostring()}:true | orderby:'pname'"> <br> <b>{{product.bname}} </b> <br>{{ product.pname }} <br> <img src="http://localhost/{{ product.image_path }}" alt="" border=3 height=75 width=75></img> </div> </div> this css class. .box { margin : 5px; display : inline-block; width: 150px; height: 250px; background-color: grey; text-align:center; } but not rendering properly. (some random margin top , bottom) can doing wrong?? add vertical-align: top; to css

jdeveloper - Oracle ADF: af:selectOneChoice Hierarchy changes -

Image
i developing web application using oracle adf. in have page follows in above image have 2 select lists. first 1 country , second 1 state. requirement when user select value country list have add appropriate states states list programatically. suppose user has selected india need states in india ap, ka, mh, tn that. i have tried this post . fixed , need add values dynamically. please me in achieving this. in advance. tthe way approach though programatic view objects. adf build work best adf bc more exactly: create simple vo based on sql statement: select '' country, '' state dual for country attribute, need create programatic view object : countrylov. same thing state attribute - statelov. this not simple task, can find quite few examples around: http://andrejusb.blogspot.co.uk/2013/12/detail-view-object-instance.html http://adfpractice-fedor.blogspot.co.uk/2011/01/adf-bc-programmatically-populated-vo.html http://www.jobinesh.com/201

java - Multiple Attributes of same name - JAXB -

is possible have xmlattributes have same name. have annotated list property xmlattribute(name="default") returns as < test default="abc cdf bhy"> expecting return < test default="abc" default="cdf" default="bhy"> is possible that? unfortunately can't. not because of jaxb shortcoming xml attributes cannot have multiple values definition. , xml strict regarding rules. the best workaround redefine attribute element. otherwise when need read attribute, you'll need parse , break value multiple tokens wouldn't recommend awkward , brittle.

java - Does Glassfish server consist of a webserver also? -

according defintions have read web server can serve http requests (e.g apache). a web container can serve servlets , jsps etc. since tomcat can both serve http requests , serve servlets , jsps considered both web server , web container. application servers jboss, glassfish fledged java ee servers include other containers apart web container. now in order application server glassfish work on own, needs web server(an http server) built it. therefore should contain webserver work on won, , if doesn't contain webserver built it, there should way plug existing web servers apache application server. what actual implementation? include webserver or should plug webservers these java ee application servers? yes, includes full web tier. java servlet spec covers of this.

Is it still possible to retrieve the user url using the YouTube Data API (v3) -

i've heard new youtube data api (v3) not retrieve user url anymore? correct? i product owner of community software , enrich public profile of user social network content. so example community member want connect community account youtube account (google+) can display , share url of youtube account other community members. thanks with channels.list method, you'll both g+ username channel url.