Posts

How to generate dynamic LINQ queries with GroupBy and Aggregates (SUM, COUNT, AVG)? -

the following code generates dynamic linq queries simple .where clauses involving field , value. extend class able generate groupby , equivalent of "having sum(amountfield)" or "having count(field)". in essence should generate equivalent of: _people.groupby(c => c.name) .where(grp => grp.count() > 1) .select(grp => grp.key); or _orders.groupby(c => c.custid) .where(grp => grp.sum(x => x.amount) > 100) .select(grp => grp.key); can help? here code i'm using: public class expressioncriteria<t> { list<expressioncriterion> _expressioncriterion = new list<expressioncriterion>(); private string _andor = "and"; public expressioncriteria<t> and() { _andor = "and"; return this; } public expressioncriteria<t> or() { _andor = "or"; return this; } ...

javascript - How can I change the body of template in meteor with a html on another template? -

i'm trying generate many graph on template, first graph default , i'd when click on zone generate graph exist in template. how can ? i try return template other grahp. template.test.events({'click .zone' : function (e){ console.log("j'ai cliqué sur le template test ... on va essayer d'ouvrir une pop up"); e.preventdefault(); //$('#animalsmodal').modal('show'); return {template: template[creategraph]}; }}); you can use template.dynamic purpose. //html <template name="graphdisplayer"> {{> template.dynamic template=helpertogetdynamictemplate}} </template> //js template.graphdisplayer.oncreated(function(){ this.templatenameofgraph = new reactivevar('yourdefaulttemplate'); }); template.graphdisplayer.events({ 'click .zone':function(e,t) { t.templatenameofgraph.set('yourothertemplate'); } }); template.graphdisplayer.helpers({ helpertogetdynamictemp...

mysql - PHP Laravel Task Scheduling Best Practice -

i building simple application schedule ad set enabled / disabled based on time user inputs. for example, user may want have ads run 6 - 9 , 5 pm - 10 pm , off @ other times. what best way schedule this? store of data in mysql, should have cron/task checks every minute rows in table match time , function enable/disable? to continue example, table might contain columns, time, function. 6 am, enable 9 am, disable 5 pm, enable 10 pm, disable my question if have 10,000 users or so, web server or there more efficient way this? in below approach, doing is... there 2 tables - ads , ad_timings saves different start_time , end_time each ad... where saving start_time 0600 , end_time 0900 . so, you'll check if current time (say, 2016-23-12 06:50:11 )... convert 0650 . now find out ads start_time less 650 , end_time more find out active ads , reverse ads stop. run every 10 mins... give each user minimum input time interval of 10 mins... way run cron every ...

ios - Objective-C pointer and swift -

i'm following apple document , unfortunately examples written on objective-c, have confidence swift language , can not understand meaning of things, in particular, in example: void runloopsourcesperformroutine (void *info){ runloopsource* obj = (runloopsource*)info; [obj sourcefired]; } this line: runloopsource* obj = (runloopsource*)info; the parameter: void *info indicates info pointer void, can put address of type of data structure, following various apple documents saw translation of : void *info swift language : info: unsafemutablerawpointer? now, runloopsource* obj = (runloopsource*)info; line indicates obj variable of type: runloopsource, , assigned value of (runloopsource *) info , precisely mean statement? : (runloopsource *) info , , how translates in swift language ? what dealing ( void *info ) c pointer-to-void , arrives swift form of unsaferawpointer. means type info has been cast away , memory being managed elsewhere. in order ...

powerpivot - Reduce the size of Very Large Excel Data Model -

hi created data model 295k rows , 27 columns comes out 17 mb when ran power pivot table. after adding table 227k row data model sudden data size jumps on 42 mb? can advise me on how reduce size of data model... thanks there's few options. reference recommend reading this article discusses powerpivot's compression techniques. powerpivot more columns rows. fewer distinct values have in columns, better. can roll-up of dimensions or rid of columns before importing data? reduce rows aggregating data. need detail, 275k rows, in order run analysis? you'd surprised if take critical look, how little might need.

c - Program memory space is being overwritten -

i writing firmware atmel mega645a controller using atmelstudio7. have bunch of messages display on 16x2 character display. in order preserve sram space, attempting store these messages in rom program memory. problem seems overwriting parts of program memory being used other code. here details: i have following statements near beginning of main program: #include "adht.h" #include "languages.h" in adht.h have following: #include <avr/pgmspace.h> i believe nut of problem in header file languages.h, created. in languages.h have hundreds of lines of code this: const char m1_1_1[] progmem = {32,32,32,32,69,110,116,101,114,105,110,103}; const char m1_2_1[] progmem = {32,32,83,116,97,110,100,98,121,32,77,111,100,101}; const char m2_1_1[] progmem = {32,32,70,87,32,82,101,118,105,115,105,111,110}; const char m2_2_1[] progmem = {32,32,32,32,40,110,117,109,98,101,114,41}; const char m3_1_1[] progmem = {32,78,79,46,32,79,70,32,84,72,69,82,65,80,89}; c...

android - Call Google Place Api on EditText -

i using google place api in app , working perfactly when using fragment want call functionality on click on edittext how call that? placepicker.intentbuilder builder = new placepicker.intentbuilder(); mgoogleapiclient = new googleapiclient .builder(this) .addapi(places.place_detection_api) .enableautomanage(this, this) .build(); try { startactivityforresult(builder.build(this), place_picker_request); } catch (googleplayservicesrepairableexception | googleplayservicesnotavailableexception e) { e.printstacktrace(); } pendingresult<placelikelihoodbuffer> result = places.placedetectionapi .getcurrentplace(mgoogleapiclient, null); result.setresultcallback(new resultcallback<placelikelihoodbuffer>() { @override public void onresult(placelikelihoodbuffer likelyplaces) { (placelikelihood placelikelihood : likelyplaces) { } ...