Posts

c# - Cuda thrust - xutility: name followed by "::" must be a class or namespace -

i use thrust reduction in cuda application. hence include header , call function: #include <thrust\reduce.h> __host__ void reduction(){ unsigned int t = 0; thrust::reduce(t,t); } however compile errors (only 1 type): "name followed "::" must class or namespace". problem file called xutility (which haven't touched). errors related follow class definition: // template class iterator_traits template<class _iter> struct iterator_traits { // traits iterator _iter typedef typename _iter::iterator_category iterator_category; typedef typename _iter::value_type value_type; typedef typename _iter::difference_type difference_type; typedef difference_type distance_type; // retained typedef typename _iter::pointer pointer; typedef typename _iter::reference reference; }; i not template programming. doing wrong? thrust routines designed invoked host side rather in kernels. see example of usi...

Wordpress Loop target individual item hover -

have got stuck on little problem, managed wordpress looping correct stuff.. , works fine. problem have got when try target individual item on hover. ive got jquery script working targets them all.. know ive got to change loop not sure im surpose do.. heres code anyway. great if guys help.. thanks wordpres loop <?php $i = 0 ?> <?php query_posts('showposts=3'); ?> <?php if(have_posts()) : while (have_posts()) : the_post(); ?> <?php if( $i == 3 ) : ?> <div class="row"> <?php endif; ?> <div class="col-lg-4 col-md-4"> <a href="<?php the_permalink(); ?>"> <div class="miniwork"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ...

Imported jar in gradle, compiles, but not recognized by Android Studio (0.2.10) -

this annoying one. have simple project structure based on gradle, similar other projects have. project has these imports: dependencies { compile 'com.android.support:support-v4:13.0.+' compile files('libs/jackson-annotations-2.1.0.jar') compile files('libs/jackson-core-2.1.0.jar') compile files('libs/jackson-databind-2.1.0.jar') compile files('libs/zip4j_1.3.1.jar') compile files('libs/httpclient-4.1.3.jar') compile files('libs/httpclient-cache-4.1.3.jar') compile files('libs/httpcore-4.1.4.jar') compile files('libs/httpmime-4.1.3.jar') compile project(":grid_lib") } which works well. the problem android studio not recognize classes, in red , have no intel. very annoying! i've been banging head against wall long, i'm trying here now. guys? ideas? thanks :-) edit i've answered own questions, find same problem. well, answer own...

html - Selecting all but children -

i've got html structure this: <div class="foo"> <ul> <li> <a href="link.bar">good</a> <ul class="children"> <li> <a href="otherlink.baz">bad</a> </li> </ul> </li> </ul> </div> now want select "good" a without selecting "bad" a (using jquery). i've tried .foo ul:not(.children) li a doesn't work (obviously). possible achieve in one-liner? fiddle you direct descendant .foo > ul > li > a

oop - c# OO advice for inherited attribute classes -

i oo correct advice please. correct way of accessing attribute data inherited classes. assuming 3 classes: public abstract class vehicle { public int id {get; set; } public int wheels {get; set; } public string name {get; set; } public string color {get; set; } } public class car : vehicle { } public class truck : vehicle { public int loadcapacity {get; set; } } my first thought create repository of kind gives me attributes of whatever i'm looking for. there 2 types of queries see need: return attributes of vehicle specific id give me vehiclesof specific type so: public class vehiclerepository { icollection <???> _vehicles; ??? getvehicle(int id); ??? getvehicles(??? vehicletype); } the ??? unknowns. my thought add interface ivehicle , implement vehicle it. result like: public class vehiclerepository { icollection <ivehicle> _vehicles; ivehicle getvehicle(int id); icollection <ivehicle> ge...

Multiple nested JQuery UI Accordion generated through Knockout template does not bind correctly -

i'm trying multiple-nested accordion control work knockout when adding panels items created through ko bindings not bind accordion new panels. the code looks this: <div data-bind="accordion: {collapsible: true, active: false, heightstyle: 'content'}, template: { name: 'querytemplate', foreach: children }"> </div> <script id="querytemplate" type="text/html"> <h3> <div> <a href="#" data-bind="text: id"></a>&nbsp; <span data-bind="text: name"></span>&nbsp; <button data-bind="click: addnext">add next item</button> </div> </h3> <div > <input data-bind="value: name"></input> <input data-bind="value: id"></input> <button data-bind="click: addsubitem">add sub...

scala - How to permute all combinations involving both lists, with each element preserved at their respective indices? -

i'd transform list - example: val = list(x,y,z) val b = list(x1,y1,z1) desired output list(list(x1,y,z),list(x,y1,z),list(x,y,z1),list(x1,y1,z), list(x1,y,z1),list(x,y1,z1),list(x1,y1,z1)) the order preserved - hence built-in combinations function wouldn't useful. there concise way of doing scala? def permut[a](l: list[(a,a)]): list[list[a]] = l match { case nil => list(list()) // or nil :: nil case (a,b) :: tail => val t = permut(tail) t.map(a :: _) ::: t.map(b :: _) } val = list("x0", "y0", "z0") val b = list("x1", "y1", "z1") scala> permut(a zip b) res22: list[list[string]] = list(list(x0, y0, z0), list(x0, y0, z1), list(x0, y1, z0), list(x0, y1, z1), list(x1 , y0, z0), list(x1, y0, z1), list(x1, y1, z0), list(x1, y1, z1))