Posts

javascript - Dynamically generated navbar and AngularJS -

i not find easy way explain following, apologize if not clear enough. i have navigation bar each item category of articles. navigation item read database , can modified back-office. i categories via angularjs controller : app.controller('apicontroller', ['$scope', '$http', function($scope, $http) { $http.get('/categories') .success(function(categories) { $scope.categories = categories; }); }]); <div class="collapse navbar-collapse" id="target-navbar-main"> <ul class="nav navbar-nav"> <li ng-repeat="category in categories"> <a href="/<% category.slug %>" title="<% category.name %>"><% category.name %></a> </li> </ul> </div> in body of page, using controller articles of given category can't find way make navbar communicate arti...

User-Defined Table Types Documentation in SQL Server 2012 -

i tried find documentation user-defined table types in sql server 2012 find 2008 r2 documentation here . i know can used in sql server 2012 should considered them bad practise or obsolete if there no documentation sql server 2012? user defined table types in 2012 , 2014. in ssms under programmability/types , see tab user defined table types.

interpolation - Algorithm to iteratively discover points on an arc described by three points -

Image
i writing graphics application needs calculate , display list of points along curve arc described 3 points. lets have points (1,1), (2,4) , (5,2). need algorithm can give me values of y each x 1 5 fall on interpolated arc. i'm sure simple task math whizes out there, me it's bit beyond mathematical payscale. thanks in advance! so problem how compute center c = (c1, c2) , radius r of circumference given 3 points p = (p1, p2) , q = (q1, q2) , s = (s1, s2). the idea simple. consists in realizing that, definition, center has same distance 3 points p , q , s. now, set of points equidistant p and q perpendicular segment pq incident @ mid point (p+q)/2 . similarly, set of points equidistant q , s perpendicular qs passing thru (q+s)/2. so, center c must intersection of these 2 lines. let's compute parametric equations of these 2 straight lines. for need 2 additional functions call dist(a,b) computes distance between points a , b , perp(a,...

c# - MonoTorrent magnet link download does not start -

Image
i believe monotorrent library can this, due lack of documentation haven't been able working. to start with, monotorrent seems able download original torrents using following code: https://smuxi.im/wiki/monotorrent/managing_torrents but due increase of magnet links popularity, would magnet links working well . "trick" of getting .torrent out of them (like using ones µtorrent generates) doesn't work me either when using same code above. stays stuck this, founding 1-3 peers per second making no progress : stackoverflow best question / answer @ topic monotorrent - magnet link torrent file unfortunately answer didn't match monotorrent constructors following: public torrentmanager(torrent torrent, string savepath, torrentsettings settings); public torrentmanager(magnetlink magnetlink, string savepath, torrentsettings settings, string torrentsave); public torrentmanager(torrent torrent, string savepath, torrentsettings settings, string basedirectory); publ...

C++ Pointer addition being multiplied -

this question has answer here: c++ pointer arithmetic weirdness 5 answers i working on packet code, , need move pointer x bytes. when tell pointer pointer = pointer + x; proceed print pointer via to_string or cout, x*2 has been added pointer. have tried multiple values, both constant , variable. have verified pointer's value before operation. thing can think when happens 3 being bit-shifted somewhere. ideas? sample code: cout << "before: " << pointer << "\n"; pointer = pointer + 3; cout << "after: " << pointer << "\n"; output: before: 0x7ffff4604e93 after: 0x7ffff4604e99 my includes: #include <cstring> #include <cstdlib> #include <cstdarg> thank you, mike pointer = pointer + x; not move pointer x bytes, moves x * sizeof(*pointer) bytes. in ca...

sql - Can I create a MYSQL select statement with a column which consists on another select statement? -

i'm trying export data old drupal site. hoping mysql query this: select users.uid, name, pass, mail, created, (select rid users_roles users_roles.uid = users.uid) all_rids users so row of output might like: "1000", "frank smith", "123456", "frank@example.com", "12/15/2012", "3,7,12" the point last column array consisting of values select statement ...sorry, forget proper terminology type of query, pretty sure possible in sql server. is possible in mysql? if so, syntax? there may multiple matches. think want use group_concat() in subquery: select users.uid, name, pass, mail, created, (select group_concat(rid) users_roles users_roles.uid = users.uid ) all_rids users;

php - Selenium PHPUnit_Extensions_Selenium2TestCase_Element::fromResponseValue() -

i'm following examples book phpunit essentials zdenek machek , i'm on section functional tests using selenium. i downloaded server, webdrivers , firefox ide. the test class exported firefox ide: class seleniumfirsttest extends phpunit_extensions_selenium2testcase { protected function setup() { $this->setbrowser('firefox'); $this->sethost('127.0.0.1'); $this->setport(4444); $this->setbrowserurl('https://www.google.com.br/'); } public function testcasephp() { $this->url("/?gws_rd=ssl"); $this->byid("lst-ib")->value("phpunit"); $this->bylinktext("documentation")->click(); $this->bylinktext("13. phpunit , selenium")->click(); $result = $this->bycssselector("h1.title")->text(); $this->assertequals("chapter 13. phpunit , selenium", $result); ...