Posts

java - How to respond with the result of an actor call? -

we looking @ using akka-http java api - using routing dsl. it's not clear how use routing functionality respond httprequest; using untyped akka actor. example, upon matching route path, how hand off request "handler" actorref, respond httpresponse in asynchronous way? a similar question posted on akka-user mailing list, no followup solutions such - https://groups.google.com/d/msg/akka-user/qhe3ko7evvg/kc-akz_o5aoj . this can accomplished combination of oncomplete directive , ask pattern. in below example requesthandleractor actor used create httpresponse based on httprequest . actor asked within route. i have never used java routing code response in scala. import scala.concurrent.duration._ import akka.actor.actorsystem import akka.http.scaladsl.model.httpresponse import akka.http.scaladsl.model.httprequest import akka.actor.actor import akka.http.scaladsl.server.directives._ import akka.actor.props import akka.pattern.ask import akka.util.timeo...

foreach - Why/How does a lodash "[iteratee=_.identity] (Function)" in _foreach have a 'mystery' third param? -

i getting hang of lodash.js first time today , have discovered can access 'value' 'index' , 'list' within iterator function. i came across when using _.foreach function. for example: _.foreach(omyarray, function(value, index, list){ ... }) however api specifies 2 params "n" , "key" when dealing objects. why no mention of third? ? api link has 3 arguments listed right there: the iteratee bound thisarg , invoked 3 arguments: (value, index|key, collection)

sql - Can anyone tell me what is wrong with my query? -

select t1.description, t1.type, t1.salespotential , t2.startdate, t3.project_region, t3.job_type sysdba.opportunity t1, select t1.type, count(*) opportunity group by type, join sysdba.activity t2 on t1.accountid = t2.accountid join sysdba.c_opportunity_ext t3 on t1.opportunityid = t3.opportunityid closeprobability > 70 the line "group by type," has bad syntax. use 1 by. type reserved word. if refers field, use `type` (surround field name ` character). comma @ end shouldn't there. group `type` if using mysql, it's practice put sub-queries inside parentesis. becomes "derived table" , needs name. i've used "sometemptable" in example: (select t1.type, count(*) opportunity group `type`) sometemptable

internet explorer 9 - Add Class to parent, jquery and IE9 -

so simple, can't work in ie9. ive read tons of answers , nothing seems work. need add class elements parent, seems simple right? in other browsers, trick: $('#trigger').click(function(e){ e.preventdefault(); $(this).parent().addclass('bar'); }); not in ie9. solutions ive found don't work either: $('#trigger').click(function(e) { e.preventdefault(); var item = $(this).closest("li"); $(item).addclass('bar'); }); here's fiddle try in ie9 this working in ie9 $('#trigger').click(function(e) { e.preventdefault(); var item =$(this).parent('li'); $(item).addclass('bar'); }); <ul> <li class="foo"> <a href="javascript:void(0)" id="trigger">click me</a> </li> <li>other shit</li> </ul>

sql - MySQL checking last updated time on multiple devices -

i check last update date , time (recordtime) every treehugger id (treehuggerid) , below did. output not last update time according below query. please advice. thank you. select `recordtime`, distinct `treehuggerid` `sensor_treehuggers` `treehuggerid` < 20000 , `treehuggerid` > 10000 order `recordtime` desc you have select max(recordtime) every treehuggerid , don't need distinct select treehuggerid,max(recordtime) sensor_treehuggers then @ end group treehuggerid like this select treehuggerid,max(recordtime) sensor_treehuggers treehuggerid between 10000 , 20000 group treehuggerid

postgresql - How do I filter jsonb with multiple criteria? -

i have following table structure: create table mytable ( id serial primary key, data jsonb ); and following data (partial brevity...notice randomness of years , sales/expense yrs don't align each other): insert mytable (data) values ('{"employee": "jim romo", "sales": [{"value": 10, "yr": "2012"}, {"value": 5, "yr": "2013"}, {"value": 40, "yr": "2014"}], "expenses": [{"value": 2, "yr": "2007"}, {"value": 1, "yr": "2013"}, {"value": 3, "yr": "2014"}], "product": "tv", "customer": "1", "updated": "20150501" }'), ('{"employee": "jim romo", "sales": [{"value": 10, "yr": "2012"}, {"value": 5, "yr": ...

c# - How to stop the creation of a table when mapping to a stored proc MVC -

i have codefirst mvc 5 application. there spatial query involved, have wrapped in stored proc. using new class, i've mapped results of stored proc call model use in views. however, codefirst wants create new table model class. how prevent that? should bother (i'm never writing table or updating table.) model class: public class conflict { [key, column(order=0)] public int projectid { get; set; } [key, column(order=1)] public int conflictprojectid { get; set; } [datatype(datatype.date)] [displayformat(dataformatstring = "{0:dd/mm/yyyy}")] [display(name="start")] public datetime startdate { get; set; } [datatype(datatype.date)] [displayformat(dataformatstring = "{0:dd/mm/yyyy}")] [display(name = "end")] public datetime enddate { get; set; } public virtual project project { get; set; } } stored proc call: public actionresult index(int d = 0, int r = 0, int p = 0, bool f...