Posts

Showing posts from September, 2012

php - Unit testing and global testing for custom CMS -

at company, writing micro-cms scratch, in php + mysql. allows create multidomain + multilanguage + e-commerce platform, administration part. not using framework, wonder how implement unit tests , modular test correct bugs may slip through code. code procedural. has grown few files huge amount of code , tables , envisioning may nightmare maintain.

sql - Run UPDATE query for every row in another SELECT -

i have sql query can return 0 let's 20 results. here example: select value_id table1 t1 inner join table2 t2 on .... inner join table3 t3 on .... .... then, want run each value_id update query. let's say: update table4 set new_value = 1 value_id in (select value_id table1 t1 inner join table2 t2 on .... inner join table3 t3 on .... ....) can subquery work on this? performance efficient or there way? your query fine. performance depends on how database structured. instance, if select runs fast, update should pretty fast (not fast: there more overhead update ). so, answer question is: yes, subquery can work this. test select version (with table4 ) idea of affect on performance.

dns - domain configuration not working properly -

i have purchased domain bigrock.in , created free hosting account in 5gbfree.com. couldn't find how add domain it. domain name venneers.in. please me. in advance. the domain: venneers.in resolves ip address: 173.193.106.13. looking @ online dns settings, there not seem issue dns configuration. when browse domain showing blank page. must browse site server check exact error , fixed or check in log files find exact error.

entity framework - Upgrade experience from EF6 to EF7 -

can share experience , insights on upgrading ef6 ef7? straight forward? did discover major benefits or drawbacks upgrade? thank read side-by-side comparison between ef-6 , ef core 1.0. http://ef.readthedocs.io/en/latest/efcore-vs-ef6/features.html#side-by-side-comparison if need feature still not done use ef 6 becasue maybe have wait long time. my recommendation, if not possible use ef 6 becasue have .net core on uwp etc, use it, otherwise currently can prefer use ef 6 on ef core recommendation ef team can find on announcing entity framework core 1.0. when use ef core we have comparing ef core , ef6.x section in our documentation. includes guidance on when use ef core, feature comparisons, , information on porting ef core. these types of applications recommend using ef core for. other applications, should consider using ef6.x. new applications not require features not yet implemented in ef core. applications target .net core, such universal windows platform

wpf - Adding additional padding with Width="Auto" -

i have listview multiple gridviewcolumns, using width="auto" each of columns, ensures columns sized according largest element. i want add additional breathing space each column header, along lines of: width = "auto" + 30 i have tried setting margins , padding results in column text heading being cut off prematurely when resized. ideas on how can achieve ? my gridviewcolumn ? <gridviewcolumn width="auto"> <gridviewcolumn.header> <gridviewcolumnheader horizontalcontentalignment="left" content="{x:static resources:resources.tableheadingdescription}" sizechanged="description_column_sizechanged"> </gridviewcolumnheader> </gridviewcolumn.header> <gridviewcolumn.celltemplate> <datatemplate> <textblock name="descriptiontextblock"

python - in the below link clade master using stanford NER package.... let me know what is the Input to Stanford-NER and corresponding Output -

i interested use clade master tool. doing project on taxonomy classification , have followed procedure have mentioned in https://github.com/flaxsearch/clade but not understanding how stanford ner package used in clade , actual input ner package taking , corresponding output ner package clade master tool. i'm particular in understanding how stanford ner has been used in taxonomy classification . ( when went through documentation of stanford ner , installed package : classifies sentence location, person, organization. how information used in taxonomy classification.) can clear me input ner package , corresponding output package in clade master tool?

javascript - Password protected chrome extension -

i made chrome extension runs , job intended for. need make extension password protected , can use application gmail user , password. i have experience using google authentication using google apis client library , can implement in application. in case, google users can run application. thought storing file list allowed users emails. however, chrome extensions open edit has little experience extension development can find , edit file. are there suggestions? code runs on extension on my machine code, not yours. can control , execution of extension, including altering code on disk , reloading extension in chrome. i can break , protections , defences place in pretty trivial matter. , i'm pretty proficient deobfuscating jumbled code, don't think going way. keep authentication logic on server, more generally, keep anything needs absolute control on server. don't care if mess extension , see red background instead of blue, care if can access things shouldn&#

android - How to add list of new items to recycler view for exisitng list without moving to top of list -

