Posts

Showing posts from May, 2013

jquery - Cross-fade div on mouse hover -

i want background image change when mouse hovers on each menu item. code works but, when images fadeout , fadein , there white flash in between. remove it, want images cross-fade instead of fading out , in. how can achieve this? $(document).ready(function() { $(".home-menu-list li a").mouseenter(function() { var bannerclass = '#home-banner-' + $(this).attr('id'); $('.active-banner').not(bannerclass).stop().fadeout().removeclass('active-banner'); $(bannerclass).stop().fadein().addclass('active-banner'); }); }); .main-banner-wrapper img { height: 50px; width: 100%; object-fit: cover; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="container-fluid "> <div id="home-banner-1" class="active-banner"> <div class="main-banner-wrapper"> <img...

Handling PHP POST variable from other php file and managing $_SERVER["PHP_SELF"] -

i stucked @ problem can't figure out why isn't working. i handling post variable php file: $temp_variable = $_post['activity']; after code process $temp_variable, try make button (still in same php file handled $_post['activity']) echo '<form action="'.htmlspecialchars($_server["php_self"]).'" method="post">'; echo '<input type="submit" value="ok" name="process_more"/>'; echo '</form>'; then try catch ok button press, start activity: if ($_server["request_method"] == "post") { $query = "delete table1 id = 5"; mysqli_query($conn,$query) } my problem "delete from" part of code executes immediately, before user press "ok" button. what can problem ? check more specific form. if(isset($_post['process_more'])){ if ($_post['process_more'] == 'ok') {...

javascript - How do I return the response from an asynchronous call? -

i have function foo makes ajax request. how can return response foo ? i tried return value success callback assigning response local variable inside function , return one, none of ways return response. function foo() { var result; $.ajax({ url: '...', success: function(response) { result = response; // return response; // <- tried 1 } }); return result; } var result = foo(); // ends being `undefined`. -> more general explanation of async behavior different examples, please see why variable unaltered after modify inside of function? - asynchronous code reference -> if understand problem, skip possible solutions below. the problem the a in ajax stands asynchronous . means sending request (or rather receiving response) taken out of normal execution flow. in example, $.ajax returns , next statement, return result; , executed before function passed success callback ca...

VSTO, Outlook add-ins, and Visual Studio 2015 -

starting visual studio rc, visual studio 2015 appears no longer support office add-in project types visual studio tools office (vsto). lots of googlin' , questions pms in ms blogs have revealed no useful information; perhaps other in community know more. opening vsto project yield "(incompatible)". so: what status of vsto , visual studio 2015 is there workaround open old project types in vs 2015 i don't have 2013 anymore because wiped machine... do have community edition of vs installed? try install https://aka.ms/getlatestofficedevtools .

c# - Check if a DayOfWeek is within two specified DayOfWeek's -

i have dayofweek , need check see if day between 2 other dayofweek variables. for example: dayofweek monday = dayofweek.monday; dayofweek friday= dayofweek.friday; dayofweek today = datetime.today.dayofweek; if (today between monday , friday) { ... } note: these days inclusive. in case, if day monday , tuesday, wednesday, thursday, , friday , it's valid. the thing can think of doing massive if statement in different method, perhaps extension method , isn't elegant. edit here example of requirements: public enum recurringmodes { minutes, hours } public recurringmodes recurringmode { get; set; } public int recurringvalue { get; set; } ... public ienumerable<datetime> allduedatestoday() { //get current date (starting @ 00:00) datetime current = datetime.today; //get today , tomorrow's day of week. dayofweek today = current.dayofweek; dayofweek tomorrow = ...

java - Can't set value on object's variable -

what trying patient id,name,age,disease window 4 text field , search patient details using patient using id.i completed whole task value couldn't save on object's variable though not getting errors.please guys me error.thanks in advance here code: /* * change license header, choose license headers in project properties. * change template file, choose tools | templates * , open template in editor. */ package hospital.management; import java.awt.*; import java.awt.event.*; import javax.swing.*; import sun.security.pkcs11.wrapper.constants; public class hospitalmanagement { public static void main(string[] args) { new run().setvisible(true); } } class patient{ private string name,disease ; int p_id,p_age; public void get_name(string n){ name=n; } void get_id(int id){ p_id=id; } ...

c# - Integrating articulate storyline in asp.net web site -

i new e-learning domain , may using incorrect terminology. our coaching team has been using articulate storyline create interactive tutorials. want integrate these tutorials our asp.net web site. this not lms. mean integration is should able play tutorial, should able track progress , should able capture user response. think need implement scorm player in asp.net web site. can point me online resources me in capturing user response? when publish project , opt lms , use scorm-2004 option, generates package , can see there js files (lms.js , lmsapi.js) generated. need write code in js files capture data? i can think of following options: use third party library scorm cloud read scorm specification guide, learn protocol , implement own scorm player user dotnetscorm open source project baseline , work there if can guide me or point me right direction/resources helpful. scorm javascript-based, need intercept javascript calls, use own backend code (ajax/xmlhtt...

mongodb - Find collection names in mongo -

there 20 different collections in mongodb, , count might increase more. is there way find out list of collection name start lets "type_"? if not, there way execute query against collection name starts "type_" ? to knowledge db.getcollectionnames() cannot used returns collections i think work: db.getcollectionnames().filter(function (c) { return c.indexof('type_') == 0; }) it might possible in 3.0 without function, see here

amazon web services - Terraform throws "groupName cannot be used with the parameter subnet" or "VPC security groups may not be used for a non-VPC launch" -

when trying figure out how configure aws_instance aws vpc following errors occur: * error launching source instance: invalidparametercombination: parameter groupname cannot used parameter subnet status code: 400, request id: [] or * error launching source instance: invalidparametercombination: vpc security groups may not used non-vpc launch status code: 400, request id: [] this due how security group associated instance. without subnet ok associate using security group's name: resource "aws_instance" "server" { ... security_groups = [ "${aws_security_group.group_name.name}" ] } in case subnet associated cannot use name, should instead use security group's id: security_groups = [ "${aws_security_group.group_name.id}" ] subnet_id = "${aws_subnet.subnet_name.id}" the above assumes you've created security group named group_name , , subnet named subnet_name

angularjs - Does Angular create a new watcher if one already exists? -

Image
consider: angular .module('app', []) .controller('maincontroller', function($scope) { $scope.$watch('bool', function(newval, oldval) { }); console.log($scope); }); and <body ng-controller='maincontroller'> <p ng-class="{'blue': bool, 'red': !bool}">ngclass</p> <p ng-show='bool'>ngshow</p> <input type='checkbox' ng-model='bool' /> </body> plnkr of above it seems there 3 watchers being created: from $scope.$watch . from ngshow . from ngclass . (note: directives involved in data binding use $scope.$watch internally.) i have thought since they're watching bool property, there'd 1 watcher , it'd have multiple listener callbacks. edit: case it's saying, "has bool changed? if run cb1 . has bool changed? if run cb2 . has bool changed? if run cb3 ." or case it's saying, "has bool ...

android - Could not find property 'VERSION_CODE' -

i want use library project , got error when try open library (floatingactionbutton) source github. i download zip project when tried open source code understand it, got error: error:(10, 0) not find property 'version_code' on project ':library'. add build.gradle apply plugin: 'com.android.library' android { compilesdkversion 22 buildtoolsversion "22.0.1" defaultconfig { minsdkversion 14 targetsdkversion 22 versioncode integer.parseint(project.version_code) versionname project.version_name } buildtypes { release { minifyenabled false debuggable false } debug { minifyenabled false debuggable true } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) } apply from: '../gradle-mvn-push.gradle' import library module, change versioncode , versionname ran...

ios - Subtract Multiple Overlapping Paths from Path -

Image
i have 3 paths. want 2 of paths, path1 , path2, subtracted path3. not want area overlaps between path1 , path2 filled. here's diagram made explain mean: i tried this question, accepted answer produces found above in "result eoclip." tried cgcontextsetblendmode(ctx, kcgblendmodeclear) , did make fill black. ideas? playing bit paintcode ( paint-code ) landed this. maybe works case? let context = uigraphicsgetcurrentcontext() cgcontextbegintransparencylayer(context, nil) let path3path = uibezierpath(rect: cgrectmake(0, 0, 40, 40)) uicolor.bluecolor().setfill() path3path.fill() cgcontextsetblendmode(context, kcgblendmodedestinationout) let path2path = uibezierpath(rect: cgrectmake(5, 5, 20, 20)) path2path.fill() let path1path = uibezierpath(rect: cgrectmake(15, 15, 20, 20)) path1path.fill() cgcontextendtransparencylayer(context)

What is this "method prototype" actually in this Java source? -

i wanted @ source getrowvector method of realmatrix class in apache commons math library. found here: grepcode . for reason though, seemingly none of methods shown have implementation; function prototypes: realvector getrowvector(int row) throws matrixindexexception; after searching though, found java doesn't have prototypes. purpose of code above? there actual implementation somewhere? it's odd because full implementation similar realvector class given i'd expect; it's realmatrix that's this. realmatrix interface. interface defines contract implementations responsible fulfilling, without providing implementation code (although of java8 can have default methods , static methods). can use interface limit how client needs know object it's using. basic example java.util.list, provides common methods accessing , modifying lists, , has multiple implementations, provided in jdk collections library (one list backed array, 1 linked list impleme...

java - MyBatis - One to many - values not set for mapped column -

i using mybatis access database. purpose have following classes: class classa { private int id; private list<classb> list; // public getters , setters } class classb { private int id; // public getters , setters } the according daos that: public interface classadao { @select("select id, name, description tablea id = #{id}") @results( @result(property = "list", javatype = list.class, column = "id", many = @many(select = "classbdao.getclassbforclassa"))) classa getclassabyid(@param("id") long id); } public interface classbdao { @select("select id, classaid tableb classaid = #{id}") classb getclassbforclassa(@param("id") long id); } unfortunately id column of classa not filled correct id. seems because used mapped column. anyone experienced problem or has solution? renaming of columns not far can see it, because still mapped column , conseque...

Python-ctype unicode processing and python copiled with UCS-2 or UCS-4? -

i trying call c-interface python using ctype module. below prototype of c function void utf_to_wide_char( const char* source, unsigned short* buffer, int buffersize) utf_to_wide_char : converts utf-* string ucs2 string source (input) : contains null terminated utf-8 string buffer (output) : pointer buffer hold converted text buffersize : indicates size of buffer, system copy upto size including null. following python function: def to_ucs2(py_unicode_string): len_str = len(py_unicode_string) local_str = py_unicode_string.encode('utf-8') src = c_wchar_p(local_str) buff = create_unicode_buffer(len_str * 2 ) # shared_lib ctype loaded instance of shared library. shared_lib.utf8_to_widechar(src, buff, sizeof(buff)) return buff.value problem : above code snippet works fine in python compiled ucs-4 ( --enable-unicode=ucs4 option ) , behave unexpected python compiled ucs-2 ( --enable-unicode=ucs2 ). ( verified python unicode compilation op...

javascript - nodeschool exercise solving with promises -

i solving nodeschool exercise "juggling async" , solved this var http=require("http"); var urls=process.argv.slice(2,process.argv.length); var count=0; var junge=[]; urls.map(function(url,index){ http.get(url,function(response){ var str=""; response.setencoding("utf-8"); response.on("data",function(data){str=str+data}) response.on("end",function(){ junge.push(str); count++; if(index==urls.length-1) junge.map(function(v){console.log(v)}) }); });}) (it works) thinking how exercise looked if used promises? tried this var http=require("http"); var urls=process.argv.slice(2,process.argv.length); var count=0; var fin=[]; var promise=function(x){ return new promise(function(resolve,reject){ http.get(x,function(response){ response.setencoding("utf-8"); var junge=[]; response.on("data",function(data){ ...

c# - Trouble with escape character in WMI query -

processname.name = @"\\dfs\ns1\application_data\tiny\development\tinylos\tinylos.exe"; string wmiquery = string.format("select commandline win32_process pathname='{0}'", processname.name); managementobjectsearcher searcher = new managementobjectsearcher(wmiquery); managementobjectcollection retobjectcollection = searcher.get(); i trying run above code in c# using wmi keep getting invalid query error when executes. suspect it's problem escaping slash thought had accounted @. missing simple because looks should execute ok? (note: query executes when slashes removed) you need pass escaped slashes , it's executablepath not pathname wmiquery = @"select commandline win32_process executablepath = 'c:\\program files\\microsoft security client\\msseces.exe'"; var searcher = new managementobjectsearcher("root\\cimv2", wmiquery); foreach (managementobject queryobj in searcher.get()) console.wri...

excel - Chart title to change to the text of a cell -

i haven't been able find if possible know if possible make chart title change whatever in cell? example: chart title says "last month returns: costco" "costco" comes cell a2 because change wal-mart , title "last month returns: wal-mart" i think done via macro if can avoid macros that'd awesome. the chart title can linked cell, not combination of text , cell. if cell a2 contains "costco" say, should enter formula in cell b2 (or other cell) formula ="last month returns: " & a2 then select chart title, , while selected type formula bar: =b2 that should it.

ios - How do I keep localized Storyboards or XIBs in sync? -

i use xcode 6. imagine following scenario: app's base language english , decide add german localisation. have 2 versions of interface.xib . if add ui elements base version, convert german version localisable strings , , changes ported (if strings added, have manually edited of course) but if it's german version of interface.xib edited? how new ui elements english version? can't use same trick, @ least have found no way convert localised strings, xcode has no idea should use remaining german xib , fill in english localised strings. what do, except make ui changes in base version in future? you correct in conclusion. way localization designed in xcode expects originate ui changes in base language.

sql - Run SSIS programmatically, remotely, and without a Windows or Web Service... maybe with Powershell -

i'm working on project client company has 1 enterprise sql server license , box highly exclusive. need enterprise version because package uses fuzzy lookups. so want trigger launch of package remotely vb.net code. can't use dts runtime library because require calling box running enterprise version too; besides enterpise version 2012 while everywhere else sql 2008 r2. can't install either web service or windows service on enterprise machine call ssis package because client won't let me. create job don't know how trigger on-demand. i've read powershell answer script i've written generates invoke command runs dtexec doesn't work again don't have enterprise version installed locally. can point me solution? i've looked , looked , find variations on i've tried , know won't work. cheers

matlab - Error: compilation of \cimgnbmap_lower.cpp failed -

i using matlab code multiscale image segmentation writtern timothee cour (inria), stella yu (boston college), jianbo shi (upenn) (c) 2004 university of pennsylvania, computer , information science department. from > http://timotheecour.com/software/ncut_multiscale/ncut_multiscale.html when tried run compiledir function faced error: i using matlab r2013a compiledir can change home, image, , results directories if want ; see startup/definepaths ********************************* error: compilation of \cimgnbmap_lower.cpp failed : usage: mex [option1 ... optionn] sourcefile1 [... sourcefilen] [objectfile1 ... objectfilen] [libraryfile1 ... libraryfilen] use -help option more information, or consult matlab api guide. c:\progra~1\matlab\r2013a\bin\mex.pl: error: unrecognized switch: -argcheck. ********************************* error: compilation of \mex...

javascript - Nested unique ng-model per ng-repeat -

currently creating page has nested ng-repeats , ng-models. ng-models based off $index. http://codepen.io/natdm/pen/vozapj?editors=101 (since jsfiddle had out-dated angular) controller: var myapp = angular.module('myapp', []); myapp.controller('teamcontroller', function($scope) { $scope.league = { teams: 5, format: 4} $scope.toarray = function(team) { return new array(team); }; $scope.log = function(data) { console.log(data); }; }); html: <div class="container" ng-app="myapp" ng-controller="teamcontroller"> <h1>create teams</h1> <table ng-repeat="t in toarray(league.teams) track $index"> <thead class="col-md-6"> <tr> <th>team {{$index + 1}}</th> </tr> </thead> <tbody class="col-md-6"> <tr> ...

tcl - What is faster to execute - expr or if -

i looking @ possibility of optimizing execution of of existing code using ternary operators in single command containing if , else blocks. is ternary operator approach faster traditional if / else e.g faster execute of following: first: expr {[info exists arr($var)]? [return $_timeouts($var)] : [puts "no key $var has been set"]} second: if {[info exists arr($var)]} { [return $_timeouts($var)] } else { puts "no key $var has been set" } notice entire expr in ternary operator approach (first) contained in single {} block , hoping faster execute second approach. thanks you can use built-in time command test question. i changed 'puts' different 'return' statement speed of variable exists in array directly compared speed of variable not exist in array. variable arr proc test1 { var } { variable arr expr {[info exists arr($var)] ? [return $arr($var)] : [return -1]} } proc test2 { var } { variable arr if {...

asp.net - Use setting in session to set SSL enforcement -

i have below code in global.ascx. works fine when debugging, on live site causes issues related session, appears session not available/created @ points, blows up. setting stored in session (appsettings.issslenforced retreived session), have read there, right thinking of perhaps putting in master page, feel leave requests vulnerable. there better alternative? protected void application_beginrequest(object sender, eventargs e) { try { if (!request.issecureconnection && appsettings.issslenforced) { response.redirect(request.url.tostring().replace("http:", "https:")); } } catch (exception ex) { logmanager.inserterrorlog(ex); } } try using application_prerequesthandlerexecute rather application_beginrequest: protected void application_prerequesthandlerexecute(object sender, eventargs e) { try { if (!request.issecureconnection ...

c# - WPF DataGrid Editing Difficulty (InvalidOperationException) -

i have datagrid filling information observablecollection<observablecollection<t>> t object of mine implements ieditableobject . i have datagrid correctly filling information need. problem when go edit box in exception. system.invalidoperationexception: 'edititem' not allowed view followed subsequent stack trace. i understand binding idea in observablecollection<t> if want able edit datagrid items need implement ieditableobject interface in object t . i'm not sure why won't let me edit, although i'm leaning more towards idea need attach object type of view. i've not found on i'm trying have been successful until point in getting on hurdles. if has insight should appreciated. also, post code if see believe it's less i've written , more still need write. edit: added code private void dg_datacontextchanged(object sender, dependencypropertychangedeventargs e) { datagrid grid = sender datagrid; ...

php - Can't make a basic OR statement work correctly -

in php function, want return if user not moderator or if user not post author etc. see following basic statement: $mod = false; $status = 'pending'; $currentuser = 22; $author = 22; if ( (!$mod) || ( ($status != 'pending') && ($currentuser != $author) ) ) { return; } so, in example, function should not return because $currentuser $author , $status matches. what doing wrong? (!$mod) true. if condition evaluated true you end having: if ( true || anothercondition ) { return; } it doesn't matter other condition in case. evaluates true your code pretty close need. if ( (!$mod) && ($status != 'pending') && ($currentuser != $author) ) { // if user not moderator , // status not pending , // user not owner, return; }

How to send bulk emails using PHP(Codeigniter)? -

kindly tell me way of sending multiple emails using php codeigniter. never use own server bulk email, if using vps, provider may have spam filter , end email pnalities, if not vps host, client may flag emails spam read more anti spam here solution use third party email service api instead example mailshimp , can alot free acount , give free key , you're use api https://apidocs.mailchimp.com/api/example-code/ example: let's api keys kisaragi2015 $key = "kisaragi2015" and have preprepared campaign on mailshimp id = 123 $cid = 123 you send send($key, $cid) ; that's it, please see doc more details https://mandrillapp.com/api/docs/ there other email service that's choose 1 fits needs best hope helps !

ios - Screen resolution iPhone -

Image
i'm new in development app iphone. i'm developing app run on iphones, i'm having problem when change emulator position of button change screen in below form. if knows solution maintain uniform screen, appreciate help even if using autolayout, looks constraints may wrong. seems each row of keypad constrained top , bottom based on distance nearest neighbors. however in case want constrain bottom nearest neighbor , set explicit height constraint.

centos - How to insert a time gap of 1 second between execution of two statements in python -

i have "for" loop in python 2.7 web scraping programme , going insert time gap of 1 second @ end of loop. how can that? thanks. import time library: import time; and use: time.sleep(1)

c# - Textfile to class to Data Dictionary -

i'm trying make textfile goes class , stores object data dictionary , create gui allows me add, edit , remove etc. my text file in following syntax: country, gdp growth, inflation, trade balance, hdi ranking, main trade partners examples: usa,1.8,2,-3.1,4,[canada;uk;brazil] canada,1.9,2.2,-2,6,[usa;china] anyway before create gui, trying make work in console first. countries come in console using step in debugger, object array , data dictionary (if have created data dictionary correctly) seem storing though when goes on next country overwrites previous one. how can make countries stored instead of one. if makes sense appreciated. my code: class program { static void main(string[] args) { const int max_lines_file = 50000; string[] alllines = new string[max_lines_file]; int = 0; //reads bin/debug subdirectory of project directory alllines = file.readalllines(@"c:\users\jack\documents\countries.csv"); ...

java - ResponseEntityExceptionHandler does not send an error code to the client despite @ResponseStatus annotation -

i want prevent spring sending complete stacktrace of runtimexceptions front end. did this: @controlleradvice public class resterrorhandler extends responseentityexceptionhandler { @exceptionhandler(exception.class) @responsestatus(value = httpstatus.internal_server_error) @override protected responseentity<object> handleexceptioninternal(exception e, object body, httpheaders headers, httpstatus status, webrequest request) { logger.error("error happened while executing controller.", e); return null; } } my objective send error code , nothing else front end. above method returns status 200 ok front end. should returned instead of null ? with @responsestatus , if providing value , httpservletresponse.setstatus(int) used: this method used set return status code when there no error (for example, sc_ok or sc_moved_temporarily status codes). if method used set error code, container's e...

ember.js - How do I send a object into the Jquery $('calendar') selector from outside -

in below code, in didinsertelement, want send mycontroller object in jquery selector ('#calendar').how can this. possible this. might easy. 1 please (function () { app.eventdisplaycalendardisplayview = ember.view.extend({ didinsertelement: function () { //i got controller object here, want pass in jquery calendar selector below. // how var mycontroller = this.get('controller'); $('#calendar').fullcalendar({ weekends: true, events: this.get('controller'), dayclick: function(start, allday, jsevent, view) { //i want access controller here how this. var controller = mycontroller; //this not work. }, eventlimit: true, // non-agenda views views: { agenda: { eventlimit: 6 // adjust 6 agendaweek/agendaday } }, eventclick: function(xeve...

javascript - how to use ng click and pass the id in google map pop window using angularjs? -

i have 2 stores in database , trying stores in google map marker pointing 2 stores.i have ng-click in info window pass id here ng-click not working there idea pass id through ng-click .controller('mapctrl', [ '$scope', '$http', '$location', '$window', function ($scope, $http, $location, $window) { $http.get('****').success(function (data, dealers, response) { function initialize() { var serverdata = data; $scope.locations = []; (var = 0; < serverdata.length; i++) { var modal = [ data[i].store_name, data[i].s_location.latitude, data[i].s_location.longitude, i, 'images/arrow.svg', data[i].s_address]; $scope.locations.push(modal); } console.log($scope.locations); //--------------------------------------------------------- //console getting var l...

ruby on rails - RoR: Nested Form , Hidden Field, value -

i have huge nested form, has task , field_for tsk1, tsk2 , tsk3, them belongs task, i'd tsk2 id of tsk1 , tsk3 of tsk2, how can handle this? have tried hidden fields value => [:tsk1_id] didn't worked. _form = http://pastebin.com/k8qs9tqw task controller class taskscontroller < applicationcontroller before_action :set_task, only: [:show, :edit, :update, :destroy] # /tasks # /tasks.json def index @tasks = task.all end # /tasks/1 # /tasks/1.json def show end # /tasks/new def new @task = task.new @tasks = task.all end # /tasks/1/edit def edit end # post /tasks # post /tasks.json def create @task = task.new(task_params) respond_to |format| if @task.save format.html { redirect_to projetopo_path, notice: 'task created.' } format.json { render :show, status: :created, location: @task } else format.html { render :new } format.json { render json: @task.error...

Flow is undefined - class inheritance issue? (Ruby Shoes) -

i following sample located here in samples folder on official shoes github repo. saw programmer defined class book inherited shoes . have relatively large program coming along shoes i'm porting 3.x, , wanted split of different classes smaller files make easier on me. have file so #this class sets user interface class interface < shoes def initialize flow @shed = button "new" @editbutton = button "edit" @employees = button "employees" @sdays = button "special days" @makenote = button "make note" @backbutton = button "go back" end end end my main file looks so $load_path << "." require 'loader' #all of these other classes have defined require 'interface' #contains interface class require 'schutil' shoes.app title: "baesler's scheduling application", width: 1024, height: 768, resizable: true interface.new end...

c++11 - How to insert a reference to a multimap? -

i have class foo contains multimap unsigned long , reference bar class . i'm getting error "no matching function call multimap, etc". what wrong on insert multimap? [header file] class foo { public: foo(); ~foo(); void set(const unsigned long var1, const bar& var2); private: struct map_sort { bool operator()(const unsigned long& e1, const unsigned long& e2) const { return (e2 < e1); } }; std::multimap<unsigned long,bar&, map_sort> m_map; }; [source file] void foo::set(const unsigned long var1, const bar& var2) { m_map.insert(var1,rtime); //<-- error!!!!!!!! } you multimap member declared take unsigned long , bar& std::multimap<unsigned long,bar&, map_sort> m_map; while, in source file void foo::set(const unsigned long var1, const bar& var2) { m_map.insert(var1,rtime); //var1 const here! (rtime not declared assum...

Copy a JSON object -

let's have json object: myjson1={ key1:value1, key2:value2 } myjson2={}; and json object myjson2 when run myjson2 = myjson1; all think goes first object equal second. if try use myjson2 this, var val = myjson2.key1; console.log(val); empty !!! i have make search , found " proto " swagin9 right - make sure assignment statement correct. comment on post, don't have enough rep i'll add here - make sure value1 , value2 defined. themselves, don't mean anything. either put them in quotes, make them ints or booleans, etc. or define them variables before instantiating myjson1 make sure mean something. correct assignment statement, you'll still error if json objects defined way right now. so example, produces error: myjson1={ key1: value1, key2: value2 } myjson2={}; myjson2 = myjson1; console.log(myjson2.key1); this not produce error: myjson1={ key1: "value1", key2: "value2" } myjson2={}; myjs...