Posts

Showing posts from July, 2011

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 = '

Python iteration program: print strings in a list that start with a specific character -

before begin question beginner student taking introduction python course @ school, apologies if question not worded, , suggestions welcome. the question struggling so: "create program requests list of names user , print names starting through i." so far code have had no luck figuring out doing wrong: students = input('enter list of students: ') s in students: if students[:1] == 'abcdefghiabcdefghi': print(s) any answers appreciated, thank time in advance. your problem appears here: if students[:1] == 'abcdefghiabcdefghi': this check false. str1 == str2 true, strings have same length, , have same characters in same order. students[:-1] going either 0 or 1 character long, can't ever equal longer string on right. check if character any of ones in long string, can use in operator: if students[:1] in 'abcdefghiabcdefghi': but note true if students empty string '' , might not want. can use stu

vb.net - Posting Panels Twice (Understanding pre-init) -

i have page dynamically builds group of panels based on sql call. here example of trying accomplish. when page first loaded several panels dynamically built. lets there 1 panel each state: ca, nj, fl, etc. if user clicks on 1 of panels (ie. 1 of states) sql call made , brings list of cities within state. page dynamically builds panels time listing cities within state clicked. when user clicks on of cities calls sql , find of schools listed in city , displays them in panels (again 1 school per panel). what's happening when states loaded display fine. though when user clicks particular state page reloads , displays of states , of cities after listing of states instead of listing cities. the proper cities being listed sql call working. solution i know several things. viewstate remembering panels created , loading them or when step through code it's loading both states , cities. dynamic controls handed during pre-init stage of life-cycle. question how

algorithm - I can't understand Pseudocode -

i want know how can improve understanding of algorithms? mean, if algorithm explained, able understand it. when read pseudocode of same algorithm, don't understand. like, have read shell sort, understand process , working of technique, when read it's pseudocode, don't understand why each specific step being taken? happens other algorithms too. there problem level of intelligence, or frequent problem? please help. i've done lot of self-studying on algorithms , data structures , i've found reading pseudocode 1 of hardest ways learn how algorithm or data structure works. in experience, best way understand algorithm high-level intuition behind it. what's key insight drives algorithm? @ high level, trying do? once know that, you'll have much easier time understanding algorithm. as example of this, try looking pseudocode dijkstra's algorithm or red/black tree. best pseudocode extremely hard understand because pseudocode doesn't make distin

python - faster alternative to numpy.where? -

i have 3d array filled integers 0 n. need list of indices corresponding array equal 1, 2, 3, ... n. can np.where follows: n = 300 shape = (1000,1000,10) data = np.random.randint(0,n+1,shape) indx = [np.where(data == i_id) i_id in range(1,data.max()+1)] but quite slow. according question fast python numpy functionality? should possible speed index search quite lot, haven't been able transfer methods proposed there problem of getting actual indices. best way speed above code? as add-on: want store indices later, makes sense use np.ravel_multi_index reduce size saving 3 indices 1, i.e. using: indx = [np.ravel_multi_index(np.where(data == i_id), data.shape) i_id in range(1, data.max()+1)] which closer e.g. matlab's find function. can directly incorporated in solution doesn't use np.where? i think standard vectorized approach problem end being memory intensive – int64 data, require o(8 * n * data.size) bytes, or ~22 gigs of memory example gave above. i

android - IONIC - Create a custom keyboard instead use a plugin -

i'm having trouble build custom keyboard using ionic framework. i'm started use framework, information helpful. i have tried use plugin driftyco didn't provide clear tutorial of how use it, difficult implement. then found tutorial youtube android studio. need guide build in ionic, can please me?

php - build sortable table from multiple ajax request PART II -

