Posts

java - Best strategy to persist ISO8601 -

i have been reading different articles on said question yet unable figure out should best strategy store date in db. i receiving iso8601 date via path-param in rest call. have decided use joda-time parse date. extract utc-0 time out of date , hours offset store utc-0 in datetime datatype in mysql db , store offset in varchar(5) . when have search based on date (an exposed rest api). use search criteria (input date) extract utc-0 time , hours offset , compare 2 columns in db i.e. where table.dateinutc0 = :inputdateinutc0 , table.hoursoffset = :inputhoursoffset i not sure step 4. doing right ? i not sure step 4. doing right ? really, depends on trying do. if want search match if searcher using same timezone original data, doing right. if don't want that, doing wrong. ask this: if enter same date / time in local time zone , utc (or other time zone), mean same thing clients of server? should they?

I'm trying to convert my matlab code to python for an adaptive gaussian quadrature -

matlab code-runs fine function [int, abt]= gadap(a,b,f,p,tol); % a,b: interval endpoints < b % f: function handle f(x, p) integrate (p user parameters) % tol: user-provided tolerance integral accuracy % int: approximation integral % abt: endpoints , approximations a_j=a; b_j=b; j=1; int=0; n=1; abt=[[a_j,b_j,0]]; while j<=n %%%evaluation of t%%% t_j=(b_j-a_j)/2*(5/9*f((b_j-a_j)/2*-1*sqrt(3/5)+(b_j+a_j)/2)+8/9*f((b_j+a_j)/2)+5/9*f((b_j-a_j)/2*sqrt(3/5)+(b_j+a_j)/2)); %%%evaluation of l%%% k=j+1; a_k=a_j; b_k=a_j+(b_j-a_j)/2; l_j=(b_k-a_k)/2*(5/9*f((b_k-a_k)/2*-1*sqrt(3/5)+(b_k+a_k)/2)+8/9*f((b_k+a_k)/2)+5/9*f((b_k-a_k)/2*sqrt(3/5)+(b_k+a_k)/2)); %%%evaluation of r%%% z=j+2; a_z=a_j+(b_j-a_j)/2; b_z=b_j; r_j=(b_z-a_z)/2*(5/9*f((b_z-a_z)/2*-1*sqrt(3/5)+(b_z+a_z)/2)+8/9*f((b_z+a_z)/2)+5/9*f((b_z-a_z)/2*sqrt(3/5)+(b_z+a_z)/2)); %%%list generation%%% if abs(t_j-(l_j+r_j))>tol*max(abs(t_j), (abs(l_j)+abs(r_j))) ...

java - In Spring Boot Application, annotation based pointcut is not executed -

hi have created spring boot application , trying apply aspect using spring aop. code below ... the custom timer annotation package org.my.pckg.annotation; @retention(retentionpolicy.runtime) @target({elementtype.method}) public @interface timer { } the timerloggingaspect aspect @aspect @component public class timeloggingaspect { @pointcut("annotation(@org.my.pckg.annotation.timer)") public void loggingpointcutdefinition(){} @around("loggingpointcutdefinition()") public void useradvice(proceedingjoinpoint joinpoint) throws throwable{ createjsonstring(joinpoint); joinpoint.proceed(); } private string createjsonstring(proceedingjoinpoint joinpoint) { //logic creating , printing json return ""; } } the config class package org.my.pckg.config; @configuration @enableaspectjautoproxy @componentscan(basepackages = {"org.my.pckg.utilities","org.my.pckg.annotation"}) public...

javascript - nodejs error on es6 class constructor with default parameter value -

i run simple es6 class code following: 'use strict'; class polygon { constructor(height=44, width=55) { //class constructor this.name = 'polygon'; this.height = height; this.width = width; } sayname() { //class method console.log('hi, a', this.name + '.'); } } class square extends polygon { constructor(length) { super(length, length); //call parent method super this.name = 'square'; } area() { //calculated attribute getter return this.height * this.width; } } let s = new square(); s.sayname(); console.log(s.area); it running ok on chrome console. running errors on nodejs(4.x, 5.x) following: constructor(height=44, width=55) { //class constructor ^ syntaxerror: unexpected token = @ exports.runinthiscontext (vm.js:53:16) @ module._compile (module.js:387:25) @ object.module._extensions..js (module.js:422:10) @ module.load (module.js:357:32) @ function.m...

java - Error in Importing Boolean variable -

i have 2 classes , 1 called adminmenu class variable votecycle boolean variable enables voter vote provided votecycle enabled , class called loginmenu utilize it. i'm doing school project. the problem have if select enable meant change boolean value true , i'm still getting false output.. if don't understand mean, code below should explain it. its basic programming. the class public class adminmenu extends javax.swing.jframe { public boolean votecycle; the method private void votecomboboxactionperformed(java.awt.event.actionevent evt) { if(vcycle.getselecteditem().tostring().equalsignorecase("true")) { votecycle=true; } else if(vcycle.getselecteditem().tostring().equalsignorecase("false")) { votecycle=false; } } this class use variable allow users log in. class called loginmenu(). @ start of class created object of class variable defined in using adminmenu adminmenu=new adminmenu(); datavalidation validate=new datavalidation();...

c - Reversing/Debugging - Finding out when an exception handler was installed -

while reversing program (needless say: educational purpose only), debugger (ollydbg) cought program's exception (access violation). i threw exception program , program continued execution, starting address. what i'm trying find out when exception handler installed (aka __try{}__except{} blocks in assembly) can not find cross-references address program continued execution from. i managed find address while runtime debugging finding correct exception_registration structure on stack want find method identify address statically , not @ runtime. help appreciated. --edit--: let me clarify, trying find the __try { do_error(); } __except(exception_execute_handler) { do_stuff(); return...; } block in assembly

javascript - Sending Message to a iFrame using postMessage from parent? -

is there way send postmessage iframe parent window? know how can send iframe parent, need send response message after parent receives it. edit--------------- have following. parent window: function toframe(type, data) { $("iframe[data-atdl='schedule']").contentwindow.postmessage({ type: type, data: data }, "*"); } iframe: window.addeventlistener("message", fromparent, false); function fromparent(e) { var data = e.data.data; var type = e.data.type; sendparentdata("alert","action " + type + " :: " + data); } ~z