Posts

java - InterceptorBinding is not working -

i created custom annotation below @interceptorbinding @retention(runtime) @target(type, method) public @interface traceable {} i wrote interceptor below @traceable @interceptor public class enterexitlogger { @aroundinvoke public object aroundinvoke(invocatiobcontext c) {} } the interceptor , annotation in module called common-utils. i annotated target class @traceable @ class level below @traceable public class cdimanagedbean { } i declared interceptor entry in beans.xml file below <interceptors> <class>my.package.enterexitlogger</class> </interceptors> the target class in separate module. beans.xml in meta-inf directory of target class's module. the target class's methods called rest class. when invoke methods interceptor's aroundinvoke method not called. i read docs , understood interceptor should contain public no argument constructor. added it. still interceptor not called. i added @inherited on custom anno...

python - right way to use eval statement in pandas dataframe map function -

i have pandas dataframe 1 column 'organization', , content of such column string list inside string : data['organization'][0] out[6] "['loony tunes']" data['organization'][1] out[7] "['the 3 stooges']" i want substitute string list inside string. try use map, function inside map eval: data['organization'] = data['organization'].map(eval) but is: traceback (most recent call last): file "c:\users\xxx\anaconda3\lib\site- packages\ipython\core\interactiveshell.py", line 3035, in run_code exec(code_obj, self.user_global_ns, self.user_ns) file "<ipython-input-7-3dbc0abf8c2e>", line 1, in <module> data['organization'] = data['organization'].map(eval) file "c:\users\xxx\anaconda3\lib\site-packages\pandas\core\series.py", line 2015, in map mapped = map_f(values, arg) file "pandas\src\inference.pyx", line 1046, in pan...

java - How to repeat code; If user inputs no. I want all three loops to repeat, until user inputs Yes -

// first loop number of quarters int quarter; while (true) { system.out.print("enter number of quarters (1-10): "); if (keyboard.hasnextint() && (quarter = keyboard.nextint()) >= 1 && quarter <= 10) break; keyboard.nextline(); // discard bad input system.out.println("number of quarters must between 1 , 10"); } keyboard.nextline(); // discard rest of line system.out.println("you have " + quarter + " quarters."); // second loop rate of intrest double intrestrate; while (true) { system.out.print("enter interest rate (5%-25%), without percent sign: "); if (keyboard.hasnextdouble() && (intrestrate = keyboard.nextdouble()) >= 5 && intrestrate <= 25) break; keyboard.nextline(); // discard bad input system.out.println("interest rate must between 5% , 25%"); } keyboard.nextline(); // discard rest of line system.out.println("you have ...

asp.net mvc - How to store my data using at the end of my step in MVC? -

i have form using table of request using idrequest (int) , titleofrequest , other table events can have multiple events same request. so table of events include : ideventst, idrequest, idtypeofevent, dateststrong textart, dateend table of typeofevent : idtypeofevent,titleoftype from view create new record, record create @ final step, want make in order 1 ) enter form fields titleofrequest , fields person can enter : datestart , dateend , typeofevent , button add, , load temporary records in datatable. my questions : best way store temporary data mvc ? , refresh in view @ least save in database. you use [tempdata] if want store data next request only.tempdata allow persisting data duration of single subsequent request. if data should accessible between multiple requests, use session. [session] able store data more long time, until user session not expire. here blogpost on matter: http://petermcintyre.com/2013/01/27/asp-net-mvc-data-persistence-c...

linux - Understanding how bootmem works -

i have been studying os concepts , decided in how these stuff implemented in linux. having problem understanding thing in relation memory management during boot process before page_allocator turned on, more precisely how bootmem works. not need exact workings of it, understanding how things are/can solved. so obviously, bootmem cannot use dynamic memory, meaning size has must known before runtime, appropriate steps can taken, i.e. maximum size of bitmap must known in advance. understand, solved mapping enough memory during kernel initialization, if architecture changes, change size of mapped memory. obviously, there lot more going on, guess got general idea? however, makes no sense me numa architecture. everywhere read, says pg_data_t created each memory node. pg_data put list(how can know size of list? or size fixed specific arch?) , each node, bitmap allocated. so, basically, sounds can create undefined number of these pg_data , each of has memory bitmap of arbitrary size....

javascript - sessionStorage.clear() not working -

i'm using sessionstorage in project, 1 caveat: can't eliminate storage clear() operator, documented. i'm doing when logging out of administrative mode of site, involves clicking on log out item in list, this: <li><a href="admin_logout.php">log out</a></li> the admin_logout.php file destroys session variables, etc., , redirects home page of site. previous form, works, is: <?php session_start(); session_destroy(); @header('location:./'); exit; ?> that works fine. can't seem integrate routine clearing sessionstorage. text of admin_logout.php file, i've tried: <?php session_start(); ?> <script> sessionstorage.clear(); </script> <?php session_destroy(); @header('location:./'); exit; ?> ...as as: <?php session_start(); echo '<script>'; echo 'sessionstorage.clear();'; echo '</script>'; session_destroy(); @header('location:./...

sql server - How does sql returns all rows when concating declared column and defining it? -

how possible in sql? declare @liststr varchar(max) ;with comma (name) ( select 'a' union select 'b' union select 'c' union select 'd' ) select @liststr = case when @liststr+',' null '' else @liststr+',' end + name comma select @liststr result the above query retuns following result +---------+ | result | +---------+ | a,b,c,d | +---------+ where if remove case statement. declare @liststr varchar(max) ;with comma (name) ( select 'a' union select 'b' union select 'c' union select 'd' ) select @liststr = @liststr+',' + name comma select @liststr result the result is +--------+ | result | +--------+ | null | +--------+ not @ all. when sql server concatenates string null value, value null . if set value empty string first, both return same values: declare @liststr varchar(max); set @liststr = '...