i trying implement pagination application , partially successful. when call server 6 items , adding items recyclerview. when user comes , scrolls @ last item making call server , fetching page 2 items , adding new items existing list. here able add new items successfully. problem calling adapter.notifydatasetchanged() , hence goes first item after adding new items. how can stop going top of list, should call other adapter.notifydatasetchanged() ? below code of setting adapter toadlineadapter = new toadlineadapter(mcontext, getdata()); recyclerview.setadapter(toadlineadapter); toadlineadapter.notifydatasetchanged(); toadlineadapter.setclicklistener(this); recyclerview.setlayoutmanager(new linearlayoutmanager(getactivity())); no need notify when initializing adapter: toadlineadapter = new toadlineadapter(mcontext, getdata()); recyclerview.setadapter(toadlineadapter); // remove below line // toadlineadapter.notifydatasetchanged(); toadlineadapter.setclicklistener(th

nuget - red dot remains with drm-free imageresizer -

so have installed imageresizer diskcache plugin elite nuget . have restarted apppool touching web.config . cleared imagecache folder , browser cache. red dot remains on image. in diagnostics says no license installed. how can verify downloads nuget package elite nuget ? image resizer diagnostic sheet new.kohleroptik.ch 29.06.2016 08:58:15 1 issues detected: resizer configuration(error): no license found domain new.kohleroptik.ch - features installed: r4performance or r4diskcache assembly use report: using plugins , assemblies v4 performance edition. ---------------- license keys not have license keys installed. ---------------- registered plugins: imageresizer.plugins.basic.defaultencoder imageresizer.plugins.basic.nocache imageresizer.plugins.basic.clientcache imageresizer.plugins.basic.diagnostic imageresizer.plugins.basic.webconfiglicensereader imageresizer.plugins.basic.sizelimiting imageresizer.plugins.basic.mvcroutingshimplugin imageresizer.plugin

javascript - Auto submit form cannot show up the selection option properly -

problem form selection box. i working on form , try make auto-submit once choose option. i have following codes: <script> function target_popup(form) { w = window.open('', 'metas_pop', 'width=600,height=400, resizable, scrollbars'); form.target = 'metas_pop'; w.focus(); } </script> <script src="gen_validatorv4.js" type="text/javascript"></script> <script src="jquery-3.0.0.js"></script> <link rel="stylesheet" type="text/css" href="osce_style.css"> and in form: <form action="" method="post"> <select style="color: red; font-size: larger" name='examiner_role' onchange='this.form.submit()' onselect='<?php $examiner_role=$_post['examiner_role'];?> <option style="color: red; font-size: larger" value="1"&

android - Custom view's measurements -

Image
i creating custom view , in layout file, set width 200dp, , height 200dp. <com.example.baoshuai.mydefineview.mytextview android:layout_width="300dp" android:layout_height="300dp" android:layout_margin="30dp" android:text="hello,sunshine" android:textallcaps="false" android:paddingtop="40dp" android:textalignment="center"/> i using getwidth() or getmeasuredwidth() view's width, value not 200dp, 700dp. here measurements: @override protected void ondraw(canvas canvas) { super.ondraw(canvas); canvas.drawcolor(color.blue); int width = getwidth(); int height = getheight(); log.d("get","width:"+width+" height:"+height); int measuredwidth = getmeasuredwidth(); int measuredheight = getmeasuredheight(); log.d("getmeasured","measuredwidth:"+measuredwidth+" measuredheight:"+measuredheight)

css - Transparent button on top of images -

Image
i want create transparent button on top of images. like this my css skills hit limit here. how do css? should work on browsers. lets have div container there inside image tag , underneath button tag. <div id="box"> <img....> <div class="overlaybutton"><a href=...." class="button"><font color="#ffffff">profile blabla</font></a></div> </div> this should minimum code should provide assume. handle problem: need change position of box img , overlaybutton in css code. this: .box img { position: absolute; .. .. } .box .overlaybutton { position: absolute; opacity:0.5; //to make transparent } the rest should self explained. hope helped you.

google spreadsheet - Get column headers with query language -

i'm using query language query data spreadsheet. retrieve first row(column headers), how do that? currently i'm using: select * ( = -1 ) , data in column never equal -1, returns column headers. is there straightforward way this? you can use query(a:z, "select * limit 0", 1) meaning: select all, return @ 0 rows. result header row returned (the 3rd parameter make clear there 1 header row). but it's not natural use query purpose. function array_constrain provided purpose of truncating array of data. example, =array_constrain(a:z, 1, 1e7) returns first row of given array. (since no limit on number of columns needed, gave 1e7 = 10,000,000 maximal number of columns. spreadsheet can't have many cells.)

ios - UITableViewCell scrolling is janky when the scrolling is slow / decellarating -

