Posts

mysql - matching groupmembers against another group and add its name to the first -

i need take members of each group in table_a , in table_b if there 1 or more groups exact same members if ad resulting groupnames result. table_a holds groupmembers: +-------+----------+--------+-------+ |uniqeid|objectname|property|value | +-------+----------+--------+-------+ |0 |thing1 |color |grey | +-------+----------+--------+-------+ |1 |thing1 |hardness|100 | +-------+----------+--------+-------+ |2 |thingy |sofness |80 | +-------+----------+--------+-------+ |3 |thingy |color |brown | +-------+----------+--------+-------+ |4 |thingy |emits |gas | +-------+----------+--------+-------+ |5 |item |exists |1 | +-------+----------+--------+-------+ continues endless data kinds of propertys , objectnames. table_b basicaly same holds objecttypes groups in table_a +-------+----------+---------+ |uniqeid|objecttype|property | +-------+----------+---------+ |0 |stone |color | +-------...

Partial match search every key's value in a document with MongoDB -

i'm working on project client wants store information trucks, trailers, , other types of equipment in database. after comparing , contrasting relational databases solutions mongodb, i've found flexibility of schema-less type of database combined way data going accessed application makes mongo better choice (see schema below). there's 1 issue i'm having, , how implement autocomplete search. salesmen want able search key (model, year, price, odometer reading) , list of documents match result. example, salesman might search "freightliner" , expect example document attached below. { "_id": "e-123456", "created_by": "2", "status": "available", "properties": [ { "active": true, "version": 1, "last_modified": "2014-06-10 00:51:02", "category": "heavy duty truck", "subcategory": ...

c++ - Custom compile error message when undefined subtype is accessed -

i have types have sub-types same name each: struct typea { typedef int subtype; }; struct typeb { typedef float subtype; }; and types don't have sub-type used in same context: struct typec { // (no subtype defined) }; how can add dummy sub-type gives custom compile error message? my (so far unsuccessful) attempt is: struct typec { struct subtype { static_assert(false, "attempt access non-existent subtype of typec."); }; }; but static_assert(false, ...) can't work, compiler throws error if type never accessed. how can delay evaluation of static_assert time when type being accessed? a failed attempt introduce dummy enum , construct expression out of it: enum { x }; static_assert(x != x, "..."); concrete use case: have class-template list defined sub-types head , tail if non-empty, , should give error if these sub-types used if empty: template<typename...> struct list; // empty list: template...

c# - How to create a separate STA thread for a WPF form that is inside of a dll and not a WPF application? -

i have dll contains wpf form. dll called wpf application, unfortunately can't touch it. problem there no main method in wpf form place [stathread] static void main() { //... } the exception thrown right on constructor of class. how can around sta problem in case. again, not wpf application, wpf form places inside of dll. namespace visualscannertest { /// <summary> /// interaction logic visualscanner.xaml /// </summary> public partial class visualscanner :window,iperipheral<visualscanner.visualscannersettings> { private visualscannersettings _settings; private readonly ieventmanager _eventmanager; public visualscanner(ieventmanager eventmanager):base() { initializecomponent(); _eventmanager = eventmanager; } private void submitbutton_click(object sender, routedeventargs e) { string input = inputextbox.text; inputextbox.text...

HTML 5 collision detection platformer game -

i working on platform game , having issues collision detection. game set many blocks next each other or spaced out player jumps 1 block next. right player able jump on top of blocks, run side of blocks , stopped if jumping bottom of blocks. issues having right if in rare scenario player falls on top of part of block, game recognizes side of block block next , player falls through block. if jumping onto edge of blocks[3] , blocks[4] right next it, game recognizes player has jumped side of blocks[4]. idea how can go fixing this? below code collision detection. function checkblockcollisions() { // if player collides block, motion should stopped. for(var = 0; < blocks.length; ++) { var angle = blocks[i].angleto(player); var thistop = blocks[i].y - blocks[i].height / 2; var thisbottom = blocks[i].y + blocks[i].height / 2; var playertop = player.y - player.height / 2; var playerbottom = player.y + player.height / ...

ruby on rails - Heroku on Ubuntu 14.04 -

i following 'ruby on rails tutorial' michael hartl. on chapter 3 when try deploy working sample app heroku rejected, , though understand error message not know how correct it. here gemfile: source 'https://rubygems.org' ruby '2.0.0' #ruby-gemset=railstutorial_rails_4_0 gem 'rails', '4.0.5' group :development, :test gem 'sqlite3', '1.3.8' gem 'rspec-rails', '2.13.1' end group :test gem 'selenium-webdriver', '2.35.1' gem 'capybara', '2.1.0' end gem 'sass-rails', '4.0.1' gem 'uglifier', '2.1.1' gem 'coffee-rails', '4.0.1' gem 'jquery-rails', '3.0.4' gem 'turbolinks', '1.1.1' gem 'jbuilder', '1.0.2' group :doc gem 'sdoc', '0.3.20', require: false end group :production gem 'pg', '0.15.1' gem 'rails_12factor', '0.0.2' end ...

repository - Can I migrate a Mercurial repo from Bitbucket to a VPS? -

i've been using shared host , bitbucket + hg several years. @ end of year plan migrate site vps , want host private mercurial instance on same vps. possible migrate repo , entire history bitbucket new vps mercurial instance or must big push default trunk , lose old branches , not? i see lot of posts migrating bitbucket none migrating out! the thing have whole history of changes (not entirely true, in cases). it means can push whole repository (which includes history) other repository. that's it: create empty repository anywhere , push it.