i have question here. i have php script request data other web service. but need request many data need queue them , wait 1 one. so request data using jquery (async), problem is, data sorted loaded sequence. so how request them async, sorted them price(for example column 6) , serve them table.. thank answer , suggestion.. so here's code. this table container <table id="searchh" width="100%" border="0" cellpadding="10px" cellspacing="1px"> <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> </tr> </table> i request new tr via this $.get(request, function( my_var1 ) { $('#searchh>tbody>tr:last').after(my_var1); }); content of request this <tr> <td>data</td> <td>data</td> <td>data&

javascript - CryptoJS not decrypting non-Latin characters faithfully -

i trying use cryptojs aes, so: var msg = "café"; var key = "something"; var c = cryptojs.aes.encrypt(msg, key).tostring(); cryptojs.aes.decrypt(c, key).tostring(cryptojs.enc.latin1); unfortunately returns café , not café . latin1 not right encoding use, can't find better one. there solution? thanks. you missing format proper way using cryptojs.enc.utf8 so, please try: cryptojs.aes.decrypt(c, key).tostring(cryptojs.enc.utf8);

sql - Merge data from different rows to different columns -

this question has answer here: efficiently convert rows columns in sql server 3 answers i have table (t) user | language | value ----------------------- 1 |1 | string 1 |2 | otherstring and want merge/join them this user | language_1 | language_2 -------------------------------- 1 |string | otherstring i tried this select user, (case when language = 1 value end) language_1, (case when language = 2 value end) language_2 t but result (i should have expected this) user | language_1 | language_2 -------------------------------- 1 |string | null 1 |null | otherstring whats right way it? you need aggregation select user, max(case when language = 1 value end) language_1, max(case when language = 2 value end) language_2 t group user

fedora 21 - Supply *.pc file for pkg-config -

hi got problem newly installed fedora linux distribution. pkg-config supposed provide linker flags, pkg-config --cflags libboost-dev . pkg-config cannot find of library packages. pkg-config --list-all shows can find few packages. i searched online , learned pkg-config finds packages searching in pre-defined paths *.pc files. packages (both pre-installed , user-installed), there no such .pc file. *.pc file not generated everytime when package installs. 1, how can provide .pc file each of packages has been installed? 2, how can make sure each time new package installed, .pc file provided? the fedora packaging guidelines give information way in packages should created, , files should contain. the section -devel packages particularly relevant. to highlight parts there types of files belong in -devel package: header files (foo.h), found in /usr/include static library files when package not provide matching shared library files. see packaging:guidel

I want to print pattern of numbers using c program -

if n=3,the output 1*2*3 7*8*9 4*5*6 if n=5,the output 1*2*3*4*5 11*12*13*14*15 21*22*23*24*25 16*17*18*19*20 6*7*8*9*10 code: int i,j,a[50][50],k=1,m=0; for(i=0;i<n;i+=2) { for(j=0;j<n;j++) { a[i][j]=k; k++; } printf("\n"); } m=k; for(i=1;i<=n;i+=2) { for(j=0;j<n;j++) { a[i][j]=m; m++; } printf("\n"); } for(i=0;i<n;i++) { for(j=0;j<n;j++) { printf("%d",a[i][j]); } printf("\n"); } i not in c language, think you. please have look, , can making change if syntax error occurs logic clear. #include <stdio.h> #include <math.h> void printoutput(int n){ int k = ceil(n/2); int m =1; int j =1; int l =k; int i; int b; for(i=1;i<=n;i++){ for(b=m;b<=m+n;b++){ printf(b); } printf("\n"); if(i<k){ j= (2*j); m =n*j+1; } else{ int z = n-i-1; m= n+1 +n*(2)*z; l =z-2; } } } void main(){

c# - How to fix "'ServerVersion' threw an exception of type 'System.InvalidOperationException'"? -

Image
i have got local sql server db, , running, , trying connect in seemingly failproof way: new sqlconnection(@"server=(localdb)\v12.0;integrated security=true;database=mydbname;"); however, line throws exception: "'serverversion' threw exception of type 'system.invalidoperationexception'"? fix it? i have run sqllocaldb create "v12.0" but seems make no difference. try take @ how opening connection. have tried this: c# console application invalid operation exception

