Posts

c++ - initiating class as a member of struct -

im trying create struct class member inside: .h file: class { public: struct result { int x; ugraph g; <------ class definition }; result m_tempstructresult; a:a(void); void function(); } .cpp file a::a() { } void a::function() { ugraph graph(10); <---- object has receive value ... //manipulations on graph ... m_tempstructresult.g = graph; } the compilation error is: error c2512: 'a::result' : no appropriate default constructor available so problem guess lack of default constructor, added this: struct result { result::result(int graph_size=0) : g(graph_size){ } int x; ugraph g; }; and problem solved. my question if there way initiate class ugraph g inside constructor of class a? , not inside member struct? thanks. yes, use initializer list in constructor of result : result::result() : g(0) // have insert integer here { } another way in c++11 giv...

perl - Array of hashes manipulation -

i'm running script below query monitoring system , results in array of hashes. best way access individual hashes , elements? use strict; use warnings; use yms::client::monstatus; use getopt::long; use dbi::dumper; use data::dumper; use yms::client::monstatus::filter; $username = "username"; $password = "passwd"; $cluster = "aso"; #my $filter = yms::client::monstatus::filter(); $client = yms::client::monstatus->new($cluster); $client->verbose("on"); $client->byauth({username => $username, password => "$password"}); $client->yms_rotation("bot.ops.com:4080"); $client->debug("on"); $filter = yms::client::monstatus::filter->new(); $filter->add("cluster", "=", "aso"); $filter->add("host", "in", "<hostname>"); #$filter->add("service", "=", "prod-deploy"); $filter->add("stat...

java - Hibernate multitenancy: change tenant in session -

we're developing saas solution several consumers. solution based on spring, wicket , hibernate. our database contains data several customers. we've decided model database follows: public shared data between customers, example user accounts not know customer user belongs to customer_1 customer_2 ... to work setup use multi-tenancy setup following tenantidentifierresolver: public class tenantproviderimpl implements currenttenantidentifierresolver { private static final threadlocal<string> tenant = new threadlocal<>(); public static void settenant(string tenant){ tenantproviderimpl.tenant.set(tenant); } @override public string resolvecurrenttenantidentifier() { return tenant.get(); } @override public boolean validateexistingcurrentsessions() { return false; } /** * initialize tenant storing tenant identifier in both http session , threadlocal * * @param string tenant ...

linux - Why is the following convert command resulting in Segmentation fault? -

this command running (directly command line, logged in root): /usr/bin/convert '/var/storage/files/drupal/273f09ab5f8671d3c457719c7955063f.jpg' -resize 127x127! -quality '75' '/var/storage/files/drupal/imagecache/artwork_moreart/273f09ab5f8671d3c457719c7955063f.jpg' the result of command just: segmentation fault version of imagemagic: imagemagick 6.4.3 2009-02-25 linux version: suse linux enterprise server 11 (x86_64) this image exists , have copied local computer , opened no issue. please let me know if there additional information need , how information. try correct command. ! needs backslash-escaping, first of all, otherwise interpreted shell, instead of convert : /usr/bin/convert \ '/var/storage/files/drupal/273f09ab5f8671d3c457719c7955063f.jpg' \ -resize 127x127\! -quality '75' \ '/var/storage/files/drupal/imagecache/artwork_moreart/273f09ab5f8671d3c457719c7955063f.jpg' if doesn't work, try surro...

visible-xs-block and visible-sm-block bootstrap 3.3.4 not working -

using bs 3.3.4 i've tried hidden-xs-block , hidden-sm-block on divs still display on iphone 3, iphone 4. way work new class display:none on media query prefer using built in functionality. applied class directly in <div class="panel panel-default hidden-sm-block "> hidden-xs-block see: http://howlingwolfmedia.com/dev/jrmasonry_btstrp/portfolio.html right side panel hidden using custom class turned off see i'm talking about. see orginal code there hidden-x , visible-x without -block classes available. e.g. @media (max-width: 767px) { .hidden-xs { display: none !important; } } @media (min-width: 768px) , (max-width: 991px) { .hidden-sm { display: none !important; } }

java - Generate fragments of html view template in Play Framework -

i know how generate html in java, , pass view using parameter. how can achieve this? i've searched official play framework documentation, nothing found it. i know possible because can pass 1 template using variable. in case generate view on java. f.e. create method display in inherited classes generate ready use html code. please help playframework 2.2.6 why won't use play.twirl.api.html ? your action: public result youraction() { html myhtml = new html("<h1>it works out of box</h1>"); return ok(yourview.render(myhtml)); } yourview.scala.html @(myhtml: html) code: @myhtml works out of box, @ least play 2.3+

javascript - Can I import data to MapBox programmatically? -

if it's possbile import data mapbox. import data mapbox using javascript api load maps ? example : in dataset (c#) have following column : country | state | city | zipcode values : usa | alabama | memphis | 38104 based on above value need show mapbox - maps ? how ? any idea ?