i have problem have relatively sophisticated table view cell using autolayout, , can't seem understand why scrolling jerky @ slow speed. i have run through instruments time profiler nothing stands out major cause. additionally, when scroll quickly, goes smoothly on iphone 6s. have verified can 55 - 60 fps using instruments core animation. issue happens when scroll little bit. here facts think relevant: the table view using automatic dimension using estimated row height. cells being reused. the table view has 20+ sections, , each section have 3 rows. each cell has collection view displays photos in grid format. height of collection view changes based on how many photos show in grid using height constraint. i tried eradicate blended layers, doesn't fix issue seeing. even tried simple solution of caching cell height in willdisplaycell delegate method , see if scrolling upwards smoother. didn't work. i happy provide more data points, stuck in way don't kn

c# - CommandBindings as static resources in MenuItem -

i doing test commandbindings modifying code found in book , stumbled upon problem. i'd define custom behaviour cut/copy/paste commands working both usual key combinations , context menu in textbox , standard menu. in order avoid redefining commandbindings declared them window resources. working in textbox don't know how use in menuitems. this code put in place till now: <window x:class="myspellchecker.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="myspellchecker" height="331" width="508" windowstartuplocation ="centerscreen" focusable="true"> <window.resources> <commandbinding command="applicationcommands.open" x:key="opencmdbinding" executed="opencmdexecuted" canexecute="opencmdcanexe

java - A good way to implement Singleton pattern with Spring -

