Posts

netbeans - no class def found com.sun.management.OperatingSystemMXBean -

i using netbeans ide , java 8 wildfly server. need print total available physical memory of server using com.sun.management.operatingsystemmxbean class (other classes provide memory of runtime) . compiles fine without erros gives no class found error @ runtime. have googled on , tried solutions provided none work.

python - Jython fails to load modules having 'com' as top level namespace -

i have jython module com.xyz.module1 in jython site-packages directory. directory structure below. jython2.7 |---lib |--site-packages |--com |--__init__.py |--xyz |--__init__.py |--module1 |--__init__.py when try import com.xyz.module1 in jython interpretor, importerror thrown ( screenshot ). however, import works fine when rename com.xyz.module1 foo.xyz.module1 . i have read jython doc discourages (but not forbid) use of com top level module namespace. jython library interested in cannot refactored not use com top level namespace. is there other way make import work? i don't think so. there unresolvable conflict here between way python import works , way people name java packages. perhaps overly simplistic, first 'com' encountered during import 1 , 'com', , prevent second 'com' being imported. so, need take different approach when naming jytho...

Problems in parsing variables from php to javascript -

scenario: tracking events(add cart, search terms, product views, etc) test e-commerce website(opencart), javascript function written in footer page , these functions called @ button triggers or page loads. problem: while tracking product view event following code added product page, function captureproductview() called footer, , parameters clientid, fname, lname retrieved getclientdetails(); <script> window.onload=function(){ getclientdetails(); captureproductview('<?php echo $product['product_id']; ?>', '<?php echo $product['name']; ?>', '<?php echo $product['price']; ?>', clientid, fname, lname); }; </script> but values php variables $product['product_id'] , $product['name'] , $product['price'] cannot parsed script tag, leaving notice: notice : undefined variable: product in /home/path.../product.tpl on line 29 "...

python - PySpark: iterate inside small groups in DataFrame -

i trying understand how can operations inside small groups in pyspark dataframe. suppose have df following schema: root |-- first_id: string (nullable = true) |-- second_id_struct: struct (nullable = true) | |-- s_id: string (nullable = true) | |-- s_id_2: int (nullable = true) |-- depth_from: float (nullable = true) |-- depth_to: float (nullable = true) |-- total_depth: float (nullable = true) so data might this: i to: group data first_id inside each group, order s_id_2 in ascending order append column layer either struct or root dataframe indicate order of s_id_2 in group. for example: first_id | second_id | second_id_order ---------| --------- | --------------- a1 | [b, 10] | 1 ---------| --------- | --------------- a1 | [b, 14] | 2 ---------| --------- | --------------- a1 | [b, 22] | 3 ---------| --------- | --------------- a5 | [a, 1] | 1 ---------| --------- | --------------- a5 | [a, 7] | 2 ---------| ---...

java - Why drivers are required for JDBC-ODBC? -

i having little confusion of have studied. have studied drivers software programs required interact external hardware devices printers,mouse,mobiles etc. when connect odbc or jdbc in java,it requires specify drivers. so why need specify drivers since our database( oracle dbc ) software , not hardware. your understanding of driver not correct. driver not hardware external but driver needed special cases of software interaction. in case driver used access filesystem system alone wouldn't able understand. driver used connect database , able interact it. the exact definition is: java database connectivity (jdbc) application programming interface (api) programming language java, defines how client may access database. (taken wikipedia )

c# - Permission issue on server (file i/o write issue) -

there application uploads zip file , extracts in temp folder located under application folder , copies these extracted file different target location , deleted these temporary extracted files temp folder. everything works fine on local machine on iis when place same code on server machine give file i/o permission error ,even though have given full access permission temp , target location folder . can me on this?? here same code string path = server.mappath("~/uploadedzipfiles/" + filename); fileupload1.saveas(path);//saves zip in temporary folder extractzip(filename, targetfolder); //extracts zip folder contains //target folder path you must grant full access permission iis user each folder app need write,delete or edit files. i think aren't well. for more info how add permission , try these: iis_iusrs , iusr permissions in iis8 https://support.gearhost.com/hc/en-us/articles/200342205-how-to-give-write-access-to-files-for-iusr up...

android - Delete image files from internal storage and arraylist -

Image
basically, i'm saving images in internal storage's directory. i'm showing them in recyclerview using arraylist. there cross button on each image in row layout(see screenshot). need delete image per position not recyclerview internal directory. able remove image recyclerview's arraylist image in directory not gets deleted. // method in activity show images int. storage recyclerview. private void showimages(){ file directory = new file(file_path); file newfile[] = directory.listfiles(); log.e("sammy_arrlistsize_befor"," "+finalimages.size()); if(finalimages!=null )finalimages.clear(); (int i= 0; < newfile.length; i++) { string path = "file://"+newfile[i].getabsolutepath(); finalimages.add(path); log.e("sammy_imagepath"," "+path); } log.e("sammy_arrlistsize_after"," "+finalimage...