Posts

javascript - D3 fading SVG path animation -

could please show me how fade out older path segments in d3 svg animation: http://jsbin.com/zegim/2/edit this example fading out entire path in 10 seconds, see how path segments (and remain faded). added line: path.append('svg:animate') .attr('attributename', 'opacity') .attr('from', '1') .attr('to', '0') .attr('dur', 10); the example same code question: changing speed of d3 path animation http://bl.ocks.org/explunit/6082362 thanks!

Javascript: How to use eval() safely -

this question has answer here: when javascript's eval() not evil? 22 answers i building little game , i've gotten point need calculate data in tips of abilities unique each individual unit. figured i'm gonna need formula. don't know if the way it's supposed done here's i've come with tip = 'hurls fire ball @ enemy, dealing [x] damage.'; formula = '5 * unit.magicpower * abilitylevel'; so each unit's tool tip use tip.replace('[x]', eval(formula)) which appears work fine, i'm concerned safety of code. hasn't been once or twice i've seen people discouraging use of it. there potential issues may occur way i'm using eval() ? as long you control input eval , it's safe use it. concern comes in when you're using process input don't control. @ point, becomes unsafe because ...

java - Querying Mapped Superclasses or Equivalent -

i have 3 classes subclasses of abstract superclass automobile. i'm using single table inheritance model , @mappedsuperclass automobile class. subclasses car, truck, , van. i want query automobile class, have different subclasses returned. i've written couple queries , done research, seems not possible query against mappedsuperclasses. have tried nativesqlqueries, can't seem able figure out how specifiy multiple resultsetmappings. is there anyway accomplish this? you cannot use mapped-superclass in query. if want use automobile in query, don't mark mapped-superclass, instead mark entity. following jpa 2.0 spec , second paragraph what's relevant in case - 2.11.2 mapped superclasses an entity may inherit superclass provides persistent entity state , mapping information, not entity. typically, purpose of such mapped superclass define state , mapping information common multiple entity classes. a mapped superclass, unlike entity, not ...

java - Calling arbitrary number of object instances -

import java.util.*; public class userinput { public static void main(string[]args){ scanner input = new scanner(system.in); system.out.println("how many students in class?"); student.n= input.nextint(); for(int i=0; i<student.n; i++){ student = new student(null, null, null, null, 0); } } } i new java , wondering if it's possible call number of object instances value inputted user during run time. here "n" number of instances want make , thought use method refer variable "i" create new object instance every "i" until reached inputted value of "n". however, duplicate local variable error. wondering if there way around this???? one possible way this: arraylist<student> manystudents = new arraylist<student>(); for(int i=0; i<student.n; i++){ manystudents.add(new student(null, null, null, null, 0)); }

sas - Encoutering an error 'run executed for function module' while calling function -

i wrote 1 module in proc iml , trying call using call fuctiong , supplied parameters. but throwing erorr: run executed function module. any suggestion? the error message says have defined function returns value ('function module') need call this: x = myfunction(x,y,z); you cannot use call statement call function, call subroutines not return values.

rewrite - Wordpress permalinks redirect to the homepage in Lighttpd -

i have wordpress app live on raspberry pi lighttpd. have activated permalink option in admin pattern http://www.myurl.com/index.php/%category%/%postname%/ when click link see post or other pages (static pages, categories), i'm redirected homepage. is there additionnal rules set in lighttpd? far understand, there if want have clean url without /index.php/ . of course, links such http://www.myurl.com/?p=x work fine. what missing? as stated in comments above, had disable "rewrite" plugin (i downloaded before knowing permalinks anyway). have managed have url without /index.php/ configuring /%category%/%postname%/ in permalinks section of wp-admin , having these rules in lighttpd.conf : url.rewrite-once = ( "^/wiki/.*" => "$0", "^/(.*/)?files/$" => "/index.php", "^/(.*/)?files/(.*)" => "/wp-includes/ms-files.php?file=$2", "^(/wp-admin/.*)" => "$1...

multithreading - Java while loop can not detect change by thread -

this question has answer here: loop doesn't see changed value without print statement 1 answer i'm new in java thread, write test program: //mytest.java public class mytest{ public static void main(string[] args){ mythread thread = new mythread(); int n; thread.start(); while (true){ //system.out.print(""); n = mythread.num; if (n != 0){ system.out.println("<num> has been modified " + n); if (n == -1) break; mythread.num = 0; } } system.out.println("main thread terminated!"); } } //mythread.java public class mythread extends thread { public static int num = 0; public void run(){ java.util.scanner input = new java.util.scanner(system.in); ...