Posts

Compile C++ error -

#include "std_lib_facilities.h" int main() { constexpr double euro_to_dollar = 1.11; constexpr double yen_to_dollar = 0.0081; double dollar = 1.00; char unit= 'a'; cout <"please enter value followed e or y: \n"; cin >>dollar>> unit; if (unit= 'e') cout << dollar << "euro == " << euro_to_dollar*dollar << "dollar\n"; else if (unit='y') cout << dollar << "yen== " << yen_to_dollar * dollar << "dollar\n"; } 5 error: 'constexpr' not declared in scope 5 error: expected ';' before 'double' 7 error: expected ';' before 'double' 15 error: 'euro_to_dollar' not declared in scope 17 error: 'yen_to_dollar' not declared in scope i'm doing problem programming: principles , practice using c++ (2nd edition)by bjarne stroustrup. , can see i'm doing wrong here. try...

angularjs - What's wrong with ngAnimate and ui.bootstrap modal? -

in example http://plnkr.co/edit/etwexjk0hru3b8wovojq angular.module('animateapp', [ 'nganimate', // adding causes issue modal backdrop 'ui.bootstrap' ]) when close modal, backdrop won't go away. if comment out 'nganimate' dependency (script.js line 4), works fine. am doing wrong or bug in ui.bootstrap when used nganimate? it appears breaking change somewhere between angular 1.3.15 , 1.4.0. apparently in nganimate changed interferes backdrop hiding. if turn off animation, backdrop hides fine: $scope.openmodal = function() { $modal.open({ templateurl: 'modal.html', controller: 'modalctrl', backdrop: true, animation: false }); } if drop down 1.3.15, there no issue: plunker if check dependencies page ui-bootstrap, doesn't have quite caught 1.4.0 yet: https://david-dm.org/angular-ui/bootstrap#info=devdependencies it may worth posting issue or seeing if has already. ...

javafx - Static contextMenu in TreeCell -

in tutorial https://docs.oracle.com/javafx/2/ui_controls/tree-view.htm contextmenu added treecell allow item specific context. instead of creating new contextmenu() every cell feasible in case make contextmenu static , create items inside static initializer e.g. private final class textfieldtreecellimpl extends treecell<string> { private static final contextmenu addmenu = new contextmenu(); static { menuitem addmenuitem = new menuitem("add employee"); addmenu.getitems().add(addmenuitem); addmenuitem.setonaction(new eventhandler() { public void handle(event t) { treeitem newemployee = new treeitem<string>("new employee"); gettreeitem().getchildren().add(newemployee); } }); } is there benefit in creating new contextmenu instance every cell?

c++ - How to store text file on embedded systems flash memory and read from it -

i'm trying following: storing text file (7kb) in flash memory of steval-mki109v2 (running freertos) board , read text file , doing computation on device itself. have 2 problems regarding that: 1) storing text file enough add text file keil project? can access after compiling? 2) accessing data that's failed until now. @ first tried using fopen() stdio.h got errors on compilation. found out project compiles using microlib seems doesn't include file i/o. after compiling standard c - library successful reach fopen part in code system crashes. now don't know if reason text file not found or if cannot use fopen() on embedded system. didn't find further information inside stm documents or forums except flash_unlock(); function seems it's used writing. do need store text file in way , access memory address instead of filename? i'm confused , cannot find information online. thanks in advance help! if want contents of file char-string, can conv...

Grails jQuery icons not showing up -

application.css *= require main *= require mobile *= require_self *= require bootstrap *= require themes/ui-lightness/jquery-ui-1.10.4.custom *= require_tree . application.js //= require jquery //= require js/jquery-ui-1.10.4.custom //= require_tree . //= require_self //= require bootstrap if (typeof jquery !== 'undefined') { (function($) { $('#spinner').ajaxstart(function() { $(this).fadein(); }).ajaxstop(function() { $(this).fadeout(); }); })(jquery); } buildconfig.groovy // plugins compile step compile ":scaffolding:2.1.2" compile ':cache:1.1.8' compile ":asset-pipeline:1.9.9" compile ":spring-security-core:2.0-rc4" compile ":spring-security-ui:1.0-rc2" compile ":mail:1.0.7" compile ":jquery-ui:1.10.4" compile ":famfamfam:1.0.1" // plugins needed @ runtime not compilation runtime ":hibernate4:4.3.6.1" // or ...

Dynamic orderBy Breaks ng-repeat in view in AngularJS -

i having problem dynamically ordering data getting through service in controller. data loads fine when initial search, try update orderby, of data in views disappear instead of being reordered. data displaying in view data stored $scope.filtered_events. also, controller attached via router template. search controller (function () { .controller("search", function ($scope, zipcodesvc, $filter, $http) { $scope.$on("search", search); $scope.sortby = "date"; function search(evt, data) { $scope.zip_codes = []; $scope.locations = null; $scope.response = null; $scope.events = null; zipcodesvc.find(data.str, data.dist) .then( function (response) { $scope.locations = response; for(i=0; i<$scope.locations.zip_codes.length; i++){ $scope.zip_codes.push($scope...

java - When reassigning color to pixels, all color is black -

simplified code: public static void main(string[]args) throws exception { bufferedimage img = new bufferedimage(512, 512, bufferedimage.type_int_argb); (int = 0; < 512; i++) { (int j = 0; j < 512; j++) { if (complex.getinfinite()) { color newcol = new color(100, 0, 0); img.setrgb(i, j, newcol.getrgb()); } if (complex.getinfinite() == false) { color newcol = new color(0, 0, 100); img.setrgb(i, j, newcol.getrgb()); } } } saveimage(img, new file("julia.jpg")); } my problem when run program, julia.jpg black image. have played around amount of pixels color , pixels coloring turn black. i wondering if issue when generated image gave wrong type. change bufferedimage img = new bufferedimage(512, 512, bufferedimage.type_int_argb); to bufferedimage img = new bufferedimage(512, 512, bufferedimage.type_int_bgr); ...