Posts

ractivejs - How to loop in ractive.js -

i have got following data (sample): "data": { "eventsheading": "upcoming events", "eventstobedisplayed": 3, "alleventlinktext": "see events", "eventslist": [ { "eventdate": "22/12/2015", "eventtitle": "event info 1" }, { "eventdate": "22/12/2015", "eventtitle": "event info 2" }, { "eventdate": "14/01/2016", "eventtitle": "event info 3" }, { "eventdate": "14/01/2016", "eventtitle": "event info 4" } ] } and have this: {{#eventslist}} <tr> <td class="date-column">{{eventdate}}</td> <td class="text-link truncate-text"><span decorator="tooltip:{{e...

node.js - Mongodb Query error -

i have collection named configuration, configuration has ostype, want calculate ostype , group on company using solution return configuration.distinct("ostype").then(function (name) { var types = name var groupobj = {"$group": {"_id": "$company.name"}}, projectobj = {"$project": {"_id": 0, "company": "$_id.company"}}; var grouppipeline = types.reduce(function (obj, type) { // set group pipeline object obj["$group"][type + "_count"] = { "$sum": { "$cond": [{"$eq": ["$type", type]}, 1, 0] } }; return obj; }, groupobj); return configuration.aggregate([grouppipeline]).then(function (result) { return {status: true, code: 200, message: "configuration count", data: result} }); i getting error "message": "exception: group aggregate field name '8.1_count' canno...

google maps - Current Location button is not showing -

i using google map v2 in android app tab(viewpager) , want show current location in map couldn't find button. addmasjid.java package com.example.saroosh.masjidnow.tabs; import android.support.annotation.nullable; import android.support.v4.app.fragment; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import com.example.saroosh.masjidnow.r; import com.google.android.gms.maps.cameraupdatefactory; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.mapfragment; import com.google.android.gms.maps.mapview; import com.google.android.gms.maps.mapsinitializer; import com.google.android.gms.maps.onmapreadycallback; import com.google.android.gms.maps.model.latlng; import com.google.android.gms.maps.model.markeroptions; public class addmasjid extends fragment implements onmapreadycallback{ mapview gmapview; googlemap gmap = null; @override public view oncreateview(la...

javascript - D3 Bubble Chart 'bubble.nodes not a function' -

i'm following mike bostock's tutorial here create bubble chart... except i'm using own dataset , i'm using d3 v4. i'm quite new d3 , understand lot has changed in v4 v3. i'm having trouble converting sample code v4. for instance, i've converted code in d3 v3: var bubble = d3.layout.pack() .sort(null) .size([diameter, diameter]) .padding(1.5); to: var bubble = d3.pack(dataset) .size([diameter, diameter]) .padding(1.5); is above correct? i'm not sure since i'm not having errors till point. but error in following piece of code: var node = svg.selectall(".node") .data( bubble.nodes(root) .filter(function(d) { return !d.children; }) ) .enter() .append("g") .attr("class", "node") .attr("transform", function(d) { return "translate(" + d.x + ...

php - Copy(): File name is longer than maximum allowed path ... Base64 image -

i have "drag & drop" image uploader. sending image module via ajax "base64 image" , use "copy()" move image. for example: copy($image_in_b64, $destination); it returns copy(): file name longer maximum allowed path length on platform (4096): data:image/jpeg;base64,/9j/4qayrxhpzgaasukqaagaa ... everything works perfect on local server not able upload on deployed server. how can fix this? in server config (what)? thank comments, had encode image , had upload it. solution: $data = //image in base64 list($img_type, $data) = explode(';', $data); list(, $data) = explode(',', $data); $data = base64_decode($data); file_put_contents($path, $data);

c++ - zlib compilation error with VxWorks 6.8 -

i trying use gzip compression feature on vxworks 6.8. vxworks development guide give says, you can add gzip compression feature system independently of wind river web server adding zlib library files project. so, add files installdir/components/webcli-4.x/target/src/wrn/wm/common/zlib project. use -dwith_zlib compiler flag when build system. i tried getting build errors ../zlib/zlib_adler32.cpp:21: error: 'z_ulong zlib_z_adler32' redeclared different kind of symbol ../zlib/zlib.h:822: error: previous declaration of 'z_ulong zlib_z_adler32(z_ulong, const z_bytef*, z_uint)' ../zlib/zlib_adler32.cpp:25: error: expected unqualified-id before '{' token c:\windriver\utilities-1.0\x86-win32\bin\make.exe: *** [.../zlib/zlib_adler32.o] error 1 note : files .c extension, changed .cpp , using c++ compiler. functions declared extern "c" declaration of function can checked here zextern ulong zexport adler32 of((ulong adler, cons...

c# - ASP net 4 search and render the result in modal bootstrap -

how input text field , when click in button show result modal bootstrap using mvc? have follow class: class vatsearch{ [required] public string vatnumber { get; set; } } controller: [httppost] public partialviewresult searchvatpartialview() { return partialview("searchvatpartialview"); } public jsonresult adduserinfo(searchvatpartialview model) { vatresponse result= new vatresponse(model.country,model.vatnumber) return json(result); } } and have view form result <form id="myform"> @html.labelfor(m => m.name) @html.textboxfor(m => m.name) @html.labelfor(m => m.address) @html.textboxfor(m => m.address) </form> function adduserinfo() { $.ajax({ url: '@url.action("adduserinfo", "home")', type: 'post', data: $("#myform").serialize(), success: function(data) { if (data.result) { $(':input...