i want implement singleton pattern in context of spring application. singleton object created spring. to that: i put class implements applicationcontextaware beans spring context: public class appcontext implements applicationcontextaware { /** * private instance of appcontext. */ private static appcontext _instance; /** * @return instance of appcontext */ public static appcontext getinstance() { return appcontext._instance; } /** * instance of applicationcontext. */ private applicationcontext _applicationcontext; /** * constructor (should never call code). */ public appcontext() { if (appcontext._instance != null) { throw (new java.lang.runtimeexception(messages.getstring("appcontext.singleton_already_exists_msg"))); //$non-nls-1$ } appcontext._instance = this; } /** * instance of class define in applicationcontext. * * @param name_p * bean's identifier in a

mysql workbench - PHP deleting last 7 day login attempt query error -

Image
i have following mysql query delete last 7 days login attempts; delete loginattempt loginat < date_sub( now(), interval 7 day ) i error when run in workbench; error code: 1175. using safe update mode , tried update table without uses key column disable safe mode, toggle option in preferences -> sql editor , reconnect. 0.032 sec here table; create table loginattempt( loginid int not null auto_increment, ipaddress varchar(20) not null, loginat datetime not null default now(), primary key(loginid) ); i guess want remove rows older 7 days... anyway disable safe mode must uncheck option in edit > preferences:

html - style input range to look like a progress bar -

Image
i have video element , want create own controls player. i'm using range input seek bar. want style this: so orange have seen , teal time left. i managed style input this: https://jsfiddle.net/d3oeztwt/ don't know orange. i know can use progress bar can't find way trigger slider progress bar. <input type="range"> input[type=range] { /*removes default webkit styles*/ -webkit-appearance: none; /*required proper track sizing in ff*/ width: 300px; } input[type=range]::-webkit-slider-runnable-track { width: 300px; height: 10px; background: #009999; border: none; border-radius: 3px; } input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; border: none; height: 20px; width: 20px; border-radius: 50%; background: #99ffff; margin-top: -4px; } input[type=range]:focus { outline: none; } i did cross-browser solution (+ie9, ff, chrome, safari), css. http://codepen

java - Running kafka consumer(new Consumer API) forever -

i have built queueing system on apache kafka . application produce messages particular kafka topic , @ consumer end have consume records produced topic. wrote consumer using new java consumer api. code looks properties props = new properties(); props.put("bootstrap.servers", kafkabrokerip+":9092"); props.put("group.id",groupid); props.put("enable.auto.commit", "true"); props.put("session.timeout.ms", "30000"); props.put("auto.offset.reset", "earliest"); props.put("key.deserializer","org.apache.kafka.common.serialization.stringdeserializer"); props.put("value.deserializer","org.apache.kafka.common.serialization.stringdeserializer"); kafkaconsumer<string, string> consumer = new kafkaconsumer(props);

android - Check boolean on every app start -

i want check, if boolean true, on every app start. when boolean false, user should redirected activity. call in start activity. when user enters app via notification or direct activity start, not called. i tried in applications class, since can't redirect users activities there, not work , don't want add call every activity. how can check, if user logged in no matter, activity started? create baseactivity , extend activities base activity. put boolean checking code in base activity. no matter activity app starts if activities , extending base activity called. this: public class baseactivity extends activity{ @override public void onresume() { super.onresume(); // check boolean here , act accordingly } } then extend activities one.

inheritance - operator= and functions that are not inherited in C++? -

until test i've made, believed constructors not inherited in c++. apparently, assignment operator= not too... what reason of ? is there workaround inherit assignment operator ? is case operator+= , operator-= , ... ? are other functions (apart constructors/operator=) inherited ? in fact, encountered problem doing crtp : template<class crtp> class base { inline crtp& operator=(const base<crtp>& rhs) {/*something*/; return static_cast<crtp&>(*this);} }; class derived1 : public base<derived1> { }; class derived2 : public base<derived2> { }; is there solution working ? edit : ok, have isolated problem. why following isn't working ? how solve problem ? #include <iostream> #include <type_traits> // base class template<template<typename, unsigned int> class crtp, typename t, unsigned int n> class base { // cast base public: inline base<crtp, t, n>& operator()()

php - submit form to MySQL database, working only once -

i have problem sending data table, table supposed keep placed order , cart_array , name , first name , last name , etc.. it submits, first time, , if want place order nothing happens... won't send data table. if delete first entry table , place order again, works auto increment id jumps 1 deleted(let's id-1 id-14, depends on mow many attempts i've had) the php block is <?php function register_transaction($register_order){ array_walk($register_order, 'array_sanitize'); $fields = '`' . implode('`, `', array_keys($register_order)) . '`'; $data = '\'' . implode('\', \'', $register_order) . '\''; mysql_query("insert `transactions` ($fields) values ($data)"); } if (empty($_post) === false) { $register_order = array( 'product_id_array' => $_post['product_id_array'], 'payer_email' => $_post['paye

javascript - How to call method from a controller to another controller appcelerator -

i'm build application appcelerator-studio. the application create programmatically table code: controller.js var rowdata = []; var header = alloy.createcontroller('result_row_header',{ examination:titanium.locale.getstring(lang+"examination"), start_date:titanium.locale.getstring(lang+"start_date"), end_date:titanium.locale.getstring(lang+"end_date") }); var viewheader = header.getview(); //disegno la testata rowdata.push(viewheader); $.table.setdata(rowdata); function set_fields(lang) { header.changelanguage(lang); } result_row_header.js var args = arguments[0] || {}; $.examination.text = args.examination; $.start_date.text = args.start_date; $.end_date.text = args.end_date; function changelanguage(lang){ $.examination.text=titanium.locale.getstring(lang+"examination"); } now want call changelanguage method controller.js if try execute method set_f

android - Customing buttons in Dialog Box in Firemonkey -

Image
i developing multi-device application in firemonkey. in cases in app appears dialog confirm action, confirm exit application (in spanish): i put text in buttons in spanish, say, 'yes' 'si' ... how can easiest way? thanks much.

arrays - VBA Live-filter listbox via textbox & save multiple selections from listbox in one cell -

hello again community, after got last problem , promted me rework entire code in more efficient manner, ask 2 more questions regarding same project. (1) implement live-filter in listbox cglist1 , connected textbox searchcglist1 . whenever types in textbox, results in listbox should adjusted. found article on website, article 3 on external webpage. however, due limited skills, have not been able adapt properly. more later. (2) after multiple items same listbox cglist1 have been transferred second listbox cglist2 via button (which works treat), save them in same cell (range "bm") on worksheet meta db . problem used google extensively , tried adapt findings (see links below) code - without success. i hope patient ones amongst can me out once again, in knowledge trying learn as possible. problem lot of things, not know for. my preliminary code problem 1: cglist1 , cglist2 have no code. populated in userform_initialize sub via: 'fill material groups listb

html - Atleast one select box is required -

i have 2 select boxes in want @ least 1 should required. if select 1 select box should tru. if select both select box should tru. if not select 1 should required . here code <select name="a[]" > <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="mercedes">mercedes</option> <option value="audi">audi</option> </select> <select name="b[]" > <option value="volvo">volvo</option> <option value="saab">saab</option> <option value="mercedes">mercedes</option> <option value="audi">audi</option> </select> html : <select name="a[]" id="test1" > <option value="">select vehicle</option> <option value="volvo">volvo</option

Edit Json schema with python -

i have main json-schema. looks that: { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "listinfo": { "type": "object", "properties": { "limit": { "type": "integer" }, "count": { "type": "integer" } }, "required": [ "offset", "count" ] }, "items": { "type": ["array", "null"], "items": { "type": "object", "properties": { "startdate": { "type": "string" }, "customer": { "type": "object", "properties": {

excel - Conditional subtraction from multiple cells -

Image
a |b |c |....|k |l |m | tom |0 | |....|tom |jim |dave | jim |1000 | |....|15000|14000|12000| dave |3000 | |....| | | | using google sheets one. values in columns k , l , , m read column b , detect if corresponding cell a reads 1 of 'tom', 'jim', or 'dave' example, , subtract amount correct column reduce running total. i've had trouble figuring out , tried use conditional formatting solve can't seem quite there. there formula can use read column b , subtract amount shown correct column based on name in column a? so pseudo-code it: read(column b cell); if(column b cell - 1 column = "tom") { column k - (value of column b cell) } else if(column b cell - 1 column = "jim") { column l - (value of column b cell) } etc. is there simple method can use generate result? thought changing formatting of cell based on name in cell next , subtracting value of cell colour becomes unwield

How to change the convert command to python code -

i'm using imagemagick image enhancement in project. i'm newbie imagemagick, have started using command line argument package. further processing, need change below command python code. convert sample.jpg -blur 2x1 -sharpen 0x3 -sharpen 0x3 -quality 100 -morphology erode diamond -auto-orient -enhance -contrast -contrast-stretch 0 -gamma .45455 -unsharp 0.25x0.25+8+0.065 -fuzz 2% output.jpg i think possible using wand package. possible convert arguments using in above command. appreciated. thanks you can use os.system() run terminal commands python. import os command = 'convert sample.jpg -blur 2x1 -sharpen 0x3 -sharpen 0x3 -quality 100 -morphology erode diamond -auto-orient -enhance -contrast -contrast-stretch 0 -gamma .45455 -unsharp 0.25x0.25+8+0.065 -fuzz 2% output.jpg' os.system(command) if want use paths dynamically, can use .format() method: infile = 'sample.jpg' outfile = 'output.jpg' command = 'convert {} -blur 2x1

javascript - jQuery Keypress Arrow Keys steering in DropDown -

i have problem dropdown, connected database , can't control arrows , down move result mouse click. see code started writing doesn't work. doing wrong? $(field-customer-dropdown).on("keydown", function(event) { var keycode = event.which; if (keycode == 38 || keycode == 40) { showdropdown(); } }); edit : as made little code looks this: $("body").on("keydown", function(event) { var keycode = event.which; if (keycode == 40) { console.log("key"); $(".drop-down-row:firstchild").css("backgroundcolor","red"); } }); and result: enter image description here how should code push keydown 40 switch data 1 on data 2? can me? javascript variables cannot contain - in them. also, selector using not html tag, doesn't have prefix. if it's class , prefix . else if id , prefix # . $(&quo

angular - Angular2 CanActivate from beta to current RC3 -

i'm trying implement in angular2, auth0 login method video . using angular2-jwt . i read documentation , tried implement it, can't right. tried export class navbarcomponent implements canactivate , routercanactivate(){} , canactivate(){} . i'm stuck. what changes needed canactivate work in current rc3? import {canactivate} 'angular2/router'; import {tokennotexpired, jwthelper} 'angular2-jwt'; ... @canactivate (()=>tokennotexpired()) export class navbarcomponent{ ... } see https://angular.io/docs/ts/latest/guide/router.html#!#can-activate-guard https://angular.io/docs/ts/latest/guide/router.html#!#can-deactivate-deactivate create service class acts guard: import { canactivate } '@angular/router'; export class authguard implements canactivate { canactivate() { console.log('authguard#canactivate called'); return true; } } in new router supports dependency injection out of box config

javascript - Backbone collection: add logic to item models -

i update backbone collection array of bare objects using reset : const collection = new backbone.collection(); // ... const switches = [ { color: "red", on: false }, { color: "green", on: false }, { color: "blue", on: true } ]; collection.reset(switches); now there 3 models in collection. want them have toggle() method: toggle: function() { this.save({ on: !this.get("on") }) } how can add it? when don't pass model backbone collection, backbone uses normal models. if want have customized models, should define model using backbone.model.extend() function , pass collection: const model = backbone.model.extend({ toggle: function() { this.save({ on: !this.get("on") }) } }); const collection = backbone.collection.extend({ model: model }); const collection = new collection();

ruby - Why can't I see TTL from db.my_collection.getIndex() output? -

i have index expireafterseconds set. how confirm using cli when output of db.my_collection.getindexes() shows this: { "v": 1, "key": { "last_used_at": 1 }, "name": "last_used_at_1", "ns": "cms.user_sessions" } it looks normal index without expireafterseconds set. how can confirm index created expireafterseconds ? here's ruby code creates index. have tried dropping index , recreating using code several times. @user_sessions.indexes.create_many([ {key: {token: 1}, unique: true}, {key: {last_used_at: 1}, expireafterseconds: ttl} ]) version information: $ mongod --version db version v2.6.5 2016-07-13t16:11:45.844+0200 git version: e99d4fcb4279c0279796f237aa92fe3b64560bf6 $ gem list | grep mongo mongo (2.2.5) there issue index, try drop , recreate. when ttl set db.name.getindexes() command [ { "v" : 1, "key" : {

php - Simple round function doesn't round -

i'm trying round 1 value 8 symbol after decimal doesn't round anything. example: 12/653.44 result: 0.018364348677767 i want round , output 8 symbols after , . function: public static function getusdrate() { $urldata = get_curl_content('https://example.com/'); $rates = json_decode($urldata, true); if (!$rates) { return '-'; } $usdrate = $rates['usd']['sell']; if (!$usdrate) { return '-'; } return round($usdrate, 8); } function calling: $singles->price/getusdrate() when call function echoes whole number... if want result have 8 decimals, should use: echo round($singles->price/getusdrate(), 8); with information in question, can see rounding early, since perform more calculations later. remove rounding getusdrate() function. if want 8 decimals in number display, rounding must performed after computations. modify getusdrate() function include rounding there: public sta

Rewrite file with hardcoded variables in UNIX SHell -

i have properties file (mydataflow.properties) called upon argument (--override) in unix shell script - see below. source ./myshell.properties $dr_home/bin/dr -cp $cp_plugin -xmx64g --engine parallelism=1 --runjson $workflow_dir/mydataflow.dr --overridefile mydataflow.properties >> $log_file unfortunately program being called upon here must have variables in properties file hardcoded. able use variables "myshell.properties" file or environment variables within "mydataflow.properties" file, can move script new environments. for example mydataflow.properties file sets following variable: dataflow.url=jdbc:ingres://someserver01.local:vw7/mydb however use variable called "mydburl" read in myshell.properties instead mydataflow.properties file this: dataflow.url=$mydburl as cannot around fact dataflow.url variable must hardcoded, looking way read mydataflow.properties file non hardcoded variables, , write out new file have hardcoded vari

Drupal cron - only one task running -

how configure drupal cron ensure task run if no other task running? the file /var/www/html/drupal/cron.php default. thanks! if tasks mutually exclusive ie: 1 can't run after other 1 finishes. should configure tasks single 1 , have them run subsequently. otherwise use hook_cron validate if second task running , schedule current task future time until finishes. hope helps bewilled.

java - RESTful service in Spring configuration with jackson-datatype-jsr310 -

i trying configure java 8 & spring 4.3.1 app use restful services. work config below, until introduce contextresolver . the reason contextresolver because need format java.time.localdatetime json . i first tried annotations on model bean adding @jsonformat , @jsonformat(shape = jsonformat.shape.string, pattern = date_format) @datetimeformat(pattern=date_format) @column(name = "joining_date", nullable = false) @type(type="org.hibernate.type.localdatetimetype") private localdatetime joiningdate; and got following error : java.lang.nosuchmethoderror: com.fasterxml.jackson.datatype.jsr310.ser.jsr310formattedserializerbase.findformatoverrides(lcom/fasterxml/jackson/databind/serializerprovider;lcom/fasterxml/jackson/databind/beanproperty;ljava/lang/class;)lcom/fasterxml/jackson/annotation/jsonformat$value; secondly, removed @jsonformat annotation , tried contextresolver , objectmappercontextresolver.java package com.jobs.spring.config

javascript - Context Menu not working in ANGULARJS -

i trying add context menu value not populating. <div class="m-l"> <a class="item-country text-orange" href="#/app/countryips/{{item.data['name']}}/ccode/{{item.data['country-code']}}" target="_blank"> {{item['data']['name']}} </a> <a class="item-ip" href="#/app/showips/{{item.data['name']}}/ip/{{item.data['ip']}}" target="_blank"><span context-menu="whitelist"> {{item.data['ip']}}</span> </a> <a href="" class="item-type text-orange"> {{item.data['type']}} </a> <a class="detail-icon" data-popup-open="popup-1" href="" ng-click="showmodal(item)"> <i class="fa fa-info-circle"></i> </a> </div> javascript $scope.whitelist = [ ['add wh

How do I get the list of all the classes and methods used in a Java project in eclipse? -

i have been trying list classes , methods in java project in eclipse. tried create javadoc gave me error. wasn't created. is there shortcut can list of classes , methods or @ least list classes used in project. try javap no options, may you. http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javap.html

angularjs - Get average from multiple JSON objects values -

Image
i have data following data: var v = { "2015-09-23":[ {"allconversions":"0.1","averagecpc":"0.01","averagecpm":"0.02","averageposition":"8.3",id:1}, {"allconversions":"0.0","averagecpc":"0.00","averagecpm":"0.00","averageposition":"9.0",id:1} ], "2015-09-18":[ {"allconversions":"0.1","averagecpc":"77.14","averagecpm":"239.57","averageposition":"7.7",id:1}, {"allconversions":"0.0","averagecpc":"39.97","averagecpm":"703.91","averageposition":"3.8",id:1}, {"allconversions":"0.0","averagecpc":"20.40","averagecpm":"381.36","averageposition":"4.3"

python - dill: TypeError: 'module' object is not callable when dill.load() is run from different files -

i use dill store python objects file like: with open(filename, 'wb') output_: dill.dump(obj, output_) and load stored objects test.dprj file c:...\dys_project\testsread_write.py import pprint mbd_system import read_and_write mbd_system.mbd_system import mbdsystem if __name__ == "__main__": mbd_file_abs_path = "c:\...\\test.dprj" mbd = read.read(mbd_file_abs_path) pprint(vars(mbd)) it works fine , object properties printed. if try load file within application dysmainwindow in c:...\dys_project\dys.py from mbd_system.mbd_system import mbdsystem mbd_system import read_and_write class dysmainwindow(qtgui.qmainwindow): def __init__(self): super(dysmainwindow, self).__init__() def showopenfiledialog(self): ... self.mbd_system = none self.mbd_system = read_and_write.read(filename) print self.mbd_system.__dict__ pprint(vars(self.mbd_system)) dictionary printed correctly, w

html - How to make entire table cell clickable when it has a hyperlink - using bootstrap v3 -

Image
this how trying not work the thing is, gets 100% width equal table cell width height not change. how can make entire table cell clickable? here do <td><a href="default.aspx?clusterid=1" class="btn-full">click here</a></td> and inside css file .btn-full { display: block; width: 100%; height: 100%; } the bootstrap version use v 3.3.6 i testing latest version chrome : version 51.0.2704.106 m in case, since other td in same row has more content, need make td contents equal height. below code should work above issue. td{overflow:hidden;} .btn-full { display: block; width: 100%; height: 100%; margin:-1000px; padding: 1000px; }

javascript - Ruby on Rails get google analytics visitors count and save into my app db. -

i working google analytics add in project. create account , added js code application footer section. want retrieve visitors information count, geo etc. need specific , simple solution that. in app/services/google_analytics.rb file, require 'google/api_client' require 'date' class googleanalytics def initialize @client = google::apiclient.new(:application_name => env['ga_app_name'], :application_version => '1.0') key_file = file.join('config', env['ga_key_file_name']) key = google::apiclient::pkcs12.load_key(key_file, 'notasecret') service_account = google::apiclient::jwtasserter.new( env['ga_service_account_email'], ['https://www.googleapis.com/auth/analytics.readonly', 'https://www.googleapis.com/auth/prediction'], key) @client.authorization = service_account.authorize @analytics = @client.discovered_api('analytics', 'v3'

java - Best way to to have GridPane with editable numbers(a la Sudoku)? [JavaFX] -

i want able edit numbers, have them readable , writable(via observer pattern). would gridpane containing labels solution? way have now, labels aren't updated when call settext on them. maybe kind of list backing gridview optimal, don't know how approach that(have searched already). you can use textfield , change css appear desired. can set textfields non editable hold initial values of suduko using textfield.seteditable(false) you can use following css make textfield transparent. .text-field { -fx-background-color: transparent ; -fx-background-insets: 0px ; }

postgresql - Spring-boot JPA connect to postgres where database and schema are provided at runtime -

i building multi-tenant application, tenant database configuration stored in redis. based on request, query redis database , schema configured tenant, application built on spring boot. i took @ spring boot's jpa sample, , did more google find suitable solution this, unfortunately, couldn't find one. is possible use jpa sample provided here ? https://github.com/spring-projects/spring-boot/tree/master/spring-boot-samples/spring-boot-sample-data-jpa please suggest me other best possible way tackle problem thanks spring data jpa uses jpa annotations define domain model. these jpa entities define schema database. can't change these entities, nor db schema on runtime. so no, updating schema on runtime not possible spring boot + spring data jpa combo. database connection (e.g. db url, username password) more flexible. need create datasource beans programmatically , somehow programatically define data source use each query per tenant. wasn't requirement

web services - Deploy Maven RESTful webservice project with Glassfish to Ubuntu server -

first of all, created restful webservice maven project. when browse http://localhost:8080/jsonservice/vehiclegroups receive list vehiclegroups. working when run in netbeans. now have following question: what steps deploy .jar ubuntu server? so created jar dependencies source . defined main class 1 empty because code inside methods called when visiting specific path. when run .jar file, executes code inside main class , stops. how make sure runs inside netbeans , receive data when browsing urls? do have install glassfish server on ubuntu , run jar? want program keep running , answer path requests. thanks! i got working! install glassfish on ubuntu , browse admin panel. go applications > deploy > add .war file. you have put mysql-connector-java-5.1.23-bin.jar inside global lib folder of glassfish avoid errors. everything works fine after that. cheers!

c++ - Draw circle on depth data from Kinect V2 -

i beginner in programming , have been going through depthbasics-d2d sample in kinect2 sdk. interested in getting depth value of single point , want draw point on output window depth image better visualization. red dot on pixel location [x,y] of getting depth value. how that? thank you.

tensorflow weights only 2 values change? -

Image
i wrote simple nn tensorflow actuate real robotic finger. problem is, after training hour, seemed has little bit learned in direction go, when @ weights in tensorboard, seemed 2 values gets updated, other values stay around 0 (to initialzed) ? here code: https://github.com/flobotics/flobotics_tensorflow_controller/blob/master/nodes/listener.py the loss decreasing should, looks good, if isnt :) edit: tried minimize code this, hope ok ? num_states = 200+200+1024+1024 #200 degree angle_goal, 200 possible degrees joint move, 1024 force values, 2 times num_actions = 9 #3^2=9 ,one stop-state, 1 different speed left, 1 diff.speed right, 2 servos session = tf.session() build_reward_state() state = tf.placeholder("float", [none, num_states]) action = tf.placeholder("float", [none, num_actions]) target = tf.placeholder("float", [none]) weights = tf.variable(tf.truncated_normal([num_states, num_actions], mean=0.1, stddev=0.02, dtype=tf.float3

hyper v - Windows Phone Emulator not running on Windows 8.1 on VirtualBox on Mac Book Pro -

Image
[ my configuration is: mac book pro running virtual box running windows 8.1, there getting error. i have checked in control panel>>programs , features >> hyper-v: components checked. also, have checked services (run>> services.msc) hyper-v services running perfectly. tried windows 10 , windows 8.1, no luck. appreciated ! according suggestion given, uninstalled hyper-v , tried again, got error "hyper-v not enabled" thanks ! windows hyperv , virtual box trying same job , conflict each other. since hyperv takes control on boot, you'll need uninstall hyperv use emulator in virtual box.

android - PackageInfo versionName now says INSTANT_RUN -

it appears android studio 2.2 preview 4 substitutes "instant_run" versionname in packageinfo rather has been put in manifest. is there other way of seeing in versionname in manifest? code using is: gstrversion = context.getpackagemanager().getpackageinfo(context.getpackagename(), 0).versionname; to answer question, no, there no other way version name manifest. but try as commented sir commansware you should disable instant run, file → settings → build, execution, deployment → instant run , uncheck enable instant run. check this answer more details

html5 - Rotating Image in List Format, Caption Needs to be Stationary -

got image in list other images. want caption remain fixed image rotates away original position. once it's inside has 'obey' transition rules. https://jsfiddle.net/k8k5kkkj/ the reason why images going in list format because that's way can use pure ccs 'flip' effect. can't images transition way in other formats. heres code. <!doctype html> <html lang="en"> <head> <style> ul.images { width:60%; /*background:#ccc;*/ list-style:none; float:left; /*padding:0 0 2.5% 0;*/ margin-top:5px; } ul.images li { width:30%; float:left; margin:2.5% 0 0 2.5%; position:relative; } ul.images li img { max-width:100%; float:left; border:2px solid #eee; -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; } .images li { -moz-transition:all 1s ease; -webkit-transition:all 1s ease; -o-transition:all 1s ease; -ms-transitio

Spring Social Facebook URL Redirect on another server -

i'm new on spring social api, i'm trying login application facebook, it's not redirecting me domain url. my application running on 2 servers, based on restcontroller ajax form submitted. 1 apache web server , 1 tomcat server. but not facebook authentication based on restcontroller, if user need login facebook id can click on login facebook button , page redirecting facebook login pate, not redirect requested url. my code under: login facebook @requestmapping(value = "/fbauth", method = requestmethod.get) public void fbredirect(@requestparam map requestparams) throws unsupportedencodingexception { string accesstoken = null; // string accesstoken = // "caafv5tfcxvsbamkgz7mz63esclek3jgzbezazbqlj3capiyqmva5hortl9ln05o3brtcx95tjt9ixzbfrz3fkzbjnj74qko1sfjjzaxmddnzvepmgxswom8nhegtza6aub7bnzbybimo2zbxx2gpo6ky7dkqu2xzbuymaalagg3ixarqme3e3w1ruutveyqrtmb3x0pehhoiatqzdzd"; resttemplate restt