Posts

.net - If one product belong to two or over categories. How show the category Breadcrumbs at product page? -

i meet question: if customer view 1 product under category, product belong 2 categories, show first [0] category name @ breadcrumbs. how show product breadcrumbs, if customer browse products under category2, @ breadcrumbs show home/category2/productname, not home/category1/productname, think customer feeling strange that, saw website greatfactoryz.com , product breadcrumbs show categories home/[category1] [category2]/productname, don't think solution, has solution ideas?

javascript - Typescript, NodeJS, ES6 - findIndex on array -

so have issue using findindex es6 function on array in typescript , nodejs. the error message i'm getting is: requesttype.findindex not function this code: let weatherstates:array<string> = ['current', 'forecast']; let requesttype:string = 'current'; requesttype.findindex(weatherstates); and error gets thrown, i'm able use sorts of other es6 functionalities though, arrow functions etc. it looks polyfill available in lib.core.d.ts typing though. here mytsconfig.json setup: { "compileroptions": { "module": "commonjs", "target": "es6", "sourcemap": true }, "exclude": [ "node_modules", "typings" ] } i'm new typescript appreciated! requesttype not array in example. string.

javascript - React-Redux connected component not passing updated props to child component -

child components (mapleftnav, map) not rerendering when application state changed. has parent component (mapview) , several siblings. assumptions: 1) app state changing , being tracked redux the action showing in redux dev tools, updated fields; i'm logging vehiclesstate in parent component (mapview), changing; 2) reducer not mutating state ( gist here ) -redux dev tools , parent ( connect ed compoent) happily picking changes case new_messages: return reducevehiclemessagestovehicles(state, action.payload) and function returns: return { vehicles: updatedvehicles, traces: updatedtraces, vehiclemessagesloading: messagesloading, } 3) parent component ( mapview, gist here ) receiving new props not child mapleftnav i console.log props , change in parent component i write fake componentwillreceiveprops (nextprops) {console.log(nextprops)} , function never fired child mapleftnav component. <mapleftnav mapstate={mainmap} push={push} vehicles...

android - onItemClickListener stops working after changing visibility of item child -

<?xml version="1.0" encoding="utf-8"?> <relativelayout /* not important */> <textview /* not important */ /> <textview /* not important */ /> <relativelayout /* not important */ android:id="@+id/detaillayout" android:visibility="gone"> <textview /* not important */ /> </relativelayout> </relativelayout> . private class itemclicklistener implements adapterview.onitemclicklistener { @override public void onitemclick(adapterview<?> parent, view view, int position, long id) { relativelayout detaillayout = (relativelayout) view.findviewbyid(r.id.detaillayout); int detaillayoutvisibility = detaillayout.getvisibility(); if(detaillayoutvisibility == view.gone) { detaillayout.setvisibility(view.visible); } else { detaillayout.setvisibility(view.gone)...

c++ - gcc-5.2 cilk plus offload to intel gfx hardware -

can offload graphics hardware using cilk plus gcc-5.2 g++ -std=c++14 -wall -o3 -march=native -fcilkplus vec_add.cpp -o vec_add vec_add.cpp:6:0: warning: ignoring #pragma offload target [-wunknown-pragmas] #pragma offload target(gfx) pin(out, in1, in2 : length(n)) the compiler gives above warning following test code: #include <iostream> #include <cilk/cilk.h> void vec_add(int n, float *out, float *in1, float *in2) { #pragma offload target(gfx) pin(out, in1, in2 : length(n)) cilk_for(int = 0; != n; ++i) { out[i] = in1[i] + in2[i]; } } static int ar_sz = 100000; int main (int argc, char **argv) { float foo[ar_sz]; float bar[ar_sz]; float out[ar_sz]; for(int = 0; != ar_sz; ++i) { foo[i] = + ar_sz * 10; bar[i] = i; } vec_add(ar_sz, out, foo, bar); for(int = 0; != ar_sz; += 100) { std::cout << "foo[" << << "] =" << foo[i] << "\t|\tba...

mysql - One to Many Join with Aggregate Function (Max) -

i have 2 tables. table 1: +---------+---------+ | lead_id | deal_id | +---------+---------+ | 2323 | null | | 2324 | 1199 | | 2325 | null | | 2326 | null | | 2327 | 1080 | +---------+---------+ table 2: +---------+-------------+-------------+------------+ | deal_id | stage_from | stage_to | changedate | +---------+-------------+-------------+------------+ | 1199 | incoming | stage1 | 01-dec-14 | | 1199 | stage1 | incoming | 05-dec-14 | | 1199 | incoming | stage1 | 12-dec-14 | | 1080 | incoming | unqualified | 06-dec-14 | | 1080 | unqualified | stage2 | 07-dec-14 | i add "changedate" each deal_id has record in table 2 stage changed "incoming" "stage1". in cases stage changed "incoming" "stage1" multiple times, want maximum date i.e. december 12, 2014 in example rather december 1, 2014. resulting table should be: +---------+---------+-...

.htaccess - Why does my Url doesnt drop the current page instead it adds it with the new Link -

Image
hi have written htaccess rule based on sources problem wanted have clean url have done problem doesn't work see image below i'm on service page atmt if wanted go page the url doesnt drop 1st link instead goes next page adding new link causing not found error.. i've been having hard time finding solution 1 can please tell me did go wrong rule on htaccess doing this? here .htaccess rewriteengine on rewritebase / rewritecond %{http:x-forwarded-proto} !https rewritecond %{https} off rewriterule .* https://%{http_host}%{request_uri} [l,r=301] rewritecond %{http_host} !^www\. rewriterule ^ https://www.%{http_host}%{request_uri} [l,r=301,ne] rewritecond %{the_request} \s/*(.*?)/index\.php [nc] rewriterule ^ %1/ [r=302,l] rewritecond %{the_request} \s/+(.+?)\.php[\s?] [nc] rewriterule ^ /%1/ [r=302,l] rewritecond %{request_filename} !-f rewriterule ^[^.]*?[^/.]$ %{request_uri}/ [l,r=302] rewritecond %{request_filename}.php -f rewriterule ^([^.]+?)/?$ $1.php [l]...