javascript - Is it possible to do Subscripting in SVG? -

i have drawn bar chart using dimple.js. have show yaxis labels , xaxis lables subscript. possible show subscript in svg. if yes please let me know how achieve subscripting in svg. fiddle - http://jsfiddle.net/keshav_1007/utfnlaz6/3/ var ymax = 1.2; var svg1 = dimple.newsvg("body", 360, 360); var datachart = [{ "brand": "aaaaaaaaaaaaaaaaaaaaaa", "day": "mon", "so2": 10 }, { "brand": "bbbbbbbbbbbbbbbbbbbb", "day": "mon", "so2": 20 }, { "brand": "ccccccccccccccccc", "day": "mon", "so2": 20 }]; var mychart = new dimple.chart(svg1, datachart); mychart.setbounds(120, 10, 200, 200) var x = mychart.addcategoryaxis("x", "day"); var y = mychart.addmeasureaxis("y", "so2"); y.ticks = 5; var s = mychart.addseries("

bash - sed contents of file appended to specific line in another file -

i have rather complicated sed script writes contents of file single line comma separated list in new file. i want read file , write end of specific line of file. better read original file, write comma separated list directly specified line in new file , skip middle man. sed -n '/# firstmark/,/# endmark/p' client_list.formal|grep -v "#"|awk -f\< '{print $2}'|awk -f\> '{print $1}'|xargs|sed -e 's/ /,\ /g'|sort -u|sed -i /writes stuff end of specified line > file.txt the break down is: sed -n '/ # firstmark/ (begin reading @ string) ,/# endmark/p' (stop reading @ string) client_list.formal (from file) grep -v "#" (remove commented out lines) awk -f\< '{print$2}'|awk-f\> '{print $1}' (print between < , >) xargs|sed -e 's/ /,\ /g'|sort -u (put on same line, add commas, , sort unique only) the final bit should write of output end of specified line in new file.

Python Shutil.copy if i have a duplicate file will it copy to new location -

i have working shutil.copy method in python i found definition listed below def copyfile(src, dest): try: shutil.copy(src, dest) # eg. src , dest same file except shutil.error e: print('error: %s' % e) # eg. source or destination doesn't exist except ioerror e: print('error: %s' % e.strerror) i accessing defination inside loop. loop based on string changes each time.the code looks @ files in directory , if see part of string in file copies new location i pretty sure there duplicate files. wondering happen. copy , fail shutil.copy not copy file new location, overwrite file. copy file src file or directory dst. if dst directory, a file same basename src created (or overwritten) in directory specified. permission bits copied. src , dst path names given strings. so have check if destination file exists , alter destination appropriate. example, can use achieve safe copy: def safe_copy(fi

loops - How to get macros take again same line's from the file, when he came to the end of file -

