Posts

publish subscribe - Meteor Group Collection by Field -

i trying return collection (postings) grouped field (status). pretty new mongo , meteor. query below gives me collections grouped status # of docs status... want same thing have actual documents in there. also, able publish/subscribe reactivly update. creating admin dashboard groups postings current status. a friend provided following gist, bit on head: https://gist.github.com/ryw/8827179 db.postings.group({ key: {status: 1}, initial: {sum:0}, reduce: function(doc, prev) { prev.sum += 1; } }) thanks! if need of documents on client, publish whole collection , let template code group them. client tracker.autorun(function() { if (meteor.user()) { meteor.subscribe('allpostings'); } }); template.admin.helpers({ postings: function() { if (session.get('currentstatus')) { return postings.find({status: session.get('currentstatus')}); } }, statuses: function() { return _.uniq(_.pluck(postings.find().fetch(), ...

jsf - How to save only one item of select many check box? -

when offer create oferta object (offer) saves of items in select many check box (this location per company selected(empresa)), not checked ones: thank can provide. <h:outputlabel value="#{bundle.createofertalabel_empresaidempresa}" for="empresaidempresa" /> <h:selectonemenu id="empresaidempresa" value="#{ofertacontroller.selected.empresaidempresa}" title="#{bundle.createofertatitle_empresaidempresa}" required="true" requiredmessage="#{bundle.createofertarequiredmessage_empresaidempresa}"> <f:ajax event="valuechange" execute="empresaidempresa" render="ubicacioncollection" /> <f:selectitems value="#{empresacontro...

mysql - whats wrong. when i call foreign key -

create table applicant ( applicant_id varchar(10) not null, applicant_name nvarchar (25) not null, father_name nvarchar (25), gender nvarchar (15), applicant_dob datetime, qualifaction nvarchar (45), application_id varchar (15), primary key (applicant_id, applicant_name) ); create table application ( application_id varchar (10), application_name nvarchar(25), applicant_id varchar (10), applicant_name nvarchar (25), primary key (application_id) ); create table cell_number ( cell_no varchar (15) not null , applicant_id varchar (10), applicant_name nvarchar (25), primary key (cell_no) ); alter table cell_number add constraint fk_applicant_id foreign key (applicant_id) references applicant (applicant_id); alter table cell_number add constraint fk_applicant_name foreign key (applicant_name) references applicant (applicant_name); show error msg 1776, level 16, state 0, line 34 there no primary or candidate keys in referenced table 'applicant' match referencing co...

linux - pipe array of json objects as a map of single post, using curl -

i have 2 nodes having same rest+json api ( not jsonapi.org btw ) one of them has many products in /products other has [] in /products i want pipe products of 1 node ( say: http://localhost:9080/products ) other 1 ( http://localhost:8080/products ) operation must happen on command line this should solved problem ? i think so, not know yet , have not find solution yet... what experimented work , found ugly for f in $( curl http://localhost:9080/products | jq -c '.[]' | sed -e 's/ /\\_/g' ); echo $f | sed -e 's/\\_//g' | curl -i -h content-type:application/json http://localhost:8080/products --data @-; done the above uses jq json parser curl http://localhost:9080/products | jq -c '.[]' emits each products of collection the ugly sed hack meant tackle label fields "label":"what favorite color?" it job on small set of products, , still i'm not happy it what did miss ? what expect of response shou...

asp.net - .NET Exception Page Not Human Readable -

this question has answer here: asp.net mvc: weird characters in error page 1 answer i'm running local dev server on windows 7 iis 7.5, .net 4. exceptions on 1 of sites don't come out normal yellow background red font screen, bunch of symbols aren't legible. i've never had happen on other computer, it's difficult describe. �x�o�8����q��5m�x�utc�&����銐����;�n����~�nڦ[v�t��isc����l�����������q���v���#�g76�d�9��̀ ,��3s�4fa<����&4'���la��b�i%l��y'�n)���)��et��smcdz�r�(u.a���3��[a��k���w��1h7shre���3&���l�&�����f���o����Ľ���� a�dl�h��y��q��/��9(!*�����(��lh��0��[^tk#n�{���9e��t�qmp��wb1��ml�"����vp��9;�4�ʴ׮e�r( �f x��� �i"��8�Ʉ�ʔ�f���xu� Ԋ����� �9\ �:d1��~���������hl|!u̢lj����ƭ@fr���4���ʺyb�j���}usj���Ԃk���,�dnϩ�4tk-�/b9(d�8a3f���|x���̞�ea ���mk0h�wɩ,5��17xu���@u�xb�d��"��]t�ĺ=������m?w�݀ޮ �]˷�|��b0r!...

Javascript Convert Unicode Embedded strings -

i'm getting passed string api method have no control on returns strings paths like: /toplevel/nextlevel/_x0034_33name/myoutput.log it seems happens directory names start number. in case directory name should '433name'. i'm guessing x0034 represents hex character '4', possibly in unicode. the following javascript returns '4', correct: string.fromcharcode(parseint("0034",16)) is there regex command or conversion utility in javascript readily available remove , replace these characters in string correct equivalents? function unescapeapi(string) { return string.replace(/_x([\da-f]{4})_/gi, function(match, p1) { return string.fromcharcode(parseint(p1, 16)); }); } # example, logs '/433name/myoutput.log' console.log(unescapeapi('/_x0034_33name/myoutput.log'));

html - "Fullscreen" height <textarea> in CSS -

i'm not best @ using css solve these problems, , wondering if give me hand. right now, i'm trying build pastebin project entirely in php. php part working great can't this. anyway, point. i have textarea tag want fill whole of screen except drop down box , submit button, regardless of resolution / zoom. here source code i'm using. index.php: http://pastebin.com/dzjkfg0t style.css: http://pastebin.com/mdhyg7xi massive can help! here css problem: * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; padding: 0; margin: 0; } body { background-color: #0099cc; color: #ffffff; font-size: 180%; margin: 10px; } .centre { text-align: center; } textarea { /* position inherited */ left: 0; top: 0; right: 0; bottom: 100px; /* height of select , input */ width: 100%; } also, jsfiddle wth full code: http://jsfiddle.net/a3um2/