Posts

sql - Esqueleto count inside select -

i have following entities : group name text groupuser user userid group groupid and query this: select g.* /* g */ , count(gu.id) groupuserscount group g left outer join groupuser gu on gu.groupid = g.id group g.id can done esqueleto ? the esqueleto docs groupby contain examples of how use it. moreover, reading through getting started section, you'll see several example of queries including equivalent of table.* : do people <- select $ $ \person -> return person putting 2 means should work: select $ \(g `leftouterjoin` gh) -> on (gu ^. groupid ==. g ^. id) groupby (g ^. id) return (g, countrows)

javascript - 401 unauthorized except through browser -

i've been trying html request, using url works in browser somehow results in 401 unauthorized error when run code. problem did provide authentication; url of form http://username:password@url?param=value it succeeds in firefox , chrome (i went through incognito mode avoid cookies), google's postman app, despite trying several other http request methods return unauthorized error. i've run through rest api , xmlhttprequest, command line. any ideas on causing this? or, better, if someone's had similar problem , has solution? (note: i'm pretty new whole thing, not sure if clear/detailed enough. i'll best elaborate if needs.) edit: here's idea of original code running: var func = function() { var options = { baseurl: server, uri: '/device.cgi', qs: { param1: value1, param2: value2 } }; request(options, function(err, response, body) { if (err) console.log(err); else console.log(body); }); }; ...

javascript - How to make SmoothScroll for website pages? -

i developing website , have question. customer wants make more smooth scrolling on site. example, browser chrome, has special extension smoothscroll . prompt me if there similar website, can script or library? as far question can offer check repo here: smooth scrolling you can declare step, speed, ease, targets...it pretty library :) , have browser , os detection functionality

asp.net mvc - Adding value to a list of item in a class c# -

below 3 methods, public class abcorder { public items items { get; set; } } public class item { public string orderrefno { get; set; } public string sku { get; set; } public string qty { get; set; } } public class items { public list<item> item { get; set; } } now want assign below, abcorder.items.item.add(new item { orderrefno = "12345", sku = "sk8765", qty = 3 }); but getting items null in abcorder.items .please help. first, don't understand why have items class. why not make abcorder class have list property? but problem never initialized objects. can't use object if never created it. easiest way in class constructor, this. public class abcorder { public abcorder() { items = new items(); } public items items { get; set; } } public class items { public items() { item = new list<item>(); ...

javascript - Setting mock location from Cordova Android -

is there way set mock location coordinates cordova? perhaps there plugin this? i developed app needed mock location, , lot of testing using localhost in iis before testing on device or emulator. global variable _testlocalhost = true i have function called isrunninglocalhost() , check anytime if need mock data. have use similar technique when testing on published apps.

javascript - d3 pie chart not displaying all labels -

Image
i trying simple pie chart labels inside slices. can display labels not all. e.g. in sample code have rick 5%, paul 4% , steve 3% not displayed because of small size of slices. how can overcome problem? <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>testing pie chart</title> <!--<script type="text/javascript" src="d3/d3.v2.js"></script>--> <script src="../js/d3.min.js" type="text/javascript"></script> <style type="text/css"> #piechart { position:absolute; top:10px; left:10px; width:400px; height: 400px; } #linechart { position:absolute; top:10px; left:410px; height: 150px; } #barchart { position:absolute; ...

javascript - how to determine if gulp watch is running -

i run gulp on server in background running gulp & but fail down. mi question is: there command gulp ask if running. gulp status thanks there nothing special in gulp limit running multiple processes or alert running gulp process. use regular unix techniques check if process running. use supervisor supervisord or runit automatically restart processes. #the program pidof set variable $? either #1 or 0 in bash depending on if finds process #with name. print out matching #process ids command line pidof gulp echo $? #1 if there no process called gulp #0 if there process called gulp if pidof gulp; echo 'gulp alive'; else echo 'we need support on here!' ./node_modules/.bin/gulp watch & sleep 3 fi