how macros take again same line's txt file, when came end of file. have script takes google+ url pages file have 35 links, have 1 file website links need post on wall. each web-link need posted on each of 35 google+ pages. @ moment script visit's url's post first link file need, when came's end of file, macros stops work. sugestion's how can make it? here script var macros; var loop = 1; macros = "code:"; macros += "set !datasource google_pages.txt" + "\n"; macros += "set !datasource_line {{i}}" + "\n"; macros += "url goto={{!col1}}" + "\n"; macros += "tag pos=1 type=div attr=class:\"kqa es\"" + "\n"; macros += "set !datasource links.txt" + "\n"; macros += "set !datasource_line {{!loop}}" + "\n"; macros += 'events type=keypress selector="div[class=\\"df b-k b-k-xb urap8 editable\\"]" chars={{!col1

how to monitor the memory usage of a java program? -

i proposed algorithm, , want prove superiority compared algorithm in terms of time&space consumption. implement algorithm in java, know how monitor memory consumption of java program when program executing? thanks. from jdk 6 onwards have tool in bin directory monitors cpu, memory consumption number of threads spawned. called visualvm . start , start java process. see java process in tool on left hand side. double click on process , view statistics. hope helps. :)

android - Flashlight control in Marshmallow -

i have problem regarding camera in recent marshmallow build, more flashlight. on pre-marshmallow version need turn flash on/off following: private void turnflashon(final camera camera, int flashlightdurationms) { if (!isflashon()) { final list<string> supportedflashmodes = camera.getparameters().getsupportedflashmodes(); if (supportedflashmodes != null && supportedflashmodes.contains(camera.parameters.flash_mode_torch)) { mparams.setflashmode(camera.parameters.flash_mode_torch); camera.setparameters(mparams); } } } and private void turnflashoff(camera camera) { if (camera != null) { final list<string> supportedflashmodes = camera.getparameters().getsupportedflashmodes(); if (supportedflashmodes != null && supportedflashmodes.contains(camera.parameters.flash_mode_off)) { mparams.setflashmode(camera.parameters.flash_mode_off); camera.setparameters(mpar

html - php option value link -

i created dropdown menu , when click on option on category in drop down bar, can link product page, failed linked them, know problems in code? enter code here $link=mysql_connect("localhost","root","")or die("can't connect..."); mysql_select_db("fyp",$link) or die("can't connect database..."); $query="select * category "; $res=mysql_query($query,$link); while($row=mysql_fetch_assoc($res)) { echo "<option value='product.php category=".$roww['$cat_id']."'>".$row['cat_nm'];///here problem $qq = "select * subcat parent_id=".$row['cat_id']; $ress = mysql_query($qq,$link) or die("wrong delete subcat query.."); while($roww = mysql_fetch_assoc($ress)) { echo "<option value='".$roww['subcat_id']."'> ---> ".$roww['subcat_nm'];//here problems } } m

Session variable is not clearing in Laravel using Route Redirect with -

i'm using laravel 5.1 , zizaco/entrust roles & permissions. here i'v issue while clearing session variable. per understanding with() method – purpose add error message or input data particular redirect , 1 page. in case redirecting dashboard session message existing after refreshing page. route <?php route::group(['middleware' => 'auth'], function () { route::get('dashboard', function () { return view('dashboard'); }); entrust::routeneedspermission('add_item', 'create_item', redirect::to('dashboard/')->with('message', 'you dont have peremissions..'), false ); route::get('add_item', 'itemcontroller@create'); }); view @if(session::has('message')) <p class="alert {{ session::get('alert-class', 'alert-info') }}">{{ session::get('message') }}</p> {{session::fo

.net - WriteableBitmap.WritePixels not refreshing on some PCs -

very odd issue have hit windows pcs. have video application , 1 part uses writepixels update writeablebitmap , display frames screen. code is: _currentframe.writepixels(new int32rect(0, 0, data.width, data.height), data.bytes, data.stride, 0); notifypropertychanged("currentframe"); (where 'data' wrapper class our pixel data) it works fine on 99% of computers. on @ least 1 windows 8.1 laptop, images don't refresh. don't know why, , else works. i don't understand make fail on pcs - suggestions welcome. details of problem system: win8.1 (spanish), net 4.5.50709 (but software uses 4.0). graphics drivers intel hd graphics 4000 we have reproduction of bug occurs on computers in our software draw high-performance charts. appears issue intel graphics drivers , writeablebitmap / .net4/4.5. see http://www.scichart.com/questions/question/zoom-not-working-properly-on-one-single-computer what believe happening writeablebitmap once locked/

php - Creating a (simple) flash game website with rating system -

he guys, for school need make website can play flash games, rate games leaving reactions in text form , vote system uses number system (i.e. 1 = extremely bad , 10 = good.). right want this: have index page each category of games users can click on games name , directed page script loads game. so far i've written code index (master) page. <!doctype html> <?php include("dbconnect.php"); ?> <html> <head> <meta charset="utf-8"> <title>master page</title> </head> <body> <?php //place data mysql query in $result. $result = mysql_query("select * gamesdb"); //while row of data exists, put row in $data associative array. while($data = mysql_fetch_assoc($result)) { //echo link games in mysql database. echo "<a href='detail.php?id=" . $data

linux - Why can't I grep zle from setopt? -

i came across chance, , it's been nagging me since: % setopt alwaystoend autocd autonamedirs ... sharehistory shinstdin zle % % setopt | grep zle # nothing printed % % setopt | cat -vet alwaystoend$ autocd$ autonamedirs$ ... sharehistory$ shinstdin$ # no zle here! as can see grep fails detect zle , , piping output of setopt cat in order detect irregular characters (not make more sense) shows no zle either! man zshzle ... if zle option set (which default in interactive shells) , shell input attached terminal, user able edit command lines. since piping output of setopt process, shell turns off command line editing. (although line of documentation refers shell input being attached terminal, captures essence of issue. nothing funny going on, shell turning off option.

c# - ReportViewer rendering a empty PDF (Just one white page) -

i have asp.net mvc 4 project , i'm using reportviewer generate reports. because there low or none compatibility reportviewer in mvc, using chrome , firefox, approach render reportviewer in pdf stream , simple returning stream this: // using microsoft.reportviewer.webforms.dll [10.0.0.0]. using (var viewer = new reportviewer()) using (var bc = new mybusinessclass()) { viewer.localreport.reportembeddedresource = @"myembeddedname"; var dsobj = bc.getdata(); var ds = new reportdatasource("dsname", dsobj); var ps = new reportparametercollection(); ps.add(new reportparameter("parametername", datetime.now)); viewer.localreport.datasources.add(ds); viewer.localreport.setparameters(ps); string deviceinfo = "some validated info"; string mimetype, encoding, filenameextension; string[] streams; warning[] warnings; var buffer = viewer.localreport.render("pdf", deviceinfo, out

oracle - How to get previous and latest date and its details in SQL -

i have table following data: create table tempdata(account varchar2(20)not null,bookid number(10),seqno number(20) not null,book_date date, book1 number(10), book2 number(10),book3 number(10)) insert tempdata values('123',101,09,add_months((sysdate),-1),100,120,130); insert tempdata values('123',101,10,sysdate),70,60,100) select * tempdata; account bookid seqno book_date book1 book2 book3 123 101 9 9/22/2015 10:05:28 100 120 130 123 101 10 10/22/2015 10:01:42 70 60 100 i need output following in order create temp table latest book details including previous date , latest date: account bookid seqno previous_date latest_date book1 book2 book3 123 101 10 9/22/2015 10:05:28 10/22/2015 10:01:42 70 60 100 here assuming want data unique account , bookid combination. select t1.account, t1.bookid, t1.seqno,t1.previous_date

entity framework - The INSERT statement conflicted with the FOREIGN KEY constraint . The statement has been terminated -

the insert statement conflicted foreign key constraint "fk_t_orderdetails_t_selectionlist". conflict occurred in database "albumportal", table "dbo.t_selectionlist", column 'id'. i new asp.net mvc ef code-first approach, error when trying save data t_orderdetails controller. in t_orderdetails table 'selectionlist_id' foreign key table dbo.t_selectionlist . defined public virtual t_selectionlist t_selectionlist { get; set; } in 't_orderdetails' , [system.diagnostics.codeanalysis.suppressmessage("microsoft.usage", "ca2227:collectionpropertiesshouldbereadonly")] public virtual icollection<t_orderdetails> t_orderdetails { get; set; } in 't_selectionlist'. modelbuilder.entity<t_selectionlist>() .hasmany(e => e.t_orderdetails) .withoptional(e => e.t_selectionlist) .hasforeignkey(e => e.selectionlist_id); is defined.

image - imagettftext PHP GD -

Image
i generate image php. gd script no problem. but want letters superimposed (picture). want use 1 input field. imagettftext($image, 500,0,1000,1700, $grey, $schrift, "$eins");

oracle - java.sql.SQLRecoverableException: Connection has been administratively disabled by console/admin command. Try later -

Image
when our application tries connect oracle database, exception thrown: java.sql.sqlrecoverableexception: connection has been administratively disabled console/admin command. try later. java.lang.exception: disabled @ tue oct 20 23:55:14 cest 2015 but, weblogic console connection test returns ok. weblogic version: 12.1.3.0.0 any explanation welcome. thanks is there other error before 1 ? maybe in log can find connection been closed. you can avoid selecting "test on connection reserve" in datasource.

git - Commit to gerrit approach -

what best approach of merging commits 1 gerrit? problem follows: small stories need have max 2 commits. far review failed 2 times, , now, third time need commit , need have max 2 patchsets not 3. the way following: if first time, commit + review. simple that. second, third,etc commit, create review branch , squash. should see that: $ git rebase -i head~4 pick 01d1125 smth s 6340aah smth 2 s ebfd369 smth 3 s 30e0ccb fixed review. # rebase 60709da..30e0ccb onto 60709da # # commands: # p, pick = use commit # e, edit = use commit, stop amending # s, squash = use commit, meld previous commit # # if remove line here commit lost. # however, if remove everything, rebase aborted. #

jquery - How can I make an img go out of page when a new div slide in? -

i building new site, in site have navbar menu indicator on left side, logo in middle , possibly other things on right side. i set jquery action when click on menu indicator new div (the menu) slide in. if surf website pc code doesn't have problems (yet), when open menu mobile img logo won't go out of page (in pc version stays in page because there lot of space), under menu, making weird. i know can't explain myself well, here jsfiddle. https://jsfiddle.net/9gx7dzwj/ html <body> <div id="menu"><ul> <h1>menu</h1> <li>home</li> </ul></div> <div id="navbar"> <div id="menuindicator"></div> <img id="logo" src="http://i.kinja-img.com/gawker-media/image/upload/s--peksmwzm--/c_scale,fl_progressive,q_80,w_800/1414228815325188681.jpg"/> </div> <div id="main">

drupal form field not loading correct data -

i building first drupal 7 module , having trouble screen edit fieldable entity. using field_attach_form , working great accept 1 field displaying field default rather current content of field entity. i have text field, number field, number of boolean fields , 1 list_text field failing. any ideas doing incorrectly? code below think needed please let me know if need more. code create field in hook_enable: if (!field_info_field('field_available')) { $field = array ( 'field_name' => 'field_available', 'type' => 'list_text', 'settings' => array( 'allowed_values' => array('no', 'provisionally', 'yes'), ), ); field_create_field($field); code create instance, in hook_enable: if (!field_info_instance('appointments_status', 'field_available', 'appointments_status')) { $instance = array( 'field_name' => 'field

android - CallLog.Calls.getLastOutgoingCall Error in Api 15 -

i tried last outgoing call contact , when used: calllog.calls.getlastoutgoingcall but error occurred. api level 15, tested in android api 22 , worked fine(in documentation said added in api 8). i found it, add below manifest: <uses-permission android:name="android.permission.read_call_log" /> <uses-permission android:name="android.permission.read_contacts" />

python - Subtract values from list of dictionaries from another list of dictionaries -

i have 2 lists of dictionaries. foo = [{'tom': 8.2}, {'bob': 16.7}, {'mike': 11.6}] bar = [{'tom': 4.2}, {'bob': 6.7}, {'mike': 10.2}] the subtraction of , b should updated in foo: foo = [{'tom': 4.0}, {'bob': 10.0}, {'mike': 1.4}] now tried 2 loops , zip -function: def sub(a,b): mydict,mydictcorr in zip(a,b): {k:[x-y x, y in mydict[k], mydictcorr[k]] k in mydict} return mydict print sub(foo,bar) i typeerror: 'float' object not iterable . where's mistake? you close. issue list comprehension had in dictionary comprehension. mydict[k], mydictcorr[k] both returning floats, trying iterate on them [x-y x, y in mydict[k], mydictcorr[k]] . this work you: def sub(base, subtract): corrected = [] base_dict, sub_dict in zip(base, subtract): corrected.append({k: v - sub_dict.get(k, 0) k, v in base_dict.items()}) return corrected or less read

c++ - Does boost::variant support 64bit integers? -

i tried use boost::variant combined 64 bit integer. unfortunately didn't work. there way fix this? or boost version old? i'm using v1.45. this declaration works: std::vector< boost::variant<int, float64_t> > vec2; this declaration doesn't work: std::vector< boost::variant<long long int, float64_t> > vec2; edit it's compiler error: error c2668: 'boost::detail::variant::make_initializer_node::apply<baseindexpair,iterator>::initializer_node::initialize' : ambiguous call overloaded function 1> 1> [ 1> baseindexpair=boost::mpl::pair<boost::detail::variant::make_initializer_node::apply<boost::mpl::pair<boost::detail::variant::make_initializer_node::apply<boost::mpl::pair<boost::detail::variant::initializer_root,boost::mpl::int_<0>>,boost::mpl::l_iter<boost::mpl::list3<__int64,double,std::basic_string<char,std::char_traits<char>,std::allocator&

Determining controller based on post data in Rails -

in rails application have form radio type inputs , post method. user selects 1 of these radio options , submits form. how set routing such (in routes.rb or in other way) controller selected based on value of selected input value in post data. in routes.rb params hash isn't available, access data in other way? two options come mind: use javascript intercept submit action. on submit, read value of selected radio option, change target attribute of form url expect used , submit form. to make javascript unobtrusive, url of target can added data-target attribute radio options. in way, once selected value, replace form target value of data-target . benefit can generate server side , don't have hard-code value. use intermediate action. submit form action reads payload , redirects relevant controller action based on payload value.

regex - Distinguish quotation mark (") from backslash and quotation mark (\") -

this simplified version of issue trying solve. so, try not hack answer :) in r, default '"' == '\"' therefore, when use urlencode('\"') urlencode('"') i got same result: %22 however, want is %5c%22 , %22 respectively above 2 commands. the goal encode string such 'parse "i * \"good\"" adj' url string parse%20%22i%20am%20*%20%5c%22good%5c%22%22%20as%20adj any ideas? ========== update ===== given confusions above question. further clarify that: understand r treats '\"' '"' . want r automatically, rather me manually , convert user's string input of '\"' '\\\"' while treating input string of '"' '"' or '\"' , equivalent anyway. the r string literals treat backslash escaping symbol. if write \" , backslash escaping " , since not valid escape sequence, backslas

android - Set applicationApk and instrumentationApk for Spoon Gradle Plugin -

Image
i'd set .apk files used run tests spoongradleplugin. there available properties can set programatically gradle file: https://github.com/stanfy/spoon-gradle-plugin/blob/master/src/main/groovy/com/stanfy/spoon/gradle/spoonextension.groovy but project has various flavours , names , i'd test them. current setup get: * went wrong: problem found configuration of task ':app:spoondebugandroidtest'. > file '/users/f1sherkk/dev/myapp-android/app/build/outputs/apk/app-debug.apk' specified property 'applicationapk' not exist. my build names are: app-debug-androidtest-unaligned.apk myapp-debuga-1.2.3-201.apk myapp-debugb-1.2.3-201.apk myapp-debugc-1.2.3-201.apk that's why setup .apk somewhere in gradle code - or console. found far there fields available in spoon gradle plugin there: https://github.com/stanfy/spoon-gradle-plugin/blob/master/src/main/groovy/com/stanfy/spoon/gradle/spoonruntask.groovy with names: /** instrumentation apk.

linux - Open gnome-terminal from shell script and hold window open -

Image
i'm trying write script sets programming environment taking argument name of project(directory) want open so example: ./my_script.sh sample_app and here script far: #!/bin/bash wmctrl -s 0 sublime & sleep 2 wmctrl -s 1 google-chrome & sleep 2 wmctrl -s 2 dir="$echo /home/bitnumb/projects/ruby/workspace/$1" echo $dir gnome-terminal --window-with-profile=guard -e ls & #gnome-terminal -e cd /home/bitnumb/projects/ruby/workspace/$1 && bundle exec guard & #gnome-terminal -e cd /home/bitnumb/projects/ruby/workspace/$1 && rails s & the problem arises when script executes: gnome-terminal --window-with-profile=guard -e ls & i message the child process exited status 0. : i can't use terminal after (i can close it) , message hides part of output. , yet, have created profile , set when command exits dropdown menu 'hold terminal open' ... ** i left comments in script can idea of i'm trying do

css - Elements can't float below the previous row's too tall first element -

Image
i have list of floated elements width of 33%, 3 elements per line. height vary. also, using javascript sorting plugin , cannot use css property. problem: if first element of given row taller other ones, first element of next row cannot float below it. how fix that? css: .resource_item { float: left; width: 31%; margin-bottom: 30px; padding-left: 1%; padding-right: 1%; } php: while ... ?> <div class='resource_item'> content </div> <?php endwhile; as comment pointed out (the person removed reason) problem solved setting elements display: inline-block instead of floating them.

jquery - TypeError: video_playlist is null JavaScript -

this question has answer here: why jquery or dom method such getelementbyid not find element? 6 answers i trying make video playlist , new js, have run lot of problems. i trying run code: //simple js playlist kristi witts - https://github.com/kwitts/js-playlist/ //mit license //ensure links in div "#player" act in same way: var video_playlist = document.getelementbyid("myvideo"); //element id should same id used in container div in html. var links = video_playlist.getelementsbytagname('a'); (var = 0; < links.length; i++) { links[i].onclick = handler; }; //give functionality links: function handler(e) { e.preventdefault(); //prevents default action of links going directly source file videotarget = this.getattribute("href"); //looks @ filename in link's href attribute filename = videotarget.subs

csr - What FQDN for SSL Certifcate Signing Request when domain A is CNAMEd to domain B -

i generate ssl certificate signing request (csr) procurement , installation of ssl certificate. my question surrounds should enter fqdn given our specific situation we hosting domain name 'www.foo.com' within our server. this domain accessed via different domain 'www.bar.com' cnamed our hosted domain 'www.foo.com' we want client see domain 'www.bar.com' has valid ssl certificate. so question is, when generate csr need enter 'www.foo.com.' or 'www.bar.com.' fqdn hostname in csr? edit: not intended domain name www.foo.com ever used access website. looking @ answer https://serverfault.com/questions/494654/which-fqdn-hostname-to-use-for-ssl-certificate-signing-request-when-using-a-cna looks in our csr should using 'www.bar.com.' confirmation suitably qualified person appreciated! www.bar.com whatever fqdn client requests in browser should in subject of certificate - no matter happens in "the backgrou

ios - How to pass variable reference between viewcontrollers? -

this question has answer here: how share data between view controllers , other objects in swift? 6 answers i writing application customizable color palette. have settings class (settings) stores these colors, , settings viewcontroller (themevc) lets user modify them, , list possible values (colorsvc). i keep reference settings in both view controllers: let settings = settings.sharedinstance in themevc list categories background, text , on in tableview this: let cell = tableview.dequeuereusablecellwithidentifier("right detail disclosure", forindexpath: indexpath) uitableviewcell switch indexpath.row { case 0: cell.textlabel?.text = "backgrounds" cell.detailtextlabel?.text = settings.backgroundcolor.name() case 1: .... default: